自 2025 年 3 月 27 日起,我們建議您使用 android-latest-release
而非 aosp-main
建構及貢獻 AOSP。詳情請參閱「Android 開放原始碼計畫變更」。
透過集合功能整理內容
你可以依據偏好儲存及分類內容。
camera3_jpeg_blob 結構體參考資料
#include <
camera3.h
>
camera3_jpeg_blob
:
輸出串流中壓縮 JPEG 緩衝區的傳輸標頭。
如要擷取 JPEG 圖片,請使用像素格式 HAL_PIXEL_FORMAT_BLOB 建立串流。框架會根據靜態中繼資料欄 android.jpeg.maxSize 計算串流的緩衝區大小。由於壓縮的 JPEG 圖片大小會有所不同,HAL 需要在輸出串流緩衝區中使用這個結構體,納入壓縮圖片的最終大小。JPEG 資料 Blob ID 欄位必須設為 CAMERA3_JPEG_BLOB_ID。
傳輸標頭應位於 JPEG 輸出串流緩衝區的結尾。也就是說,jpeg_blob_id 必須從 byte[buffer_size - sizeof(camera3_jpeg_blob)] 開始,其中 buffer_size 是 gralloc 緩衝區的大小。使用此傳輸標頭的任何 HAL 都必須在 android.jpeg.maxSize 中計算。JPEG 資料本身會從緩衝區開頭開始,長度應為 jpeg_size 個位元組。
定義位於檔案
camera3.h
的
1885
行。
這個結構體的說明文件是由下列檔案產生:
-
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_jpeg_blob Struct Reference\n\ncamera3_jpeg_blob Struct Reference\n==================================\n\n[Data Fields](#pub-attribs) \ncamera3_jpeg_blob 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| uint16_t | [jpeg_blob_id](/reference/hal/structcamera3__jpeg__blob#a8eecd9b8a99477acdd51629ad25470fe) |\n| ||\n| uint32_t | [jpeg_size](/reference/hal/structcamera3__jpeg__blob#a2dcb603ff79e35e18e814e85f75c83e5) |\n| ||\n\n\nDetailed Description\n--------------------\n\n\n[camera3_jpeg_blob](/reference/hal/structcamera3__jpeg__blob)\n:\n\n\nTransport header for compressed JPEG buffers in output streams.\n\n\nTo capture JPEG images, a stream is created using the pixel format HAL_PIXEL_FORMAT_BLOB. The buffer size for the stream is calculated by the framework, based on the static metadata field android.jpeg.maxSize. Since compressed JPEG images are of variable size, the HAL needs to include the final size of the compressed image using this structure inside the output stream buffer. The JPEG blob ID field must be set to CAMERA3_JPEG_BLOB_ID.\n\n\nTransport header should be at the end of the JPEG output stream buffer. That means the jpeg_blob_id must start at byte\\[buffer_size - sizeof(camera3_jpeg_blob)\\], where the buffer_size is the size of gralloc buffer. Any HAL using this transport header must account for it in android.jpeg.maxSize The JPEG data itself starts at the beginning of the buffer and should be jpeg_size bytes long.\n\n\nDefinition at line\n[1885](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| uint16_t jpeg_blob_id |\n\n\nDefinition at line\n[1886](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 jpeg_size |\n\n\nDefinition at line\n[1887](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)"]]