gboolean templ_found = FALSE;
GList *list;
gint n;
+ gchar *str;
g_return_val_if_fail (element != NULL, NULL);
g_return_val_if_fail (GST_IS_ELEMENT (element), NULL);
g_return_val_if_fail (name != NULL, NULL);
- if (strstr (name, "%d")) {
- templ = gst_element_get_padtemplate_by_name (element, name);
- templ_found = (templ != NULL);
- req_name = NULL;
+ if (strstr (name, "%")) {
+ templ = gst_element_get_padtemplate_by_name (element, name);
+ req_name = NULL;
+ if (templ)
+ templ_found = TRUE;
} else {
- list = gst_element_get_padtemplate_list(element);
- while (!templ_found && list) {
- templ = (GstPadTemplate*) list->data;
- if (strstr (templ->name_template, "%d")) {
- if (sscanf(name, templ->name_template, &n)) {
- templ_found = TRUE;
- req_name = name;
- break;
- }
+ list = gst_element_get_padtemplate_list(element);
+ while (!templ_found && list) {
+ templ = (GstPadTemplate*) list->data;
+ if (templ->presence == GST_PAD_REQUEST) {
+ /* we know that %s and %d are the ony possibilities because of sanity
+ checks in gst_padtemplate_new */
+ if (strstr (templ->name_template, "%d")) {
+ if (sscanf(name, templ->name_template, &n)) {
+ templ_found = TRUE;
+ req_name = name;
+ break;
+ }
+ } else if (strstr (templ->name_template, "%s")) {
+ if (sscanf(name, templ->name_template, &str)) {
+ templ_found = TRUE;
+ req_name = name;
+ break;
}
- list = list->next;
+ }
}
+ list = list->next;
+ }
}
if (!templ_found)
}
/**
- * gst_element_install_std_props:
+ * gst_element_class_install_std_props:
* @klass: the class to add the properties to
* @first_name: the first in a NULL terminated
* 'name', 'id', 'flags' triplet list.
* the flags determine readability / writeability.
**/
void
-gst_element_install_std_props (GstElementClass * klass, const char *first_name, ...)
+gst_element_class_install_std_props (GstElementClass * klass, const char *first_name, ...)
{
const char *name;
va_end (args);
}
+/**
+ * gst_element_get_managing_bin:
+ * @element: the element in question
+ *
+ * Get the managing bin (a pipeline or a thread, for example) of an element.
+ *
+ * Returns: the bin, or NULL on failure
+ **/
GstBin*
gst_element_get_managing_bin (GstElement *element)
{