Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

setPreviewDisplay vs setPreviewTexture

When opening the Android camera, either a SurfaceHolder or an OpenGL SurfaceTexture must be set to hold the displayed images, using setPreviewDisplay() (API level 1) or setPreviewTexture() (API level 11), respectively. Is there any difference in speed, device compatibility (aside from API level), or image quality between the two?

like image 215
1'' Avatar asked May 25 '13 18:05

1''


1 Answers

Whenever you use SurfaceView to open camera, you can see a little lag and blink in screen. This is because, SurfaceView creates a new separate window where in TextureView (added in API level 14) does not create new window but acts as normal view, so, you won't see any lag or blink while opening camera using TextureView. This is more of a performance issue.

For more information, look here.

like image 133
Braj Avatar answered Sep 18 '22 14:09

Braj