हमारा सुझाव है कि 27 मार्च, 2025 से AOSP को बनाने और उसमें योगदान देने के लिए, aosp-main
के बजाय android-latest-release
का इस्तेमाल करें. ज़्यादा जानकारी के लिए, AOSP में हुए बदलाव लेख पढ़ें.
संग्रह की मदद से व्यवस्थित रहें
अपनी प्राथमिकताओं के आधार पर, कॉन्टेंट को सेव करें और कैटगरी में बांटें.
camera2_stream_ops स्ट्रक्चर का रेफ़रंस
#include <
camera2.h
>
आउटपुट इमेज स्ट्रीम की सूची का इंटरफ़ेस. इन तरीकों का एक सेट, allocate_stream() में HAL डिवाइस को दिया जाता है. इनका इस्तेमाल, उस स्ट्रीम के लिए gralloc बफ़र कतार के साथ इंटरैक्ट करने के लिए किया जाता है. जब तक allocate_stream फ़ंक्शन से कोई रिस्पॉन्स नहीं मिलता, तब तक इन फ़ंक्शन को कॉल नहीं किया जा सकता.
परिभाषा,
camera2.h
फ़ाइल की लाइन
73
पर दी गई है.
बफ़र को 'पूरा हो गया' के तौर पर मार्क किए बिना, उसे सूची में वापस लाएं.
परिभाषा,
camera2.h
फ़ाइल की लाइन
102
पर दी गई है.
सूची से भरने के लिए बफ़र पाएं. किसी स्ट्रीम (allocate_stream में तय की गई) के लिए, बफ़र का साइज़ और फ़ॉर्मैट तय होता है. साथ ही, प्लैटफ़ॉर्म के gralloc मॉड्यूल से स्ट्राइड के बारे में क्वेरी की जानी चाहिए. gralloc बफ़र, allocate_stream से मिले इस्तेमाल के फ़्लैग के आधार पर असाइन किया गया होगा. साथ ही, इसे इस्तेमाल के लिए लॉक कर दिया जाएगा.
परिभाषा,
camera2.h
फ़ाइल की लाइन
81
पर दी गई है.
int(* enqueue_buffer)(const struct
camera2_stream_ops
*w, int64_t timestamp, buffer_handle_t *buffer)
|
उपभोक्ता के इस्तेमाल के लिए, स्ट्रीम में भरा हुआ बफ़र डालें.
टाइमस्टैंप से, इमेज की पहली लाइन के एक्सपोज़र की शुरुआत का समय पता चलता है. यह समय, एक जैसी गति वाली घड़ी से होना चाहिए और इसे नैनोसेकंड में मेज़र किया जाता है. अलग-अलग कैमरों या एक ही कैमरे के लगातार रिकॉर्ड किए गए वीडियो के टाइमस्टैंप की तुलना करने की ज़रूरत नहीं है. हालांकि, एक ही कैमरे से ली गई स्ट्रीम के बीच, इनकी तुलना की जा सकती है. अगर एक कैप्चर से कई स्ट्रीम के लिए बफ़र बनते हैं, तो हर स्ट्रीम के लिए उस बफ़र का टाइमस्टैंप एक ही होना चाहिए. साथ ही, वह टाइमस्टैंप, आउटपुट फ़्रेम मेटाडेटा में मौजूद टाइमस्टैंप से मेल खाना चाहिए.
परिभाषा,
camera2.h
फ़ाइल की लाइन
96
पर दी गई है.
int(* set_crop)(const struct
camera2_stream_ops
*w, int left, int top, int right, int bottom)
|
बाद में लाइन में लगाए गए बफ़र के लिए, काटने की विंडो सेट करें. पैरामीटर को बफ़र की चौड़ाई और ऊंचाई के हिसाब से पिक्सल में मेज़र किया जाता है.
परिभाषा,
camera2.h
फ़ाइल की लाइन
108
पर दी गई है.
इस स्ट्रक्चर का दस्तावेज़, इस फ़ाइल से जनरेट किया गया था:
-
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_stream_ops Struct Reference\n\ncamera2_stream_ops Struct Reference\n===================================\n\n[Data Fields](#pub-attribs) \ncamera2_stream_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(\\* | [dequeue_buffer](/reference/hal/structcamera2__stream__ops#ad51917100a74cf70e552c51e24407cbb) )(const struct [camera2_stream_ops](/reference/hal/structcamera2__stream__ops) \\*w, buffer_handle_t \\*\\*buffer) |\n| ||\n| int(\\* | [enqueue_buffer](/reference/hal/structcamera2__stream__ops#a724a4193411f3278ad9ad3f04ab983f1) )(const struct [camera2_stream_ops](/reference/hal/structcamera2__stream__ops) \\*w, int64_t timestamp, buffer_handle_t \\*buffer) |\n| ||\n| int(\\* | [cancel_buffer](/reference/hal/structcamera2__stream__ops#ae3aa87ba699c53b8960b6529eb01ba83) )(const struct [camera2_stream_ops](/reference/hal/structcamera2__stream__ops) \\*w, buffer_handle_t \\*buffer) |\n| ||\n| int(\\* | [set_crop](/reference/hal/structcamera2__stream__ops#a3c2102f917bfe992de1967f9f8abc1d6) )(const struct [camera2_stream_ops](/reference/hal/structcamera2__stream__ops) \\*w, int left, int top, int right, int bottom) |\n| ||\n\n\nDetailed Description\n--------------------\n\n\nOutput image stream queue interface. A set of these methods is provided to the HAL device in allocate_stream(), and are used to interact with the gralloc buffer queue for that stream. They may not be called until after allocate_stream returns.\n\n\nDefinition at line\n[73](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(\\* cancel_buffer)(const struct [camera2_stream_ops](/reference/hal/structcamera2__stream__ops) \\*w, buffer_handle_t \\*buffer) |\n\n\nReturn a buffer to the queue without marking it as filled.\n\n\nDefinition at line\n[102](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(\\* dequeue_buffer)(const struct [camera2_stream_ops](/reference/hal/structcamera2__stream__ops) \\*w, buffer_handle_t \\*\\*buffer) |\n\n\nGet a buffer to fill from the queue. The size and format of the buffer are fixed for a given stream (defined in allocate_stream), and the stride should be queried from the platform gralloc module. The gralloc buffer will have been allocated based on the usage flags provided by allocate_stream, and will be locked for use.\n\n\nDefinition at line\n[81](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(\\* enqueue_buffer)(const struct [camera2_stream_ops](/reference/hal/structcamera2__stream__ops) \\*w, int64_t timestamp, buffer_handle_t \\*buffer) |\n\n\nPush a filled buffer to the stream to be used by the consumer.\n\n\nThe timestamp represents the time at start of exposure of the first row of the image; it must be from a monotonic clock, and is measured in nanoseconds. The timestamps do not need to be comparable between different cameras, or consecutive instances of the same camera. However, they must be comparable between streams from the same camera. If one capture produces buffers for multiple streams, each stream must have the same timestamp for that buffer, and that timestamp must match the timestamp in the output frame metadata.\n\n\nDefinition at line\n[96](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(\\* set_crop)(const struct [camera2_stream_ops](/reference/hal/structcamera2__stream__ops) \\*w, int left, int top, int right, int bottom) |\n\n\nSet the crop window for subsequently enqueued buffers. The parameters are measured in pixels relative to the buffer width and height.\n\n\nDefinition at line\n[108](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)"]]