اعتبارًا من 27 آذار (مارس) 2025، ننصحك باستخدام android-latest-release
بدلاً من aosp-main
لإنشاء AOSP والمساهمة فيه. لمزيد من المعلومات، يُرجى الاطّلاع على التغييرات في AOSP.
تنظيم صفحاتك في مجموعات
يمكنك حفظ المحتوى وتصنيفه حسب إعداداتك المفضّلة.
بنية camera3_stream_buffer
#include <
camera3.h
>
camera3_stream_buffer_t:
ذاكرة تخزين مؤقت واحدة من بث كاميرا3 ويتضمن معرّفًا للبث الرئيسي، ومعرّفًا لوحدة تخزين gralloc نفسها، وحدود المزامنة.
لا يحدِّد المخزن المؤقت ما إذا كان سيتم استخدامه للإدخال أو الإخراج، ويتم تحديد ذلك حسب نوع البث الرئيسي وكيفية تمرير المخزن المؤقت إلى جهاز HAL.
التعريف في السطر
1755
من الملف
camera3.h
.
الحصول على سياج المزامنة لهذا المخزن المؤقت يجب أن ينتظر HAL على fd هذا قبل محاولة القراءة من هذا المخزن المؤقت أو الكتابة فيه.
يمكن ضبط الإطار على -1 للإشارة إلى أنّه ليس من الضروري الانتظار لهذا المخزن المؤقت.
عندما يعرض HAL مخزنًا مؤقتًا للإخراج إلى إطار العمل باستخدام عملية process_capture_result()، يجب ضبط acquire_fence على -1. إذا لم ينتظر HAL أبدًا على acquire_fence بسبب خطأ في ملء المخزن المؤقت، عند استدعاء process_capture_result()، يجب أن يضبط HAL قيمة release_fence للمخزن المؤقت لتكون acquire_fence التي تم تمريرها إليه من خلال الإطار. سيسمح ذلك للإطار بالانتظار قبل إعادة استخدام المخزن المؤقت.
بالنسبة إلى وحدات تخزين المؤقتة للدخل، يجب ألا يغيّر HAL حقل acquire_fence أثناء طلب process_capture_request().
>= CAMERA_DEVICE_API_VERSION_3_2:
عندما يعرض HAL وحدة تخزين مؤقت للإدخال إلى إطار العمل باستخدام process_capture_result()، يجب ضبط acquire_fence على -1. إذا لم ينتظر HAL أبدًا على سياج اكتساب مخزن مؤقت للإدخال بسبب خطأ، يجب التعامل مع سياج المزامنة بشكل مشابه للطريقة التي يتم بها التعامل مع مخازن مؤقتة للإخراج.
التعريف في السطر
1800
من الملف
camera3.h
.
الاسم المعرِّف الأصلي للذاكرة المؤقتة
التعريف في السطر
1764
من الملف
camera3.h
.
حدّ مزامنة الإصدار لهذا المخزن المؤقت. يجب أن يضبط HAL هذا الفاصل عند إرجاع المخزن المؤقت إلى إطار العمل، أو يكتب -1 للإشارة إلى أنّه لا يلزم الانتظار لهذا المخزن المؤقت.
بالنسبة إلى وحدات تخزين الإخراج، يجب ضبط حدودها في صفيف output_buffers الذي يتم تمريره إلى دالة process_capture_result().
<= CAMERA_DEVICE_API_VERSION_3_1:
بالنسبة إلى وحدة تخزين مؤقت للإدخال، يجب ضبط حدود الإصدار من خلال طلب process_capture_request().
>= CAMERA_DEVICE_API_VERSION_3_2:
بالنسبة إلى وحدة تخزين مؤقت للإدخال، يجب ضبط حدود الإطارات في input_buffer التي تم تمريرها إلى process_capture_result().
بعد إرسال إشارة release_fence لهذا المخزن المؤقت، يجب ألا يحاول HAL الوصول إلى هذا المخزن المؤقت مرة أخرى لأنّه تم نقل الملكية بالكامل مرة أخرى إلى إطار العمل.
إذا تم تحديد قيمة -1 للحاجز، يتم نقل ملكية هذا المخزن المؤقت مرة أخرى على الفور عند استدعاء process_capture_result.
التعريف في السطر
1827
من الملف
camera3.h
.
الحالة الحالية للذاكرة المؤقتة، وهي إحدى قيم camera3_buffer_status_t. لن يُرسِل إطار العمل وحدات التخزين المؤقت إلى HAL التي تكون في حالة خطأ. في حال تعذّر على HAL ملء المخزن المؤقت، يجب ضبط حالته على CAMERA3_BUFFER_STATUS_ERROR عند إرجاعه إلى إطار العمل باستخدام process_capture_result().
التعريف في السطر
1773
من الملف
camera3.h
.
الاسم المعرِّف للبث المرتبط بهذا المخزن المؤقت
التعريف في السطر
1759
من الملف
camera3.h
.
تم إنشاء مستندات هذه البنية من الملف التالي:
-
hardware/libhardware/include/hardware/
camera3.h
يخضع كل من المحتوى وعيّنات التعليمات البرمجية في هذه الصفحة للتراخيص الموضحّة في ترخيص استخدام المحتوى. إنّ Java وOpenJDK هما علامتان تجاريتان مسجَّلتان لشركة Oracle و/أو الشركات التابعة لها.
تاريخ التعديل الأخير: 2025-07-27 (حسب التوقيت العالمي المتفَّق عليه)
[null,null,["تاريخ التعديل الأخير: 2025-07-27 (حسب التوقيت العالمي المتفَّق عليه)"],[],[],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)"]]