diff options
Diffstat (limited to 'gnl/gnloperation.c')
-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)); |