gst/gstcaps.h: Added gst_caps_is_simple() macro.
authorDavid Schleef <ds@schleef.org>
Fri, 16 Jan 2004 00:58:06 +0000 (00:58 +0000)
committerDavid Schleef <ds@schleef.org>
Fri, 16 Jan 2004 00:58:06 +0000 (00:58 +0000)
Original commit message from CVS:
* gst/gstcaps.h:
Added gst_caps_is_simple() macro.
* testsuite/caps/caps.c: (test1):
* testsuite/caps/intersect2.c: (main):
* testsuite/caps/intersection.c: (main):
Fixes to make 'make check' work again after removing
gst_caps_is_chained().

ChangeLog
gst/gstcaps.h
tests/old/testsuite/caps/caps.c
tests/old/testsuite/caps/intersect2.c
tests/old/testsuite/caps/intersection.c
testsuite/caps/caps.c
testsuite/caps/intersect2.c
testsuite/caps/intersection.c

index 4e6f2dc..0267ebd 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,13 @@
+2004-01-15  David Schleef  <ds@schleef.org>
+
+       * gst/gstcaps.h:
+       Added gst_caps_is_simple() macro.
+       * testsuite/caps/caps.c: (test1):
+       * testsuite/caps/intersect2.c: (main):
+       * testsuite/caps/intersection.c: (main):
+       Fixes to make 'make check' work again after removing
+       gst_caps_is_chained().
+
 2004-01-15  Leif Johnson <leif@ambient.2y.net>
 
        * docs/random/uraeus/gstreamer_and_midi.txt: Rather large edits
index b77c792..aac52e5 100644 (file)
@@ -84,6 +84,7 @@ void gst_caps_append (GstCaps *caps1, GstCaps *caps2);
 void gst_caps_append_structure (GstCaps *caps1, GstStructure *structure);
 GstCaps *gst_caps_split_one (GstCaps *caps);
 int gst_caps_get_size (const GstCaps *caps);
+#define gst_caps_is_simple(caps) (gst_caps_get_size(caps) == 1)
 GstStructure *gst_caps_get_structure (const GstCaps *caps, int index);
 #ifndef GST_DISABLE_DEPRECATED
 GstCaps *gst_caps_copy_1 (const GstCaps *caps);
index d2f159c..bed8f7c 100644 (file)
@@ -22,7 +22,7 @@ void test1(void)
   g_assert(caps != NULL);
   g_assert(gst_caps_is_empty(caps)==FALSE);
   g_assert(gst_caps_is_any(caps)==FALSE);
-  g_assert(gst_caps_is_chained(caps)==FALSE);
+  g_assert(gst_caps_is_simple(caps)==TRUE);
   g_assert(gst_caps_is_fixed(caps)==TRUE);
   g_print("%s\n", gst_caps_to_string(caps));
   gst_caps_free(caps);
@@ -32,7 +32,7 @@ void test1(void)
   g_assert(caps != NULL);
   g_assert(gst_caps_is_empty(caps)==FALSE);
   g_assert(gst_caps_is_any(caps)==FALSE);
-  g_assert(gst_caps_is_chained(caps)==FALSE);
+  g_assert(gst_caps_is_simple(caps)==TRUE);
   g_assert(gst_caps_is_fixed(caps)==TRUE);
   g_print("%s\n", gst_caps_to_string(caps));
   gst_caps_free(caps);
@@ -42,7 +42,7 @@ void test1(void)
   g_assert(caps != NULL);
   g_assert(gst_caps_is_empty(caps)==FALSE);
   g_assert(gst_caps_is_any(caps)==FALSE);
-  g_assert(gst_caps_is_chained(caps)==FALSE);
+  g_assert(gst_caps_is_simple(caps)==TRUE);
   g_assert(gst_caps_is_fixed(caps)==TRUE);
   g_print("%s\n", gst_caps_to_string(caps));
   gst_caps_free(caps);
@@ -52,7 +52,7 @@ void test1(void)
   g_assert(caps != NULL);
   g_assert(gst_caps_is_empty(caps)==FALSE);
   g_assert(gst_caps_is_any(caps)==FALSE);
-  g_assert(gst_caps_is_chained(caps)==FALSE);
+  g_assert(gst_caps_is_simple(caps)==TRUE);
   g_assert(gst_caps_is_fixed(caps)==TRUE);
   g_print("%s\n", gst_caps_to_string(caps));
   gst_caps_free(caps);
