public abstract class CameraStateCallback extends Object
A callback is an input parameter of CameraKit.createCamera(String,
CameraStateCallback, EventHandler) and is used throughout the camera lifecycle from creation to release.
SystemCapability.Multimedia#CAMERA| 限定符和类型 | 类 | 说明 |
|---|---|---|
static interface |
CameraStateCallback.ErrorCode |
Defines error codes used during the camera lifecycle.
|
| 构造器 | 说明 |
|---|---|
CameraStateCallback() |
| 限定符和类型 | 方法 | 说明 |
|---|---|---|
void |
onCaptureIdle(Camera camera) |
Called after the camera is successfully configured, and did not start capturing or has stopped capturing.
|
void |
onCaptureRun(Camera camera) |
Called when the capture starts.
|
void |
onConfigured(Camera camera) |
Called when the camera is successfully configured by
Camera#configure(CameraConfig). |
void |
onConfigureFailed(Camera camera,
int errorCode) |
Called when camera configuration fails.
|
void |
onCreated(Camera camera) |
Called when the camera is successfully created by
CameraKit.createCamera(String,
CameraStateCallback, EventHandler). |
void |
onCreateFailed(String cameraId,
int errorCode) |
Called when the camera fails to be created.
|
void |
onFatalError(Camera camera,
int errorCode) |
Called when an error occurs throughout the camera lifecycle.
|
void |
onPartialConfigured(Camera camera) |
Called when the camera is successfully configured by
Camera#configure after CameraConfig.Builder#addDeferredSurfaceSize was called to set the deferred surface size. |
void |
onReleased(Camera camera) |
Called after the camera is released.
|
public void onCreated(Camera camera)
CameraKit.createCamera(String,
CameraStateCallback, EventHandler).camera - Indicates the camera.public void onCreateFailed(String cameraId, int errorCode)
cameraId - Indicates the camera ID.errorCode - Indicates the error code defined in CameraStateCallback.ErrorCode.public void onConfigured(Camera camera)
Camera#configure(CameraConfig).camera - Indicates the camera.public void onPartialConfigured(Camera camera)
Camera#configure after CameraConfig.Builder#addDeferredSurfaceSize was called to set the deferred surface size.
After this callback is invoked, non-deferred surfaces that have been configured can be used for frame capture
by calling Camera#triggerSingleCapture, Camera#triggerMultiCapture, or Camera#triggerLoopingCapture, whereas the deferred surface cannot be used for frame capture until it is added by
CameraConfig.Builder#addDeferredSurface.
camera - Indicates the camera.public void onConfigureFailed(Camera camera, int errorCode)
Configure the camera again.
camera - Indicates the camera.errorCode - Indicates the failure error code defined in CameraStateCallback.ErrorCode.public void onReleased(Camera camera)
camera - Indicates the camera.public void onFatalError(Camera camera, int errorCode)
When a fatal error occurs, the camera will release itself, and CameraStateCallback#onReleased(Camera)
is called.
camera - Indicates the camera.errorCode - Indicates the failure error code defined in CameraStateCallback.ErrorCode.public void onCaptureRun(Camera camera)
camera - Indicates the created Camera object.public void onCaptureIdle(Camera camera)
camera - Indicates the created Camera object.