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 322911 - [docs] [ADM] uses non existant gst_init_get_popt_table
[docs] [ADM] uses non existant gst_init_get_popt_table
Status: RESOLVED FIXED
Product: GStreamer
Classification: Platform
Component: documentation
0.9.6
Other All
: Normal minor
: 0.10.2
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2005-12-01 10:07 UTC by Nils Rennebarth
Modified: 2006-01-13 19:19 UTC
See Also:
GNOME target: ---
GNOME version: 2.7/2.8



Description Nils Rennebarth 2005-12-01 10:07:10 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:
Comment 1 Tim-Philipp Müller 2005-12-11 18:42:58 UTC
Care to write a patch? :-)
Comment 2 Nils Rennebarth 2005-12-12 19:40:43 UTC
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.
Comment 3 Tim-Philipp Müller 2005-12-13 15:15:27 UTC
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

                      
Comment 4 Nils Rennebarth 2005-12-14 20:06:16 UTC
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 :-)
Comment 5 Tim-Philipp Müller 2006-01-05 10:08:23 UTC
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?
Comment 6 Tim-Philipp Müller 2006-01-13 19:19:32 UTC
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.