setPreviewDisplay vs setPreviewTexture

故事扮演 提交于 2020-01-02 01:09:08

问题


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?


回答1:


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.



来源:https://stackoverflow.com/questions/16752454/setpreviewdisplay-vs-setpreviewtexture

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!