ACameraDevice_StateCallbacks

Summary

Public attributes

context
void *
optional application context.
onDisconnected
The function is called when a camera device is no longer available for use.
onError
The function called when a camera device has encountered a serious error.

Public attributes

context

void * ACameraDevice_StateCallbacks::context

optional application context.

onDisconnected

ACameraDevice_StateCallback ACameraDevice_StateCallbacks::onDisconnected

The function is called when a camera device is no longer available for use.

Any attempt to call API methods on this ACameraDevice will return ACAMERA_ERROR_CAMERA_DISCONNECTED. The disconnection could be due to a change in security policy or permissions; the physical disconnection of a removable camera device; or the camera being needed for a higher-priority camera API client.

Application should clean up the camera with ACameraDevice_close after this happens, as it is not recoverable until the camera can be opened again.

onError

ACameraDevice_ErrorStateCallback ACameraDevice_StateCallbacks::onError

The function called when a camera device has encountered a serious error.

This indicates a failure of the camera device or camera service in some way. Any attempt to call API methods on this ACameraDevice in the future will return ACAMERA_ERROR_CAMERA_DISCONNECTED.

There may still be capture completion or camera stream callbacks that will be called after this error is received.

Application should clean up the camera with ACameraDevice_close after this happens. Further attempts at recovery are error-code specific.