The implementation mode of a
User preference on how the
PreviewView should render the preview.
PreviewView displays the preview with either a
SurfaceView or a
SurfaceView is generally better than a
TextureView when it comes to certain key metrics, including power and latency. On the other hand,
TextureView is better supported by a wider range of devices. The option is used by
PreviewView to decide what is the best internal implementation given the device capabilities and user configurations.
enum val PERFORMANCE : PreviewView.ImplementationMode
PreviewView falls back to
TextureView when the API level is 24 or lower, the camera hardware support level is
Preview#getTargetRotation() is different from
PreviewView's display rotation.
Do not use this mode if
Preview.Builder#setTargetRotation(int) is set to a value different than the display's rotation, because
SurfaceView does not support arbitrary rotations. Do not use this mode if the
PreviewView needs to be animated.
SurfaceView animation is not supported on API level 24 or lower. Also, for the preview's streaming state provided in
StreamState#STREAMING state might happen prematurely if this mode is used.