ViewfinderSurfaceRequest


public class ViewfinderSurfaceRequest


The request to get a Surface to display camera feed.

This request contains requirements for the surface resolution and camera device information from CameraCharacteristics.

Calling requestSurfaceAsync with this request will send the request to the surface provider, which is either a TextureView or SurfaceView and get a ListenableFuture of Surface.

Calling markSurfaceSafeToRelease will notify the surface provider that the surface is not needed and related resources can be released.

Summary

Nested types

This class is deprecated.

Use androidx.camera.viewfinder.surface.ViewfinderSurfaceRequest.Builder instead.

Public methods

@Nullable CameraViewfinder.ImplementationMode

Returns the androidx.camera.viewfinder.CameraViewfinder.ImplementationMode.

int

Returns the camera lens facing.

@NonNull Size

Returns the resolution of the requested Surface.

int

Returns the sensor orientation.

void

Closes the viewfinder surface to mark it as safe to release.

Protected methods

void

Public methods

getLensFacing

Added in 1.4.0-alpha10
Deprecated in 1.4.0-alpha10
public int getLensFacing()

Returns the camera lens facing.

The value is set by setLensFacing, which can be retrieved from CameraCharacteristics by key LENS_FACING.

Returns
int

The lens facing.

getResolution

Added in 1.4.0-alpha10
Deprecated in 1.4.0-alpha10
public @NonNull Size getResolution()

Returns the resolution of the requested Surface.

The value is set by Builder. The surface which fulfills this request must have the resolution specified here in order to fulfill the resource requirements of the camera.

Returns
@NonNull Size

The guaranteed supported resolution.

getSensorOrientation

Added in 1.4.0-alpha10
Deprecated in 1.4.0-alpha10
public int getSensorOrientation()

Returns the sensor orientation.

The value is set by setSensorOrientation, which can be retrieved from CameraCharacteristics by key SENSOR_ORIENTATION.

Returns
int

The sensor orientation.

markSurfaceSafeToRelease

Added in 1.4.0-alpha10
Deprecated in 1.4.0-alpha10
public void markSurfaceSafeToRelease()

Closes the viewfinder surface to mark it as safe to release.

This method should be called by the user when the requested surface is not needed and related resources can be released.

Protected methods

finalize

protected void finalize()