From 54c678a21ec65d5d4aa82ed18116b1ee9624a5e8 Mon Sep 17 00:00:00 2001 From: Philippe Normand Date: Fri, 29 Mar 2013 14:56:57 +0100 Subject: [PATCH] query: new _BANDWIDTH_LIMITED flag Source elements with limited bandwidth capabilities and supporting buffering for downstream elements should set this flag when answering a scheduling query. This is useful for the on-disk buffering scenario of uridecodebin to avoid checking the URI protocol against a list of hardcoded protocols. Bug 693484 --- docs/design/part-scheduling.txt | 14 ++++++++++++-- gst/gstquery.h | 6 ++++-- win32/common/gstenumtypes.c | 3 +++ 3 files changed, 19 insertions(+), 4 deletions(-) diff --git a/docs/design/part-scheduling.txt b/docs/design/part-scheduling.txt index a4fbdb7968..c1dd331931 100644 --- a/docs/design/part-scheduling.txt +++ b/docs/design/part-scheduling.txt @@ -67,8 +67,9 @@ this with the SCHEDULING query. (out) "flags", GST_TYPE_SCHEDULING_FLAGS (default 0) typedef enum { - GST_SCHEDULING_FLAG_SEEKABLE = (1 << 0), - GST_SCHEDULING_FLAG_SEQUENTIAL = (1 << 1) + GST_SCHEDULING_FLAG_SEEKABLE = (1 << 0), + GST_SCHEDULING_FLAG_SEQUENTIAL = (1 << 1), + GST_SCHEDULING_FLAG_BANDWIDTH_LIMITED = (1 << 2) } GstSchedulingFlags; _SEEKABLE: @@ -80,6 +81,15 @@ this with the SCHEDULING query. seeks are allowed but should be avoided. This is common for network streams. + _BANDWIDTH_LIMITED: + - suggest the element supports buffering data for downstream to + cope with bandwidth limitations. If this flag is on the + downstream element might ask for more data than necessary for + normal playback. This use-case is interesting for on-disk + buffering scenarios for instance. Seek operations might be + slow as well so downstream elements should take this into + consideration. + (out) "minsize", G_TYPE_INT (default 1) - the suggested minimum size of pull requests diff --git a/gst/gstquery.h b/gst/gstquery.h index c8eb6f95d6..57a9c0622d 100644 --- a/gst/gstquery.h +++ b/gst/gstquery.h @@ -442,12 +442,14 @@ gboolean gst_query_find_allocation_meta (GstQuery *query, GType api * GstSchedulingFlags: * @GST_SCHEDULING_FLAG_SEEKABLE: if seeking is possible * @GST_SCHEDULING_FLAG_SEQUENTIAL: if sequential access is recommended + * @GST_SCHEDULING_FLAG_BANDWIDTH_LIMITED: if bandwidth is limited and buffering possible * * The different scheduling flags. */ typedef enum { - GST_SCHEDULING_FLAG_SEEKABLE = (1 << 0), - GST_SCHEDULING_FLAG_SEQUENTIAL = (1 << 1) + GST_SCHEDULING_FLAG_SEEKABLE = (1 << 0), + GST_SCHEDULING_FLAG_SEQUENTIAL = (1 << 1), + GST_SCHEDULING_FLAG_BANDWIDTH_LIMITED = (1 << 2) } GstSchedulingFlags; GstQuery * gst_query_new_scheduling (void) G_GNUC_MALLOC; diff --git a/win32/common/gstenumtypes.c b/win32/common/gstenumtypes.c index 9e04f5883e..a7c04930bb 100644 --- a/win32/common/gstenumtypes.c +++ b/win32/common/gstenumtypes.c @@ -1461,6 +1461,9 @@ gst_scheduling_flags_get_type (void) "seekable"}, {C_FLAGS (GST_SCHEDULING_FLAG_SEQUENTIAL), "GST_SCHEDULING_FLAG_SEQUENTIAL", "sequential"}, + {C_FLAGS (GST_SCHEDULING_FLAG_BANDWIDTH_LIMITED), + "GST_SCHEDULING_FLAG_BANDWIDTH_LIMITED", + "bandwidth-limited"}, {0, NULL, NULL} };