diff options
author | Tim-Philipp Müller <tim.muller@collabora.co.uk> | 2013-01-22 14:40:15 +0000 |
---|---|---|
committer | Sebastian Dröge <slomo@circular-chaos.org> | 2013-07-23 15:06:04 +0200 |
commit | 1b0217d6796d745652386476ef61adcf0ffdadfa (patch) | |
tree | 19e225124a48bbea228c5ec07a93f430f7904233 | |
parent | f3b7ed54cef7b8e1baf949833e2cac32e6fe88b0 (diff) |
gnloperation: check for request pads on the element class not the factory
When checking for request pads as fallback, just look at the
element's class, not the factory, since there might not be
a factory (in case of python elements) or the factory might
be the wrong one (in case of a GstBin sub-class) and doesn't
have complete information.
https://bugzilla.gnome.org/show_bug.cgi?id=582244
-rw-r--r-- | gnl/gnloperation.c | 22 |
1 files changed, 5 insertions, 17 deletions
diff --git a/gnl/gnloperation.c b/gnl/gnloperation.c index c271c7b..249c604 100644 --- a/gnl/gnloperation.c +++ b/gnl/gnloperation.c @@ -197,8 +197,6 @@ gnl_operation_init (GnlOperation * operation) static gboolean element_is_valid_filter (GstElement * element, gboolean * isdynamic) { - GstElementFactory *factory; - const GList *templates; gboolean havesink = FALSE; gboolean havesrc = FALSE; gboolean done = FALSE; @@ -239,21 +237,11 @@ element_is_valid_filter (GstElement * element, gboolean * isdynamic) g_value_unset (&item); gst_iterator_free (pads); - if (G_LIKELY ((factory = gst_element_get_factory (element)))) { - - for (templates = gst_element_factory_get_static_pad_templates (factory); - templates; templates = templates->next) { - GstStaticPadTemplate *template = (GstStaticPadTemplate *) templates->data; - - if (template->direction == GST_PAD_SRC) - havesrc = TRUE; - else if (template->direction == GST_PAD_SINK) { - if (!havesink && (template->presence == GST_PAD_REQUEST) && isdynamic) - *isdynamic = TRUE; - havesink = TRUE; - } - } - } else if (GST_ELEMENT_GET_CLASS (element)) { + /* just look at the element's class, not the factory, since there might + * not be a factory (in case of python elements) or the factory is the + * wrong one (in case of a GstBin sub-class) and doesn't have complete + * information. */ + { GList *tmp = gst_element_class_get_pad_template_list (GST_ELEMENT_GET_CLASS (element)); |