After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 693484 - uridecodebin: query URI to source element and fallback to decoder's URI
uridecodebin: query URI to source element and fallback to decoder's URI
Status: RESOLVED FIXED
Product: GStreamer
Classification: Platform
Component: gst-plugins-base
git master
Other Linux
: Normal enhancement
: 1.1.1
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2013-02-09 17:25 UTC by Philippe Normand
Modified: 2013-04-16 14:55 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
uridecodebin: query URI to source element and fallback to decoder's URI (2.48 KB, patch)
2013-02-09 17:31 UTC, Philippe Normand
none Details | Review
query: new _NEEDS_BUFFERING flag (3.16 KB, patch)
2013-03-28 13:29 UTC, Philippe Normand
none Details | Review
uridecodebin: query buffering capability to source element (1.56 KB, patch)
2013-03-28 13:29 UTC, Philippe Normand
none Details | Review
query: new _BANDWIDTH_LIMITED flag (3.28 KB, patch)
2013-03-29 14:00 UTC, Philippe Normand
none Details | Review
query: new _BANDWIDTH_LIMITED flag (3.28 KB, patch)
2013-03-29 14:02 UTC, Philippe Normand
needs-work Details | Review
uridecodebin: query buffering capability to source element (1.56 KB, patch)
2013-03-29 14:06 UTC, Philippe Normand
none Details | Review
uridecodebin: query bandwidth capability to source element (1.71 KB, patch)
2013-03-29 14:13 UTC, Philippe Normand
committed Details | Review
query: new _BANDWIDTH_LIMITED flag (3.40 KB, patch)
2013-03-30 10:28 UTC, Philippe Normand
committed Details | Review
souphttpsrc: basic scheduling query support (1.02 KB, patch)
2013-03-31 10:10 UTC, Philippe Normand
committed Details | Review

Description Philippe Normand 2013-02-09 17:25:33 UTC
In the gen_source_element() function various tests are done on the URI used to create the source element. In the case where the source element handles http-like URIs (example webkit+http://...) this breaks on-disk buffering at least because in that case decoder->is_stream is set to FALSE even though the source element is capable of handling on-disk buffering with downstream elements.

We should query the URI really used by the source element and fallback to using decoder->uri.
Comment 1 Philippe Normand 2013-02-09 17:31:33 UTC
Created attachment 235592 [details] [review]
uridecodebin: query URI to source element and fallback to decoder's URI

The source element created in gen_source_element() might be able to
provide streamable data even though its advertised URI scheme is not
in the list of protocols known by uridecodebin to support this
feature. To cope with this special case, query the URI to the newly
created source element and fallback to the URI already known by the
decoder.

Fixes bug 693484.
Comment 2 Sebastian Dröge (slomo) 2013-02-11 11:37:13 UTC
Or maybe do something with the SCHEDULING query here instead, by maybe adding more information to it if there's not enough information in the query yet.
Comment 3 Philippe Normand 2013-03-28 13:29:36 UTC
Created attachment 240050 [details] [review]
query: new _NEEDS_BUFFERING flag

Source elements 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
Comment 4 Philippe Normand 2013-03-28 13:29:52 UTC
Created attachment 240051 [details] [review]
uridecodebin: query buffering capability to source element

If the source element doesn't handle the query fallback to checking
the URI protocol against the hardcoded list of protocols known to
handle buffering already.

Fixes bug 693484.
Comment 5 Sebastian Dröge (slomo) 2013-03-28 15:19:14 UTC
Looks good but should probably be implemented in souphttpsrc and others :)
Comment 6 Wim Taymans 2013-03-28 15:33:19 UTC
NEEDS_BUFFERING sounds rather specific. I think you want to say that the source is likely going to provide data slower than real-time (in which case you might want to do some buffering).
Comment 7 Sebastian Dröge (slomo) 2013-03-29 09:31:36 UTC
Ok, some suggestions for the name:

BANDWIDTH_LIMITED
SPEED_LIMITED
MIGHT_BE_SLOW
HTTPISH
SLOWER_THAN_REALTIME

or something along those lines. I currently prefer the first two
Comment 8 Philippe Normand 2013-03-29 14:00:03 UTC
Created attachment 240117 [details] [review]
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
Comment 9 Philippe Normand 2013-03-29 14:02:58 UTC
Created attachment 240118 [details] [review]
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
Comment 10 Philippe Normand 2013-03-29 14:06:34 UTC
Created attachment 240119 [details] [review]
uridecodebin: query buffering capability to source element

If the source element doesn't handle the query fallback to checking
the URI protocol against the hardcoded list of protocols known to
handle buffering already.

Fixes bug 693484.
Comment 11 Tim-Philipp Müller 2013-03-29 14:10:10 UTC
Not that I have any better suggestion, but arguably external USB drives are also bandwidth limited, for example ;)
Comment 12 Philippe Normand 2013-03-29 14:13:43 UTC
Created attachment 240121 [details] [review]
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.
Comment 13 Sebastian Dröge (slomo) 2013-03-30 07:20:22 UTC
(In reply to comment #11)
> Not that I have any better suggestion, but arguably external USB drives are
> also bandwidth limited, for example ;)

Strictly speaking everything is bandwidth limited ;) But if you for example play from a very slow drive (floppy disk? :) ) you might want to do buffering too
Comment 14 Sebastian Dröge (slomo) 2013-03-30 07:22:46 UTC
Review of attachment 240118 [details] [review]:

::: docs/design/part-scheduling.txt
@@ +87,3 @@
+         downstream element might ask for more data than necessary for
+         normal playback. This use-case is interesting for on-disk
+         buffering scenarios for instance.

Maybe also add here that you probably don't want to seek as much as on other sources :)

::: win32/common/gstenumtypes.c
@@ +1464,3 @@
+    {C_FLAGS (GST_SCHEDULING_FLAG_NEEDS_BUFFERING),
+          "GST_SCHEDULING_FLAG_BANDWIDTH_LIMITED",
+        "bandwidth-limited"},

This is outdated
Comment 15 Philippe Normand 2013-03-30 10:28:46 UTC
Created attachment 240157 [details] [review]
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
Comment 16 Philippe Normand 2013-03-31 10:10:15 UTC
Created attachment 240194 [details] [review]
souphttpsrc: basic scheduling query support

Answer to scheduling queries with default parameters and the new
_BANDWIDTH_LIMITED_FLAG so that downstream is advised to minimize seek
operations and perform on-disk buffering if possible.

Bug 693484
Comment 17 Sebastian Dröge (slomo) 2013-04-16 14:55:47 UTC
commit 54c678a21ec65d5d4aa82ed18116b1ee9624a5e8
Author: Philippe Normand <philn@igalia.com>
Date:   Fri Mar 29 14:56:57 2013 +0100

    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

commit b857cb38ddb63af8ba745c10bece8f1b528af4fe
Author: Philippe Normand <philn@igalia.com>
Date:   Sun Mar 31 12:05:49 2013 +0200

    souphttpsrc: basic scheduling query support
    
    Answer to scheduling queries with default parameters and the new
    _BANDWIDTH_LIMITED_FLAG so that downstream is advised to minimize seek
    operations and perform on-disk buffering if possible.
    
    Bug 693484

commit 26fb72cf6577494fed4c00ecba2ad4d746d0caf5
Author: Philippe Normand <philn@igalia.com>
Date:   Thu Mar 28 14:21:41 2013 +0100

    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.