From: Mathieu Duponchelle Date: Wed, 20 Oct 2021 12:34:42 +0000 (+0200) Subject: nvh264enc: add constrained-baseline to the caps profiles X-Git-Tag: 1.19.3~102 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=2f8030d98b10ccc869dda30e13c8a5f000859e3b;p=platform%2Fupstream%2Fgstreamer.git nvh264enc: add constrained-baseline to the caps profiles In practice, when baseline is requested from the encoder it produces constrained baseline, and it is already reflected in the profile-iop flags. Part-of: --- diff --git a/subprojects/gst-plugins-bad/docs/plugins/gst_plugins_cache.json b/subprojects/gst-plugins-bad/docs/plugins/gst_plugins_cache.json index 8ec3b7d2..0283967 100644 --- a/subprojects/gst-plugins-bad/docs/plugins/gst_plugins_cache.json +++ b/subprojects/gst-plugins-bad/docs/plugins/gst_plugins_cache.json @@ -213843,7 +213843,7 @@ "presence": "always" }, "src": { - "caps": "video/x-h264:\n width: [ 145, 4096 ]\n height: [ 49, 4096 ]\n framerate: [ 0/1, 2147483647/1 ]\n stream-format: byte-stream\n alignment: au\n profile: { (string)main, (string)high, (string)high-4:4:4, (string)baseline }\n", + "caps": "video/x-h264:\n width: [ 145, 4096 ]\n height: [ 49, 4096 ]\n framerate: [ 0/1, 2147483647/1 ]\n stream-format: byte-stream\n alignment: au\n profile: { (string)main, (string)high, (string)high-4:4:4, (string)baseline, (string)constrained-baseline }\n", "direction": "src", "presence": "always" } diff --git a/subprojects/gst-plugins-bad/sys/nvcodec/gstnvenc.c b/subprojects/gst-plugins-bad/sys/nvcodec/gstnvenc.c index 4218369..1963767 100644 --- a/subprojects/gst-plugins-bad/sys/nvcodec/gstnvenc.c +++ b/subprojects/gst-plugins-bad/sys/nvcodec/gstnvenc.c @@ -514,6 +514,9 @@ gst_nvenc_get_supported_codec_profiles (gpointer enc, GUID codec_id) /* put baseline to last since it does not support bframe */ {"baseline", NV_ENC_H264_PROFILE_BASELINE_GUID, NV_ENC_CODEC_H264_GUID, FALSE, FALSE, FALSE}, + {"constrained-baseline", NV_ENC_H264_PROFILE_BASELINE_GUID, + NV_ENC_CODEC_H264_GUID, + FALSE, FALSE, FALSE}, /* hevc profiles */ {"main", NV_ENC_HEVC_PROFILE_MAIN_GUID, NV_ENC_CODEC_HEVC_GUID, FALSE, FALSE, FALSE}, diff --git a/subprojects/gst-plugins-bad/sys/nvcodec/gstnvh264enc.c b/subprojects/gst-plugins-bad/sys/nvcodec/gstnvh264enc.c index 3c74c87..4e436d8 100644 --- a/subprojects/gst-plugins-bad/sys/nvcodec/gstnvh264enc.c +++ b/subprojects/gst-plugins-bad/sys/nvcodec/gstnvh264enc.c @@ -79,7 +79,7 @@ enum "framerate = " GST_VIDEO_FPS_RANGE ", " \ "stream-format = (string) byte-stream, " \ "alignment = (string) au, " \ - "profile = (string) { main, high, high-4:4:4, baseline }" + "profile = (string) { main, high, high-4:4:4, baseline, constrained-baseline }" static gboolean gst_nv_h264_enc_open (GstVideoEncoder * enc); static gboolean gst_nv_h264_enc_close (GstVideoEncoder * enc); @@ -474,7 +474,8 @@ gst_nv_h264_enc_set_encoder_config (GstNvBaseEnc * nvenc, profile = gst_structure_get_string (s, "profile"); if (profile) { - if (!strcmp (profile, "baseline")) { + if (!strcmp (profile, "baseline") + || !strcmp (profile, "constrained-baseline")) { selected_profile = NV_ENC_H264_PROFILE_BASELINE_GUID; } else if (g_str_has_prefix (profile, "high-4:4:4")) { selected_profile = NV_ENC_H264_PROFILE_HIGH_444_GUID;