diff options
author | Thibault Saunier <tsaunier@igalia.com> | 2020-11-19 19:03:29 -0300 |
---|---|---|
committer | Thibault Saunier <tsaunier@igalia.com> | 2020-11-30 15:44:53 -0300 |
commit | 174201059e7e0a009b5cdbd07e7c82c40b33e72d (patch) | |
tree | 56e554feb8c950a8a2b494d620495ad29bff1318 /gst | |
parent | dc4c976727cb3aae07d8dce9a373a37db716cd44 (diff) | |
download | gstreamer-plugins-base-174201059e7e0a009b5cdbd07e7c82c40b33e72d.tar.gz |
encodebin: Ignore element classification when a muxer name specified
Instead of going through the list of known muxers go ahead and
instantiate the muxer specified as 'preset name' as this specifies
the exact element factory name to use.
Diffstat (limited to 'gst')
-rw-r--r-- | gst/encoding/gstencodebasebin.c | 26 |
1 files changed, 19 insertions, 7 deletions
diff --git a/gst/encoding/gstencodebasebin.c b/gst/encoding/gstencodebasebin.c index 956e809cd..6a3752687 100644 --- a/gst/encoding/gstencodebasebin.c +++ b/gst/encoding/gstencodebasebin.c @@ -1934,7 +1934,7 @@ compare_elements (gconstpointer a, gconstpointer b, gpointer udata) static inline GstElement * _get_muxer (GstEncodeBaseBin * ebin) { - GList *muxers, *formatters, *tmpmux; + GList *muxers = NULL, *formatters, *tmpmux; GstElement *muxer = NULL; GstElementFactory *muxerfact = NULL; const GList *tmp; @@ -1945,11 +1945,23 @@ _get_muxer (GstEncodeBaseBin * ebin) preset = gst_encoding_profile_get_preset (ebin->profile); preset_name = gst_encoding_profile_get_preset_name (ebin->profile); - GST_DEBUG ("Getting list of muxers for format %" GST_PTR_FORMAT, format); + GST_DEBUG_OBJECT (ebin, "Getting list of muxers for format %" GST_PTR_FORMAT, + format); - muxers = - gst_element_factory_list_filter (ebin->muxers, format, GST_PAD_SRC, - !preset_name); + if (preset_name) { + GstElementFactory *f = + (GstElementFactory *) gst_registry_find_feature (gst_registry_get (), + preset_name, + GST_TYPE_ELEMENT_FACTORY); + + if (f) + muxers = g_list_append (muxers, f); + } else { + muxers = + gst_element_factory_list_filter (ebin->muxers, format, GST_PAD_SRC, + !preset_name); + + } formatters = gst_element_factory_list_filter (ebin->formatters, format, GST_PAD_SRC, @@ -1973,7 +1985,7 @@ _get_muxer (GstEncodeBaseBin * ebin) muxerfact = (GstElementFactory *) tmpmux->data; - GST_DEBUG ("Trying muxer %s", GST_OBJECT_NAME (muxerfact)); + GST_DEBUG_OBJECT (ebin, "Trying muxer %s", GST_OBJECT_NAME (muxerfact)); /* See if the muxer can sink all of our stream profile caps */ for (tmp = profiles; tmp; tmp = tmp->next) { @@ -1981,7 +1993,7 @@ _get_muxer (GstEncodeBaseBin * ebin) GstCaps *sformat = gst_encoding_profile_get_format (sprof); if (!_factory_can_handle_caps (muxerfact, sformat, GST_PAD_SINK, FALSE)) { - GST_DEBUG ("Skipping muxer because it can't sink caps %" + GST_ERROR ("Skipping muxer because it can't sink caps %" GST_PTR_FORMAT, sformat); cansinkstreams = FALSE; if (sformat) |