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 171202 - [0.9] Get rid of queries?
[0.9] Get rid of queries?
Status: RESOLVED OBSOLETE
Product: GStreamer
Classification: Platform
Component: gstreamer (core)
git master
Other Linux
: Normal normal
: NONE
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2005-03-22 12:17 UTC by Tim-Philipp Müller
Modified: 2005-08-29 15:10 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Tim-Philipp Müller 2005-03-22 12:17:48 UTC
Do we really need queries?

They are a pain to use for application programmers (constant polling required),
like in the case of length and position queries, and a pain to implement
properly for plugin writers.

It would be nice if there was some push/event-based mechanism available for this
kind of stuff.

Cheers
 -Tim
Comment 1 Ronald Bultje 2005-03-22 12:25:38 UTC
I know Benjamin will hug you right now, but let's face one thing: queries may
suck for applications, but they totally rock for peer elements. Thread safety
and scheduler suckiness aside, they do actually work. Even across a queue.
Comment 2 Benjamin Otte (Company) 2005-03-22 12:37:24 UTC
I don't know of a single non-hack solution where queries are used. In fact I can
only come up with the oggdemux hack of using queries in the hope that the peer
element is one of our own elements.
Comment 3 Tim-Philipp Müller 2005-03-31 12:56:10 UTC
Just out of curiosity, I've grepped the gstreamer core and gst-plugins code for
queries that are not GST_QUERY_POSITION or GST_QUERY_TOTAL (those could be done
with buffers or events instead of with queries IMHO). 

Results:

 - GST_QUERY_LATENCY:
   Only implemented by osssink and alsasink. Could be replaced with
   a canonically named property, or a message on the new bus or so,
   if it is needed at all (is it?)

 - GST_QUERY_JITTER:
   Not used anywhere

 - GST_QUERY_START and GST_QUERY_SEGMENT_END:
   There are two elements where this is used: fakesrc and cdparanoia
   (cdaudio claims to support this but the query function doesn't
   implement it). In the cdparanoia case this stuff can be ditched
   altogether IMHO, which leaves fakesrc. 

 - GST_QUERY_RATE:
   Not used anywhere

Similarly, grepping for gst_query_type_register() also doesn't yield any results.

It seems to me that only GST_QUERY_TOTAL and GST_QUERY_POSITION are really used
and useful in the real world - am I missing something? 

Cheers
 -Tim
Comment 4 Ronald Bultje 2005-03-31 13:35:58 UTC
I have a custom query-type 'cache' locally, which gets the contents of queue.
Using properties instead of queries is totally not-done, properties are for
user-settable and interesting things such as a bitrate or so, not for technical
stuff that the app should display right in the primary display.

If you've got a better way than queries and it's not properties, I'm fine with
it. ;).