3 /* these caps all have a non empty intersection */
4 GstStaticCaps sinkcaps = GST_STATIC_CAPS ("video/mpeg, "
6 "foo1=(int)[20,40], " "foo2=(int)[20,40], " "foo3=(int)[10,20]");
8 GstStaticCaps mp1parsecaps = GST_STATIC_CAPS ("video/mpeg, "
10 "foo1=(int)30, " "foo2=(int)[20,30], " "foo3=(int)[20,30]");
14 GstStaticCaps rawcaps = GST_STATIC_CAPS ("video/raw, "
15 "width=(int)[16,4096], " "height=(int)[16,4096]");
17 GstStaticCaps rawcaps2 = GST_STATIC_CAPS ("video/raw, "
18 "height=(int)[16,256], " "depth=(int)16");
20 GstStaticCaps rawcaps3 = GST_STATIC_CAPS ("video/raw, "
21 "fourcc=(fourcc){\"YUY2\", \"YV12\" }, " "height=(int)[16,4096]");
23 GstStaticCaps rawcaps4 = GST_STATIC_CAPS ("video/raw, "
24 "fourcc=(fourcc){\"YUY2\",\"YV12\",\"YUYV\" }, " "height=(int)[16,4096]");
26 GstStaticCaps rawcaps5 = GST_STATIC_CAPS ("video/raw, "
27 "fourcc=(fourcc){\"YUYV\",\"YUY2\"}, " "height=(int)[16,4096]");
29 GstStaticCaps rawcaps6 = GST_STATIC_CAPS ("video/raw, "
30 "fourcc=(fourcc)\"YUYV\", "
33 "framerate=(double)30.0; "
35 "fourcc=(fourcc)\"I420\", "
36 "height=(int)640, " "width=(int)480, " "framerate=(double)30.0");
38 GstStaticCaps rawcaps7 =
40 ("video/x-raw-yuv, format=(fourcc)YUY2, width=(int)[1,2147483647], height=(int)[1,2147483647], framerate=(double)[0,1.79769e+308]");
42 GstStaticCaps rawcaps8 =
44 ("video/x-raw-yuv, format=(fourcc){ I420, YV12, YUY2 }, width=(int)[16,4096], height=(int)[16,4096], framerate=(double)[0,1.79769e+308]");
47 main (int argc, char *argv[])
53 gst_init (&argc, &argv);
55 doc = xmlNewDoc ("1.0");
56 doc->xmlRootNode = xmlNewDocNode (doc, NULL, "Capabilities", NULL);
60 for (i = 0; i<100000; i++) {
61 caps = gst_caps_intersect (gst_static_caps_get (rawcaps3), GST_CAPS_GET (rawcaps4));
62 gst_caps_unref (caps);
67 caps = gst_caps_intersect (gst_static_caps_get (&sinkcaps),
68 gst_static_caps_get (&mp1parsecaps));
69 parent = xmlNewChild (doc->xmlRootNode, NULL, "Capabilities1", NULL);
70 gst_caps_save_thyself (caps, parent);
72 caps = gst_caps_intersect (gst_static_caps_get (&rawcaps),
73 gst_static_caps_get (&rawcaps2));
74 parent = xmlNewChild (doc->xmlRootNode, NULL, "Capabilities2", NULL);
75 gst_caps_save_thyself (caps, parent);
77 caps = gst_caps_intersect (gst_static_caps_get (&rawcaps3),
78 gst_static_caps_get (&rawcaps4));
79 parent = xmlNewChild (doc->xmlRootNode, NULL, "Capabilities3", NULL);
80 gst_caps_save_thyself (caps, parent);
82 caps = gst_caps_intersect (gst_static_caps_get (&rawcaps3),
83 gst_static_caps_get (&rawcaps5));
84 parent = xmlNewChild (doc->xmlRootNode, NULL, "Capabilities4", NULL);
85 gst_caps_save_thyself (caps, parent);
87 caps = gst_caps_intersect (gst_static_caps_get (&rawcaps6),
88 gst_caps_new_full (gst_structure_copy (gst_caps_get_structure
89 (gst_static_caps_get (&rawcaps6), 0)), NULL));
90 parent = xmlNewChild (doc->xmlRootNode, NULL, "Capabilities5", NULL);
91 gst_caps_save_thyself (caps, parent);
93 caps = gst_caps_intersect (gst_static_caps_get (&rawcaps7),
94 gst_static_caps_get (&rawcaps8));
95 g_print ("intersection: %s\n", gst_caps_to_string (caps));
97 xmlDocDump (stdout, doc);