diff options
author | Thibault Saunier <tsaunier@igalia.com> | 2021-08-09 21:24:34 -0400 |
---|---|---|
committer | GStreamer Marge Bot <gitlab-merge-bot@gstreamer-foundation.org> | 2021-08-20 14:20:25 +0000 |
commit | acf98372a3dbc04c23e0d3139dad1c295eedeac2 (patch) | |
tree | b4bd98c02b5227905d9dd2411e21d99d5b0bff04 /gst/encoding/gstencodebasebin.c | |
parent | 4aa72cea4f99c9c47f5d88f294942b8db4a60aa0 (diff) | |
download | gstreamer-plugins-base-acf98372a3dbc04c23e0d3139dad1c295eedeac2.tar.gz |
smartencoder: Respect user `stream-format` when specified
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-base/-/merge_requests/1249>
Diffstat (limited to 'gst/encoding/gstencodebasebin.c')
-rw-r--r-- | gst/encoding/gstencodebasebin.c | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/gst/encoding/gstencodebasebin.c b/gst/encoding/gstencodebasebin.c index e5a69c8f2..005443344 100644 --- a/gst/encoding/gstencodebasebin.c +++ b/gst/encoding/gstencodebasebin.c @@ -1196,16 +1196,19 @@ _capsfilter_force_format (GstPad * pad, if (sgroup->smart_capsfilter) { GstStructure *structure = gst_caps_get_structure (caps, 0); - /* Pick a stream format that allows for in-band SPS updates, and remove - * restrictions on fields that can be updated by codec_data or in-band SPS + /* Pick a stream format that allows for in-band SPS updates if none + * specified by the user, and remove restrictions on fields that can be + * updated by codec_data or in-band SPS */ - if (gst_structure_has_name (structure, "video/x-h264")) { + if (gst_structure_has_name (structure, "video/x-h264") && + !gst_structure_has_field (structure, "stream_format")) { gst_structure_set (structure, "stream-format", G_TYPE_STRING, "avc3", NULL); gst_structure_remove_fields (structure, "codec_data", "profile", "level", NULL); - } else if (gst_structure_has_name (structure, "video/x-h265")) { + } else if (gst_structure_has_name (structure, "video/x-h265") && + !gst_structure_has_field (structure, "stream_format")) { gst_structure_set (structure, "stream-format", G_TYPE_STRING, "hev1", NULL); |