summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorShrikara B <shrikara@codeaurora.org>2020-06-04 19:57:40 +0530
committerSanjay Singh <sisanj@codeaurora.org>2020-06-10 10:10:41 +0530
commit00527c2bbf4d94476a34672fe0c0ccb1a706583b (patch)
tree335f82d8276fc1a5714d7a254754785afe7d1303
parente5d42a17efc3e56fd913ae04ae50cf0f1efd0650 (diff)
mm-video-v4l2: venc: Convert maxLuminance to 0.0001 cd/m^2 scale
Convert maxDisplayLuminance from cd/m^2 to 0.0001 cd/m^2 scale as the standard expects the field in this scale in SEI message Change-Id: Ibfc2a70c528be96546a8f4dc16d4224d3904475c
-rw-r--r--mm-video-v4l2/vidc/venc/src/video_encoder_device_v4l2.cpp7
1 files changed, 6 insertions, 1 deletions
diff --git a/mm-video-v4l2/vidc/venc/src/video_encoder_device_v4l2.cpp b/mm-video-v4l2/vidc/venc/src/video_encoder_device_v4l2.cpp
index a08ca766..73f6cfa5 100644
--- a/mm-video-v4l2/vidc/venc/src/video_encoder_device_v4l2.cpp
+++ b/mm-video-v4l2/vidc/venc/src/video_encoder_device_v4l2.cpp
@@ -120,6 +120,8 @@ ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#undef LOG_TAG
#define LOG_TAG "OMX-VENC: venc_dev"
+#define LUMINANCE_MULTIPLICATION_FACTOR 10000
+
//constructor
venc_dev::venc_dev(class omx_venc *venc_class)
{
@@ -7664,7 +7666,10 @@ bool venc_dev::venc_set_hdr_info(const MasteringDisplay& mastering_disp_info,
ctrl[8].value = mastering_disp_info.primaries.whitePoint[1];
ctrl[9].id = V4L2_CID_MPEG_VIDC_VENC_MAX_DISP_LUM;
- ctrl[9].value = mastering_disp_info.maxDisplayLuminance;
+ // maxDisplayLuminance is in cd/m^2 scale. But the standard requires this field
+ // to be in 0.0001 cd/m^2 scale. So, multiply with LUMINANCE_MULTIPLICATION_FACTOR
+ // and give to be driver
+ ctrl[9].value = mastering_disp_info.maxDisplayLuminance * LUMINANCE_MULTIPLICATION_FACTOR;
ctrl[10].id = V4L2_CID_MPEG_VIDC_VENC_MIN_DISP_LUM;
ctrl[10].value = mastering_disp_info.minDisplayLuminance;