自 2025 年 3 月 27 日起,我們建議您使用 android-latest-release
而非 aosp-main
建構及貢獻 AOSP。詳情請參閱「Android 開放原始碼計畫變更」。
透過集合功能整理內容
你可以依據偏好儲存及分類內容。
camera_module_callbacks 結構參考
#include <
camera_common.h
>
回呼函式,供攝影機 HAL 模組使用,用於通知架構攝影機子系統的變更。
版本資訊 (根據 camera_module_t.common.module_api_version):
每個回呼只會由實作指定 HAL 模組 API 介面以上版本的 HAL 模組呼叫。
CAMERA_MODULE_API_VERSION_2_1:
camera_device_status_change()
CAMERA_MODULE_API_VERSION_2_4:
torch_mode_status_change()
定義位於檔案
camera_common.h
的
594
行。
camera_device_status_change:
回呼至架構,指出特定攝影機裝置的狀態已變更。在模組載入期間,架構會假設所有相機裝置都處於 CAMERA_DEVICE_STATUS_PRESENT 狀態。HAL 必須呼叫這個方法,向架構通知任何最初 NOT_PRESENT 裝置。
這個回呼是為了 CAMERA_MODULE_API_VERSION_2_1 而新增。
camera_module_callbacks
:透過 set_callbacks 傳遞至模組的 camera_module_callbacks_t 例項。
camera_id:具有新狀態的相機裝置 ID。
new_status:新的狀態碼,為 camera_device_status_t 列舉之一,或特定平台的狀態。
定義位於檔案
camera_common.h
的
616
行。
torch_mode_status_change:
回呼至架構,指出與特定相機裝置相關聯的閃光燈單元燈泡模式狀態已變更。如果透過 get_camera_info() 呼叫回報 android.flash.info.available 為 True,則在模組載入期間,架構會假設手電筒模式處於 TORCH_MODE_STATUS_AVAILABLE_OFF 狀態。
這個回呼是為了 CAMERA_MODULE_API_VERSION_2_4 而新增。
camera_module_callbacks
:透過 set_callbacks 傳遞至模組的 camera_module_callbacks_t 例項。
camera_id:閃光燈的閃光燈模式狀態有變更的相機裝置 ID。
new_status:新狀態碼,是 torch_mode_status_t 列舉之一。
定義位於檔案
camera_common.h
的
639
行。
這個結構體的說明文件是由下列檔案產生:
這個頁面中的內容和程式碼範例均受《內容授權》中的授權所規範。Java 與 OpenJDK 是 Oracle 和/或其關係企業的商標或註冊商標。
上次更新時間:2025-07-27 (世界標準時間)。
[[["容易理解","easyToUnderstand","thumb-up"],["確實解決了我的問題","solvedMyProblem","thumb-up"],["其他","otherUp","thumb-up"]],[["缺少我需要的資訊","missingTheInformationINeed","thumb-down"],["過於複雜/步驟過多","tooComplicatedTooManySteps","thumb-down"],["過時","outOfDate","thumb-down"],["翻譯問題","translationIssue","thumb-down"],["示例/程式碼問題","samplesCodeIssue","thumb-down"],["其他","otherDown","thumb-down"]],["上次更新時間:2025-07-27 (世界標準時間)。"],[],[],null,["# Android Hardware Abstraction Layer: camera_module_callbacks Struct Reference\n\ncamera_module_callbacks Struct Reference\n========================================\n\n[Data Fields](#pub-attribs) \ncamera_module_callbacks Struct Reference \n\n`\n#include \u003c\n`[camera_common.h](https://android.googlesource.com/platform/hardware/libhardware/+/master/include/hardware/camera_common.h)`\n\u003e\n`\n\n|---------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| Data Fields ----------- ||\n| void(\\* | [camera_device_status_change](/reference/hal/structcamera__module__callbacks#a79f12aab43e5c0ca75b127718f3144cf) )(const struct [camera_module_callbacks](/reference/hal/structcamera__module__callbacks) \\*, int camera_id, int new_status) |\n| ||\n| void(\\* | [torch_mode_status_change](/reference/hal/structcamera__module__callbacks#a70479d8b007a3a6b441437a3e584b2af) )(const struct [camera_module_callbacks](/reference/hal/structcamera__module__callbacks) \\*, const char \\*camera_id, int new_status) |\n| ||\n\n\nDetailed Description\n--------------------\n\n\nCallback functions for the camera HAL module to use to inform the framework of changes to the camera subsystem.\n\n\nVersion information (based on camera_module_t.common.module_api_version):\n\n\nEach callback is called only by HAL modules implementing the indicated version or higher of the HAL module API interface.\n\n\nCAMERA_MODULE_API_VERSION_2_1:\n[camera_device_status_change()](/reference/hal/structcamera__module__callbacks#a79f12aab43e5c0ca75b127718f3144cf)\n\n\nCAMERA_MODULE_API_VERSION_2_4:\n[torch_mode_status_change()](/reference/hal/structcamera__module__callbacks#a70479d8b007a3a6b441437a3e584b2af)\n\n\nDefinition at line\n[594](https://android.googlesource.com/platform/hardware/libhardware/+/master/include/hardware/camera_common.h)\nof file\n[camera_common.h](https://android.googlesource.com/platform/hardware/libhardware/+/master/include/hardware/camera_common.h)\n.\n\nField Documentation\n-------------------\n\n\n|----------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| void(\\* camera_device_status_change)(const struct [camera_module_callbacks](/reference/hal/structcamera__module__callbacks) \\*, int camera_id, int new_status) |\n\n\ncamera_device_status_change:\n\n\nCallback to the framework to indicate that the state of a specific camera device has changed. At module load time, the framework will assume all camera devices are in the CAMERA_DEVICE_STATUS_PRESENT state. The HAL must call this method to inform the framework of any initially NOT_PRESENT devices.\n\n\nThis callback is added for CAMERA_MODULE_API_VERSION_2_1.\n\n\n[camera_module_callbacks](/reference/hal/structcamera__module__callbacks)\n: The instance of camera_module_callbacks_t passed to the module with set_callbacks.\n\n\ncamera_id: The ID of the camera device that has a new status.\n\n\nnew_status: The new status code, one of the camera_device_status_t enums, or a platform-specific status.\n\n\nDefinition at line\n[616](https://android.googlesource.com/platform/hardware/libhardware/+/master/include/hardware/camera_common.h)\nof file\n[camera_common.h](https://android.googlesource.com/platform/hardware/libhardware/+/master/include/hardware/camera_common.h)\n.\n\n|----------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| void(\\* torch_mode_status_change)(const struct [camera_module_callbacks](/reference/hal/structcamera__module__callbacks) \\*, const char \\*camera_id, int new_status) |\n\n\ntorch_mode_status_change:\n\n\nCallback to the framework to indicate that the state of the torch mode of the flash unit associated with a specific camera device has changed. At module load time, the framework will assume the torch modes are in the TORCH_MODE_STATUS_AVAILABLE_OFF state if android.flash.info.available is reported as true via get_camera_info() call.\n\n\nThis callback is added for CAMERA_MODULE_API_VERSION_2_4.\n\n\n[camera_module_callbacks](/reference/hal/structcamera__module__callbacks)\n: The instance of camera_module_callbacks_t passed to the module with set_callbacks.\n\n\ncamera_id: The ID of camera device whose flash unit has a new torch mode status.\n\n\nnew_status: The new status code, one of the torch_mode_status_t enums.\n\n\nDefinition at line\n[639](https://android.googlesource.com/platform/hardware/libhardware/+/master/include/hardware/camera_common.h)\nof file\n[camera_common.h](https://android.googlesource.com/platform/hardware/libhardware/+/master/include/hardware/camera_common.h)\n.\n\n*** ** * ** ***\n\nThe documentation for this struct was generated from the following file:\n\n- hardware/libhardware/include/hardware/ [camera_common.h](https://android.googlesource.com/platform/hardware/libhardware/+/master/include/hardware/camera_common.h)"]]