*/
#define GST_PARSE_ERROR gst_parse_error_quark ()
+/* FIXME 2.0: rename to GstParseLaunchError, this is not only related to
+ *parsing */
/**
* GstParseError:
* @GST_PARSE_ERROR_SYNTAX: A syntax error occurred.
* @GST_PARSE_ERROR_COULD_NOT_SET_PROPERTY: There was an error setting a property
* @GST_PARSE_ERROR_EMPTY_BIN: An empty bin was specified.
* @GST_PARSE_ERROR_EMPTY: An empty description was specified
+ * @GST_PARSE_ERROR_DELAYED_LINK: A delayed link did not get resolved.
*
* The different parsing errors that can occur.
*/
GST_PARSE_ERROR_LINK,
GST_PARSE_ERROR_COULD_NOT_SET_PROPERTY,
GST_PARSE_ERROR_EMPTY_BIN,
- GST_PARSE_ERROR_EMPTY
+ GST_PARSE_ERROR_EMPTY,
+ GST_PARSE_ERROR_DELAYED_LINK
} GstParseError;
/**
gchar *sink_pad;
GstElement *sink;
GstCaps *caps;
- gulong signal_id;
+ gulong pad_added_signal_id, no_more_pads_signal_id;
} DelayedLink;
typedef struct {
g_slice_free (DelayedLink, link);
}
+static void gst_parse_no_more_pads (GstElement *src, gpointer data)
+{
+ DelayedLink *link = data;
+
+ GST_ELEMENT_WARNING(src, PARSE, DELAYED_LINK,
+ (_("Delayed linking failed.")),
+ ("failed delayed linking %s:%s to %s:%s",
+ GST_STR_NULL (GST_ELEMENT_NAME (src)), GST_STR_NULL (link->src_pad),
+ GST_STR_NULL (GST_ELEMENT_NAME (link->sink)), GST_STR_NULL (link->sink_pad)));
+ /* we keep the handlers connected, so that in case an element still adds a pad
+ * despite no-more-pads, we will consider it for pending delayed links */
+}
+
static void gst_parse_found_pad (GstElement *src, GstPad *pad, gpointer data)
{
DelayedLink *link = data;
GST_CAT_DEBUG (GST_CAT_PIPELINE, "delayed linking %s:%s to %s:%s worked",
GST_STR_NULL (GST_ELEMENT_NAME (src)), GST_STR_NULL (link->src_pad),
GST_STR_NULL (GST_ELEMENT_NAME (link->sink)), GST_STR_NULL (link->sink_pad));
- g_signal_handler_disconnect (src, link->signal_id);
+ g_signal_handler_disconnect (src, link->no_more_pads_signal_id);
+ /* releases 'link' */
+ g_signal_handler_disconnect (src, link->pad_added_signal_id);
}
}
} else {
data->caps = NULL;
}
- data->signal_id = g_signal_connect_data (src, "pad-added",
+ data->pad_added_signal_id = g_signal_connect_data (src, "pad-added",
G_CALLBACK (gst_parse_found_pad), data,
(GClosureNotify) gst_parse_free_delayed_link, (GConnectFlags) 0);
+ data->no_more_pads_signal_id = g_signal_connect (src, "no-more-pads",
+ G_CALLBACK (gst_parse_no_more_pads), data);
return TRUE;
}
}