हमारा सुझाव है कि 27 मार्च, 2025 से AOSP को बनाने और उसमें योगदान देने के लिए, aosp-main
के बजाय android-latest-release
का इस्तेमाल करें. ज़्यादा जानकारी के लिए, AOSP में हुए बदलाव लेख पढ़ें.
संग्रह की मदद से व्यवस्थित रहें
अपनी प्राथमिकताओं के आधार पर, कॉन्टेंट को सेव करें और कैटगरी में बांटें.
camera2_request_queue_src_ops स्ट्रक्चर का रेफ़रंस
#include <
camera2.h
>
अनुरोध इनपुट कतार प्रोटोकॉल:
फ़्रेमवर्क में सूची और उसका कॉन्टेंट सेव होता है. शुरू में, सूची खाली होती है.
-
जब पहला मेटाडेटा बफ़र सूची में डाला जाता है, तो फ़्रेमवर्क, notify_request_queue_not_empty() को कॉल करके डिवाइस को सिग्नल भेजता है.
-
notify_request_queue_not_empty मिलने के बाद, डिवाइस को अगला बफ़र मैनेज करने के लिए, dequeue() को कॉल करना होगा.
-
जब डिवाइस किसी बफ़र को प्रोसेस कर लेता है और अगले बफ़र के लिए तैयार हो जाता है, तो उसे सूचना का इंतज़ार करने के बजाय, dequeue() को फिर से कॉल करना चाहिए. अगर कोई बफ़र उपलब्ध नहीं है, तो dequeue() फ़ंक्शन NULL दिखाएगा. इसके बाद, जब कोई बफ़र उपलब्ध हो जाता है, तो फ़्रेमवर्क को notify_request_queue_not_empty() को फिर से कॉल करना होगा. अगर डिवाइस को dequeue से NULL रिटर्न मिलता है, तो उसे तब तक कतार के लिए फिर से क्वेरी करने की ज़रूरत नहीं है, जब तक सोर्स से notify_request_queue_not_empty() कॉल नहीं मिलता.
-
अगर डिवाइस buffer_count() को कॉल करता है और उसे 0 वैल्यू मिलती है, तो इसका मतलब यह नहीं है कि फ़्रेमवर्क, notify_request_queue_not_empty() कॉल देगा. फ़्रेमवर्क सिर्फ़ तब ऐसी सूचना देगा, जब डिवाइस को डिसक्यू से NULL मिला हो या शुरुआती स्टार्टअप के बाद.
-
notify_request_queue_not_empty() के जवाब में dequeue() कॉल, notify_request_queue_not_empty() कॉल की ही थ्रेड पर हो सकता है. साथ ही, notify कॉल से भी इसे किया जा सकता है.
-
सूची से हटाए गए सभी अनुरोध बफ़र को free_request को कॉल करके फ़्रेमवर्क में वापस लाया जाना चाहिए. इसमें गड़बड़ियां होने, डिवाइस को फ़्लश करने का अनुरोध करने या डिवाइस के बंद होने पर भी ऐसा करना ज़रूरी है.
परिभाषा,
camera2.h
फ़ाइल की लाइन
220
पर दी गई है.
फ़्रेमवर्क से मेटाडेटा बफ़र पाएं. अगर कोई गड़बड़ी नहीं है, तो OK दिखाता है. अगर कतार खाली है, तो बफ़र में NULL दिखाता है. ऐसे में, डिवाइस को फिर से सूची से हटाने की कोशिश करने से पहले, notify_request_queue_not_empty() मैसेज का इंतज़ार करना होगा. इस तरह से मिले बफ़र को
free_request()
के साथ फ़्रेमवर्क में वापस लौटाया जाना चाहिए
.
परिभाषा,
camera2.h
फ़ाइल की लाइन
237
पर दी गई है.
मेटाडेटा बफ़र का इस्तेमाल करने के बाद या कोई गड़बड़ी या शटडाउन होने पर, उसे फ़्रेमवर्क में वापस लाएं.
परिभाषा,
camera2.h
फ़ाइल की लाइन
243
पर दी गई है
.
सूची में मौजूद, अनुरोध बफ़र की संख्या देखें. अगर फ़िलहाल बार-बार होने वाले अनुरोध (स्ट्रीम के लिए अनुरोध) को कॉन्फ़िगर किया गया है, तो CAMERA2_REQUEST_QUEUE_IS_BOTTOMLESS को दिखाया जा सकता है. इस तरीके को कॉल करने से, इस बात पर कोई असर नहीं पड़ता कि फ़्रेमवर्क, notify_request_queue_not_empty() तरीके को कॉल करेगा या नहीं.
परिभाषा,
camera2.h
फ़ाइल की लाइन
228
पर दी गई है.
इस स्ट्रक्चर का दस्तावेज़, इस फ़ाइल से जनरेट किया गया था:
-
hardware/libhardware/include/hardware/
camera2.h
इस पेज पर मौजूद कॉन्टेंट और कोड सैंपल कॉन्टेंट के लाइसेंस में बताए गए लाइसेंस के हिसाब से हैं. Java और OpenJDK, Oracle और/या इससे जुड़ी हुई कंपनियों के ट्रेडमार्क या रजिस्टर किए हुए ट्रेडमार्क हैं.
आखिरी बार 2025-07-27 (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-07-27 (UTC) को अपडेट किया गया."],[],[],null,["# Android Hardware Abstraction Layer: camera2_request_queue_src_ops Struct Reference\n\ncamera2_request_queue_src_ops Struct Reference\n==============================================\n\n[Data Fields](#pub-attribs) \ncamera2_request_queue_src_ops 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| int(\\* | [request_count](/reference/hal/structcamera2__request__queue__src__ops#a19ec09251038ee392fedcaeb68ede229) )(const struct [camera2_request_queue_src_ops](/reference/hal/structcamera2__request__queue__src__ops) \\*q) |\n| ||\n| int(\\* | [dequeue_request](/reference/hal/structcamera2__request__queue__src__ops#a79adee987dbd6a8ea0cfab81c89ae579) )(const struct [camera2_request_queue_src_ops](/reference/hal/structcamera2__request__queue__src__ops) \\*q, [camera_metadata_t](https://android.googlesource.com/platform/hardware/libhardware/+/master/include/hardware/camera_common.h) \\*\\*buffer) |\n| ||\n| int(\\* | [free_request](/reference/hal/structcamera2__request__queue__src__ops#aa45ae2fd2aedf1843378e213e65a66f8) )(const struct [camera2_request_queue_src_ops](/reference/hal/structcamera2__request__queue__src__ops) \\*q, [camera_metadata_t](https://android.googlesource.com/platform/hardware/libhardware/+/master/include/hardware/camera_common.h) \\*old_buffer) |\n| ||\n\n\nDetailed Description\n--------------------\n\n\nRequest input queue protocol:\n\n\nThe framework holds the queue and its contents. At start, the queue is empty.\n\n1. When the first metadata buffer is placed into the queue, the framework signals the device by calling notify_request_queue_not_empty().\n2. After receiving notify_request_queue_not_empty, the device must call dequeue() once it's ready to handle the next buffer.\n3. Once the device has processed a buffer, and is ready for the next buffer, it must call dequeue() again instead of waiting for a notification. If there are no more buffers available, dequeue() will return NULL. After this point, when a buffer becomes available, the framework must call notify_request_queue_not_empty() again. If the device receives a NULL return from dequeue, it does not need to query the queue again until a notify_request_queue_not_empty() call is received from the source.\n4. If the device calls buffer_count() and receives 0, this does not mean that the framework will provide a notify_request_queue_not_empty() call. The framework will only provide such a notification after the device has received a NULL from dequeue, or on initial startup.\n5. The dequeue() call in response to notify_request_queue_not_empty() may be on the same thread as the notify_request_queue_not_empty() call, and may be performed from within the notify call.\n6. All dequeued request buffers must be returned to the framework by calling free_request, including when errors occur, a device flush is requested, or when the device is shutting down.\n\n\nDefinition at line\n[220](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| int(\\* dequeue_request)(const struct [camera2_request_queue_src_ops](/reference/hal/structcamera2__request__queue__src__ops) \\*q, [camera_metadata_t](https://android.googlesource.com/platform/hardware/libhardware/+/master/include/hardware/camera_common.h) \\*\\*buffer) |\n\n\nGet a metadata buffer from the framework. Returns OK if there is no error. If the queue is empty, returns NULL in buffer. In that case, the device must wait for a notify_request_queue_not_empty() message before attempting to dequeue again. Buffers obtained in this way must be returned to the framework with\n[free_request()](/reference/hal/structcamera2__request__queue__src__ops#aa45ae2fd2aedf1843378e213e65a66f8)\n.\n\n\nDefinition at line\n[237](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| int(\\* free_request)(const struct [camera2_request_queue_src_ops](/reference/hal/structcamera2__request__queue__src__ops) \\*q, [camera_metadata_t](https://android.googlesource.com/platform/hardware/libhardware/+/master/include/hardware/camera_common.h) \\*old_buffer) |\n\n\nReturn a metadata buffer to the framework once it has been used, or if an error or shutdown occurs.\n\n\nDefinition at line\n[243](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| int(\\* request_count)(const struct [camera2_request_queue_src_ops](/reference/hal/structcamera2__request__queue__src__ops) \\*q) |\n\n\nGet the count of request buffers pending in the queue. May return CAMERA2_REQUEST_QUEUE_IS_BOTTOMLESS if a repeating request (stream request) is currently configured. Calling this method has no effect on whether the notify_request_queue_not_empty() method will be called by the framework.\n\n\nDefinition at line\n[228](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)"]]