mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-02-22 05:56:31 +00:00
playbin2: add flag to enable decodebin buffering
Add a flag that enables buffering in decodebin.
This commit is contained in:
parent
f998858192
commit
660fc111d1
3 changed files with 19 additions and 2 deletions
|
@ -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);
|
||||
|
|
|
@ -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())
|
||||
|
|
|
@ -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);
|
||||
|
|
Loading…
Reference in a new issue