@@ -64,7 +64,7 @@ void test1(void)
   g_assert(caps != NULL);
   g_assert(gst_caps_is_empty(caps)==FALSE);
   g_assert(gst_caps_is_any(caps)==FALSE);
-  g_assert(gst_caps_is_chained(caps)==TRUE);
+  g_assert(gst_caps_is_simple(caps)==FALSE);
   g_assert(gst_caps_is_fixed(caps)==FALSE);
   g_print("%s\n", gst_caps_to_string(caps));
   gst_caps_free(caps);
@@ -75,7 +75,7 @@ void test1(void)
   g_assert(caps2 != NULL);
   g_assert(gst_caps_is_empty(caps2)==FALSE);
   g_assert(gst_caps_is_any(caps2)==FALSE);
-  g_assert(gst_caps_is_chained(caps2)==FALSE);
+  g_assert(gst_caps_is_simple(caps2)==TRUE);
   g_assert(gst_caps_is_fixed(caps2)==TRUE);
   g_print("%s\n", gst_caps_to_string(caps));
   g_print("%s\n", gst_caps_to_string(caps2));
@@ -88,7 +88,7 @@ void test1(void)
   g_assert(caps != NULL);
   g_assert(gst_caps_is_empty(caps)==FALSE);
   g_assert(gst_caps_is_any(caps)==FALSE);
-  g_assert(gst_caps_is_chained(caps)==TRUE);
+  g_assert(gst_caps_is_simple(caps)==FALSE);
   g_assert(gst_caps_is_fixed(caps)==FALSE);
   g_print("%s\n", gst_caps_to_string(caps));
   gst_caps_free(caps);
@@ -99,7 +99,7 @@ void test1(void)
       gst_structure_new("audio/raw", "_int", G_TYPE_INT, 200, NULL));
   g_assert(gst_caps_is_empty(caps)==FALSE);
   g_assert(gst_caps_is_any(caps)==FALSE);
-  g_assert(gst_caps_is_chained(caps)==TRUE);
+  g_assert(gst_caps_is_simple(caps)==FALSE);
   g_assert(gst_caps_is_fixed(caps)==FALSE);
   g_print("%s\n", gst_caps_to_string(caps));
   gst_caps_free(caps);
index bde4e06..f5464dc 100644 (file)
@@ -54,7 +54,8 @@ main (int argc, char *argv[])
   gst_init (&argc, &argv);
 
   caps1 = gst_caps_copy( gst_static_caps_get (&rawcaps1));
-  caps2 = gst_caps_copy_1 (gst_static_caps_get (&rawcaps1));
+  caps2 = gst_caps_new_full (gst_structure_copy ( gst_caps_get_structure (
+        gst_static_caps_get (&rawcaps1), 0)), NULL);
 
 #if 0
   gst_caps_set(caps1, "height", GST_PROPS_INT(640));
index a672591..2e36970 100644 (file)
@@ -112,7 +112,8 @@ main (int argc, char *argv[])
   gst_caps_save_thyself (caps, parent);
 
   caps = gst_caps_intersect (gst_static_caps_get (&rawcaps6),
-      gst_caps_copy_1(gst_static_caps_get (&rawcaps6)));
+      gst_caps_new_full (gst_structure_copy (
+          gst_caps_get_structure (gst_static_caps_get (&rawcaps6), 0)), NULL));
   parent = xmlNewChild (doc->xmlRootNode, NULL, "Capabilities5", NULL);
   gst_caps_save_thyself (caps, parent);
 
index d2f159c..bed8f7c 100644 (file)
@@ -22,7 +22,7 @@ void test1(void)
   g_assert(caps != NULL);
   g_assert(gst_caps_is_empty(caps)==FALSE);
   g_assert(gst_caps_is_any(caps)==FALSE);
-  g_assert(gst_caps_is_chained(caps)==FALSE);
+  g_assert(gst_caps_is_simple(caps)==TRUE);
   g_assert(gst_caps_is_fixed(caps)==TRUE);
   g_print("%s\n", gst_caps_to_string(caps));
   gst_caps_free(caps);
@@ -32,7 +32,7 @@ void test1(void)
   g_assert(caps != NULL);
   g_assert(gst_caps_is_empty(caps)==FALSE);
   g_assert(gst_caps_is_any(caps)==FALSE);
-  g_assert(gst_caps_is_chained(caps)==FALSE);
+  g_assert(gst_caps_is_simple(caps)==TRUE);
   g_assert(gst_caps_is_fixed(caps)==TRUE);
   g_print("%s\n", gst_caps_to_string(caps));
   gst_caps_free(caps);
