हमारा सुझाव है कि 27 मार्च, 2025 से AOSP को बनाने और उसमें योगदान देने के लिए, aosp-main
के बजाय android-latest-release
का इस्तेमाल करें. ज़्यादा जानकारी के लिए, AOSP में हुए बदलाव लेख पढ़ें.
संग्रह की मदद से व्यवस्थित रहें
अपनी प्राथमिकताओं के आधार पर, कॉन्टेंट को सेव करें और कैटगरी में बांटें.
camera3_stream_buffer स्ट्रक्चर का रेफ़रंस
#include <
camera3.h
>
camera3_stream_buffer_t:
camera3 स्ट्रीम का एक बफ़र. इसमें, पैरंट स्ट्रीम का हैंडल, gralloc बफ़र का हैंडल, और सिंक फ़ेंस शामिल होते हैं
बफ़र से यह पता नहीं चलता कि उसका इस्तेमाल इनपुट के लिए करना है या आउटपुट के लिए. यह इस बात से तय होता है कि उसकी पैरंट स्ट्रीम किस तरह की है और बफ़र को HAL डिवाइस में कैसे पास किया जाता है.
परिभाषा,
camera3.h
फ़ाइल की लाइन
1755
पर दी गई है.
इस बफ़र के लिए, सिंक फ़ेंस हासिल करें. इस बफ़र से पढ़ने या उसमें लिखने से पहले, एचएएल को इस फ़ेंस एफ़डी पर इंतज़ार करना होगा.
फ़्रेमवर्क को -1 पर सेट किया जा सकता है, ताकि यह पता चल सके कि इस बफ़र के लिए इंतज़ार करने की ज़रूरत नहीं है.
जब HAL, process_capture_result() की मदद से फ़्रेमवर्क को कोई आउटपुट बफ़र दिखाता है, तो acquire_fence को -1 पर सेट करना ज़रूरी है. अगर बफ़र भरने में हुई गड़बड़ी की वजह से, एचएएल कभी भी acquire_fence पर इंतज़ार नहीं करता है, तो process_capture_result() को कॉल करते समय, एचएएल को बफ़र के release_fence को, फ़्रेमवर्क से पास किए गए acquire_fence के तौर पर सेट करना होगा. इससे फ़्रेमवर्क, बफ़र का फिर से इस्तेमाल करने से पहले, फ़ेंस पर इंतज़ार कर पाएगा.
इनपुट बफ़र के लिए, HAL को process_capture_request() कॉल के दौरान acquire_fence फ़ील्ड में बदलाव नहीं करना चाहिए.
>= CAMERA_DEVICE_API_VERSION_3_2:
जब HAL, process_capture_result() के साथ फ़्रेमवर्क को इनपुट बफ़र दिखाता है, तो acquire_fence को -1 पर सेट किया जाना चाहिए. अगर किसी गड़बड़ी की वजह से एचएएल, इनपुट बफ़र के लिए फ़ेंस हासिल करने का इंतज़ार कभी नहीं करता है, तो सिंक फ़ेंस को उसी तरह से मैनेज किया जाना चाहिए जिस तरह आउटपुट बफ़र के लिए किया जाता है.
परिभाषा, फ़ाइल के
camera3.h
की लाइन
1800
पर दी गई है.
बफ़र का नेटिव हैंडल
परिभाषा, फ़ाइल
camera3.h
की लाइन
1764
पर दी गई है.
इस बफ़र के लिए रिलीज़ सिंक फ़ेंस. फ़्रेमवर्क को बफ़र दिखाते समय, एचएएल को यह फ़ेंस सेट करना होगा या -1 लिखकर यह बताना होगा कि इस बफ़र के लिए इंतज़ार करने की ज़रूरत नहीं है.
आउटपुट बफ़र के लिए, फ़ेंस को process_capture_result() फ़ंक्शन में पास किए गए output_buffers कलेक्शन में सेट किया जाना चाहिए.
<= CAMERA_DEVICE_API_VERSION_3_1:
इनपुट बफ़र के लिए, रिलीज़ फ़ेंस को process_capture_request() कॉल से सेट किया जाना चाहिए.
>= CAMERA_DEVICE_API_VERSION_3_2:
इनपुट बफ़र के लिए, फ़ेंस को process_capture_result() फ़ंक्शन में पास किए गए input_buffer में सेट किया जाना चाहिए.
इस बफ़र के लिए release_fence सिग्नल देने के बाद, एचएएल को इस बफ़र को ऐक्सेस करने की कोई और कोशिश नहीं करनी चाहिए, क्योंकि इसका मालिकाना हक पूरी तरह से फ़्रेमवर्क को वापस ट्रांसफ़र कर दिया गया है.
अगर फ़ेंस के तौर पर -1 तय किया गया था, तो process_capture_result को कॉल करने के तुरंत बाद, इस बफ़र का मालिकाना हक वापस ट्रांसफ़र कर दिया जाता है.
परिभाषा,
camera3.h
फ़ाइल की लाइन
1827
पर दी गई है.
बफ़र की मौजूदा स्थिति, camera3_buffer_status_t की वैल्यू में से कोई एक. फ़्रेमवर्क, गड़बड़ी की स्थिति में मौजूद बफ़र को एचएएल को पास नहीं करेगा. अगर एचएएल किसी बफ़र को भर नहीं पाता है, तो process_capture_result() के साथ फ़्रेमवर्क में लौटने पर, उसका स्टेटस CAMERA3_BUFFER_STATUS_ERROR पर सेट होना चाहिए.
परिभाषा, फ़ाइल
camera3.h
की लाइन
1773
पर दी गई है.
इस बफ़र से जुड़ी स्ट्रीम का हैंडल
परिभाषा, फ़ाइल
camera3.h
की पंक्ति
1759
पर दी गई है.
इस स्ट्रक्चर का दस्तावेज़, इस फ़ाइल से जनरेट किया गया था:
-
hardware/libhardware/include/hardware/
camera3.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: camera3_stream_buffer Struct Reference\n\ncamera3_stream_buffer Struct Reference\n======================================\n\n[Data Fields](#pub-attribs) \ncamera3_stream_buffer Struct Reference \n\n`\n#include \u003c\n`[camera3.h](https://android.googlesource.com/platform/hardware/libhardware/+/master/include/hardware/camera3.h)`\n\u003e\n`\n\n|---------------------------------------------------------------------------------------------------------------------------|-------------------------------------------------------------------------------------------------|\n| Data Fields ----------- ||\n| [camera3_stream_t](https://android.googlesource.com/platform/hardware/libhardware/+/master/include/hardware/camera3.h) \\* | [stream](/reference/hal/structcamera3__stream__buffer#afaf6c85f165b4180fe63affae0232dad) |\n| ||\n| buffer_handle_t \\* | [buffer](/reference/hal/structcamera3__stream__buffer#ab87cddef201db642e7972d124d741dc2) |\n| ||\n| int | [status](/reference/hal/structcamera3__stream__buffer#a6e27f49150e9a14580fb313cc2777e00) |\n| ||\n| int | [acquire_fence](/reference/hal/structcamera3__stream__buffer#a5d59e0770b54af97a9fe151da5688719) |\n| ||\n| int | [release_fence](/reference/hal/structcamera3__stream__buffer#a248e5f7856e4c2877715fc9fda8d8ba8) |\n| ||\n\n\nDetailed Description\n--------------------\n\n\ncamera3_stream_buffer_t:\n\n\nA single buffer from a camera3 stream. It includes a handle to its parent stream, the handle to the gralloc buffer itself, and sync fences\n\n\nThe buffer does not specify whether it is to be used for input or output; that is determined by its parent stream type and how the buffer is passed to the HAL device.\n\n\nDefinition at line\n[1755](https://android.googlesource.com/platform/hardware/libhardware/+/master/include/hardware/camera3.h)\nof file\n[camera3.h](https://android.googlesource.com/platform/hardware/libhardware/+/master/include/hardware/camera3.h)\n.\n\nField Documentation\n-------------------\n\n\n|-------------------|\n| int acquire_fence |\n\n\nThe acquire sync fence for this buffer. The HAL must wait on this fence fd before attempting to read from or write to this buffer.\n\n\nThe framework may be set to -1 to indicate that no waiting is necessary for this buffer.\n\n\nWhen the HAL returns an output buffer to the framework with process_capture_result(), the acquire_fence must be set to -1. If the HAL never waits on the acquire_fence due to an error in filling a buffer, when calling process_capture_result() the HAL must set the release_fence of the buffer to be the acquire_fence passed to it by the framework. This will allow the framework to wait on the fence before reusing the buffer.\n\n\nFor input buffers, the HAL must not change the acquire_fence field during the process_capture_request() call.\n\n\n\\\u003e= CAMERA_DEVICE_API_VERSION_3_2:\n\n\nWhen the HAL returns an input buffer to the framework with process_capture_result(), the acquire_fence must be set to -1. If the HAL never waits on input buffer acquire fence due to an error, the sync fences should be handled similarly to the way they are handled for output buffers.\n\n\nDefinition at line\n[1800](https://android.googlesource.com/platform/hardware/libhardware/+/master/include/hardware/camera3.h)\nof file\n[camera3.h](https://android.googlesource.com/platform/hardware/libhardware/+/master/include/hardware/camera3.h)\n.\n\n|--------------------------|\n| buffer_handle_t\\* buffer |\n\n\nThe native handle to the buffer\n\n\nDefinition at line\n[1764](https://android.googlesource.com/platform/hardware/libhardware/+/master/include/hardware/camera3.h)\nof file\n[camera3.h](https://android.googlesource.com/platform/hardware/libhardware/+/master/include/hardware/camera3.h)\n.\n\n|-------------------|\n| int release_fence |\n\n\nThe release sync fence for this buffer. The HAL must set this fence when returning buffers to the framework, or write -1 to indicate that no waiting is required for this buffer.\n\n\nFor the output buffers, the fences must be set in the output_buffers array passed to process_capture_result().\n\n\n\\\u003c= CAMERA_DEVICE_API_VERSION_3_1:\n\n\nFor the input buffer, the release fence must be set by the process_capture_request() call.\n\n\n\\\u003e= CAMERA_DEVICE_API_VERSION_3_2:\n\n\nFor the input buffer, the fences must be set in the input_buffer passed to process_capture_result().\n\n\nAfter signaling the release_fence for this buffer, the HAL should not make any further attempts to access this buffer as the ownership has been fully transferred back to the framework.\n\n\nIf a fence of -1 was specified then the ownership of this buffer is transferred back immediately upon the call of process_capture_result.\n\n\nDefinition at line\n[1827](https://android.googlesource.com/platform/hardware/libhardware/+/master/include/hardware/camera3.h)\nof file\n[camera3.h](https://android.googlesource.com/platform/hardware/libhardware/+/master/include/hardware/camera3.h)\n.\n\n|------------|\n| int status |\n\n\nCurrent state of the buffer, one of the camera3_buffer_status_t values. The framework will not pass buffers to the HAL that are in an error state. In case a buffer could not be filled by the HAL, it must have its status set to CAMERA3_BUFFER_STATUS_ERROR when returned to the framework with process_capture_result().\n\n\nDefinition at line\n[1773](https://android.googlesource.com/platform/hardware/libhardware/+/master/include/hardware/camera3.h)\nof file\n[camera3.h](https://android.googlesource.com/platform/hardware/libhardware/+/master/include/hardware/camera3.h)\n.\n\n|----------------------------------------------------------------------------------------------------------------------------------|\n| [camera3_stream_t](https://android.googlesource.com/platform/hardware/libhardware/+/master/include/hardware/camera3.h) \\* stream |\n\n\nThe handle of the stream this buffer is associated with\n\n\nDefinition at line\n[1759](https://android.googlesource.com/platform/hardware/libhardware/+/master/include/hardware/camera3.h)\nof file\n[camera3.h](https://android.googlesource.com/platform/hardware/libhardware/+/master/include/hardware/camera3.h)\n.\n\n*** ** * ** ***\n\nThe documentation for this struct was generated from the following file:\n\n- hardware/libhardware/include/hardware/ [camera3.h](https://android.googlesource.com/platform/hardware/libhardware/+/master/include/hardware/camera3.h)"]]