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.
Tham chiếu cấu trúc camera3_capture_request
#include <
camera3.h
>
camera3_capture_request_t:
Một yêu cầu duy nhất để chụp ảnh/xử lý lại vùng đệm, được khung gửi đến thiết bị HAL của Máy ảnh trong process_capture_request().
Yêu cầu này chứa các chế độ cài đặt sẽ được dùng cho quá trình chụp này và tập hợp vùng đệm đầu ra để ghi dữ liệu hình ảnh thu được. Tệp này có thể chứa bộ đệm đầu vào (không bắt buộc). Trong trường hợp này, yêu cầu là để xử lý lại bộ đệm đầu vào đó thay vì chụp ảnh mới bằng cảm biến máy ảnh. Lần chụp được xác định bằng frame_number.
Để phản hồi, thiết bị HAL của máy ảnh phải gửi cấu trúc
camera3_capture_result
không đồng bộ đến khung bằng lệnh gọi lại process_capture_result().
Định nghĩa tại dòng
2135
của tệp
camera3.h
.
Số khung hình là một số nguyên tăng dần do khung đặt để xác định riêng biệt ảnh chụp này. Bạn cần trả về giá trị này trong lệnh gọi kết quả và cũng dùng để xác định yêu cầu trong thông báo không đồng bộ được gửi đến
camera3_callback_ops_t.notify()
.
Định nghĩa tại dòng
2142
của tệp
camera3.h
.
Vùng đệm luồng đầu vào để sử dụng cho yêu cầu này, nếu có.
Nếu input_buffer là NULL, thì yêu cầu là để chụp ảnh mới từ máy ảnh. Nếu input_buffer hợp lệ, yêu cầu này là để xử lý lại hình ảnh có trong input_buffer.
Trong trường hợp sau, HAL phải đặt release_fence của input_buffer thành một hàng rào đồng bộ hoá hợp lệ hoặc thành -1 nếu HAL không hỗ trợ đồng bộ hoá, trước khi process_capture_request() trả về.
HAL bắt buộc phải đợi hàng rào đồng bộ hoá thu nạp của vùng đệm đầu vào trước khi truy cập vào vùng đệm đó.
<= CAMERA_DEVICE_API_VERSION_3_1:
Mọi vùng đệm đầu vào có trong đây sẽ được đăng ký với HAL thông qua register_stream_buffers() trước khi đưa vào yêu cầu.
>= CAMERA_DEVICE_API_VERSION_3_2:
Các vùng đệm sẽ không được đăng ký trước với HAL. Các yêu cầu tiếp theo có thể sử dụng lại vùng đệm hoặc cung cấp vùng đệm hoàn toàn mới.
Định nghĩa tại dòng
2177
của tệp
camera3.h
.
uint32_t num_output_buffers
|
Số lượng vùng đệm đầu ra cho yêu cầu chụp này. Phải có ít nhất 1.
Định nghĩa tại dòng
2183
của tệp
camera3.h
.
Một mảng các vùng đệm luồng num_output_buffers, được điền bằng dữ liệu hình ảnh từ quá trình chụp/xử lý lại này. HAL phải đợi các hàng rào thu nạp của từng vùng đệm luồng trước khi ghi vào các vùng đệm đó.
HAL sở hữu các mục buffer_handle_t thực tế trong output_buffers; khung này không truy cập vào các mục đó cho đến khi các mục đó được trả về trong camera3_capture_result_t.
<= CAMERA_DEVICE_API_VERSION_3_1:
Tất cả vùng đệm có trong đây sẽ được đăng ký với HAL thông qua register_stream_buffers() trước khi được đưa vào yêu cầu.
>= CAMERA_DEVICE_API_VERSION_3_2:
Bất kỳ hoặc tất cả vùng đệm nào có trong đây đều có thể hoàn toàn mới trong yêu cầu này (HAL chưa từng thấy).
Định nghĩa tại dòng
2204
của tệp
camera3.h
.
Vùng đệm cài đặt chứa các tham số chụp và xử lý cho yêu cầu. Trong trường hợp đặc biệt, bộ đệm cài đặt NULL cho biết rằng các chế độ cài đặt giống hệt với yêu cầu chụp gần đây nhất đã gửi. Bạn không thể sử dụng vùng đệm NULL làm yêu cầu đầu tiên được gửi sau lệnh gọi configure_streams().
Định nghĩa tại dòng
2151
của tệp
camera3.h
.
Tài liệu cho cấu trúc này được tạo từ tệp sau:
-
hardware/libhardware/include/hardware/
camera3.h
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: camera3_capture_request Struct Reference\n\ncamera3_capture_request Struct Reference\n========================================\n\n[Data Fields](#pub-attribs) \ncamera3_capture_request Struct Reference \n\n`\n#include \u003c\n`[camera3.h](https://android.googlesource.com/platform/hardware/libhardware/+/master/include/hardware/camera3.h)`\n\u003e\n`\n\n|----------------------------------------------------------------------------------------------------------------------------------------|--------------------------------------------------------------------------------------------------------|\n| Data Fields ----------- ||\n| uint32_t | [frame_number](/reference/hal/structcamera3__capture__request#a57cc7f4d579276167efca6cf047839b2) |\n| ||\n| const [camera_metadata_t](https://android.googlesource.com/platform/hardware/libhardware/+/master/include/hardware/camera_common.h) \\* | [settings](/reference/hal/structcamera3__capture__request#adccd8702a549b9f5fb98afa0c4b44a62) |\n| ||\n| [camera3_stream_buffer_t](https://android.googlesource.com/platform/hardware/libhardware/+/master/include/hardware/camera3.h) \\* | [input_buffer](/reference/hal/structcamera3__capture__request#ac1c94bbde71f06911c6abe85f3a44593) |\n| ||\n| uint32_t | [num_output_buffers](/reference/hal/structcamera3__capture__request#a70d2093ddb1078b68c6688b6cf923380) |\n| ||\n| const [camera3_stream_buffer_t](https://android.googlesource.com/platform/hardware/libhardware/+/master/include/hardware/camera3.h) \\* | [output_buffers](/reference/hal/structcamera3__capture__request#ab1d50229b27a7cf28ff1374be6650fb6) |\n| ||\n\n\nDetailed Description\n--------------------\n\n\ncamera3_capture_request_t:\n\n\nA single request for image capture/buffer reprocessing, sent to the Camera HAL device by the framework in process_capture_request().\n\n\nThe request contains the settings to be used for this capture, and the set of output buffers to write the resulting image data in. It may optionally contain an input buffer, in which case the request is for reprocessing that input buffer instead of capturing a new image with the camera sensor. The capture is identified by the frame_number.\n\n\nIn response, the camera HAL device must send a\n[camera3_capture_result](/reference/hal/structcamera3__capture__result)\nstructure asynchronously to the framework, using the process_capture_result() callback.\n\n\nDefinition at line\n[2135](https://android.googlesource.com/platform/hardware/libhardware/+/master/include/hardware/camera3.h)\nof file\n[camera3.h](https://android.googlesource.com/platform/hardware/libhardware/+/master/include/hardware/camera3.h)\n.\n\nField Documentation\n-------------------\n\n\n|-----------------------|\n| uint32_t frame_number |\n\n\nThe frame number is an incrementing integer set by the framework to uniquely identify this capture. It needs to be returned in the result call, and is also used to identify the request in asynchronous notifications sent to\n[camera3_callback_ops_t.notify()](/reference/hal/structcamera3__callback__ops#a6d702d6e962f95105b984b17462619b3)\n.\n\n\nDefinition at line\n[2142](https://android.googlesource.com/platform/hardware/libhardware/+/master/include/hardware/camera3.h)\nof file\n[camera3.h](https://android.googlesource.com/platform/hardware/libhardware/+/master/include/hardware/camera3.h)\n.\n\n|-----------------------------------------------------------------------------------------------------------------------------------------------|\n| [camera3_stream_buffer_t](https://android.googlesource.com/platform/hardware/libhardware/+/master/include/hardware/camera3.h) \\* input_buffer |\n\n\nThe input stream buffer to use for this request, if any.\n\n\nIf input_buffer is NULL, then the request is for a new capture from the imager. If input_buffer is valid, the request is for reprocessing the image contained in input_buffer.\n\n\nIn the latter case, the HAL must set the release_fence of the input_buffer to a valid sync fence, or to -1 if the HAL does not support sync, before process_capture_request() returns.\n\n\nThe HAL is required to wait on the acquire sync fence of the input buffer before accessing it.\n\n\n\\\u003c= CAMERA_DEVICE_API_VERSION_3_1:\n\n\nAny input buffer included here will have been registered with the HAL through register_stream_buffers() before its inclusion in a request.\n\n\n\\\u003e= CAMERA_DEVICE_API_VERSION_3_2:\n\n\nThe buffers will not have been pre-registered with the HAL. Subsequent requests may reuse buffers, or provide entirely new buffers.\n\n\nDefinition at line\n[2177](https://android.googlesource.com/platform/hardware/libhardware/+/master/include/hardware/camera3.h)\nof file\n[camera3.h](https://android.googlesource.com/platform/hardware/libhardware/+/master/include/hardware/camera3.h)\n.\n\n|-----------------------------|\n| uint32_t num_output_buffers |\n\n\nThe number of output buffers for this capture request. Must be at least 1.\n\n\nDefinition at line\n[2183](https://android.googlesource.com/platform/hardware/libhardware/+/master/include/hardware/camera3.h)\nof file\n[camera3.h](https://android.googlesource.com/platform/hardware/libhardware/+/master/include/hardware/camera3.h)\n.\n\n|-------------------------------------------------------------------------------------------------------------------------------------------------------|\n| const [camera3_stream_buffer_t](https://android.googlesource.com/platform/hardware/libhardware/+/master/include/hardware/camera3.h) \\* output_buffers |\n\n\nAn array of num_output_buffers stream buffers, to be filled with image data from this capture/reprocess. The HAL must wait on the acquire fences of each stream buffer before writing to them.\n\n\nThe HAL takes ownership of the actual buffer_handle_t entries in output_buffers; the framework does not access them until they are returned in a camera3_capture_result_t.\n\n\n\\\u003c= CAMERA_DEVICE_API_VERSION_3_1:\n\n\nAll the buffers included here will have been registered with the HAL through register_stream_buffers() before their inclusion in a request.\n\n\n\\\u003e= CAMERA_DEVICE_API_VERSION_3_2:\n\n\nAny or all of the buffers included here may be brand new in this request (having never before seen by the HAL).\n\n\nDefinition at line\n[2204](https://android.googlesource.com/platform/hardware/libhardware/+/master/include/hardware/camera3.h)\nof file\n[camera3.h](https://android.googlesource.com/platform/hardware/libhardware/+/master/include/hardware/camera3.h)\n.\n\n|-------------------------------------------------------------------------------------------------------------------------------------------------|\n| const [camera_metadata_t](https://android.googlesource.com/platform/hardware/libhardware/+/master/include/hardware/camera_common.h) \\* settings |\n\n\nThe settings buffer contains the capture and processing parameters for the request. As a special case, a NULL settings buffer indicates that the settings are identical to the most-recently submitted capture request. A NULL buffer cannot be used as the first submitted request after a configure_streams() call.\n\n\nDefinition at line\n[2151](https://android.googlesource.com/platform/hardware/libhardware/+/master/include/hardware/camera3.h)\nof file\n[camera3.h](https://android.googlesource.com/platform/hardware/libhardware/+/master/include/hardware/camera3.h)\n.\n\n*** ** * ** ***\n\nThe documentation for this struct was generated from the following file:\n\n- hardware/libhardware/include/hardware/ [camera3.h](https://android.googlesource.com/platform/hardware/libhardware/+/master/include/hardware/camera3.h)"]]