source: trunk/third/gstreamer/testsuite/caps/intersect2.c @ 21005

Revision 21005, 3.8 KB checked in by ghudson, 20 years ago (diff)
This commit was generated by cvs2svn to compensate for changes in r21004, which included commits to RCS files with non-trunk default branches.
Line 
1#include <gst/gst.h>
2
3GstStaticCaps rawcaps1 = GST_STATIC_CAPS ("video/x-raw-yuv, "
4    "fourcc:fourcc=\"YUYV\", "
5    "height:int=640, "
6    "width:int=480, "
7    "framerate:float=30.0; "
8    "video/x-raw-yuv, "
9    "fourcc:fourcc=\"I420\", "
10    "height:int=640, " "width:int=480, " "framerate:float=30.0");
11
12GstStaticCaps rawcaps2 = GST_STATIC_CAPS ("video/x-raw-yuv");
13
14GstStaticCaps rawcaps3 =
15GST_STATIC_CAPS ("video/x-raw-yuv, height=(int) [ 0, MAX ]");
16
17GstStaticCaps rawcaps4 =
18    GST_STATIC_CAPS
19    ("video/x-raw-yuv, format=(fourcc)YUY2; video/x-raw-yuv, format=(fourcc)UYVY");
20
21GstStaticCaps rawcaps5 =
22    GST_STATIC_CAPS
23    ("video/x-raw-yuv, format=(fourcc)YUY2, framerate=(double)[0,1.79769e+308], width=(int)[0,2147483647], height=(int)[0,2147483647]; video/x-raw-yuv, format=(fourcc)UYVY, framerate=(double)[0,1.79769e+308], width=(int)[0,2147483647], height=(int)[0,2147483647]");
24
25GstStaticCaps rawcaps6 =
26    GST_STATIC_CAPS
27    ("video/x-raw-yuv, format=(fourcc)YUY2, width=(int)320, height=(int)240");
28
29GstStaticCaps rawcaps7 =
30    GST_STATIC_CAPS
31    ("video/x-raw-yuv, format=(fourcc)YUY2, width=(int)[0,2147483647], height=(int)[0,2147483647], framerate=(double)[0,1.79769e+308]");
32
33GstStaticCaps rawcaps8 =
34    GST_STATIC_CAPS
35    ("video/x-raw-yuv, format=(fourcc)YUY2, width=(int)320, height=(int)240");
36
37GstStaticCaps rawcaps9 =
38    GST_STATIC_CAPS
39    ("audio/x-raw-float, "
40    "channel-positions=(int)< "
41    "{ 1, 2, 3, 4, 5, 6 }, "
42    "{ 1, 2 }, "
43    "{ 1, 2, 3, 4, 5, 6 }, " "{ 1, 2, 3, 4, 5, 6 }, " "{ 4, 5, 6 }, " "6 >");
44
45GstStaticCaps rawcaps10 =
46    GST_STATIC_CAPS
47    ("audio/x-raw-float, "
48    "channel-positions=(int)< 1, { 2, 3, 4, 5, 6 }, 3, 4, {4, 5, 6 }, "
49    "{ 4, 5, 6 } >");
50
51
52int
53main (int argc, char *argv[])
54{
55  GstCaps *caps1;
56  GstCaps *caps2;
57  GstCaps *caps3;
58  GstCaps *caps4;
59  GstCaps *caps;
60
61  gst_init (&argc, &argv);
62
63  caps1 = gst_caps_copy (gst_static_caps_get (&rawcaps1));
64  caps2 =
65      gst_caps_new_full (gst_structure_copy (gst_caps_get_structure
66          (gst_static_caps_get (&rawcaps1), 0)), NULL);
67
68#if 0
69  gst_caps_set (caps1, "height", GST_PROPS_INT (640));
70  gst_caps_set (caps1, "width", GST_PROPS_INT (480));
71  gst_caps_set (caps1, "framerate", GST_PROPS_FLOAT (30.0));
72#endif
73
74  caps = gst_caps_intersect (caps1, caps2);
75  g_print ("caps %s\n", gst_caps_to_string (caps));
76  if (gst_caps_is_empty (caps))
77    return 1;
78  gst_caps_free (caps1);
79  gst_caps_free (caps2);
80
81  caps1 = gst_caps_copy (gst_static_caps_get (&rawcaps2));
82  caps2 = gst_caps_copy (gst_static_caps_get (&rawcaps3));
83  caps = gst_caps_intersect (caps1, caps2);
84  g_print ("caps %s\n", gst_caps_to_string (caps));
85  if (gst_caps_is_empty (caps))
86    return 1;
87  gst_caps_free (caps1);
88  gst_caps_free (caps2);
89
90  caps1 = gst_caps_copy (gst_static_caps_get (&rawcaps4));
91  caps2 = gst_caps_copy (gst_static_caps_get (&rawcaps5));
92  caps3 = gst_caps_copy (gst_static_caps_get (&rawcaps6));
93  caps4 = gst_caps_intersect (caps1, caps2);
94  caps = gst_caps_intersect (caps3, caps4);
95  g_print ("caps4 %s\n", gst_caps_to_string (caps4));
96  g_print ("caps %s\n", gst_caps_to_string (caps));
97  gst_caps_free (caps1);
98  gst_caps_free (caps2);
99  gst_caps_free (caps3);
100  gst_caps_free (caps4);
101
102  caps1 = gst_caps_copy (gst_static_caps_get (&rawcaps7));
103  caps2 = gst_caps_copy (gst_static_caps_get (&rawcaps8));
104  caps = gst_caps_intersect (caps1, caps2);
105  g_print ("caps %s\n", gst_caps_to_string (caps));
106  if (gst_caps_is_empty (caps))
107    return 1;
108  gst_caps_free (caps1);
109  gst_caps_free (caps2);
110
111  caps1 = gst_caps_copy (gst_static_caps_get (&rawcaps9));
112  caps2 = gst_caps_copy (gst_static_caps_get (&rawcaps10));
113  caps = gst_caps_intersect (caps1, caps2);
114  g_print ("caps %s\n", gst_caps_to_string (caps));
115  if (gst_caps_is_empty (caps))
116    return 1;
117  gst_caps_free (caps1);
118  gst_caps_free (caps2);
119
120  return 0;
121}
Note: See TracBrowser for help on using the repository browser.