Kể từ ngày 27 tháng 3 năm 2025, bạn nên sử dụng android-latest-release
thay vì aosp-main
để xây dựng và đóng góp cho AOSP. Để biết thêm thông tin, hãy xem phần Thay đổi đối với AOSP.
Sử dụng bộ sưu tập để sắp xếp ngăn nắp các trang
Lưu và phân loại nội dung dựa trên lựa chọn ưu tiên của bạn.
Tài liệu tham khảo về cấu trúc camera_module_callbacks
#include <
camera_common.h
>
Các hàm gọi lại để mô-đun HAL của máy ảnh sử dụng nhằm thông báo cho khung về các thay đổi đối với hệ thống con của máy ảnh.
Thông tin phiên bản (dựa trên camera_module_t.common.module_api_version):
Mỗi lệnh gọi lại chỉ được các mô-đun HAL triển khai phiên bản được chỉ định trở lên của giao diện API mô-đun HAL gọi.
CAMERA_MODULE_API_VERSION_2_1:
camera_device_status_change()
CAMERA_MODULE_API_VERSION_2_4:
torch_mode_status_change()
Định nghĩa tại dòng
594
của tệp
camera_common.h
.
camera_device_status_change:
Lệnh gọi lại cho khung để cho biết trạng thái của một thiết bị máy ảnh cụ thể đã thay đổi. Tại thời điểm tải mô-đun, khung sẽ giả định tất cả thiết bị máy ảnh đều ở trạng thái CAMERA_DEVICE_STATUS_PRESENT. HAL phải gọi phương thức này để thông báo cho khung về mọi thiết bị NOT_PRESENT ban đầu.
Lệnh gọi lại này được thêm vào CAMERA_MODULE_API_VERSION_2_1.
camera_module_callbacks
: Thực thể của camera_module_callbacks_t được truyền đến mô-đun bằng set_callbacks.
camera_id: Mã của thiết bị máy ảnh có trạng thái mới.
new_status: Mã trạng thái mới, một trong các enum camera_device_status_t hoặc trạng thái dành riêng cho nền tảng.
Định nghĩa tại dòng
616
của tệp
camera_common.h
.
torch_mode_status_change:
Gọi lại khung để cho biết trạng thái của chế độ đèn pin của đơn vị đèn flash liên kết với một thiết bị máy ảnh cụ thể đã thay đổi. Tại thời điểm tải mô-đun, khung sẽ giả định các chế độ đèn pin ở trạng thái TORCH_MODE_STATUS_AVAILABLE_OFF nếu android.flash.info.available được báo cáo là true thông qua lệnh gọi get_camera_info().
Lệnh gọi lại này được thêm vào CAMERA_MODULE_API_VERSION_2_4.
camera_module_callbacks
: Thực thể của camera_module_callbacks_t được truyền đến mô-đun bằng set_callbacks.
camera_id: Mã thiết bị máy ảnh có đơn vị đèn flash có trạng thái chế độ đèn pin mới.
new_status: Mã trạng thái mới, một trong các enum torch_mode_status_t.
Định nghĩa tại dòng
639
của tệp
camera_common.h
.
Tài liệu cho cấu trúc này được tạo từ tệp sau:
Nội dung và mã mẫu trên trang này phải tuân thủ các giấy phép như mô tả trong phần Giấy phép nội dung. Java và OpenJDK là nhãn hiệu hoặc nhãn hiệu đã đăng ký của Oracle và/hoặc đơn vị liên kết của Oracle.
Cập nhật lần gần đây nhất: 2025-07-27 UTC.
[[["Dễ hiểu","easyToUnderstand","thumb-up"],["Giúp tôi giải quyết được vấn đề","solvedMyProblem","thumb-up"],["Khác","otherUp","thumb-up"]],[["Thiếu thông tin tôi cần","missingTheInformationINeed","thumb-down"],["Quá phức tạp/quá nhiều bước","tooComplicatedTooManySteps","thumb-down"],["Đã lỗi thời","outOfDate","thumb-down"],["Vấn đề về bản dịch","translationIssue","thumb-down"],["Vấn đề về mẫu/mã","samplesCodeIssue","thumb-down"],["Khác","otherDown","thumb-down"]],["Cập nhật lần gần đây nhất: 2025-07-27 UTC."],[],[],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)"]]