Commit b60d8fe0 authored by Thomas Vander Stichele's avatar Thomas Vander Stichele
Browse files

mainloop test and some caps fixes that had to go in

Original commit message from CVS:
mainloop test
and some caps fixes that had to go in
parent de8df7b9
......@@ -93,31 +93,31 @@ main (int argc, char *argv[])
gst_init (&argc, &argv);
testret = gst_caps_check_compatibility (GST_CAPS_GET (mp1parsecaps), GST_CAPS_GET (rawcaps));
testret = gst_caps_is_always_compatible (GST_CAPS_GET (mp1parsecaps), GST_CAPS_GET (rawcaps));
g_print ("4 <-> 2 == %d (invalid, wrong major type)\n", testret);
testret = gst_caps_check_compatibility (GST_CAPS_GET (mp1parsecaps), GST_CAPS_GET (sinkcaps));
testret = gst_caps_is_always_compatible (GST_CAPS_GET (mp1parsecaps), GST_CAPS_GET (sinkcaps));
g_print ("4 <-> 1 == %d (valid, subset)\n", testret);
testret = gst_caps_check_compatibility (GST_CAPS_GET (sinkcaps), GST_CAPS_GET (mp1parsecaps));
testret = gst_caps_is_always_compatible (GST_CAPS_GET (sinkcaps), GST_CAPS_GET (mp1parsecaps));
g_print ("1 <-> 4 == %d (invalid, superset)\n", testret);
testret = gst_caps_check_compatibility (GST_CAPS_GET (rawcaps), GST_CAPS_GET (rawcaps2));
testret = gst_caps_is_always_compatible (GST_CAPS_GET (rawcaps), GST_CAPS_GET (rawcaps2));
g_print ("2 <-> 3 == %d (invalid, ranges)\n", testret);
testret = gst_caps_check_compatibility (GST_CAPS_GET (rawcaps), GST_CAPS_GET (rawcaps3));
testret = gst_caps_is_always_compatible (GST_CAPS_GET (rawcaps), GST_CAPS_GET (rawcaps3));
g_print ("2 <-> 5 == %d (valid)\n", testret);
testret = gst_caps_check_compatibility (GST_CAPS_GET (rawcaps3), GST_CAPS_GET (rawcaps));
testret = gst_caps_is_always_compatible (GST_CAPS_GET (rawcaps3), GST_CAPS_GET (rawcaps));
g_print ("5 <-> 2 == %d (invalid)\n", testret);
testret = gst_caps_check_compatibility (GST_CAPS_GET (rawcaps2), GST_CAPS_GET (rawcaps3));
testret = gst_caps_is_always_compatible (GST_CAPS_GET (rawcaps2), GST_CAPS_GET (rawcaps3));
g_print ("3 <-> 5 == %d (valid)\n", testret);
testret = gst_caps_check_compatibility (GST_CAPS_GET (rawcaps2), GST_CAPS_GET (rawcaps));
testret = gst_caps_is_always_compatible (GST_CAPS_GET (rawcaps2), GST_CAPS_GET (rawcaps));
g_print ("3 <-> 2 == %d (invalid, property missing in source)\n", testret);
testret = gst_caps_check_compatibility (GST_CAPS_GET (rawcaps), GST_CAPS_GET (rawcaps));
testret = gst_caps_is_always_compatible (GST_CAPS_GET (rawcaps), GST_CAPS_GET (rawcaps));
g_print ("2 <-> 2 == %d (valid, same caps)\n", testret);
return 0;
......
......@@ -3,7 +3,7 @@ tests_failing = element bin element_pad pad
else
tests_failing =
endif
tests_working =
tests_working = mainloop
element_SOURCES = element.c mem.c
pad_SOURCES = pad.c mem.c
......
#include <gst/gst.h>
/* test to make sure that we can do gst_main and gst_main_quit in succession */
/* FIXME: use mutexes */
gboolean mainloop = FALSE;
static gboolean
quit_main (gpointer data)
{
if (mainloop)
{
mainloop = FALSE;
g_print ("-");
gst_main_quit ();
}
return TRUE;
}
int
main (int argc, gchar *argv[])
{
int i;
g_timeout_add (10, quit_main, NULL);
for (i = 0; i < 1000; ++i)
{
mainloop = TRUE;
g_print ("+");
gst_main ();
}
return 0;
}
......@@ -93,31 +93,31 @@ main (int argc, char *argv[])
gst_init (&argc, &argv);
testret = gst_caps_check_compatibility (GST_CAPS_GET (mp1parsecaps), GST_CAPS_GET (rawcaps));
testret = gst_caps_is_always_compatible (GST_CAPS_GET (mp1parsecaps), GST_CAPS_GET (rawcaps));
g_print ("4 <-> 2 == %d (invalid, wrong major type)\n", testret);
testret = gst_caps_check_compatibility (GST_CAPS_GET (mp1parsecaps), GST_CAPS_GET (sinkcaps));
testret = gst_caps_is_always_compatible (GST_CAPS_GET (mp1parsecaps), GST_CAPS_GET (sinkcaps));
g_print ("4 <-> 1 == %d (valid, subset)\n", testret);
testret = gst_caps_check_compatibility (GST_CAPS_GET (sinkcaps), GST_CAPS_GET (mp1parsecaps));
testret = gst_caps_is_always_compatible (GST_CAPS_GET (sinkcaps), GST_CAPS_GET (mp1parsecaps));
g_print ("1 <-> 4 == %d (invalid, superset)\n", testret);
testret = gst_caps_check_compatibility (GST_CAPS_GET (rawcaps), GST_CAPS_GET (rawcaps2));
testret = gst_caps_is_always_compatible (GST_CAPS_GET (rawcaps), GST_CAPS_GET (rawcaps2));
g_print ("2 <-> 3 == %d (invalid, ranges)\n", testret);
testret = gst_caps_check_compatibility (GST_CAPS_GET (rawcaps), GST_CAPS_GET (rawcaps3));
testret = gst_caps_is_always_compatible (GST_CAPS_GET (rawcaps), GST_CAPS_GET (rawcaps3));
g_print ("2 <-> 5 == %d (valid)\n", testret);
testret = gst_caps_check_compatibility (GST_CAPS_GET (rawcaps3), GST_CAPS_GET (rawcaps));
testret = gst_caps_is_always_compatible (GST_CAPS_GET (rawcaps3), GST_CAPS_GET (rawcaps));
g_print ("5 <-> 2 == %d (invalid)\n", testret);
testret = gst_caps_check_compatibility (GST_CAPS_GET (rawcaps2), GST_CAPS_GET (rawcaps3));
testret = gst_caps_is_always_compatible (GST_CAPS_GET (rawcaps2), GST_CAPS_GET (rawcaps3));
g_print ("3 <-> 5 == %d (valid)\n", testret);
testret = gst_caps_check_compatibility (GST_CAPS_GET (rawcaps2), GST_CAPS_GET (rawcaps));
testret = gst_caps_is_always_compatible (GST_CAPS_GET (rawcaps2), GST_CAPS_GET (rawcaps));
g_print ("3 <-> 2 == %d (invalid, property missing in source)\n", testret);
testret = gst_caps_check_compatibility (GST_CAPS_GET (rawcaps), GST_CAPS_GET (rawcaps));
testret = gst_caps_is_always_compatible (GST_CAPS_GET (rawcaps), GST_CAPS_GET (rawcaps));
g_print ("2 <-> 2 == %d (valid, same caps)\n", testret);
return 0;
......
......@@ -3,7 +3,7 @@ tests_failing = element bin element_pad pad
else
tests_failing =
endif
tests_working =
tests_working = mainloop
element_SOURCES = element.c mem.c
pad_SOURCES = pad.c mem.c
......
#include <gst/gst.h>
/* test to make sure that we can do gst_main and gst_main_quit in succession */
/* FIXME: use mutexes */
gboolean mainloop = FALSE;
static gboolean
quit_main (gpointer data)
{
if (mainloop)
{
mainloop = FALSE;
g_print ("-");
gst_main_quit ();
}
return TRUE;
}
int
main (int argc, gchar *argv[])
{
int i;
g_timeout_add (10, quit_main, NULL);
for (i = 0; i < 1000; ++i)
{
mainloop = TRUE;
g_print ("+");
gst_main ();
}
return 0;
}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment