diff --git a/gst/gstbin.c b/gst/gstbin.c index 4a936da00c..2c68a31623 100644 --- a/gst/gstbin.c +++ b/gst/gstbin.c @@ -114,10 +114,8 @@ gst_bin_class_init (GstBinClass * klass) 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); @@ -739,7 +737,8 @@ static gboolean 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)); diff --git a/gst/gstpad.c b/gst/gstpad.c index cb2bf30b91..04ca54ed63 100644 --- a/gst/gstpad.c +++ b/gst/gstpad.c @@ -587,6 +587,7 @@ gst_pad_connect_filtered (GstPad *srcpad, GstPad *sinkpad, GstCaps *filtercaps) { GstRealPad *realsrc, *realsink; gboolean negotiated = FALSE; + gint num_decoupled = 0; /* generic checks */ g_return_val_if_fail (srcpad != NULL, FALSE); @@ -607,6 +608,25 @@ gst_pad_connect_filtered (GstPad *srcpad, GstPad *sinkpad, GstCaps *filtercaps) 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) && diff --git a/gst/gstparse.c b/gst/gstparse.c index 7ae33121a8..f1625337cb 100644 --- a/gst/gstparse.c +++ b/gst/gstparse.c @@ -68,7 +68,9 @@ dynamic_connect (GstElement * element, GstPad * newpad, gpointer data) 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); } } @@ -422,8 +424,13 @@ gst_parse_launchv_recurse (const gchar **argv, GstBin * parent, gst_parse_priv * 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; + } } } diff --git a/gst/gstparse.h b/gst/gstparse.h index bc1526eba6..f32eec1f9a 100644 --- a/gst/gstparse.h +++ b/gst/gstparse.h @@ -35,7 +35,8 @@ typedef enum { 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); diff --git a/gst/gstxml.c b/gst/gstxml.c index f5b64df709..08de28af1f 100644 --- a/gst/gstxml.c +++ b/gst/gstxml.c @@ -254,6 +254,9 @@ gst_xml_parse_doc (GstXML *xml, xmlDocPtr doc, const guchar *root) * 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