自 2025 年 3 月 27 日起,我們建議您使用 android-latest-release
而非 aosp-main
建構及貢獻 AOSP。詳情請參閱「Android 開放原始碼計畫變更」。
透過集合功能整理內容
你可以依據偏好儲存及分類內容。
camera3_capture_request 結構參考資料
#include <
camera3.h
>
camera3_capture_request_t:
單一要求,要求對圖片擷取/緩衝區重新處理,在 process_capture_request() 中由架構傳送至相機 HAL 裝置。
這項要求包含用於這項擷取作業的設定,以及用於寫入最終圖片資料的輸出緩衝區集。這項要求可選擇包含輸入緩衝區,在這種情況下,系統會重新處理該輸入緩衝區,而不是使用相機感應器擷取新圖片。擷取畫面會以 frame_number 識別。
相機 HAL 裝置必須使用 process_capture_result() 回呼,以非同步方式將
camera3_capture_result
結構傳送至架構。
定義位於檔案
camera3.h
的
2135
行。
用於此要求的輸入串流緩衝區 (如有)。
如果 input_buffer 為空值,則要求是從影像擷取器擷取新影像。如果 input_buffer 有效,要求就會重新處理 input_buffer 中包含的圖片。
在後一種情況下,在 process_capture_request() 傳回之前,HAL 必須將 input_buffer 的 release_fence 設為有效的同步區隔,如果 HAL 不支援同步,則設為 -1。
HAL 必須先等待輸入緩衝區的取得同步區域,才能存取該緩衝區。
<= CAMERA_DEVICE_API_VERSION_3_1:
在此處加入的任何輸入緩衝區,都會先透過 register_stream_buffers() 向 HAL 註冊,再納入要求。
>= CAMERA_DEVICE_API_VERSION_3_2:
緩衝區不會預先註冊至 HAL。後續要求可能會重複使用緩衝區,或提供全新的緩衝區。
定義位於檔案
camera3.h
的
2177
行。
uint32_t num_output_buffers
|
一個 num_output_buffers 串流緩衝區陣列,可填入來自這項擷取/重新處理作業的圖片資料。HAL 必須等待每個串流緩衝區的取得柵欄,才能寫入這些緩衝區。
HAL 會取得 output_buffers 中實際 buffer_handle_t 項目的擁有權;在這些項目以 camera3_capture_result_t 傳回之前,架構不會存取這些項目。
<= CAMERA_DEVICE_API_VERSION_3_1:
在將這裡的所有緩衝區納入要求之前,會先透過 register_stream_buffers() 將這些緩衝區註冊至 HAL。
>= CAMERA_DEVICE_API_VERSION_3_2:
這裡所包含的任何或所有緩衝區,都可能是此要求中的全新緩衝區 (從未在 HAL 中出現過)。
定義位於檔案
camera3.h
的
2204
行。
設定緩衝區包含要求的擷取和處理參數。在特殊情況下,空值設定緩衝區表示設定與最近提交的擷取要求相同。在 configure_streams() 呼叫後,您無法將空值緩衝區用於做為第一個提交的要求。
定義位於檔案
camera3.h
的第
2151
行。
這個結構體的說明文件是由下列檔案產生:
-
hardware/libhardware/include/hardware/
camera3.h
這個頁面中的內容和程式碼範例均受《內容授權》中的授權所規範。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: 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)"]]