@@ -528,9 +528,8 @@ void ASurfaceTransaction_setHdrMetadata_cta861_3(ASurfaceTransaction* transactio
528528
529529/**
530530 * Sets the desired extended range brightness for the layer. This only applies for layers whose
531- * dataspace has RANGE_EXTENDED set on it.
532- *
533- * Available since API level 34.
531+ * dataspace has RANGE_EXTENDED set on it. See: ASurfaceTransaction_setDesiredHdrHeadroom, prefer
532+ * using this API for formats that encode an HDR/SDR ratio as part of generating the buffer.
534533 *
535534 * @param surface_control The layer whose extended range brightness is being specified
536535 * @param currentBufferRatio The current hdr/sdr ratio of the current buffer as represented as
@@ -564,6 +563,12 @@ void ASurfaceTransaction_setHdrMetadata_cta861_3(ASurfaceTransaction* transactio
564563 * determined entirely by the dataspace being used (ie, typically SDR
565564 * however PQ or HLG transfer functions will still result in HDR)
566565 *
566+ * When called after ASurfaceTransaction_setDesiredHdrHeadroom, the
567+ * desiredRatio will override the desiredHeadroom provided by
568+ * ASurfaceTransaction_setDesiredHdrHeadroom. Conversely, when called before
569+ * ASurfaceTransaction_setDesiredHdrHeadroom, the desiredHeadroom provided by
570+ *. ASurfaceTransaction_setDesiredHdrHeadroom will override the desiredRatio.
571+ *
567572 * Must be finite && >= 1.0f
568573 *
569574 * Available since API level 34.
@@ -573,6 +578,45 @@ void ASurfaceTransaction_setExtendedRangeBrightness(ASurfaceTransaction* transac
573578 float currentBufferRatio ,
574579 float desiredRatio ) __INTRODUCED_IN (__ANDROID_API_U__ );
575580
581+ /**
582+ * Sets the desired hdr headroom for the layer. See: ASurfaceTransaction_setExtendedRangeBrightness,
583+ * prefer using this API for formats that conform to HDR standards like HLG or HDR10, that do not
584+ * communicate a HDR/SDR ratio as part of generating the buffer.
585+ *
586+ * @param surface_control The layer whose desired hdr headroom is being specified
587+ *
588+ * @param desiredHeadroom The desired hdr/sdr ratio as represented as peakHdrBrightnessInNits /
589+ * targetSdrWhitePointInNits. This can be used to communicate the max
590+ * desired brightness range of the panel. The system may not be able to, or
591+ * may choose not to, deliver the requested range.
592+ *
593+ * While requesting a large desired ratio will result in the most
594+ * dynamic range, voluntarily reducing the requested range can help
595+ * improve battery life as well as can improve quality by ensuring
596+ * greater bit depth is allocated to the luminance range in use.
597+ *
598+ * Default value is 0.0f and indicates that the system will choose the best
599+ * headroom for this surface control's content. Typically, this means that
600+ * HLG/PQ encoded content will be displayed with some HDR headroom greater
601+ * than 1.0.
602+ *
603+ * When called after ASurfaceTransaction_setExtendedRangeBrightness, the
604+ * desiredHeadroom will override the desiredRatio provided by
605+ * ASurfaceTransaction_setExtendedRangeBrightness. Conversely, when called
606+ * before ASurfaceTransaction_setExtendedRangeBrightness, the desiredRatio
607+ * provided by ASurfaceTransaction_setExtendedRangeBrightness will override
608+ * the desiredHeadroom.
609+ *
610+ * Must be finite && >= 1.0f or 0.0f to indicate there is no desired
611+ * headroom.
612+ *
613+ * Available since API level 35.
614+ */
615+ void ASurfaceTransaction_setDesiredHdrHeadroom (ASurfaceTransaction * transaction ,
616+ ASurfaceControl * surface_control ,
617+ float desiredHeadroom )
618+ __INTRODUCED_IN (__ANDROID_API_V__ );
619+
576620/**
577621 * Same as ASurfaceTransaction_setFrameRateWithChangeStrategy(transaction, surface_control,
578622 * frameRate, compatibility, ANATIVEWINDOW_CHANGE_FRAME_RATE_ONLY_IF_SEAMLESS).
0 commit comments