mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-29 21:21:12 +00:00
playbin3: Inform (uri)decodebin3 of the subtitle caps from playsink
Subtitles are better handled by overlayers/renderers within playsink. By informing (uri)decodebin3 of the formats that can be handled we can avoid those being "decoded" too early. Fixes #1081 Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6153>
This commit is contained in:
parent
479c0c5bb4
commit
c1d33126aa
1 changed files with 10 additions and 0 deletions
|
@ -1058,6 +1058,8 @@ colorbalance_value_changed_cb (GstColorBalance * balance,
|
|||
static void
|
||||
gst_play_bin3_init (GstPlayBin3 * playbin)
|
||||
{
|
||||
GstCaps *uridecodebin_caps, *subtitle_caps;
|
||||
|
||||
g_rec_mutex_init (&playbin->lock);
|
||||
|
||||
/* assume we can create an input-selector */
|
||||
|
@ -1073,6 +1075,14 @@ gst_play_bin3_init (GstPlayBin3 * playbin)
|
|||
gst_bin_add (GST_BIN_CAST (playbin),
|
||||
GST_ELEMENT_CAST (playbin->uridecodebin));
|
||||
|
||||
/* Make sure uridecodebin3 knows of all the subtitle formats that playsink can
|
||||
* handle as-is */
|
||||
subtitle_caps = gst_subtitle_overlay_create_factory_caps ();
|
||||
g_object_get (playbin->uridecodebin, "caps", &uridecodebin_caps, NULL);
|
||||
uridecodebin_caps = gst_caps_merge (uridecodebin_caps, subtitle_caps);
|
||||
g_object_set (playbin->uridecodebin, "caps", uridecodebin_caps, NULL);
|
||||
gst_caps_unref (uridecodebin_caps);
|
||||
|
||||
g_signal_connect (playbin->uridecodebin, "pad-added",
|
||||
G_CALLBACK (pad_added_cb), playbin);
|
||||
g_signal_connect (playbin->uridecodebin, "pad-removed",
|
||||
|
|
Loading…
Reference in a new issue