0

guys.

I'm trying to develop an app, that should take raw image from camera N times per second and then I'm doing some data processing with it. First I just displayed all these frames on SurfacePreview and got them directly from the screen:

    @Override
public void onPreviewFrame(byte[] data, Camera camera) {
    yuvs.add(data);
    count++;
}

It works well. But now I want to do some signal visualization, so, there shouldn't be any Preview on my screen. So I want to know, how can I get these images in byte[] from camera without displaying it on screen.

Thank you for any answer or advice.

Rachnog
  • 353
  • 1
  • 7
  • 18

1 Answers1

0

You can hide the SurfaceView under some other nontransparent view and/or resize the preview surface to very small rectangle. You will still receive same callbacks, at full size controlled by setPreviewSize().

Alex Cohn
  • 56,089
  • 9
  • 113
  • 307