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 141304 - GST_CAPS and GST_IS_CAPS broken
GST_CAPS and GST_IS_CAPS broken
Status: RESOLVED FIXED
Product: GStreamer
Classification: Platform
Component: gstreamer (core)
git master
Other Linux
: High major
: 0.8.2
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2004-04-28 16:01 UTC by Tim-Philipp Müller
Modified: 2004-12-22 21:47 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
patch for gstcaps.h (800 bytes, patch)
2004-04-28 16:03 UTC, Tim-Philipp Müller
none Details | Review
test case (1.22 KB, text/plain)
2004-04-28 16:05 UTC, Tim-Philipp Müller
  Details
gstcaps.c - replaced all caps != NULL assertions with GST_IS_CAPS(caps) etc. (6.49 KB, patch)
2004-04-28 16:34 UTC, Tim-Philipp Müller
none Details | Review

Description Tim-Philipp Müller 2004-04-28 16:01:05 UTC
As thomasvs observed, the GST_CAPS and GST_IS_CAPS macros are broken.  
 
GstCaps is not a GTypeInstance (as GObject is), so one can't use the 
G_TYPE_INSTANCE_ stuff on it. 
 
Attached a test program that demonstrates the problem and shows that the fix 
works. 
 
Patch for gstcaps.h attached. 
 
Cheers 
-Tim
Comment 1 Tim-Philipp Müller 2004-04-28 16:03:01 UTC
Created attachment 27168 [details] [review]
patch for gstcaps.h
Comment 2 Tim-Philipp Müller 2004-04-28 16:05:35 UTC
Created attachment 27169 [details]
test case
Comment 3 Tim-Philipp Müller 2004-04-28 16:34:34 UTC
Created attachment 27170 [details] [review]
gstcaps.c - replaced all caps != NULL assertions with GST_IS_CAPS(caps) etc.

<Company> bitshifter: for added bonus, replace all g_return_if_fail (caps !=
NULL) with g_return_if_fail (GST_IS_CAPS (caps)) and similar


Please double-check especially the GValue asserts in
gst_caps_transform_to_string() for sanity.

Cheers
-Tim
Comment 4 David Schleef 2004-04-28 20:05:38 UTC
Applied to CVS.  Thanks.