2025년 3월 27일부터 AOSP를 빌드하고 기여하려면 aosp-main
대신 android-latest-release
를 사용하는 것이 좋습니다. 자세한 내용은 AOSP 변경사항을 참고하세요.
프레임 메타데이터
컬렉션을 사용해 정리하기
내 환경설정을 기준으로 콘텐츠를 저장하고 분류하세요.
프레임 메타데이터는 Android 11에서 BufferDesc 데이터 구조의 한 요소로 도입되었습니다. 이 새로운 필드는 고객 정의 데이터 형식을 수용하기 위해 vec<uint8_t>
로 선언되며 EVS Manager에 불투명합니다.
struct BufferDesc {
/**
* HIDL counterpart of AHardwareBuffer_Desc. Please see
* hardware/interfaces/graphics/common/1.2/types.hal for more details.
*/
HardwareBuffer buffer;
...
/**
* Time that this buffer is being filled.
*/
int64_t timestamp;
/**
* Frame metadata field. This is opaque to EVS manager.
*/
vec<uint8_t> metadata;
};
HIDL vec<T>
는 별도의 버퍼에 저장된 데이터를 갖는, 동적 크기의 배열을 나타냅니다. 이러한 인스턴스는 구조체에서 vec<T>
의 인스턴스로 표현됩니다. 즉, EVS 카메라 HAL 드라이버 구현이 이 메타데이터를 소유해 적절히 정리해야 한다는 의미입니다. 메타데이터는 다음 두 가지 방법으로 채울 수 있습니다.
operator[]
을 사용하여 컨테이너 크기를 조절하고 데이터를 채웁니다. struct BufferDesc desc = {};
...
desc.metadata.resize(10);
for (auto i = 0; i < 10; ++i) {
desc.metadata[i] = frameInfo[i];
}
...
setToExternal()
을 사용하여 vec<T>
가 맞춤 데이터 구조를 가리키도록 합니다.struct BufferDesc desc = {};
struct FrameMetadata metadata = {
...
}; // this is in vendor-defined format.
desc.metadata.setToExternal(&metadata, sizeof(metadata));
...
이 페이지에 나와 있는 콘텐츠와 코드 샘플에는 콘텐츠 라이선스에서 설명하는 라이선스가 적용됩니다. 자바 및 OpenJDK는 Oracle 및 Oracle 계열사의 상표 또는 등록 상표입니다.
최종 업데이트: 2025-08-08(UTC)
[[["이해하기 쉬움","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-08-08(UTC)"],[],[],null,["# Frame metadata is introduced in Android 11 as a member of the BufferDesc data\nstructure. This new field is declared as `vec\u003cuint8_t\u003e` to accommodate\na customer-defined data format and is opaque to EVS manager. \n\n```carbon\nstruct BufferDesc {\n /**\n * HIDL counterpart of AHardwareBuffer_Desc. Please see\n * hardware/interfaces/graphics/common/1.2/types.hal for more details.\n */\n HardwareBuffer buffer;\n ...\n\n /**\n * Time that this buffer is being filled.\n */\n int64_t timestamp;\n\n /**\n * Frame metadata field. This is opaque to EVS manager.\n */\n vec\u003cuint8_t\u003e metadata;\n};\n```\n\nHIDL `vec\u003cT\u003e` represents dynamically sized arrays with the data\nstored in a separate buffer. Such instances are represented with an instance of the\n`vec\u003cT\u003e` in the [struct](/devices/architecture/hidl/types#struct),\nwhich means the EVS Camera HAL driver implementation owns this metadata and should clean\nit up properly. There are two ways to fill metadata:\n\n- Resize the container and fill data by using [operator[]](https://android.googlesource.com/platform/system/libhwbinder/+/8539c12501d835979c853a249f8925ef64ecd042/include/hwbinder/HidlSupport.h#115) \n\n ```transact-sql\n struct BufferDesc desc = {};\n ...\n desc.metadata.resize(10);\n for (auto i = 0; i \u003c 10; ++i) {\n desc.metadata[i] = frameInfo[i];\n }\n ...\n \n ```\n- Use [setToExternal()](https://android.googlesource.com/platform/system/libhwbinder/+/8539c12501d835979c853a249f8925ef64ecd042/include/hwbinder/HidlSupport.h#83)`\n ` to make `vec\u003cT\u003e` point to your custom data structure. \n\n ```text\n struct BufferDesc desc = {};\n struct FrameMetadata metadata = {\n ...\n }; // this is in vendor-defined format.\n\n\n desc.metadata.setToExternal(&metadata, sizeof(metadata));\n ...\n ```"]]