از 27 مارس 2025، توصیه می کنیم از android-latest-release
به جای aosp-main
برای ساختن و کمک به AOSP استفاده کنید. برای اطلاعات بیشتر، به تغییرات 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() را فراخوانی کند. اگر دستگاه یک بازگشت NULL از dequeue دریافت کند، تا زمانی که یک تماس notify_request_queue_not_empty() از منبع دریافت نشود، نیازی به پرس و جوی مجدد صف ندارد.
- اگر دستگاه باffer_count() را فراخوانی کرد و 0 دریافت کرد، این بدان معنا نیست که فریم ورک یک فراخوان notify_request_queue_not_empty() را ارائه می دهد. این فریم ورک تنها پس از دریافت NULL از Dequeue یا در راه اندازی اولیه، چنین اعلانی را ارائه می دهد.
- فراخوانی dequeue() در پاسخ به notify_request_queue_not_empty() ممکن است در همان رشته تماس notify_request_queue_not_empty() باشد و ممکن است از درون تماس notify انجام شود.
- تمام بافرهای درخواست حذف شده باید با فراخوانی free_request به چارچوب برگردانده شوند، از جمله زمانی که خطا رخ می دهد، درخواست فلاش دستگاه یا زمانی که دستگاه در حال خاموش شدن است.
تعریف در خط 220 فایل camera2.h .
یک بافر ابرداده از چارچوب دریافت کنید. اگر خطایی وجود نداشته باشد، OK را برمیگرداند. اگر صف خالی باشد، NULL را در بافر برمیگرداند. در این صورت، دستگاه باید منتظر پیام notify_request_queue_not_empty () بنشیند و قبل از اینکه دوباره از صف خارج شود. بافرهایی که از این طریق به دست می آیند باید با ()free_request به چارچوب برگردانده شوند.
تعریف در خط 237 فایل camera2.h .
یک بافر ابرداده را پس از استفاده، یا در صورت بروز خطا یا خاموشی، به چارچوب برگردانید.
تعریف در خط 243 فایل camera2.h .
تعداد بافرهای درخواستی معلق در صف را دریافت کنید. اگر یک درخواست تکراری (درخواست جریان) در حال حاضر پیکربندی شده باشد، ممکن است CAMERA2_REQUEST_QUEUE_IS_BOTTOMLESS را برگرداند. فراخوانی این متد تأثیری بر فراخوانی متد notify_request_queue_not_empty () توسط فریمورک ندارد.
تعریف در خط 228 فایل camera2.h .
مستندات این ساختار از فایل زیر تولید شده است:
- hardware/libhardware/include/hardware/ camera2.h
محتوا و نمونه کدها در این صفحه مشمول پروانههای توصیفشده در پروانه محتوا هستند. جاوا و OpenJDK علامتهای تجاری یا علامتهای تجاری ثبتشده Oracle و/یا وابستههای آن هستند.
تاریخ آخرین بهروزرسانی 2025-07-29 بهوقت ساعت هماهنگ جهانی.
[[["درک آسان","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-29 بهوقت ساعت هماهنگ جهانی."],[],[],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)"]]