diff options
author | Mark Nauwelaerts <mark.nauwelaerts@collabora.co.uk> | 2010-08-11 10:27:35 +0200 |
---|---|---|
committer | Mark Nauwelaerts <mark.nauwelaerts@collabora.co.uk> | 2010-08-12 10:52:59 +0200 |
commit | 6c5b437118a8dcc998d20b28017190a55fcd6ecd (patch) | |
tree | b9653fbc87f7bbff2a525c4ca7a707e1758c339b | |
parent | ff8bdcfe9437a7eb7de0293b3b4a5490832d5711 (diff) |
playbin2/playsink: update subtitle handling for streamsynchronizer
Streamsynchronizer excepts to see stream-changed msg for all streams, but to
arrange for this, video and subtitle streams need to be decoupled by means
of queues (due to pad blocks that may occur).
Fixes #626463.
-rw-r--r-- | gst/playback/gstplaybin2.c | 7 | ||||
-rw-r--r-- | gst/playback/gstplaysink.c | 21 |
2 files changed, 21 insertions, 7 deletions
diff --git a/gst/playback/gstplaybin2.c b/gst/playback/gstplaybin2.c index f26bc627e..6be78d27d 100644 --- a/gst/playback/gstplaybin2.c +++ b/gst/playback/gstplaybin2.c @@ -2691,10 +2691,9 @@ no_more_pads_cb (GstElement * decodebin, GstSourceGroup * group) for (i = 0; i < GST_PLAY_SINK_TYPE_LAST; i++) { GstSourceSelect *select = &group->selector[i]; - /* Wait for stream-changed messages on all selectors except - * the text selector because of the sparse nature of text streams. - */ - if (select->sinkpad && select->type != GST_PLAY_SINK_TYPE_TEXT) { + /* All streamsynchronizer streams should see stream-changed message, + * to arrange for blocking unblocking. */ + if (select->sinkpad) { GstStructure *s; GstMessage *msg; GstEvent *event; diff --git a/gst/playback/gstplaysink.c b/gst/playback/gstplaysink.c index 25420dd0c..f42f65be5 100644 --- a/gst/playback/gstplaysink.c +++ b/gst/playback/gstplaysink.c @@ -1498,6 +1498,8 @@ gen_text_chain (GstPlaySink * playsink) (_("Missing element '%s' - check your GStreamer installation."), "subtitleoverlay"), ("subtitle rendering disabled")); } else { + GstElement *element; + gst_bin_add (bin, chain->overlay); g_object_set (G_OBJECT (chain->overlay), "silent", FALSE, NULL); @@ -1513,9 +1515,22 @@ gen_text_chain (GstPlaySink * playsink) gst_element_link_pads_full (chain->queue, "src", chain->overlay, "video_sink", GST_PAD_LINK_CHECK_TEMPLATE_CAPS); - textsinkpad = - gst_element_get_static_pad (chain->overlay, "subtitle_sink"); - srcpad = gst_element_get_static_pad (chain->overlay, "src"); + /* make another little queue to decouple streams */ + element = gst_element_factory_make ("queue", "subqueue"); + if (element == NULL) { + post_missing_element_message (playsink, "queue"); + GST_ELEMENT_WARNING (playsink, CORE, MISSING_PLUGIN, + (_("Missing element '%s' - check your GStreamer installation."), + "queue"), ("rendering might be suboptimal")); + } else { + g_object_set (G_OBJECT (element), "max-size-buffers", 3, + "max-size-bytes", 0, "max-size-time", (gint64) 0, NULL); + gst_bin_add (bin, element); + gst_element_link_pads_full (element, "src", chain->overlay, + "subtitle_sink", GST_PAD_LINK_CHECK_TEMPLATE_CAPS); + textsinkpad = gst_element_get_static_pad (element, "sink"); + srcpad = gst_element_get_static_pad (chain->overlay, "src"); + } } } } |