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 562949 - [API] Add an URI query type for querying the source/sink URI
[API] Add an URI query type for querying the source/sink URI
Status: RESOLVED FIXED
Product: GStreamer
Classification: Platform
Component: gstreamer (core)
git master
Other Linux
: Normal enhancement
: 0.10.22
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2008-12-02 09:45 UTC by Sebastian Dröge (slomo)
Modified: 2008-12-20 17:38 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
gstquery-uri.patch (5.47 KB, patch)
2008-12-02 09:47 UTC, Sebastian Dröge (slomo)
none Details | Review
gstquery-uri-implementation.patch (4.93 KB, patch)
2008-12-02 09:47 UTC, Sebastian Dröge (slomo)
committed Details | Review
gstquery-uri.patch (5.49 KB, patch)
2008-12-02 10:00 UTC, Sebastian Dröge (slomo)
committed Details | Review
gstquery-uri-implementation-base.patch (5.44 KB, patch)
2008-12-02 10:05 UTC, Sebastian Dröge (slomo)
committed Details | Review

Description Sebastian Dröge (slomo) 2008-12-02 09:45:53 UTC
Hi,
the attached patch adds an URI query type and some functions to handle them.

This query will be implemented by sinks/sources to query the current URI and will be used for example by demuxers for formats that can reference other files to get the current URI and create a new src pipeline with the URI of the referenced other file.

The second patch adds this to filesrc/filesink/fdsrc/fdsink
Comment 1 Sebastian Dröge (slomo) 2008-12-02 09:47:18 UTC
Created attachment 123777 [details] [review]
gstquery-uri.patch
Comment 2 Sebastian Dröge (slomo) 2008-12-02 09:47:38 UTC
Created attachment 123778 [details] [review]
gstquery-uri-implementation.patch
Comment 3 Sebastian Dröge (slomo) 2008-12-02 10:00:09 UTC
Created attachment 123779 [details] [review]
gstquery-uri.patch

Add const qualifier to the URI parameter of gst_query_set_uri()
Comment 4 Sebastian Dröge (slomo) 2008-12-02 10:05:26 UTC
Created attachment 123782 [details] [review]
gstquery-uri-implementation-base.patch

Implementation for gio and gnomevfs.
Comment 5 Tim-Philipp Müller 2008-12-02 11:42:48 UTC
 - what would the semantics of the query be when done
   as element query on the top-level pipeline? (Pass on
   to most source-like element? Don't support at all?)

 - maybe add an gst_uri_is_valid guard to _set_uri?


Comment 6 Sebastian Dröge (slomo) 2008-12-02 12:23:10 UTC
(In reply to comment #5)
>  - what would the semantics of the query be when done
>    as element query on the top-level pipeline? (Pass on
>    to most source-like element? Don't support at all?)

How do we handle position or duration query in that case? Pass on to the most sink-like element?

Well, passing it to the most source-like element sounds good IMHO

>  - maybe add an gst_uri_is_valid guard to _set_uri?

Good point, I'll add that before committing.
Comment 7 Sebastian Dröge (slomo) 2008-12-02 13:40:03 UTC
(In reply to comment #6)
> (In reply to comment #5)
> >  - what would the semantics of the query be when done
> >    as element query on the top-level pipeline? (Pass on
> >    to most source-like element? Don't support at all?)
> 
> How do we handle position or duration query in that case? Pass on to the most
> sink-like element?
> 
> Well, passing it to the most source-like element sounds good IMHO

Thinking about it a bit more it's probably better to not handle this case.

This query is mostly useful from elements inside a pipeline where the query is then sent upstream or downstream, depending on the pad where it was received until some element is reached that can answer the query or return FALSE.

The semantic should probably be to send this query upstream or downstream, depending on receiving pad until it reaches an element that can answer the query. Sending directly to an element should give the URI if the element has one and return FALSE otherwise (and not forward anywhere).

What do you think?
Comment 8 Wim Taymans 2008-12-02 16:07:27 UTC
This query should travel upstream. when executed from the app it should be sent to the sinks.
Comment 9 Sebastian Dröge (slomo) 2008-12-04 07:54:46 UTC
(In reply to comment #8)
> This query should travel upstream. when executed from the app it should be sent
> to the sinks.

But this would mean, that we restrict the query to the URI of the source(s) and that it can't be used to query the sink location
Comment 10 Tim-Philipp Müller 2008-12-04 09:36:03 UTC
It also assumes that there's only one result, so maybe we should just make gst_element_query() return FALSE by default for now (and elements like playbin can then override that if they want to). I don't think this is a blocker in any case, was just wondering how it would work in that case.
Comment 11 Wim Taymans 2008-12-08 13:08:35 UTC
I think that when the app does a query on the pipeline it would be most interested in the uri of the source. I'm just talking about the default behaviour of the URI query, the query can still go downstream because a query is never restricted to one direction only.
Comment 12 Sebastian Dröge (slomo) 2008-12-08 13:34:09 UTC
Ok, shall I commit the patches then (+ the valid URI check)?
Comment 13 Sebastian Dröge (slomo) 2008-12-19 09:51:05 UTC
Well, I'll commit them later ;)
Comment 14 Sebastian Dröge (slomo) 2008-12-20 17:38:22 UTC
2008-12-20  Sebastian Dröge  <sebastian.droege@collabora.co.uk>

        * docs/gst/gstreamer-sections.txt:
        * gst/gstquark.c:
        * gst/gstquark.h:
        * gst/gstquery.c: (gst_query_new_uri), (gst_query_set_uri),
        (gst_query_parse_uri):
        * gst/gstquery.h:
        API: Add URI query type. This is useful to query the URI
        of a sink/source element and can be used by demuxers that
        need to get data from other files.
        This query should go upstream by default.
        Fixes bug #562949.
        * plugins/elements/gstfdsink.c: (gst_fd_sink_query):
        * plugins/elements/gstfdsrc.c: (gst_fd_src_class_init),
        (gst_fd_src_query):
        * plugins/elements/gstfilesink.c: (gst_file_sink_query):
        * plugins/elements/gstfilesrc.c: (gst_file_src_class_init),
        (gst_file_src_query):
        Implement URI query.


2008-12-20  Sebastian Dröge  <sebastian.droege@collabora.co.uk>

        * ext/gio/gstgiobasesink.c: (gst_gio_base_sink_query):
        * ext/gio/gstgiobasesrc.c: (gst_gio_base_src_class_init),
        (gst_gio_base_src_query):
        * ext/gnomevfs/gstgnomevfssink.c: (gst_gnome_vfs_sink_query):
        * ext/gnomevfs/gstgnomevfssrc.c: (gst_gnome_vfs_src_class_init),
        (gst_gnome_vfs_src_query):
        Implement URI query. Fixes bug #562949.