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 camera2_jpeg_blob
#include <
camera2.h
>
Tiêu đề truyền tải cho vùng đệm JPEG nén trong luồng đầu ra.
Để chụp ảnh JPEG, một luồng sẽ được tạo bằng định dạng pixel HAL_PIXEL_FORMAT_BLOB và trường siêu dữ liệu tĩnh android.jpeg.maxSize được dùng làm kích thước bộ đệm. Vì hình ảnh JPEG nén có kích thước thay đổi, nên HAL cần bao gồm kích thước cuối cùng của hình ảnh nén bằng cách sử dụng cấu trúc này bên trong bộ đệm luồng đầu ra. Bạn phải đặt trường mã blob JPEG thành CAMERA2_JPEG_BLOB_ID.
Tiêu đề truyền tải phải nằm ở cuối vùng đệm luồng đầu ra JPEG. Điều đó có nghĩa là jpeg_blob_id phải bắt đầu tại byte[android.jpeg.maxSize - sizeof(camera2_jpeg_blob)]. Mọi HAL sử dụng tiêu đề truyền tải này đều phải tính đến tiêu đề đó trong android.jpeg.maxSize. Bản thân dữ liệu JPEG bắt đầu tại byte[0] và phải có kích thước là jpeg_size byte.
Định nghĩa tại dòng
146
của tệp
camera2.h
.
Tài liệu cho cấu trúc này được tạo từ tệp sau:
-
hardware/libhardware/include/hardware/
camera2.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: camera2_jpeg_blob Struct Reference\n\ncamera2_jpeg_blob Struct Reference\n==================================\n\n[Data Fields](#pub-attribs) \ncamera2_jpeg_blob Struct Reference \n\n`\n#include \u003c\n`[camera2.h](https://android.googlesource.com/platform/hardware/libhardware/+/master/include/hardware/camera2.h)`\n\u003e\n`\n\n|----------|--------------------------------------------------------------------------------------------|\n| Data Fields ----------- ||\n| uint16_t | [jpeg_blob_id](/reference/hal/structcamera2__jpeg__blob#a8eecd9b8a99477acdd51629ad25470fe) |\n| ||\n| uint32_t | [jpeg_size](/reference/hal/structcamera2__jpeg__blob#a2dcb603ff79e35e18e814e85f75c83e5) |\n| ||\n\n\nDetailed Description\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, and the static metadata field android.jpeg.maxSize is used as the buffer size. 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 CAMERA2_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\\[android.jpeg.maxSize - sizeof(camera2_jpeg_blob)\\]. Any HAL using this transport header must account for it in android.jpeg.maxSize. The JPEG data itself starts at byte\\[0\\] and should be jpeg_size bytes long.\n\n\nDefinition at line\n[146](https://android.googlesource.com/platform/hardware/libhardware/+/master/include/hardware/camera2.h)\nof file\n[camera2.h](https://android.googlesource.com/platform/hardware/libhardware/+/master/include/hardware/camera2.h)\n.\n\nField Documentation\n-------------------\n\n\n|-----------------------|\n| uint16_t jpeg_blob_id |\n\n\nDefinition at line\n[147](https://android.googlesource.com/platform/hardware/libhardware/+/master/include/hardware/camera2.h)\nof file\n[camera2.h](https://android.googlesource.com/platform/hardware/libhardware/+/master/include/hardware/camera2.h)\n.\n\n|--------------------|\n| uint32_t jpeg_size |\n\n\nDefinition at line\n[148](https://android.googlesource.com/platform/hardware/libhardware/+/master/include/hardware/camera2.h)\nof file\n[camera2.h](https://android.googlesource.com/platform/hardware/libhardware/+/master/include/hardware/camera2.h)\n.\n\n*** ** * ** ***\n\nThe documentation for this struct was generated from the following file:\n\n- hardware/libhardware/include/hardware/ [camera2.h](https://android.googlesource.com/platform/hardware/libhardware/+/master/include/hardware/camera2.h)"]]