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 539059 - Gst::get_option_group does not cause Gst::wrap_init to be called
Gst::get_option_group does not cause Gst::wrap_init to be called
Status: RESOLVED FIXED
Product: gstreamermm
Classification: Bindings
Component: general
git master
Other All
: Normal normal
: ---
Assigned To: gtkmm-forge
gtkmm-forge
Depends on:
Blocks:
 
 
Reported: 2008-06-19 02:31 UTC by Marcus Brinkmann
Modified: 2011-01-16 23:37 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Example program exhibiting the problem. (3.64 KB, text/plain)
2008-06-19 02:32 UTC, Marcus Brinkmann
Details

Description Marcus Brinkmann 2008-06-19 02:31:26 UTC
Please describe the problem:
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.

However, from looking at gstreamermm/gstreamer/gstreamermm/init.cc, Gst::wrap_init is never called if the get_option_group approach is used.

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

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


Actual results:
Error messages like this when utilizing gstreamermm:

(lt-mediaplayer:4327): glibmm-WARNING **: failed to wrap type of 'GstPlayBin'

(lt-mediaplayer:4327): glibmm-WARNING **: failed to wrap type of 'GstXImageSink'
One of the elements for media player could not be created.


Expected results:
gstreamermm should be initialized properly and function as if Gst::init() had been called.

Does this happen every time?
Yes.

Other information:
Please note that Gst::init_check() does not call the same wrap_init functions as Gst::init() does.  If that is incorrect, I suppose the correct initialization code should be refactored.  This could be exported similar to Gtk::init_gtkmm_internals() which can be useful sometimes.

I don't have a good idea how to fix the problem.  If the wrap_init functions can be called at any time, the call might be added to get_option_group.  If not, the call may have to be delayed until after option parsing, but to do this automatically, the option group object has to be derived it seems (annoyingly).

But please note that I do not know the binding code very well and I do not know the proper initialization sequences, so these ideas are just stabs in the dark.
Comment 1 Marcus Brinkmann 2008-06-19 02:32:47 UTC
Created attachment 113017 [details]
Example program exhibiting the problem.

Use this instead of main.cc in examples/media_player_gtkmm/, then build and run to reproduce the problem.
Comment 2 José Alburquerque 2008-06-23 01:57:22 UTC
The only solution to this I see at the moment would be to provide no argument Gst::init() and Gst::init_check() methods (by overriding) and make it clear in the docs that some form of Gst::init* should be used to initialize gstreamermm.
Comment 3 José Alburquerque 2008-11-05 13:32:05 UTC
Closing as fixed.  I hope the following changes are enough:

2008-06-30  José Alburquerque  <jaalburqu@svn.gnome.org>

	* gstreamer/gstreamermm/init.cc:
	* gstreamer/gstreamermm/init.h: Added Gst::init() and
	Gst::init_check() with no arguments to fix bug #539059.
	* tests/Makefile.am:
	* tests/test-init-check-noargs.cc:
	* tests/test-init-check.cc:
	* tests/test-init-noargs.cc:
	* tests/test-init.cc: Added init tests to test Gst::init() and
	Gst::init_check() methods (arguments and no argument versions).

	* gstreamerbase/gstreamerbasemm/init.h: Made it clear in the
	GstBase::init() function docs that Gst::init() functions already
	initialize gstreamerbasemm (no need to call GstBase::init() directly).