@@ -42,7 +42,7 @@ void test1(void)
   g_assert(caps != NULL);
   g_assert(gst_caps_is_empty(caps)==FALSE);
   g_assert(gst_caps_is_any(caps)==FALSE);
-  g_assert(gst_caps_is_chained(caps)==FALSE);
+  g_assert(gst_caps_is_simple(caps)==TRUE);
   g_assert(gst_caps_is_fixed(caps)==TRUE);
   g_print("%s\n", gst_caps_to_string(caps));
   gst_caps_free(caps);
@@ -52,7 +52,7 @@ void test1(void)
   g_assert(caps != NULL);
   g_assert(gst_caps_is_empty(caps)==FALSE);
   g_assert(gst_caps_is_any(caps)==FALSE);
-  g_assert(gst_caps_is_chained(caps)==FALSE);
+  g_assert(gst_caps_is_simple(caps)==TRUE);
   g_assert(gst_caps_is_fixed(caps)==TRUE);
   g_print("%s\n", gst_caps_to_string(caps));
   gst_caps_free(caps);
@@ -64,7 +64,7 @@ void test1(void)
   g_assert(caps != NULL);
   g_assert(gst_caps_is_empty(caps)==FALSE);
   g_assert(gst_caps_is_any(caps)==FALSE);
-  g_assert(gst_caps_is_chained(caps)==TRUE);
+  g_assert(gst_caps_is_simple(caps)==FALSE);
   g_assert(gst_caps_is_fixed(caps)==FALSE);
   g_print("%s\n", gst_caps_to_string(caps));
   gst_caps_free(caps);
@@ -75,7 +75,7 @@ void test1(void)
   g_assert(caps2 != NULL);
   g_assert(gst_caps_is_empty(caps2)==FALSE);
   g_assert(gst_caps_is_any(caps2)==FALSE);
-  g_assert(gst_caps_is_chained(caps2)==FALSE);
+  g_assert(gst_caps_is_simple(caps2)==TRUE);
   g_assert(gst_caps_is_fixed(caps2)==TRUE);
   g_print("%s\n", gst_caps_to_string(caps));
   g_print("%s\n", gst_caps_to_string(caps2));
@@ -88,7 +88,7 @@ void test1(void)
   g_assert(caps != NULL);
   g_assert(gst_caps_is_empty(caps)==FALSE);
   g_assert(gst_caps_is_any(caps)==FALSE);
-  g_assert(gst_caps_is_chained(caps)==TRUE);
+  g_assert(gst_caps_is_simple(caps)==FALSE);
   g_assert(gst_caps_is_fixed(caps)==FALSE);
   g_print("%s\n", gst_caps_to_string(caps));
   gst_caps_free(caps);
@@ -99,7 +99,7 @@ void test1(void)
       gst_structure_new("audio/raw", "_int", G_TYPE_INT, 200, NULL));
   g_assert(gst_caps_is_empty(caps)==FALSE);
   g_assert(gst_caps_is_any(caps)==FALSE);
-  g_assert(gst_caps_is_chained(caps)==TRUE);
+  g_assert(gst_caps_is_simple(caps)==FALSE);
   g_assert(gst_caps_is_fixed(caps)==FALSE);
   g_print("%s\n", gst_caps_to_string(caps));
   gst_caps_free(caps);
index bde4e06..f5464dc 100644 (file)
@@ -54,7 +54,8 @@ main (int argc, char *argv[])
   gst_init (&argc, &argv);
 
   caps1 = gst_caps_copy( gst_static_caps_get (&rawcaps1));
-  caps2 = gst_caps_copy_1 (gst_static_caps_get (&rawcaps1));
+  caps2 = gst_caps_new_full (gst_structure_copy ( gst_caps_get_structure (
+        gst_static_caps_get (&rawcaps1), 0)), NULL);
 
 #if 0
   gst_caps_set(caps1, "height", GST_PROPS_INT(640));
index a672591..2e36970 100644 (file)
@@ -112,7 +112,8 @@ main (int argc, char *argv[])
   gst_caps_save_thyself (caps, parent);
 
   caps = gst_caps_intersect (gst_static_caps_get (&rawcaps6),
-      gst_caps_copy_1(gst_static_caps_get (&rawcaps6)));
+      gst_caps_new_full (gst_structure_copy (
+          gst_caps_get_structure (gst_static_caps_get (&rawcaps6), 0)), NULL));
   parent = xmlNewChild (doc->xmlRootNode, NULL, "Capabilities5", NULL);
   gst_caps_save_thyself (caps, parent);