diff --git a/gst/playback/gstplay-enum.c b/gst/playback/gstplay-enum.c index c0c1fe1f7e..60c448c840 100644 --- a/gst/playback/gstplay-enum.c +++ b/gst/playback/gstplay-enum.c @@ -61,6 +61,8 @@ register_gst_play_flags (GType * id) "native-video"}, {C_FLAGS (GST_PLAY_FLAG_DOWNLOAD), "Attempt progressive download buffering", "download"}, + {C_FLAGS (GST_PLAY_FLAG_BUFFERING), "Buffer demuxed/parsed data", + "buffering"}, {0, NULL, NULL} }; *id = g_flags_register_static ("GstPlayFlags", values); diff --git a/gst/playback/gstplay-enum.h b/gst/playback/gstplay-enum.h index 96ff6dffce..96f271b886 100644 --- a/gst/playback/gstplay-enum.h +++ b/gst/playback/gstplay-enum.h @@ -55,6 +55,7 @@ GType gst_autoplug_select_result_get_type (void); * configuration of ffmpegcolorspace and videoscale. * @GST_PLAY_FLAG_DOWNLOAD: enable progressice download buffering for selected * formats. + * @GST_PLAY_FLAG_BUFFERING: enable buffering of the demuxed or parsed data. * * Extra flags to configure the behaviour of the sinks. */ @@ -66,7 +67,8 @@ typedef enum { GST_PLAY_FLAG_SOFT_VOLUME = (1 << 4), GST_PLAY_FLAG_NATIVE_AUDIO = (1 << 5), GST_PLAY_FLAG_NATIVE_VIDEO = (1 << 6), - GST_PLAY_FLAG_DOWNLOAD = (1 << 7) + GST_PLAY_FLAG_DOWNLOAD = (1 << 7), + GST_PLAY_FLAG_BUFFERING = (1 << 8) } GstPlayFlags; #define GST_TYPE_PLAY_FLAGS (gst_play_flags_get_type()) diff --git a/gst/playback/gstplaybin2.c b/gst/playback/gstplaybin2.c index 04a3924391..a405c78bb9 100644 --- a/gst/playback/gstplaybin2.c +++ b/gst/playback/gstplaybin2.c @@ -2600,6 +2600,7 @@ activate_group (GstPlayBin * playbin, GstSourceGroup * group, GstState target) { GstElement *uridecodebin; GstElement *suburidecodebin = NULL; + GstPlayFlags flags; g_return_val_if_fail (group->valid, FALSE); g_return_val_if_fail (!group->active, FALSE); @@ -2624,14 +2625,26 @@ activate_group (GstPlayBin * playbin, GstSourceGroup * group, GstState target) /* configure connection speed */ g_object_set (uridecodebin, "connection-speed", playbin->connection_speed / 1000, NULL); - if (gst_play_sink_get_flags (playbin->playsink) & GST_PLAY_FLAG_DOWNLOAD) + + flags = gst_play_sink_get_flags (playbin->playsink); + + /* configure download buffering */ + if (flags & GST_PLAY_FLAG_DOWNLOAD) g_object_set (uridecodebin, "download", TRUE, NULL); else g_object_set (uridecodebin, "download", FALSE, NULL); + + /* configure subtitle encoding */ g_object_set (uridecodebin, "subtitle-encoding", playbin->encoding, NULL); /* configure uri */ g_object_set (uridecodebin, "uri", group->uri, NULL); + /* configure buffering of demuxed/parsed data */ + if (flags & GST_PLAY_FLAG_BUFFERING) + g_object_set (uridecodebin, "use-buffering", TRUE, NULL); + else + g_object_set (uridecodebin, "use-buffering", FALSE, NULL); + /* configure buffering parameters */ g_object_set (uridecodebin, "buffer-duration", playbin->buffer_duration, NULL); g_object_set (uridecodebin, "buffer-size", playbin->buffer_size, NULL);