Camera
interface Camera
androidx.camera.core.Camera |
The camera interface is used to control the flow of data to use cases, control the camera via the CameraControl
, and publish the state of the camera via CameraInfo
.
An example of how to obtain an instance of this class can be found in the androidx.camera.lifecycle
package.
Summary
Public methods | |
---|---|
abstract CameraControl |
Returns the |
abstract CameraInfo |
Returns information about this camera. |
Public methods
getCameraControl
@NonNull abstract fun getCameraControl(): CameraControl
Returns the CameraControl
for the Camera
.
The CameraControl
provides various asynchronous operations like zoom, focus and metering. CameraControl
is ready to start operations immediately after use cases are bound to the Camera
. When all UseCase
s are unbound, or when camera is closing or closed because lifecycle onStop happens, the CameraControl
will reject all operations.
Each method of CameraControl
returns a ListenableFuture
which apps can use to check the asynchronous result. If the operation is not allowed in current state, the returned ListenableFuture
will fail immediately with CameraControl.OperationCanceledException
.
getCameraInfo
@NonNull abstract fun getCameraInfo(): CameraInfo
Returns information about this camera.
The returned information can be used to query static camera characteristics or observe the runtime state of the camera.
Return | |
---|---|
CameraInfo |
the CameraInfo . |