diff options
author | Sebastian Dröge <slomo@circular-chaos.org> | 2013-07-30 08:18:47 +0200 |
---|---|---|
committer | Sebastian Dröge <slomo@circular-chaos.org> | 2013-07-30 08:18:47 +0200 |
commit | ab458c2ee68b132b62e498fcf293c2ec44477faf (patch) | |
tree | a2455400f05646458d97021f31202134f0f1dd11 /plugins | |
parent | 01f23673f675e49cdadf2007671a14835c7b2698 (diff) |
Imported Upstream version 1.1.3upstream/1.1.3
Diffstat (limited to 'plugins')
-rw-r--r-- | plugins/Makefile.in | 2 | ||||
-rw-r--r-- | plugins/elements/Makefile.in | 2 | ||||
-rw-r--r-- | plugins/elements/gstinputselector.c | 26 | ||||
-rw-r--r-- | plugins/elements/gstinputselector.h | 2 | ||||
-rw-r--r-- | plugins/elements/gstmultiqueue.c | 35 | ||||
-rw-r--r-- | plugins/elements/gsttypefindelement.c | 7 |
6 files changed, 56 insertions, 18 deletions
diff --git a/plugins/Makefile.in b/plugins/Makefile.in index ffdad8d..ebaf4fd 100644 --- a/plugins/Makefile.in +++ b/plugins/Makefile.in @@ -315,6 +315,7 @@ GTKDOC_DEPS_CFLAGS = @GTKDOC_DEPS_CFLAGS@ GTKDOC_DEPS_LIBS = @GTKDOC_DEPS_LIBS@ GTKDOC_MKPDF = @GTKDOC_MKPDF@ GTKDOC_REBASE = @GTKDOC_REBASE@ +HAVE_DOCBOOK2HTML = @HAVE_DOCBOOK2HTML@ HAVE_DOCBOOK2PS = @HAVE_DOCBOOK2PS@ HAVE_DVIPS = @HAVE_DVIPS@ HAVE_EPSTOPDF = @HAVE_EPSTOPDF@ @@ -325,7 +326,6 @@ HAVE_PNGTOPNM = @HAVE_PNGTOPNM@ HAVE_PNMTOPS = @HAVE_PNMTOPS@ HAVE_PS2PDF = @HAVE_PS2PDF@ HAVE_XMLLINT = @HAVE_XMLLINT@ -HAVE_XSLTPROC = @HAVE_XSLTPROC@ HOST_CPU = @HOST_CPU@ HTML_DIR = @HTML_DIR@ INSTALL = @INSTALL@ diff --git a/plugins/elements/Makefile.in b/plugins/elements/Makefile.in index a7dc786..14eab12 100644 --- a/plugins/elements/Makefile.in +++ b/plugins/elements/Makefile.in @@ -358,6 +358,7 @@ GTKDOC_DEPS_CFLAGS = @GTKDOC_DEPS_CFLAGS@ GTKDOC_DEPS_LIBS = @GTKDOC_DEPS_LIBS@ GTKDOC_MKPDF = @GTKDOC_MKPDF@ GTKDOC_REBASE = @GTKDOC_REBASE@ +HAVE_DOCBOOK2HTML = @HAVE_DOCBOOK2HTML@ HAVE_DOCBOOK2PS = @HAVE_DOCBOOK2PS@ HAVE_DVIPS = @HAVE_DVIPS@ HAVE_EPSTOPDF = @HAVE_EPSTOPDF@ @@ -368,7 +369,6 @@ HAVE_PNGTOPNM = @HAVE_PNGTOPNM@ HAVE_PNMTOPS = @HAVE_PNMTOPS@ HAVE_PS2PDF = @HAVE_PS2PDF@ HAVE_XMLLINT = @HAVE_XMLLINT@ -HAVE_XSLTPROC = @HAVE_XSLTPROC@ HOST_CPU = @HOST_CPU@ HTML_DIR = @HTML_DIR@ INSTALL = @INSTALL@ diff --git a/plugins/elements/gstinputselector.c b/plugins/elements/gstinputselector.c index 6fcda93..7eda5a2 100644 --- a/plugins/elements/gstinputselector.c +++ b/plugins/elements/gstinputselector.c @@ -461,7 +461,7 @@ gst_selector_pad_event (GstPad * pad, GstObject * parent, GstEvent * event) active_sinkpad = gst_input_selector_activate_sinkpad (sel, pad); GST_INPUT_SELECTOR_UNLOCK (sel); - if (prev_active_sinkpad != active_sinkpad && pad == active_sinkpad) { + if (prev_active_sinkpad != active_sinkpad) { if (prev_active_sinkpad) g_object_notify (G_OBJECT (prev_active_sinkpad), "active"); g_object_notify (G_OBJECT (active_sinkpad), "active"); @@ -477,6 +477,13 @@ gst_selector_pad_event (GstPad * pad, GstObject * parent, GstEvent * event) forward = (pad == active_sinkpad); switch (GST_EVENT_TYPE (event)) { + case GST_EVENT_STREAM_START:{ + guint group_id; + + if (!gst_event_parse_group_id (event, &group_id)) + sel->have_group_id = FALSE; + break; + } case GST_EVENT_FLUSH_START: /* Unblock the pad if it's waiting */ selpad->flushing = TRUE; @@ -756,6 +763,17 @@ forward_sticky_events (GstPad * sinkpad, GstEvent ** event, gpointer user_data) gst_event_set_seqnum (e, GST_SELECTOR_PAD_CAST (sinkpad)->segment_seqnum); gst_pad_push_event (sel->srcpad, e); + } else if (GST_EVENT_TYPE (*event) == GST_EVENT_STREAM_START + && !sel->have_group_id) { + GstEvent *tmp = + gst_pad_get_sticky_event (sel->srcpad, GST_EVENT_STREAM_START, 0); + + /* Only push stream-start once if not all our streams have a stream-id */ + if (!tmp) { + gst_pad_push_event (sel->srcpad, gst_event_ref (*event)); + } else { + gst_event_unref (tmp); + } } else { gst_pad_push_event (sel->srcpad, gst_event_ref (*event)); } @@ -1032,7 +1050,7 @@ gst_selector_pad_chain (GstPad * pad, GstObject * parent, GstBuffer * buf) GST_INPUT_SELECTOR_UNLOCK (sel); - if (prev_active_sinkpad != active_sinkpad && pad == active_sinkpad) { + if (prev_active_sinkpad != active_sinkpad) { if (prev_active_sinkpad) g_object_notify (G_OBJECT (prev_active_sinkpad), "active"); g_object_notify (G_OBJECT (active_sinkpad), "active"); @@ -1275,6 +1293,7 @@ gst_input_selector_init (GstInputSelector * sel) sel->active_sinkpad = NULL; sel->padcount = 0; sel->sync_streams = DEFAULT_SYNC_STREAMS; + sel->have_group_id = TRUE; g_mutex_init (&sel->lock); g_cond_init (&sel->cond); @@ -1699,10 +1718,10 @@ gst_input_selector_release_pad (GstElement * element, GstPad * pad) sel->active_sinkpad = NULL; } sel->n_pads--; + GST_INPUT_SELECTOR_UNLOCK (sel); gst_pad_set_active (pad, FALSE); gst_element_remove_pad (GST_ELEMENT (sel), pad); - GST_INPUT_SELECTOR_UNLOCK (sel); } static void @@ -1727,6 +1746,7 @@ gst_input_selector_reset (GstInputSelector * sel) selpad->tags = NULL; } } + sel->have_group_id = TRUE; GST_INPUT_SELECTOR_UNLOCK (sel); } diff --git a/plugins/elements/gstinputselector.h b/plugins/elements/gstinputselector.h index 57678f6..96c680f 100644 --- a/plugins/elements/gstinputselector.h +++ b/plugins/elements/gstinputselector.h @@ -72,6 +72,8 @@ struct _GstInputSelector { GstInputSelectorSyncMode sync_mode; gboolean cache_buffers; + gboolean have_group_id; + GMutex lock; GCond cond; gboolean blocked; diff --git a/plugins/elements/gstmultiqueue.c b/plugins/elements/gstmultiqueue.c index 9e9209c..7a9cd5f 100644 --- a/plugins/elements/gstmultiqueue.c +++ b/plugins/elements/gstmultiqueue.c @@ -1614,17 +1614,30 @@ gst_multi_queue_sink_query (GstPad * pad, GstObject * parent, GstQuery * query) if (sq->srcresult != GST_FLOW_OK) goto out_flushing; - /* Get an unique incrementing id. */ - curid = g_atomic_int_add ((gint *) & mq->counter, 1); - - item = gst_multi_queue_mo_item_new ((GstMiniObject *) query, curid); - - GST_DEBUG_OBJECT (mq, - "SingleQueue %d : Enqueuing query %p of type %s with id %d", - sq->id, query, GST_QUERY_TYPE_NAME (query), curid); - res = gst_data_queue_push (sq->queue, (GstDataQueueItem *) item); - g_cond_wait (&sq->query_handled, &mq->qlock); - res = sq->last_query; + /* serialized events go in the queue. We need to be certain that we + * don't cause deadlocks waiting for the query return value. We check if + * the queue is empty (nothing is blocking downstream and the query can + * be pushed for sure) or we are not buffering. If we are buffering, + * the pipeline waits to unblock downstream until our queue fills up + * completely, which can not happen if we block on the query.. + * Therefore we only potentially block when we are not buffering. */ + if (!mq->use_buffering || gst_data_queue_is_empty (sq->queue)) { + /* Get an unique incrementing id. */ + curid = g_atomic_int_add ((gint *) & mq->counter, 1); + + item = gst_multi_queue_mo_item_new ((GstMiniObject *) query, curid); + + GST_DEBUG_OBJECT (mq, + "SingleQueue %d : Enqueuing query %p of type %s with id %d", + sq->id, query, GST_QUERY_TYPE_NAME (query), curid); + res = gst_data_queue_push (sq->queue, (GstDataQueueItem *) item); + g_cond_wait (&sq->query_handled, &mq->qlock); + res = sq->last_query; + } else { + GST_DEBUG_OBJECT (mq, "refusing query, we are buffering and the " + "queue is not empty"); + res = FALSE; + } GST_MULTI_QUEUE_MUTEX_UNLOCK (mq); } else { /* default handling */ diff --git a/plugins/elements/gsttypefindelement.c b/plugins/elements/gsttypefindelement.c index ebbb6e7..c298414 100644 --- a/plugins/elements/gsttypefindelement.c +++ b/plugins/elements/gsttypefindelement.c @@ -989,12 +989,15 @@ gst_type_find_element_loop (GstPad * pad) if (typefind->need_stream_start) { gchar *stream_id; + GstEvent *event; stream_id = gst_pad_create_stream_id (typefind->src, GST_ELEMENT_CAST (typefind), NULL); GST_DEBUG_OBJECT (typefind, "Pushing STREAM_START"); - gst_pad_push_event (typefind->src, gst_event_new_stream_start (stream_id)); + event = gst_event_new_stream_start (stream_id); + gst_event_set_group_id (event, gst_util_group_id_next ()); + gst_pad_push_event (typefind->src, event); typefind->need_stream_start = FALSE; g_free (stream_id); @@ -1085,7 +1088,7 @@ gst_type_find_element_loop (GstPad * pad) if (ret != GST_FLOW_OK) goto pause; - typefind->offset += 4096; + typefind->offset += gst_buffer_get_size (outbuf); ret = gst_pad_push (typefind->src, outbuf); if (ret != GST_FLOW_OK) |