Frame metadata
Stay organized with collections
Save and categorize content based on your preferences.
Frame metadata is introduced in Android 11 as a member of the BufferDesc data
structure. This new field is declared as vec<uint8_t>
to accommodate
a customer-defined data format and is opaque to 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>
represents dynamically sized arrays with the data
stored in a separate buffer. Such instances are represented with an instance of the
vec<T>
in the struct,
which means the EVS Camera HAL driver implementation owns this metadata and should clean
it up properly. There are two ways to fill metadata:
- Resize the container and fill data by using
operator[]
struct BufferDesc desc = {};
...
desc.metadata.resize(10);
for (auto i = 0; i < 10; ++i) {
desc.metadata[i] = frameInfo[i];
}
...
- Use
setToExternal()
to make vec<T>
point to your custom data structure.
struct BufferDesc desc = {};
struct FrameMetadata metadata = {
...
}; // this is in vendor-defined format.
desc.metadata.setToExternal(&metadata, sizeof(metadata));
...
Content and code samples on this page are subject to the licenses described in the Content License. Java and OpenJDK are trademarks or registered trademarks of Oracle and/or its affiliates.
Last updated 2024-09-03 UTC.
[{
"type": "thumb-down",
"id": "missingTheInformationINeed",
"label":"Missing the information I need"
},{
"type": "thumb-down",
"id": "tooComplicatedTooManySteps",
"label":"Too complicated / too many steps"
},{
"type": "thumb-down",
"id": "outOfDate",
"label":"Out of date"
},{
"type": "thumb-down",
"id": "samplesCodeIssue",
"label":"Samples / code issue"
},{
"type": "thumb-down",
"id": "otherDown",
"label":"Other"
}]
[{
"type": "thumb-up",
"id": "easyToUnderstand",
"label":"Easy to understand"
},{
"type": "thumb-up",
"id": "solvedMyProblem",
"label":"Solved my problem"
},{
"type": "thumb-up",
"id": "otherUp",
"label":"Other"
}]
{"lastModified": "Last updated 2024-09-03 UTC."}
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2024-09-03 UTC."]]