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 519584 - gst_element_implements_interface() segfaults with 'filesrc' element
gst_element_implements_interface() segfaults with 'filesrc' element
Status: RESOLVED FIXED
Product: GStreamer
Classification: Platform
Component: gstreamer (core)
git master
Other Linux
: Normal normal
: 0.10.18
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2008-02-29 18:11 UTC by José Alburquerque
Modified: 2008-03-04 23:29 UTC
See Also:
GNOME target: ---
GNOME version: 2.19/2.20


Attachments
gst_element_implements_interace() test (541 bytes, text/x-csrc)
2008-02-29 18:12 UTC, José Alburquerque
Details

Description José Alburquerque 2008-02-29 18:11:08 UTC
I've been working on wrapping the GstImplementsInterface API (http://gstreamer.freedesktop.org/data/doc/gstreamer/head/gstreamer/html/GstImplementsInterface.html) for gstreamermm and kept getting segfaults when using the gst_implements_interface_check() method to see if a 'filesrc' element implements the URIHandler interface.  I thought I might have done something wrong, but I wrote the attached short program (which uses gst_element_implements_interface() in the same fashion) and it too segfaults.
Comment 1 José Alburquerque 2008-02-29 18:12:58 UTC
Created attachment 106286 [details]
gst_element_implements_interace() test
Comment 2 Tim-Philipp Müller 2008-02-29 18:43:04 UTC
It's not really the way gst_element_implements_interface() is meant to be used: it's only supposed to be used on elements which implement the GstImplementsInterface interface (yes, this is all horribly ugly).

Should not crash  of course, fixed in CVS now:

2008-02-29  Tim-Philipp Müller  <tim at centricular dot net>

        * gst/gstinterface.c: (gst_element_implements_interface):
          Don't crash if the element supports the interface queried, but does
          not implement GstImplementsInterface. Fixes #519584.

        * tests/check/Makefile.am:
        * tests/check/gst/.cvsignore:
        * tests/check/gst/gstinterface.c:
          Add unit test for the above.

Comment 3 José Alburquerque 2008-02-29 18:48:03 UTC
I know this may not be appropriate to be asking in a bug report, but do all elements not implement the GstImplementsInterface?
Comment 4 René Stadler 2008-02-29 19:22:36 UTC
At least these elements have it:

alsamixer, alsasrc, dfbvideosink, glimagesink, ossmixer, osssrc, sdlvideosink, v4l2src, v4lsrc, videobalance, volume, ximagesink, xvimagesink

As you can see, there's a lot of stuff dealing with hardware.  AFAIK the intent of this interface is to let an element instance not implement another interface based on hardware device capabilities for example.
Comment 5 José Alburquerque 2008-02-29 19:28:41 UTC
Thanks.  One final question:  Is it possible to use the gst_implements_interface_cast() method to cast from a GstElement to an interface, for example URIHandler, if the GstElement does not implement the GstImplementsInterface?  Thanks.
Comment 6 José Alburquerque 2008-03-04 23:29:34 UTC
By testing I've found that gst_implements_interface_cast() works with elements not implementing GstImplementsInterface.  Thanks.