GNOME Bugzilla – Bug 608005
[GStreamer] Bug in VAPI-Binding for Pad.caps property
Last modified: 2010-03-30 06:25:35 UTC
Created attachment 152205 [details] [review] Patch to fix the bug, in VAPI file I'm using vala 0.7.9 to implement a Vala based GStreamer plugin. During development, I found a bug in the vapi-bindings for GStreamer. (in file gstreamer-0.10.vapi) Vala expands the following expression outbuf.set_caps(_srcPad.caps); to gst_buffer_set_caps (outbuf, gst_pad_get_caps (self->priv->_srcPad)); instead of gst_buffer_set_caps (outbuf, GST_PAD_CAPS (self->priv->_srcPad)); The problem is, that the getter of the caps-property should be mapped to GST_PAD_CAPS() instead to gst_pad_get_caps(). See also http://www.gstreamer.net/data/doc/gstreamer/head/gstreamer/html/GstPad.html#gst-pad-get-caps http://gstreamer.freedesktop.org/data/doc/gstreamer/head/pwg/html/section-nego-getcaps.html Attached, you will find a patch to solve the issue. Cheers, Sebastian
This is wrong, you shouldn't use GST_PAD_CAPS() unless you know what the pad is doing. It doesn't increase the refcount of the caps and if another thread changes the caps at the same time you could get an invalid pointer. Either the caps property should really be used for this or gst_pad_get_negotiated_caps(). Attached patch does the first.
Created attachment 157269 [details] [review] gstreamer: Don't use the accessor method when accessing Gst.Pad:caps property Gst.Pad.get_caps() returns something completely different than the caps property. Fixes bug #608005.
commit 41df69cde674d9a3742bdfff3f38bcebfcd8305a Author: Sebastian Dröge <sebastian.droege@collabora.co.uk> Date: Sat Mar 27 11:02:31 2010 +0100 gstreamer: Don't use the accessor method when accessing Gst.Pad:caps property Gst.Pad.get_caps() returns something completely different than the caps property. Fixes bug #608005.