mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-28 04:31:06 +00:00
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.
This commit is contained in:
parent
dbbcdf901c
commit
26fb72cf65
1 changed files with 10 additions and 1 deletions
|
@ -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);
|
||||
|
|
Loading…
Reference in a new issue