Stay organized with collections
Save and categorize content based on your preferences.
ACameraDevice_StateCallbacks
Applications' callbacks for camera device state changes, register with ACameraManager_openCamera.
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
Declared in camera/NdkCameraDevice.h
void * ACameraDevice_StateCallbacks::context
optional application context.
onDisconnected
Declared in camera/NdkCameraDevice.h
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
Declared in camera/NdkCameraDevice.h
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.
Content and code samples on this page are subject to the licenses described in the Content License. Java and OpenJDK are trademarks or registered trademarks of Oracle and/or its affiliates.
Last updated 2024-11-19 UTC.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2024-11-19 UTC."],[],[],null,["# ACameraDevice_StateCallbacks Struct Reference\n\nACameraDevice_StateCallbacks\n============================\n\nApplications' callbacks for camera device state changes, register with [ACameraManager_openCamera](/ndk/reference/group/camera#group___camera_1ga56ec3decad6c0734be7cc504b03acc41).\n\nSummary\n-------\n\n| ### Public attributes ||\n|------------------------------------------------------------------------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| [context](#struct_a_camera_device___state_callbacks_1a1af65c7c80b963cecfcd86b6f703f6ea) | `void *` optional application context. |\n| [onDisconnected](#struct_a_camera_device___state_callbacks_1ad7205d4bfb74bb45546a755722f77cc1) | [ACameraDevice_StateCallback](/ndk/reference/group/camera#group___camera_1ga1d130717db897dc5153ad06ae55c4e74) The function is called when a camera device is no longer available for use. |\n| [onError](#struct_a_camera_device___state_callbacks_1aed90f2d11faf2c2bb3bbd96d819a3d4f) | [ACameraDevice_ErrorStateCallback](/ndk/reference/group/camera#group___camera_1ga3054838b8100369296a1284952d8ef29) The function called when a camera device has encountered a serious error. |\n\nPublic attributes\n-----------------\n\n### context\n\nDeclared in `camera/NdkCameraDevice.h` \n\n```scdoc\nvoid * ACameraDevice_StateCallbacks::context\n``` \noptional application context. \n\n### onDisconnected\n\nDeclared in `camera/NdkCameraDevice.h` \n\n```scdoc\nACameraDevice_StateCallback ACameraDevice_StateCallbacks::onDisconnected\n``` \nThe function is called when a camera device is no longer available for use.\n\nAny attempt to call API methods on this ACameraDevice will return [ACAMERA_ERROR_CAMERA_DISCONNECTED](/ndk/reference/group/camera#group___camera_1gga3b80654c88185cba0dcad6a23dbc9bbea534161a9892a70fc06ae2a4da884de85). 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.\n\nApplication should clean up the camera with [ACameraDevice_close](/ndk/reference/group/camera#group___camera_1gaaade95c538f907727896dd92a6ae01fa) after this happens, as it is not recoverable until the camera can be opened again. \n\n### onError\n\nDeclared in `camera/NdkCameraDevice.h` \n\n```scdoc\nACameraDevice_ErrorStateCallback ACameraDevice_StateCallbacks::onError\n``` \nThe function called when a camera device has encountered a serious error.\n\nThis 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](/ndk/reference/group/camera#group___camera_1gga3b80654c88185cba0dcad6a23dbc9bbea534161a9892a70fc06ae2a4da884de85).\n\nThere may still be capture completion or camera stream callbacks that will be called after this error is received.\n\nApplication should clean up the camera with [ACameraDevice_close](/ndk/reference/group/camera#group___camera_1gaaade95c538f907727896dd92a6ae01fa) after this happens. Further attempts at recovery are error-code specific."]]