اعتبارًا من 27 آذار (مارس) 2025، ننصحك باستخدام android-latest-release
بدلاً من aosp-main
لإنشاء AOSP والمساهمة فيه. لمزيد من المعلومات، يُرجى الاطّلاع على التغييرات في AOSP.
إخراج الكاميرا بدقة 10 بت
تنظيم صفحاتك في مجموعات
يمكنك حفظ المحتوى وتصنيفه حسب إعداداتك المفضّلة.
بالنسبة إلى الأجهزة التي تعمل بالإصدار 13 من نظام التشغيل Android والإصدارات الأحدث، يسمح نظام التشغيل Android
بإخراج الكاميرا بدقة 10 بت من خلال ملفات تعريف النطاق الديناميكي التي يمكن لبرنامج العميل للكاميرا تعديلها كجزء من إعداد البث. يمكن لصنّاع
الأجهزة إضافة ملفّات تعريف النطاق الديناميكي بدقة 10 بت، مثل HLG10
وHDR 10 وHDR 10+ وDolby Vision.
يتيح توفّر مخرجات الكاميرا بدقة 10 بت لعملاء الكاميرا اكتشاف ملفات تعريف النطاق الديناميكي بدقة 10 بت المتوافقة على الجهاز من خلال الاتصال بـ
getSupportedProfiles
.
بعد ذلك، يعرض الإطار مثيلًا من
DynamicRangeProfiles
،
الذي يتضمّن معلومات عن الملفات الشخصية للنطاقات الديناميكية المتوافقة والقيود المفروضة على طلب الالتقاط، إن كانت متوفرة. يجب أن يكون الملف الشخصي
HLG10
متوافقًا. يتم إدراج الملف الشخصي للنطاق الديناميكي المقترَح في الحقل
REQUEST_RECOMMENDED_TEN_BIT_DYNAMIC_RANGE_PROFILE
.
يمكن لعملاء الكاميرا ضبط مجموعات البث من خلال الاتصال بـ
setDynamicRangeProfile
.
لمزيد من المعلومات عن مجموعات بث الإخراج الإلزامية، يُرجى الاطّلاع على جدول
الإعدادات الإضافية المضمونة لإخراج 10 بت في
التسجيل العادي.
المتطلبات
لتتمكّن الكاميرا من عرض فيديوهات بدقة 10 بت، يجب أن يتضمّن الجهاز أداة استشعار كاميرا متوافقة مع دقة 10 بت أو أعلى، وأن تكون متوافقة مع وحدة معالجة الصور ذات الصلة. لمعرفة التفاصيل حول متطلبات التوافق ذات الصلة لدعم 10 بت، يُرجى الاطّلاع على القسم
7.5. الكاميرات في CDD
التنفيذ
لتوفير إمكانية استخدام كاميرا بدقة 10 بت، على الشركات المصنّعة للأجهزة تنفيذ
عمليات دمج Camera AIDL HAL التالية:
- أدرِج
ANDROID_REQUEST_AVAILABLE_CAPABILITIES_DYNAMIC_RANGE_TEN_BIT
في
إمكانات الكاميرا.
- املأ
ANDROID_REQUEST_AVAILABLE_DYNAMIC_RANGE_PROFILES_MAP
بكل
ملفّات التعريف المسموح بها للّوحة الديناميكية وصورة نقطية لقيودها.
يجب أن يكون الملف الشخصي
HLG10
متوافقًا. يجب أيضًا تضمين ملف شخصي مقترَح لالنطاق الديناميكي لإعلام عملاء الكاميرا بالتنسيق الأمثل المتوافق.
- تأكَّد من توفّر قيمة الملف الشخصي للنطاق الديناميكي أثناء عملية
ضبط البث للأحداث التي تستخدم تنسيق
P010
أو توفّر تنسيق محدّد من التنفيذ
(
ImageFormat.PRIVATE
).
- استنادًا إلى الملف الشخصي للنطاق الديناميكي، اضبط ملف البيانات الوصفية الساكنة أو الديناميكية
المخزّن المؤقت لمخازن Gralloc 4 التي تمت معالجتها قبل إرسال إشعار إلى خدمة الكاميرا.
لمزيد من التفاصيل حول إخراج الكاميرا بدقة 10 بت في Camera HAL، يُرجى الاطّلاع على النقاط التالية في metadata_definitions.xml
:
للحصول على مرجع لتنفيذ Camera HAL متوافق مع إخراج الكاميرا بدقة 10 بت، يُرجى الاطّلاع على
/hardware/google/camera/devices/EmulatedCamera/hwl
.
التحقُّق
للتأكّد من صحة عملية تنفيذ إخراج الكاميرا بدقة 10 بت والتأكّد من أنّه
يمكن للتطبيقات التابعة لجهات خارجية تفعيل الميزة، ننصحك بتنفيذ الخطوات التالية، وهي
المراحل الثلاث للتحقّق من الصحة.
للتحقّق من صحة الإخراج بدقة 10 بت من الكاميرا، يُفترض أنّ الجهاز
يتوافق مع عرض الفيديو بنطاق عالي الديناميكية (عرض بأكثر من 1000 وحدة نِت)، وأنّ تطبيق مشاهدة الفيديو (مثل
"صور Google") يتوافق مع تشغيل الفيديو بنطاق عالي الديناميكية.
اختبار صحة وظائف واجهة برمجة التطبيقات
لاختبار صحة وظائف واجهة برمجة التطبيقات لإخراج الكاميرا بدقة 10 بت، عليك إجراء اختبارات CTS وITS للكاميرا وVTS التالية:
مقارنة الكاميرا المدمجة بالتطبيق التابع لجهة خارجية
ننصحك بشدة بالتأكّد من أنّ نتائج التقاط فيديوهات بدقة 10 بت باستخدام
تطبيق تابع لجهة خارجية تكون مشابهة لنتائج تطبيق الكاميرا الأصلي، إن لم تكن مطابقة له. ويعني ذلك أنّ خيارات الضبط، مثل التعريض والنطاق الديناميكي واللون، يجب
أن تنتقل من التطبيق الأصلي إلى التطبيقات التابعة لجهات خارجية. للتحقّق من سلوك تسجيل
الفيديو في تطبيق تابع لجهة خارجية متوافق مع إخراج الكاميرا بدقة 10 بت على
جهازك، استخدِم
نموذج تطبيق Camera2Video
على GitHub. توضِّح الإرشادات التالية الجوانب المرئية لتكنولوجيا
HDR بدون تقديم أرقام موضوعية، وذلك بسبب اختلاف أدوات الاستشعار واللوحات
وظروف المشاهدة والإعدادات المفضّلة لدى المورّدين.
مَشاهد مقترَحة للمقارنة
لإجراء مقارنة بين تطبيق الكاميرا الأصلي وتطبيق تابع لجهة خارجية،
يمكنك التقاط فيديوهات باستخدام عدة مَشاهد مختلفة باستخدام كلّ من تطبيق الكاميرا الأصلي
وتطبيق Camera2Video. في ما يلي مَشاهد مقترَحة لاستخدامها في مقارنة:
- مشهد منخفض الإضاءة إلى متوسط الإضاءة مع جسم ساطع، مثل شمعة أو
ضوء ساطع صغير يُنشئ نطاقًا كبيرًا من السطوع يؤكد ذلك
سلوك التعريض التلقائي والنطاق الديناميكي.
- مشهد مشرق في الهواء الطلق بألوان نابضة بالحياة وعناصر عاكسة، مثل مصدات الكروم في السيارة، ما يخلق نقاط تمييز ساطعة يؤكّد ذلك
عرض المشاهد الساطعة مع إضاءة أكثر سطوعًا.
- مشهد متوسط النطاق منخفض النطاق الديناميكي، مثل مشهد طبيعي داخلي في
منزل أو مكتب يؤكد ذلك أنّ ظروف الإضاءة الأقل تطرفاً تعمل
على النحو المتوقّع.
في جميع المشاهد، ننصحك بتصوير أشخاص ووجوه للتحقّق من معالجة مستوى الإضاءة واللون
ودرجة لون البشرة. يساعد تقليل الاختلافات بين اللقطات في تسهيل مقارنة اللقطات المتعاقبة.
مقارنة النطاق الديناميكي العادي والنطاق العالي الديناميكية
للتأكّد من أنّ هناك فائدة ملحوظة من استخدام ملف تعريف النطاق الديناميكي بدقة 10 بت بدلاً من ملف تعريف النطاق الديناميكي العادي، قارِن بين لقطات الفيديو التي تم إنشاؤها باستخدام النطاق الديناميكي العادي (بدون ملف تعريف HDR) والفيديوهات بنطاق عالي الديناميكية للتأكّد من ظهور الجوانب الرئيسية لتقنية HDR في اللقطات. لمقارنة تقنية النطاق العادي الديناميكية (SDR) وتقنية النطاق العالي الديناميكية (HDR)، استخدِم
تطبيق Camera2Video التجريبي
والمشاهد المقترَحة لمقارنة تطبيق الكاميرا المدمج
والتطبيقات التابعة لجهات خارجية.
في ما يلي الجوانب الرئيسية التي يجب التحقّق منها في المشاهد المقترَحة. تختلف لوحات العرض
التي تتيح ميزة النطاق العالي الديناميكية (HDR) في مستويات السطوع (يتم قياسها بالنِت أو اللمّون)، لذا فإنّ الأرقام التالية المُقدَّمة هي أمثلة:
- في المشهد الذي يضم إضاءة متوسطة أو منخفضة، يتم عرض الأجزاء الساطعة من الشمعة أو المصابيح الصغيرة بأعلى درجة سطوع للشاشة (قد تصل إلى 1,000 نِت) في المقطع بتقنية النطاق العالي الديناميكية، وبأعلى درجة سطوع للمحتوى بدقة عادية (100 نِت تقريبًا) في المقطع بدقة عادية. في المقطع بتقنية HDR، يجب أن تظهر المؤثرات المميّزة الساطعة على الشاشة، ما ينقل انطباع المستخدم عن النطاق الديناميكي الحقيقي للمشهد. مقارنةً بالفيديو بتنسيق HDR، يجب أن يظهر مقطع
SDR بشكل أقل سطوعًا وأقل حيوية.
- في مشهد الإخراج المشرق، يُظهر المقطع الذي تم إنشاؤه باستخدام تقنية HDR اختلافًا واضحًا في مستوى سطوع الشاشة مقارنةً بالمقطع الذي تم إنشاؤه باستخدام تقنية SDR، وذلك استنادًا إلى إعدادات الجهاز. بالنسبة إلى المقطع بتقنية النطاق العالي الديناميكية (HDR)، يجب أن يكون سطوع الشاشة للّقطة بأكملها
(حسب المساحة المتاحة) أعلى، على سبيل المثال، ما يصل إلى 800 نِت،
وأكثر من ذلك للعناصر المميّزة الساطعة، مثل مصدات الكروم، عند استخدام
أعلى درجة سطوع.
- في التصوير الداخلي بنطاق ديناميكي منخفض ومتوسط، تكون لقطات HDR وSDR مشابهة من حيث اللون والدرجة اللونية، مع احتمال أن تكون لقطات HDR
أكثر سطوعًا من لقطات SDR. يجب ألا تكون درجة تشبع الألوان في الفيديوهات بتنسيق HDR أقل من درجة تشبع الألوان في الفيديوهات بتنسيق SDR. إذا كانت خيارات الضبط تجعل ذلك مستحيلاً، تأكَّد من أنّ سلوك التطبيق التابع لجهة خارجية يتطابق مع سلوك تطبيق الكاميرا الأصلي.
يخضع كل من المحتوى وعيّنات التعليمات البرمجية في هذه الصفحة للتراخيص الموضحّة في ترخيص استخدام المحتوى. إنّ Java وOpenJDK هما علامتان تجاريتان مسجَّلتان لشركة Oracle و/أو الشركات التابعة لها.
تاريخ التعديل الأخير: 2025-07-26 (حسب التوقيت العالمي المتفَّق عليه)
[[["يسهُل فهم المحتوى.","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-26 (حسب التوقيت العالمي المتفَّق عليه)"],[],[],null,["# 10-bit camera output\n\nFor devices running Android 13 and higher, Android\nsupports 10-bit camera output through dynamic range profiles that can be\nconfigured by the camera client as part of the stream configuration. Device\nmanufacturers can add support for 10-bit dynamic range profiles such as HLG10,\nHDR 10, HDR 10+, and Dolby Vision.\n\n10-bit camera output support lets camera clients discover supported 10-bit\ndynamic range profiles of a device by calling\n[`getSupportedProfiles`](https://developer.android.com/reference/android/hardware/camera2/params/DynamicRangeProfiles#getSupportedProfiles()).\nThe framework then returns an instance of\n[`DynamicRangeProfiles`](https://developer.android.com/reference/android/hardware/camera2/params/DynamicRangeProfiles),\nwhich includes information about supported dynamic range profiles and, if\navailable, capture request constraints. The\n[`HLG10`](https://developer.android.com/reference/android/hardware/camera2/params/DynamicRangeProfiles#HLG10)\nprofile must be supported. The recommended dynamic range profile is listed in\nthe\n[`REQUEST_RECOMMENDED_TEN_BIT_DYNAMIC_RANGE_PROFILE`](https://developer.android.com/reference/android/hardware/camera2/CameraCharacteristics#REQUEST_RECOMMENDED_TEN_BIT_DYNAMIC_RANGE_PROFILE)\nfield.\n\nCamera clients can configure stream combinations by calling\n[`setDynamicRangeProfile`](https://developer.android.com/reference/android/hardware/camera2/params/OutputConfiguration#setDynamicRangeProfile(long)).\nFor more information on mandatory output stream combinations, see the\n*10-bit output additional guaranteed configurations* table in\n[Regular capture](https://developer.android.com/reference/android/hardware/camera2/CameraDevice#regular-capture).\n\nRequirements\n------------\n\nTo support 10-bit camera output, the device must have a 10-bit or higher\ncapable camera sensor with respective ISP support. For details about related\ncompatibility requirements for 10-bit support, see section\n[7.5. Cameras](/docs/compatibility/13/android-13-cdd#75_cameras) in the CDD.\n\nImplementation\n--------------\n\nTo provide support for 10-bit camera output, device manufacturers must perform\nthe following Camera AIDL HAL integrations:\n\n- Include `ANDROID_REQUEST_AVAILABLE_CAPABILITIES_DYNAMIC_RANGE_TEN_BIT` in camera capabilities.\n- Populate `ANDROID_REQUEST_AVAILABLE_DYNAMIC_RANGE_PROFILES_MAP` with all supported dynamic range profiles and a bitmap of their constraints. The [`HLG10`](https://developer.android.com/reference/android/hardware/camera2/params/DynamicRangeProfiles#HLG10) profile must be supported. You must also include a recommended dynamic range profile to inform camera clients of the optimal supported format.\n- Ensure support for the dynamic range profile value during stream configuration for streams using the [P010](https://developer.android.com/reference/android/graphics/ImageFormat#YCBCR_P010) format or support for an implementation-defined format ([`ImageFormat.PRIVATE`](https://developer.android.com/reference/android/graphics/ImageFormat#PRIVATE)).\n- Depending on the dynamic range profile, set the static or dynamic metadata buffer of processed Gralloc 4 buffers before notifying the camera service.\n\nFor further details on 10-bit camera output in the Camera HAL, see the\nfollowing in [`metadata_definitions.xml`](https://cs.android.com/android/platform/superproject/+/android-latest-release:system/media/camera/docs/metadata_definitions.xml):\n\n- [`DYNAMIC_RANGE_TEN_BIT`](https://cs.android.com/android/platform/superproject/+/android-latest-release:system/media/camera/docs/metadata_definitions.xml?q=DYNAMIC_RANGE_TEN_BIT)\n- HAL details for [`availableDynamicRangeProfilesMap`](https://cs.android.com/android/platform/superproject/+/android-latest-release:system/media/camera/docs/metadata_definitions.xml?q=availableDynamicRangeProfilesMap)\n- [`recommendedTenBitDynamicRangeProfile`](https://cs.android.com/android/platform/superproject/+/android-latest-release:system/media/camera/docs/metadata_definitions.xml?q=recommendedTenBitDynamicRangeProfile)\n- [`10BIT_OUTPUT`](https://cs.android.com/android/platform/superproject/+/android-latest-release:system/media/camera/docs/metadata_definitions.xml?q=10BIT_OUTPUT)\n\nFor a reference Camera HAL implementation supporting 10-bit camera output, see\n[`/hardware/google/camera/devices/EmulatedCamera/hwl`](https://cs.android.com/android/platform/superproject/+/android-latest-release:hardware/google/camera/devices/EmulatedCamera/hwl/).\n\nValidation\n----------\n\nTo validate your implementation of 10-bit camera output and ensure that\nthird-party apps can enable the feature, we recommend performing the following\nthree stages of validation.\n\n- [Test API functional correctness](#test-api-functional-correctness)\n- [Compare native camera and third-party app](#compare-native-third-party-app)\n- [Compare standard dynamic range and high dynamic range](#compare-sdr-hdr)\n\nFor visual validation of 10-bit camera output, it's assumed that the device\nsupports displaying HDR (1000+ nits display), and the video viewing app (for\nexample, Google Photos) supports playback of HDR video.\n\n### Test API functional correctness\n\nTo test the API functional correctness of 10-bit camera output, run the\nfollowing CTS, camera ITS, and VTS tests:\n\n- [`hardware/interfaces/camera/provider/aidl/vts/`](https://cs.android.com/android/platform/superproject/+/android-latest-release:hardware/interfaces/camera/provider/aidl/vts/): Tests for basic discovery, configuration, and streaming, and checks for the presence of HDR metadata where required.\n- [`tests/camera/src/android/hardware/camera2/cts/`](https://cs.android.com/android/platform/superproject/+/android-latest-release:cts/tests/camera/src/android/hardware/camera2/cts): Ensures that the camera behaves according to the AOSP API specifications.\n- [`cts/apps/CameraITS`](https://cs.android.com/android/platform/superproject/+/android-latest-release:cts/apps/CameraITS): Confirms general video behavior is consistent when HDR profiles are used. The specific test is [`tests/scene4/test_video_aspect_ratio_and_crop.py`](https://cs.android.com/android/platform/superproject/+/android-latest-release:cts/apps/CameraITS/tests/scene4/test_video_aspect_ratio_and_crop.py).\n\n### Compare native camera and third-party app\n\nWe strongly recommend ensuring that the results of capturing 10-bit videos with\na third-party app are similar, if not identical, to the native camera app. This\nmeans that tuning choices, such as exposure, dynamic range, and color, should\ncarry forward from the native app to third-party apps. To verify the video\nrecording behavior of a third-party app supporting 10-bit camera output on your\ndevice, use the\n[Camera2Video sample app](https://github.com/android/camera-samples/tree/main/Camera2Video)\non GitHub. The following guidance serves to illustrate the visible aspects of\nHDR without objective numbers, due to the variability of sensors, panels,\nviewing conditions, and vendor preferences.\n\n#### Suggested scenes for comparison\n\nTo make a comparison between the native camera app and a third-party app,\ncapture videos using several different scenes with both the native camera app\nand the Camera2Video sample app. The following are suggested scenes to use for\ncomparison:\n\n- A mid-light to low-light scene with a bright object, such as a candle or small bright light that creates a significant range of brightness. This confirms the auto exposure behavior and dynamic range.\n- A bright outdoor scene with vibrant colors and reflective objects such as chrome bumpers on a car, which creates bright highlights. This confirms the rendering for bright scenes with even brighter highlights.\n- A mid-range, low dynamic range scene such as an indoor natural scene in a home or office. This confirms that less extreme lighting conditions behave as expected.\n\nFor all scenes, we recommend having people and faces to verify exposure, color,\nand skin tone handling. Reducing shot-to-shot variation eases back-to-back\ncomparisons.\n\n### Compare standard dynamic range and high dynamic range\n\nTo ensure that there's a perceived benefit of using a 10-bit dynamic range\nprofile over a standard dynamic range profile, compare video captures using SDR\n(no HDR profile) against HDR videos to confirm that key aspects of HDR appear in\nthe captures. To compare SDR and HDR, use the\n[Camera2Video sample app](https://github.com/android/camera-samples/tree/main/Camera2Video)\nand [suggested scenes](#suggested-scenes) for comparing the native camera\napp and third-party apps.\n\nThe following are key aspects to verify in the suggested scenes. Display panels\ncapable of HDR vary in brightness levels (measured in nits or lumens), so the\nfollowing numbers given are meant to be examples:\n\n- In the mid-light to low-light scene, the bright highlights of the candle or small light are rendered at *max brightness for the display* (possibly up to 1000 nits) in the HDR clip, and rendered at *max brightness for SDR* (approximately 100 nits) in the SDR clip. In the HDR clip, the bright highlights should shine out of the display, capturing the user's perception of what the scene's true dynamic range was. Compared to the HDR clip, the SDR clip should appear as flatter and less bright.\n- In the bright output scene, depending on the device's tuning, the HDR clip shows an apparent difference in screen brightness as compared to the SDR clip. For the HDR clip, the screen brightness for the overall scene (depending on headroom) should be higher, for example, up to 800 nits, and even more so for the bright highlights such as the chrome bumpers, around maximum brightness.\n- In the mid-range, low dynamic range indoor capture, the HDR and SDR clips are similar in color and tone, with the HDR capture being potentially brighter than the SDR. The HDR shouldn't be darker than the SDR. If tuning choices make this impossible, ensure that the third-party app behavior matches the native camera app behavior."]]