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: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1213>
This commit is contained in:
Mathieu Duponchelle 2021-10-20 14:34:42 +02:00 committed by GStreamer Marge Bot
parent 8b6c3e030b
commit 2f8030d98b
3 changed files with 7 additions and 3 deletions

View file

@ -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"
}

View file

@ -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},

View file

@ -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;