query: new _BANDWIDTH_LIMITED flag
authorPhilippe Normand <philn@igalia.com>
Fri, 29 Mar 2013 13:56:57 +0000 (14:56 +0100)
committerSebastian Dröge <sebastian.droege@collabora.co.uk>
Tue, 16 Apr 2013 14:52:08 +0000 (16:52 +0200)
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
gst/gstquery.h
win32/common/gstenumtypes.c

index a4fbdb7..c1dd331 100644 (file)
@@ -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
 
index c8eb6f9..57a9c06 100644 (file)
@@ -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;
index 9e04f58..a7c0493 100644 (file)
@@ -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}
   };