GNOME Bugzilla – Bug 322911
[docs] [ADM] uses non existant gst_init_get_popt_table
Last modified: 2006-01-13 19:19:32 UTC
Documentation bug Section: section 23.2, Gnome Integration It uses gst_init_get_popt_table to integrate GStreamer with local options Correct version: It should use gst_init_get_option_group() together with g_option_context_parse as mentioned in the Gst section of the Core Reference Manual Other information:
Care to write a patch? :-)
Unfortunately it uses gnome_program_init which itself does not yet support GOptions. The next 2.13/2.14 release will support G_OPTION_CONTEXT but we need to wait for it. In the meantime, we might just talk about integration in gtk programs using gtk_get_option_group. I could provide an example for *that* if you are interested.
I'd say let's just provide an example for 2.13/2.14 and mention that it's 2.14 only, after all, gnome-integrated apps that use GStreamer 0.10 will most likely target gnome 2.14 anyway. Does this look alright then? GOptionContext *ctx; GOptionGroup *group; ctx = g_option_context_new ("my-gnome-app"); g_option_context_add_group (ctx, gst_init_get_option_group ()); gnome_program_init ("my-gnome-app", "0.0.1", LIBGNOMEUI_MODULE, argc, argv, GNOME_PARAM_GOPTION_CONTEXT, ctx, NULL); ? Cheers -Tim
Yes, although I would add the arguments GNOME_PARAM_ENABLE_SOUND, FALSE for gstreamer applications, to block sounds which might come from the currently installed theme. ALSA might cope with it, but I heard from hangs with OSS. The option was introduced after a bug report coming from the author of a gstreamer application :-)
Do you happen to know how one would access any remaining non-option arguments passed on the command line (e.g. filenames of files to open or so)? It seems gnome_program_init() does the option parsing, but given that we only pass argc, argv to gnome_program_init() instead of &argc, &argv and the argv[] is copied anyway within gnome-program.c, how do we get the remaining arguments?
Fixed in CVS, thanks for the report! 2006-01-13 Tim-Philipp Muller <tim at centricular dot net> * docs/manual/appendix-integration.xml: Update GNOME integration section to use gst_init_get_option_group() instead of the old popt stuff (#322911). Also, GNOME applications should now use gconf*sink and gconf*src instead of the old gconf helper lib we had.