diff --git a/ChangeLog b/ChangeLog index 4e6f2dc727..0267ebdb30 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,13 @@ +2004-01-15 David Schleef + + * 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 * docs/random/uraeus/gstreamer_and_midi.txt: Rather large edits diff --git a/gst/gstcaps.h b/gst/gstcaps.h index b77c792d88..aac52e5c77 100644 --- a/gst/gstcaps.h +++ b/gst/gstcaps.h @@ -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); diff --git a/tests/old/testsuite/caps/caps.c b/tests/old/testsuite/caps/caps.c index d2f159c5cf..bed8f7cbdc 100644 --- a/tests/old/testsuite/caps/caps.c +++ b/tests/old/testsuite/caps/caps.c @@ -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); diff --git a/tests/old/testsuite/caps/intersect2.c b/tests/old/testsuite/caps/intersect2.c index bde4e06c33..f5464dce75 100644 --- a/tests/old/testsuite/caps/intersect2.c +++ b/tests/old/testsuite/caps/intersect2.c @@ -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)); diff --git a/tests/old/testsuite/caps/intersection.c b/tests/old/testsuite/caps/intersection.c index a67259144a..2e369700e8 100644 --- a/tests/old/testsuite/caps/intersection.c +++ b/tests/old/testsuite/caps/intersection.c @@ -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); diff --git a/testsuite/caps/caps.c b/testsuite/caps/caps.c index d2f159c5cf..bed8f7cbdc 100644 --- a/testsuite/caps/caps.c +++ b/testsuite/caps/caps.c @@ -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); diff --git a/testsuite/caps/intersect2.c b/testsuite/caps/intersect2.c index bde4e06c33..f5464dce75 100644 --- a/testsuite/caps/intersect2.c +++ b/testsuite/caps/intersect2.c @@ -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)); diff --git a/testsuite/caps/intersection.c b/testsuite/caps/intersection.c index a67259144a..2e369700e8 100644 --- a/testsuite/caps/intersection.c +++ b/testsuite/caps/intersection.c @@ -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);