PreviewView.ImplementationMode


public enum PreviewView.ImplementationMode


The implementation mode of a PreviewView.

User preference on how the PreviewView should render the preview. PreviewView displays the preview with either a SurfaceView or a TextureView. 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.

Summary

Enum Values

COMPATIBLE

Use a TextureView for the preview.

PERFORMANCE

Use a SurfaceView for the preview when possible.

Public methods

static PreviewView.ImplementationMode

Returns the enum constant of this type with the specified name.

static PreviewView.ImplementationMode[]

Returns an array containing the constants of this enum type, in the order they're declared.

Enum Values

PERFORMANCE

PreviewView.ImplementationMode PreviewView.ImplementationMode.PERFORMANCE

Use a SurfaceView for the preview when possible. If the device doesn't support SurfaceView, PreviewView will fall back to use a TextureView instead.

PreviewView falls back to TextureView when the API level is 24 or lower, the camera hardware support level is INFO_SUPPORTED_HARDWARE_LEVEL_LEGACY, or getTargetRotation is different from PreviewView's display rotation.

Do not use this mode if setTargetRotation 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 getPreviewStreamState, the STREAMING state might happen prematurely if this mode is used.

Public methods

valueOf

Added in 1.1.0
public static PreviewView.ImplementationMode valueOf(String name)

Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)

Returns
PreviewView.ImplementationMode

the enum constant with the specified name

Throws
java.lang.IllegalArgumentException

if this enum type has no constant with the specified name

values

Added in 1.1.0
public static PreviewView.ImplementationMode[] values()

Returns an array containing the constants of this enum type, in the order they're declared. This method may be used to iterate over the constants.

Returns
PreviewView.ImplementationMode[]

an array containing the constants of this enum type, in the order they're declared