89344fa3e59e9a869895005e15eb17de1bb3f024
[platform/upstream/gstreamer.git] / testsuite / caps / normalisation.c
1 #include <gst/gst.h>
2
3 /* these caps all have a non empty intersection */
4 GstStaticCaps sinkcaps = GST_STATIC_CAPS (
5   "video/mpeg, "
6     "fourcc=(fourcc){\"YV12\",\"YUY2\"}, "
7     "foo1=(int)[20,40], "
8     "foo2=(int)[20,40], "
9     "foo3=(int)[10,20]"
10 );
11
12 GstStaticCaps mp1parsecaps = GST_STATIC_CAPS (
13   "video/mpeg, "
14     "fourcc=(fourcc){\"YV12\",\"YUY2\"}, "
15     "foo4=(fourcc){\"YV12\",\"YUY2\"}"
16 );
17
18 GstStaticCaps rawcaps = GST_STATIC_CAPS (
19   "video/raw, "
20     "width=(int)[16,4096], "
21     "height=(int)[16,4096], "
22     "fourcc=(fourcc){\"YV12\",\"YUY2\"}"
23 );
24
25 GstStaticCaps rawcaps2 = GST_STATIC_CAPS (
26   "video/raw, "
27     "width=(int)[16,256], "
28     "height=(int)16; "
29   "video/raw, "
30     "width=(int)[16,256], "
31     "height=(int)16"
32 );
33
34 GstStaticCaps rawcaps3 = GST_STATIC_CAPS (
35   "video/raw, "
36     "width=(int)[16,256], "
37     "height=(int)16; "
38   "video/raw, "
39     "width=(int)[16,256], "
40     "height=(int)16; "
41   "video/raw, "
42     "fourcc=(fourcc){\"YV12\",\"YUY2\"}, "
43     "height=(int)[16,4096]"
44 );
45
46 GstStaticCaps rawcaps4 = GST_STATIC_CAPS (
47   "x, "
48     "y=(int){1,2}, "
49     "z=(int){3,4}; "
50   "a, "
51     "b=(int){5,6}, "
52     "c=(int){7,8}"
53 );
54
55 /* defined, not used
56 GST_CAPS_FACTORY (rawcaps4,
57   GST_CAPS_NEW (
58     "raw2_sink_caps",
59     "video/raw",
60       "fourcc",   GST_PROPS_LIST (
61                     GST_PROPS_FOURCC (GST_STR_FOURCC ("YUY2")),
62                     GST_PROPS_FOURCC (GST_STR_FOURCC ("YV12")),
63                     GST_PROPS_FOURCC (GST_STR_FOURCC ("YUYV")) 
64                   ),
65       "height",   GST_PROPS_INT_RANGE (16, 4096)
66   )
67 );
68
69 GST_CAPS_FACTORY (rawcaps5,
70   GST_CAPS_NEW (
71     "raw2_sink_caps",
72     "video/raw",
73       "fourcc",   GST_PROPS_LIST (
74                     GST_PROPS_FOURCC (GST_STR_FOURCC ("YUYV")),
75                     GST_PROPS_FOURCC (GST_STR_FOURCC ("YUY2"))
76                   ),
77       "height",   GST_PROPS_INT_RANGE (16, 4096)
78   )
79 );
80 */
81
82 int 
83 main (int argc, char *argv[]) 
84 {
85   GstCaps *caps;
86
87   gst_init (&argc, &argv);
88
89   caps = gst_caps_normalize (gst_static_caps_get (&sinkcaps));
90   g_print ("\n%s\n", gst_caps_to_string (caps));
91
92   caps = gst_caps_normalize (gst_static_caps_get (&mp1parsecaps));
93   g_print ("\n%s\n", gst_caps_to_string (caps));
94
95   caps = gst_caps_normalize (gst_static_caps_get (&rawcaps));
96   g_print ("\n%s\n", gst_caps_to_string (caps));
97
98   caps = gst_caps_normalize (gst_static_caps_get (&rawcaps2));
99   g_print ("\n%s\n", gst_caps_to_string (caps));
100
101   caps = gst_caps_normalize (gst_static_caps_get (&rawcaps3));
102   g_print ("\n%s\n", gst_caps_to_string (caps));
103
104   caps = gst_caps_normalize (gst_static_caps_get (&rawcaps4));
105   g_assert (gst_caps_get_size (caps) == 8);
106   g_print ("\n%s\n", gst_caps_to_string (caps));
107
108   return 0;
109 }