Re: gstreamermm option group does not init



At Wed, 18 Jun 2008 00:02:48 -0400,
José Alburquerque <jaalburquerque cox net> wrote:
> 
> Marcus Brinkmann wrote:
> > Hi,
> >
> > maybe I am doing something wrong, but if gstreamermm is used with
> > gtkmm and with option groups instead of calling Gst::init directly,
> > the library does not seem to get properly initialized (while a
> > comparable C program works).
> >
> >   
> 
> Could you provide short equivalent C and C++ examples so that I can see 
> better where the problems are?  Thanks.

It is my understanding that using the Gst option group together with
glib's option parser will automatically cause all necessary
initialization in Gst.  This is what the documentation of the
get_option_group method says and it is also necessary as there is no
init() method that does not take argc/argv arguments.

Note that the C++ program works correctly if I insert a call to
Gst::init() with dummy arguments.  I would guess that the wrapper of
get_option_group() fails to call an initialization routing of the
gstreamermm bindings layer or something.

The core of the complete example I provided is this:

  Glib::OptionGroup m_GstOptiongroup = Gst::get_option_group();
  m_OptionContext.add_group(m_GstOptiongroup);

  Gtk::Main *kit = new Gtk::Main (argc, argv, m_OptionContext);

This should implicitely do whatever Gst::init() does as well.  In
particular, it should register the type wrappers and what not.

In C, the core of a corresponding working example is something like
this:

  GOptionContext *option_context;
  GnomeProgram *program;

  g_option_context_add_group (option_context, gst_init_get_option_group ());
  program = gnome_program_init (PACKAGE, VERSION, LIBGNOMEUI_MODULE, argc, argv,
                                GNOME_PARAM_HUMAN_READABLE_NAME, PACKAGE_PRETTY,
                                GNOME_PARAM_GOPTION_CONTEXT, option_context,
                                NULL);

The C program does not call gst_init or friends.  This works just fine.

Thanks,
Marcus



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]