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 626152 - [playbin2] add "source-setup" signal
[playbin2] add "source-setup" signal
Status: RESOLVED FIXED
Product: GStreamer
Classification: Platform
Component: gst-plugins-base
git master
Other Linux
: Normal enhancement
: 0.10.33
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2010-08-05 22:31 UTC by Tim-Philipp Müller
Modified: 2011-02-24 19:50 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Tim-Philipp Müller 2010-08-05 22:31:22 UTC
Currently applications have to connect to the "notify::source" signal and then retrieve the source via g_object_get() to configure the source element in playbin2.

This is not very nice, not very discoverable, and generally seems to confuse people (trying to g_object_set() back the source later etc.).

I wonder if we should just add a "configure-source" signal, which would be both more convenient and more discoverable.

I can whip up a patch if people agree this seems a good idea.
Comment 1 Sebastian Dröge (slomo) 2010-08-06 09:49:54 UTC
Or we could document that notify::source better.

Should there be a difference between notify::source and configure-source?
Comment 2 Tim-Philipp Müller 2010-08-06 09:58:11 UTC
> Should there be a difference between notify::source and configure-source?

No, but we could pass the source object in the callback, so that the app doesn't have to retrieve it, which is more convenient ;)
Comment 3 Sebastian Dröge (slomo) 2010-08-06 17:47:38 UTC
Well, I don't know if this is really necessary so let's see what others think about this :)
Comment 4 Stefan Sauer (gstreamer, gtkdoc dev) 2010-08-12 12:18:05 UTC
GObject needs a "notify-value" signal that added the gvalue to the callback parameters. I slightly tend to prefer an example in the docs instead of extra code.
Comment 5 Sebastian Dröge (slomo) 2010-08-19 12:57:28 UTC
Ok, so let's not add new API but improve the docs?
Comment 6 Sebastian Dröge (slomo) 2010-09-21 17:32:49 UTC
Tim?
Comment 7 Tim-Philipp Müller 2010-09-21 17:38:46 UTC
Well, I still think your guys are wrong and that no amount of documentation is going to make things as obvious, discoverable and easy-to-use as a "configure-source" signal (less code, no need to figure out that a g_object_get() on the "source" property is needed, no need to look up the callback signature for the notify signal etc.). This notify::foo stuff is just horrible from an API point of view.

But I guess I have been outvoted, so feel free to close this *shrug*.
Comment 8 Tobias Mueller 2011-02-11 12:31:32 UTC
Reopening as I think the requested information has been provided.
Comment 9 Tim-Philipp Müller 2011-02-11 13:43:56 UTC
Thanks, I still intend to add this, but with a different name:

08-10-2010 18:35:05 <tim> wtay^, do you have a naming preference for the "configure-source" signal I'd like to add to playbin2? It sounds a bit like an action signal, but "source-configure", "source-ready" or so just seem awkward..
08-10-2010 18:35:56 <wim>: source-added ?
08-10-2010 18:36:16 <wim>: source-created
08-10-2010 18:36:26 <wim>: configure-source is not so good IMO
08-10-2010 18:36:38 <tim>: source-created maybe
08-10-2010 18:37:00 <tim>: still doesn't make it clear that that's for setting up the source though
08-10-2010 18:38:06 <tim>: source-setup?
08-10-2010 18:38:46 <wim>: well, it's like pad-added, the pad is added and you can do stuff with it
08-10-2010 18:39:28 <wim>: source-configure doesn't sound too bad
08-10-2010 18:39:44 <wim>: source-setup neither
08-10-2010 18:40:52 <tim>: ok, I'll flip a coin, thanks
Comment 10 Tim-Philipp Müller 2011-02-24 19:50:00 UTC
commit 2835a9e45c6d9a7a3a9339aba65e3fc319535a50
Author: Tim-Philipp Müller <tim.muller@collabora.co.uk>
Date:   Tue Feb 22 14:54:55 2011 +0000

    checks: add a simple unit test for the source-setup signal

commit c48c193b56480d286935a6d97071ad8caa19b99e
Author: Tim-Philipp Müller <tim.muller@collabora.co.uk>
Date:   Tue Feb 22 12:56:48 2011 +0000

    playbin2, uridecodebin: add "source-setup" signal
    
    Add "source-setup" signal for convenience and discoverability. No need
    to figure out "notify::source", look up the notify callback signature,
    then do an g_object_get() to get the source element..
    
    https://bugzilla.gnome.org/show_bug.cgi?id=626152