![]() With SurfaceView, unfortunately, it isn’t possible to control when the surface is released, as this is controlled by the View hierarchy. However, some devices (mainly legacy devices) crash when the preview surface is released prematurely. SurfaceView is generally better than TextureView when it comes to certain key metrics, including power and latency, which is why PreviewView tries to use a SurfaceView by default. To display the camera feed, it uses either a SurfaceView or TextureView, provides a preview surface to the camera when it’s ready, tries to keep it valid as long as the camera is using it, and when released prematurely, provides a new surface if the camera is still in use. PreviewView is a subclass of FrameLayout. It also contains compatibility fixes and workarounds in order to provide a seamless experience on a multitude of devices, screen sizes, camera hardware support levels, and display configurations such as split-screen mode, locked orientation, and free-form multi-window.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |