summaryrefslogtreecommitdiff
path: root/omx/gstomxh265enc.c
diff options
context:
space:
mode:
Diffstat (limited to 'omx/gstomxh265enc.c')
-rw-r--r--omx/gstomxh265enc.c27
1 files changed, 20 insertions, 7 deletions
diff --git a/omx/gstomxh265enc.c b/omx/gstomxh265enc.c
index 6e807de..a016cab 100644
--- a/omx/gstomxh265enc.c
+++ b/omx/gstomxh265enc.c
@@ -492,17 +492,30 @@ gst_omx_h265_enc_set_format (GstOMXVideoEnc * enc, GstOMXPort * port,
}
gst_caps_unref (peercaps);
+ }
- if (profile != OMX_VIDEO_HEVCProfileUnknown
- || level != OMX_VIDEO_HEVCLevelUnknown) {
- /* OMX provides 2 API to set the profile and level. We try using the
- * generic on here and the H265 specific when calling
- * update_param_hevc() */
- if (!update_param_profile_level (self, profile, level))
- return FALSE;
+ /* Change default profile to main-10 if input is 10 bits */
+ if (profile == OMX_VIDEO_HEVCProfileUnknown) {
+ GstVideoFormat format;
+
+ format = state->info.finfo->format;
+ if (format == GST_VIDEO_FORMAT_NV12_10LE32 ||
+ format == GST_VIDEO_FORMAT_NV16_10LE32) {
+ GST_DEBUG_OBJECT (self,
+ "Set profile to main-10 as input is a 10 bits format");
+ profile = OMX_VIDEO_HEVCProfileMain10;
}
}
+ if (profile != OMX_VIDEO_HEVCProfileUnknown
+ || level != OMX_VIDEO_HEVCLevelUnknown) {
+ /* OMX provides 2 API to set the profile and level. We try using the
+ * generic one here and the H265 specific when calling
+ * update_param_hevc() */
+ if (!update_param_profile_level (self, profile, level))
+ return FALSE;
+ }
+
if (!update_param_hevc (self, profile, level))
return FALSE;