2003-12-22 02:11:52 +00:00
|
|
|
|
|
|
|
#include <gst/gst.h>
|
|
|
|
|
2004-03-13 15:27:01 +00:00
|
|
|
void
|
|
|
|
test1 (void)
|
2003-12-22 02:11:52 +00:00
|
|
|
{
|
|
|
|
GValue dest = { 0 };
|
|
|
|
GValue src1 = { 0 };
|
|
|
|
GValue src2 = { 0 };
|
|
|
|
gboolean ret;
|
|
|
|
|
2004-03-13 15:27:01 +00:00
|
|
|
g_value_init (&src1, G_TYPE_INT);
|
|
|
|
g_value_set_int (&src1, 10);
|
|
|
|
g_value_init (&src2, G_TYPE_INT);
|
|
|
|
g_value_set_int (&src1, 20);
|
|
|
|
ret = gst_value_intersect (&dest, &src1, &src2);
|
|
|
|
g_assert (ret == 0);
|
|
|
|
g_print ("ret = %d\n", ret);
|
2003-12-22 03:03:31 +00:00
|
|
|
}
|
|
|
|
|
2004-03-13 15:27:01 +00:00
|
|
|
void
|
|
|
|
test2 (void)
|
2003-12-22 03:03:31 +00:00
|
|
|
{
|
|
|
|
GValue dest = { 0 };
|
|
|
|
GValue src1 = { 0 };
|
|
|
|
GValue src2 = { 0 };
|
|
|
|
GValue item = { 0 };
|
|
|
|
gboolean ret;
|
|
|
|
|
2004-03-13 15:27:01 +00:00
|
|
|
g_value_init (&src1, GST_TYPE_FOURCC);
|
|
|
|
gst_value_set_fourcc (&src1, GST_MAKE_FOURCC ('Y', 'U', 'Y', '2'));
|
|
|
|
g_value_init (&src2, GST_TYPE_LIST);
|
|
|
|
g_value_init (&item, GST_TYPE_FOURCC);
|
|
|
|
gst_value_set_fourcc (&item, GST_MAKE_FOURCC ('Y', 'U', 'Y', '2'));
|
2003-12-22 03:03:31 +00:00
|
|
|
gst_value_list_append_value (&src2, &item);
|
2004-03-13 15:27:01 +00:00
|
|
|
gst_value_set_fourcc (&item, GST_MAKE_FOURCC ('I', '4', '2', '0'));
|
2003-12-22 03:03:31 +00:00
|
|
|
gst_value_list_append_value (&src2, &item);
|
2004-03-13 15:27:01 +00:00
|
|
|
gst_value_set_fourcc (&item, GST_MAKE_FOURCC ('A', 'B', 'C', 'D'));
|
2003-12-22 03:03:31 +00:00
|
|
|
gst_value_list_append_value (&src2, &item);
|
2004-03-13 15:27:01 +00:00
|
|
|
ret = gst_value_intersect (&dest, &src1, &src2);
|
|
|
|
g_print ("ret = %d\n", ret);
|
2003-12-22 02:11:52 +00:00
|
|
|
|
2004-03-13 15:27:01 +00:00
|
|
|
g_print ("type = %s\n", g_type_name (G_VALUE_TYPE (&dest)));
|
|
|
|
g_print ("value = %s\n", g_strdup_value_contents (&dest));
|
2003-12-22 02:11:52 +00:00
|
|
|
}
|
|
|
|
|
2004-03-13 15:27:01 +00:00
|
|
|
int
|
|
|
|
main (int argc, char *argv[])
|
2003-12-22 02:11:52 +00:00
|
|
|
{
|
|
|
|
|
2004-03-13 15:27:01 +00:00
|
|
|
gst_init (&argc, &argv);
|
2003-12-22 02:11:52 +00:00
|
|
|
|
2004-03-13 15:27:01 +00:00
|
|
|
test1 ();
|
|
|
|
test2 ();
|
2003-12-22 02:11:52 +00:00
|
|
|
|
|
|
|
return 0;
|
|
|
|
|
|
|
|
}
|