summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSanjay Singh <sisanj@codeaurora.org>2020-08-10 12:26:07 +0530
committerGerrit - the friendly Code Review server <code-review@localhost>2020-08-10 04:57:48 -0700
commit33297dfdc8ce7b00e84297a135f289938fe7f568 (patch)
treea145e64c62a3333a7c02878149d8f01c111e1243
parent33db5677a568d554b770971e56fbafb40ff66de0 (diff)
mm-video-v4l2: venc: Extradata setting during profile update
Invoke HDR10 metadata for profile setting. This will ensure required input extradata buffers are allocated. Change-Id: Ie807632b9c59281d1d490eea10d10b3924fce530
-rw-r--r--mm-video-v4l2/vidc/venc/inc/video_encoder_device_v4l2.h3
-rw-r--r--mm-video-v4l2/vidc/venc/src/video_encoder_device_v4l2.cpp27
2 files changed, 21 insertions, 9 deletions
diff --git a/mm-video-v4l2/vidc/venc/inc/video_encoder_device_v4l2.h b/mm-video-v4l2/vidc/venc/inc/video_encoder_device_v4l2.h
index 0e5d3f31..e230d633 100644
--- a/mm-video-v4l2/vidc/venc/inc/video_encoder_device_v4l2.h
+++ b/mm-video-v4l2/vidc/venc/inc/video_encoder_device_v4l2.h
@@ -1,5 +1,5 @@
/*--------------------------------------------------------------------------
-Copyright (c) 2012-2019, The Linux Foundation. All rights reserved.
+Copyright (c) 2012-2020, The Linux Foundation. All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are
@@ -607,6 +607,7 @@ class venc_dev
OMX_U32 append_extradata_roi_region_qp_info(OMX_OTHER_EXTRADATATYPE *data,
OMX_TICKS timestamp, OMX_U32 freeSize);
bool mBitrateSavingsEnable;
+ bool hdr10metadata_supported;
};
enum instance_state {
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 f91d051a..5a6c3849 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
@@ -1,5 +1,5 @@
/*--------------------------------------------------------------------------
-Copyright (c) 2010-2018, The Linux Foundation. All rights reserved.
+Copyright (c) 2010-2018, 2020, The Linux Foundation. All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
@@ -192,6 +192,7 @@ venc_dev::venc_dev(class omx_venc *venc_class)
intra_period.num_bframes = 0;
mIsNativeRecorder = false;
m_hdr10meta_enabled = false;
+ hdr10metadata_supported = false;
Platform::Config::getInt32(Platform::vidc_enc_log_in,
(int32_t *)&m_debug.in_buffer_log, 0);
@@ -1657,6 +1658,14 @@ bool venc_dev::venc_open(OMX_U32 codec)
supported_rc_modes = (RC_ALL & ~RC_CBR_CFR);
}
+ if (!strcmp(m_platform_name, "sm6150") || !strcmp(m_platform_name, "atoll") || !strcmp(m_platform_name, "trinket"))
+ {
+ hdr10metadata_supported = false;
+ }
+ else {
+ hdr10metadata_supported = true;
+ }
+
#ifdef HYPERVISOR
m_nDriver_fd = hypv_open(device_name, O_RDWR);
#else
@@ -3765,13 +3774,7 @@ unsigned venc_dev::venc_start(void)
return 1;
}
- char platform_name[PROP_VALUE_MAX] = {0};
- char version[PROP_VALUE_MAX] = {0};
- property_get("ro.board.platform", platform_name, "0");
- if (!strcmp(platform_name, "sm6150") || !strcmp(platform_name, "atoll") || !strcmp(platform_name, "trinket"))
- {
- DEBUG_PRINT_HIGH("HDR10 is not supported on this target");
- } else {
+ if (hdr10metadata_supported == true) {
venc_set_extradata_hdr10metadata();
}
@@ -5288,6 +5291,14 @@ bool venc_dev::venc_set_profile(OMX_U32 eProfile)
DEBUG_PRINT_LOW("Success IOCTL set control for id=%d, value=%d", control.id, control.value);
codec_profile.profile = control.value;
+
+ if (hdr10metadata_supported == true) {
+ if (venc_set_extradata_hdr10metadata() == false)
+ {
+ DEBUG_PRINT_ERROR("Failed to set extradata HDR10PLUS_METADATA");
+ return false;
+ }
+ }
return true;
}