fix bug when requesting pads by name

Original commit message from CVS:
* fix bug when requesting pads by name
* added api: gst_element_get_managing_bin ()
This commit is contained in:
Andy Wingo 2002-03-06 16:14:34 +00:00
parent fbe0d0ba6b
commit 660621ca99
2 changed files with 18 additions and 1 deletions

View file

@ -735,7 +735,7 @@ gst_element_request_pad_by_name (GstElement *element, const gchar *name)
}
}
if (templ == NULL)
if (!templ_found)
return NULL;
pad = gst_element_request_pad (element, templ, req_name);
@ -1908,3 +1908,18 @@ gst_element_install_std_props (GstElementClass * klass, const char *first_name,
va_end (args);
}
GstBin*
gst_element_get_managing_bin (GstElement *element)
{
GstBin *bin;
g_return_val_if_fail (element != NULL, NULL);
bin = GST_BIN (gst_object_get_parent (GST_OBJECT_CAST (element)));
while (bin && !GST_FLAG_IS_SET (GST_OBJECT_CAST (bin), GST_BIN_FLAG_MANAGER))
bin = GST_BIN (gst_object_get_parent (GST_OBJECT_CAST (bin)));
return bin;
}

View file

@ -246,6 +246,8 @@ GstElementFactory* gst_element_get_factory (GstElement *element);
void gst_element_install_std_props (GstElementClass *klass,
const char *first_name, ...);
GstBin* gst_element_get_managing_bin (GstElement *element);
/*
*