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 640811 - discoverer async api does not work (as expected)
discoverer async api does not work (as expected)
Status: RESOLVED OBSOLETE
Product: GStreamer
Classification: Platform
Component: gst-plugins-base
unspecified
Other Linux
: Normal normal
: git master
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2011-01-28 10:54 UTC by Stefan Sauer (gstreamer, gtkdoc dev)
Modified: 2018-05-04 11:36 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
don't start discoverer when adding uris (1.10 KB, patch)
2011-04-05 14:17 UTC, Stefan Sauer (gstreamer, gtkdoc dev)
none Details | Review

Description Stefan Sauer (gstreamer, gtkdoc dev) 2011-01-28 10:54:12 UTC
I have switched from using the sync API to the async API in discoverer. I have a file-browser in in the selection callback I start discovering the selected file.

When I do it like this:
gst_discoverer_stop (self->priv->dc);
gst_discoverer_discover_uri_async (self->priv->dc, uri);
gst_discoverer_start (self->priv->dc);

_discover_uri_async() starts discovering immediately, it does not emit the ::discovered() signal and _start() blocks.

Using the API like this works, but is not obvious for me:
gst_discoverer_stop (self->priv->dc);
gst_discoverer_start (self->priv->dc);
gst_discoverer_discover_uri_async (self->priv->dc, uri);

Two goals for this bug:
- clarify the docs
- ensure it does not hang.

I am not sure whats the intention of the "can_run" in _discover_uri_async(). If I ensure that _discover_uri_async() won't call _start() everything is fine.
Comment 1 Bastien Nocera 2011-04-03 18:20:28 UTC
I saw the same problem using gstreamer-plugins-base-0.10.32-1.fc15.x86_64.

It did not hang though, but there was no discovery done whatsoever.
Comment 2 Stefan Sauer (gstreamer, gtkdoc dev) 2011-04-05 14:17:19 UTC
Created attachment 185199 [details] [review]
don't start discoverer when adding uris
Comment 3 Stefan Sauer (gstreamer, gtkdoc dev) 2011-04-05 14:34:28 UTC
Okay, from the gst-discoverer tool I seem to understand the intendet use of the API in the async mode.

One should:
- run the discoverer
- when the mainloop runs, call gst_discoverer_discover_uri_async() for one or more files
- stop the discoverer when done or otherwise desired

The not so obvious part is that gst_discoverer_discover_uri_async() will start the discoverer if it wasn't running and the list of uris was empty.

Shall we just document that or change the implict bahaviour?
Comment 4 Stefan Sauer (gstreamer, gtkdoc dev) 2011-04-05 15:30:16 UTC
I started adding unit test for discoverer as well, lets hope Edward can clarify his intent here.
Comment 5 Edward Hervey 2018-05-04 11:36:28 UTC
It does work that way now. Must have been fixed in the past 7 years.