G_STRUCT_OFFSET (GstBinClass, object_added), NULL, NULL,
gst_marshal_VOID__POINTER, G_TYPE_NONE, 1, G_TYPE_POINTER);
- klass->change_state_type = GST_DEBUG_FUNCPTR (gst_bin_change_state_type);
- klass->iterate = GST_DEBUG_FUNCPTR (gst_bin_iterate_func);
-
gobject_class->dispose = GST_DEBUG_FUNCPTR (gst_bin_dispose);
+
#ifndef GST_DISABLE_LOADSAVE
gstobject_class->save_thyself = GST_DEBUG_FUNCPTR (gst_bin_save_thyself);
gstobject_class->restore_thyself = GST_DEBUG_FUNCPTR (gst_bin_restore_thyself);
gst_bin_iterate_func (GstBin * bin)
{
/* only iterate if this is the manager bin */
- if (GST_ELEMENT_SCHED (bin)->parent == GST_ELEMENT (bin)) {
+ if (GST_ELEMENT_SCHED (bin) &&
+ GST_ELEMENT_SCHED (bin)->parent == GST_ELEMENT (bin)) {
GstSchedulerState state;
state = gst_scheduler_iterate (GST_ELEMENT_SCHED (bin));
{
GstRealPad *realsrc, *realsink;
gboolean negotiated = FALSE;
+ gint num_decoupled = 0;
/* generic checks */
g_return_val_if_fail (srcpad != NULL, FALSE);
g_return_val_if_fail (GST_RPAD_PEER (realsrc) == NULL, FALSE);
g_return_val_if_fail (GST_RPAD_PEER (realsink) == NULL, FALSE);
+ g_return_val_if_fail (GST_PAD_PARENT (realsrc) != NULL, FALSE);
+ g_return_val_if_fail (GST_PAD_PARENT (realsink) != NULL, FALSE);
+
+ if (realsrc->sched && realsink->sched) {
+ if (GST_FLAG_IS_SET (GST_PAD_PARENT (realsrc), GST_ELEMENT_DECOUPLED))
+ num_decoupled++;
+ if (GST_FLAG_IS_SET (GST_PAD_PARENT (realsink), GST_ELEMENT_DECOUPLED))
+ num_decoupled++;
+
+ if (realsrc->sched == realsink->sched && num_decoupled != 0) {
+ g_warning ("cannot connect pads from decoupled elements with the same sched\n");
+ return FALSE;
+ } else if (realsrc->sched != realsink->sched && num_decoupled != 1) {
+ g_warning ("connecting pads with different scheds requires one decoupled element (queue)\n");
+ return FALSE;
+ }
+ } else if (realsrc->sched || realsink->sched) {
+ g_warning ("you can't connect to a non-managed element");
+ }
/* check for reversed directions and swap if necessary */
if ((GST_RPAD_DIRECTION (realsrc) == GST_PAD_SINK) &&
if (!strcmp (gst_pad_get_name (newpad), connect->srcpadname)) {
gst_element_set_state (connect->pipeline, GST_STATE_PAUSED);
- gst_pad_connect (newpad, connect->target);
+ if (!gst_pad_connect (newpad, connect->target))
+ g_warning ("could not connect %s:%s to %s:%s", GST_DEBUG_PAD_NAME (newpad),
+ GST_DEBUG_PAD_NAME (connect->target));
gst_element_set_state (connect->pipeline, GST_STATE_PLAYING);
}
}
GST_DEBUG (0, "CONNECTING %s:%s and %s:%s\n",
GST_DEBUG_PAD_NAME (GST_PARSE_LISTPAD (g_slist_nth (srcpads, j))),
GST_DEBUG_PAD_NAME (GST_PARSE_LISTPAD (g_slist_nth (sinkpads, j))));
- gst_pad_connect (GST_PARSE_LISTPAD (g_slist_nth (srcpads, j)),
- GST_PARSE_LISTPAD (g_slist_nth (sinkpads, j)));
+ if (!gst_pad_connect (GST_PARSE_LISTPAD (g_slist_nth (srcpads, j)),
+ GST_PARSE_LISTPAD (g_slist_nth (sinkpads, j)))) {
+ g_warning ("could not connect %s:%s to %s:%s",
+ GST_DEBUG_PAD_NAME (GST_PARSE_LISTPAD (g_slist_nth (srcpads, j))),
+ GST_DEBUG_PAD_NAME (GST_PARSE_LISTPAD (g_slist_nth (sinkpads, j))));
+ return GST_PARSE_ERROR_CONNECT;
+ }
}
}
GST_PARSE_ERROR_SYNTAX = -1,
GST_PARSE_ERROR_CREATING_ELEMENT = -2,
GST_PARSE_ERROR_NOSUCH_ELEMENT = -3,
- GST_PARSE_ERROR_INTERNAL = -4
+ GST_PARSE_ERROR_INTERNAL = -4,
+ GST_PARSE_ERROR_CONNECT = -5,
} GstParseErrors;
GstPipeline* gst_parse_launch (const gchar *pipeline_description);
* if you only want to build a specific element from an XML file
* but not the pipeline it is embedded in.
*
+ * Pass "-" as fname to read from stdin. You can also pass a URI
+ * of any format that libxml supports, including http.
+ *
* Returns: TRUE on success, FALSE otherwise
*/
gboolean