1

I want to draw a picture over on camera preview. I want to know which view(SurfaceView, TextureView, GLSurfaceView, etc.) is the best one (performance) for camera preview.

And if you can explain how to draw it, that will be great.

Thanks.

Jerikc XIONG
  • 3,517
  • 5
  • 42
  • 71

1 Answers1

0

Your best choice would be to use OpenGL and SurfaceTexture to capture camera preview in the same view. Note that if you want to synchronize the preview with your overlay, you must delay the camera preview. For that, you can implement onPreviewCallback and push its buffer to a texture, while hiding the native texture that comes directly from camera.

Alex Cohn
  • 56,089
  • 9
  • 113
  • 307
  • I mean draw an extra picture on camera preview. Maybe there is some other operations, like change the alpha of the extra picture. – Jerikc XIONG Aug 23 '15 at 08:30
  • Yes, this is exactly what I mean by OpenGL textures. Overlay by separate view with transparent or semi-transparent "holes" is much less efficient. – Alex Cohn Aug 23 '15 at 12:51