GNOME Bugzilla – Bug 626152
[playbin2] add "source-setup" signal
Last modified: 2011-02-24 19:50:00 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.
Or we could document that notify::source better. Should there be a difference between notify::source and configure-source?
> 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 ;)
Well, I don't know if this is really necessary so let's see what others think about this :)
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.
Ok, so let's not add new API but improve the docs?
Tim?
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*.
Reopening as I think the requested information has been provided.
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
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