summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPhilippe Normand <philn@igalia.com>2013-03-28 14:21:41 +0100
committerSebastian Dröge <sebastian.droege@collabora.co.uk>2013-04-16 16:47:28 +0200
commit26fb72cf6577494fed4c00ecba2ad4d746d0caf5 (patch)
tree04512fc7f8cc2da07deaca66650d97e779e21359
parentdbbcdf901c4b91e773373aae4ab2c4373caffd6d (diff)
uridecodebin: query bandwidth capability to source element
Use a scheduling query to check if the source element has some bandwidth limitations. If this is the case on-disk buffering might be used. If the source element doesn't handle the scheduling query then fallback to checking the URI protocol against the hardcoded list of protocols known to handle buffering already. Fixes bug 693484.
-rw-r--r--gst/playback/gsturidecodebin.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/gst/playback/gsturidecodebin.c b/gst/playback/gsturidecodebin.c
index b039db646..34468dc16 100644
--- a/gst/playback/gsturidecodebin.c
+++ b/gst/playback/gsturidecodebin.c
@@ -1253,6 +1253,8 @@ gen_source_element (GstURIDecodeBin * decoder)
GObjectClass *source_class;
GstElement *source;
GParamSpec *pspec;
+ GstQuery *query;
+ GstSchedulingFlags flags;
if (!decoder->uri)
goto no_uri;
@@ -1272,7 +1274,14 @@ gen_source_element (GstURIDecodeBin * decoder)
GST_LOG_OBJECT (decoder, "found source type %s", G_OBJECT_TYPE_NAME (source));
- decoder->is_stream = IS_STREAM_URI (decoder->uri);
+ query = gst_query_new_scheduling ();
+ if (gst_element_query (source, query)) {
+ gst_query_parse_scheduling (query, &flags, NULL, NULL, NULL);
+ decoder->is_stream = flags & GST_SCHEDULING_FLAG_BANDWIDTH_LIMITED;
+ } else
+ decoder->is_stream = IS_STREAM_URI (decoder->uri);
+ gst_query_unref (query);
+
GST_LOG_OBJECT (decoder, "source is stream: %d", decoder->is_stream);
decoder->need_queue = IS_QUEUE_URI (decoder->uri);