हमारा सुझाव है कि 27 मार्च, 2025 से AOSP को बनाने और उसमें योगदान देने के लिए, aosp-main
के बजाय android-latest-release
का इस्तेमाल करें. ज़्यादा जानकारी के लिए, AOSP में हुए बदलाव लेख पढ़ें.
फ़्रेम का मेटाडेटा
संग्रह की मदद से व्यवस्थित रहें
अपनी प्राथमिकताओं के आधार पर, कॉन्टेंट को सेव करें और कैटगरी में बांटें.
फ़्रेम मेटाडेटा को Android 11 में, BufferDesc डेटा स्ट्रक्चर के सदस्य के तौर पर पेश किया गया है. ग्राहक के तय किए गए डेटा फ़ॉर्मैट को शामिल करने के लिए, इस नए फ़ील्ड को vec<uint8_t>
के तौर पर दिखाया गया है. यह EVS मैनेजर के लिए नहीं दिखता.
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 Camera HAL ड्राइवर लागू करने वाले के पास इस मेटाडेटा का मालिकाना हक होता है और उसे इसे ठीक से हटाना चाहिए. मेटाडेटा भरने के दो तरीके हैं:
operator[]
का इस्तेमाल करके, कंटेनर का साइज़ बदलना और डेटा भरना
struct BufferDesc desc = {};
...
desc.metadata.resize(10);
for (auto i = 0; i < 10; ++i) {
desc.metadata[i] = frameInfo[i];
}
...
vec<T>
को अपने कस्टम डेटा स्ट्रक्चर पर ले जाने के लिए, setToExternal()
का इस्तेमाल करें.
struct BufferDesc desc = {};
struct FrameMetadata metadata = {
...
}; // this is in vendor-defined format.
desc.metadata.setToExternal(&metadata, sizeof(metadata));
...
इस पेज पर मौजूद कॉन्टेंट और कोड सैंपल कॉन्टेंट के लाइसेंस में बताए गए लाइसेंस के हिसाब से हैं. Java और OpenJDK, 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 ```"]]