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 731704 - gst_caps_is_any() returns FALSE or flag value, not TRUE or FALSE
gst_caps_is_any() returns FALSE or flag value, not TRUE or FALSE
Status: RESOLVED FIXED
Product: GStreamer
Classification: Platform
Component: gstreamer (core)
1.x
Other Linux
: Normal blocker
: 1.3.3
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2014-06-16 06:38 UTC by europe.lee
Modified: 2014-06-22 11:58 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description europe.lee 2014-06-16 06:38:47 UTC
Hi, I use appsrc, and need set caps for appsrc, but such below:

	GstCaps * gany;
	gany = gst_caps_new_any();
	if (TRUE == gst_caps_is_any(gany))
	{
		g_print("any");
                g_object_set(source, "caps", gany, NULL);
	}
	else
	{

		g_print("not any!");
	}

//I use old version 0.10.36, gst_caps_is_any is true,
but use 1.x,  gst_caps_is_any is false!
Comment 1 Tim-Philipp Müller 2014-06-22 11:53:56 UTC
Nice catch, thanks for the bug report!

Most people seem to just do

   if (gst_caps_is_any (caps)) { ... }

which luckily works :)

commit 39b69d27da2649740709433b24b8f41b52b20e53
Author: Tim-Philipp Müller <tim@centricular.com>
Date:   Sun Jun 22 12:52:01 2014 +0100

    tests: add unit test for gst_caps_is_any() and _is_empty()
    
    https://bugzilla.gnome.org//show_bug.cgi?id=731704

commit 8e30a9462cf1a470f620490f90a9f51cf976655c
Author: Tim-Philipp Müller <tim@centricular.com>
Date:   Sun Jun 22 12:50:42 2014 +0100

    caps: gst_caps_is_any() should return TRUE or FALSE
    
    Not some flag value instead of TRUE. Fixes code like
    gst_caps_is_any() == TRUE.
    
    https://bugzilla.gnome.org//show_bug.cgi?id=731704