3 /* these caps all have a non empty intersection */
4 GstStaticCaps sinkcaps = GST_STATIC_CAPS ("video/mpeg, " "mpegtype=(int)[1,2]");
6 GstStaticCaps mp1parsecaps = GST_STATIC_CAPS ("video/mpeg, " "mpegtype=(int)1");
8 GstStaticCaps rawcaps = GST_STATIC_CAPS ("video/raw, "
9 "fourcc=(fourcc){YV12,YUY2}, "
10 "width=(int)[16,4096], " "height=(int)[16,4096]");
12 GstStaticCaps rawcaps2 = GST_STATIC_CAPS ("video/raw, "
13 "fourcc=(fourcc)YUY2, " "height=(int)[16,256]");
15 GstStaticCaps rawcaps3 = GST_STATIC_CAPS ("video/raw, "
16 "fourcc=(fourcc){YV12,YUY2}, " "height=(int)[16,4096]");
19 /* these caps aren't used yet */
20 GstStaticCaps rawcaps4 = GST_STATIC_CAPS ("video/raw, "
21 "fourcc=(fourcc){\"YV12\", \"YUYV\"}, " "height=(int)[16,4096]");
23 GstStaticCaps rawcaps4 = GST_STATIC_CAPS ("video/raw, "
24 "fourcc=(fourcc){\"YUYV\", \"YUY2\"}, " "height=(int)[16,4096]");
27 GstStaticCaps rawcaps6 = GST_STATIC_CAPS ("video/raw, "
28 "format=(fourcc)\"I420\"; " "video/raw, " "format=(fourcc)\"YUYV\"");
30 GstStaticCaps rawcaps7 = GST_STATIC_CAPS ("video/raw, "
31 "format=(fourcc)\"I420\"; " "video/raw, " "format=(fourcc)\"YV12\"");
35 main (int argc, char *argv[])
40 gst_init (&argc, &argv);
42 testret = gst_caps_is_always_compatible (gst_static_caps_get (&mp1parsecaps),
43 gst_static_caps_get (&rawcaps));
44 g_print ("4 <-> 2 == %d (invalid, wrong major type)\n", testret);
45 ret = ret + (testret == FALSE) ? 0 : 1;
47 testret = gst_caps_is_always_compatible (gst_static_caps_get (&mp1parsecaps),
48 gst_static_caps_get (&sinkcaps));
49 g_print ("4 <-> 1 == %d (valid, subset)\n", testret);
50 ret = ret + (testret == TRUE) ? 0 : 1;
52 testret = gst_caps_is_always_compatible (gst_static_caps_get (&sinkcaps),
53 gst_static_caps_get (&mp1parsecaps));
54 g_print ("1 <-> 4 == %d (invalid, superset)\n", testret);
55 ret = ret + (testret == FALSE) ? 0 : 1;
57 testret = gst_caps_is_always_compatible (gst_static_caps_get (&rawcaps),
58 gst_static_caps_get (&rawcaps2));
59 g_print ("2 <-> 3 == %d (invalid, ranges)\n", testret);
60 ret = ret + (testret == FALSE) ? 0 : 1;
62 testret = gst_caps_is_always_compatible (gst_static_caps_get (&rawcaps),
63 gst_static_caps_get (&rawcaps3));
64 g_print ("2 <-> 5 == %d (valid)\n", testret);
65 ret = ret + (testret == TRUE) ? 0 : 1;
67 testret = gst_caps_is_always_compatible (gst_static_caps_get (&rawcaps3),
68 gst_static_caps_get (&rawcaps));
69 g_print ("5 <-> 2 == %d (invalid)\n", testret);
70 ret = ret + (testret == FALSE) ? 0 : 1;
72 testret = gst_caps_is_always_compatible (gst_static_caps_get (&rawcaps2),
73 gst_static_caps_get (&rawcaps3));
74 g_print ("3 <-> 5 == %d (valid)\n", testret);
75 ret = ret + (testret == TRUE) ? 0 : 1;
77 testret = gst_caps_is_always_compatible (gst_static_caps_get (&rawcaps2),
78 gst_static_caps_get (&rawcaps));
79 g_print ("3 <-> 2 == %d (invalid, property missing in source)\n", testret);
80 ret = ret + (testret == FALSE) ? 0 : 1;
82 testret = gst_caps_is_always_compatible (gst_static_caps_get (&rawcaps),
83 gst_static_caps_get (&rawcaps));
84 g_print ("2 <-> 2 == %d (valid, same caps)\n", testret);
85 ret = ret + (testret == TRUE) ? 0 : 1;
87 testret = gst_caps_is_always_compatible (gst_static_caps_get (&rawcaps6),
88 gst_static_caps_get (&rawcaps7));
89 g_print ("6 <-> 7 == %d (invalid, second caps doesn't fit)\n", testret);
90 ret = ret + (testret == FALSE) ? 0 : 1;