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.
This commit is contained in:
Mark Nauwelaerts 2010-08-11 10:27:35 +02:00
parent ff8bdcfe94
commit 6c5b437118
2 changed files with 21 additions and 7 deletions

View file

@ -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;

View file

@ -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");
}
}
}
}