diff options
author | Tim-Philipp Müller <tim@centricular.net> | 2013-05-12 22:41:32 +0100 |
---|---|---|
committer | Tim-Philipp Müller <tim@centricular.net> | 2013-05-12 23:42:06 +0100 |
commit | 020c93b973a7e601a8f9ac1a0fad808074e130c8 (patch) | |
tree | 1018416f6438c75c50e3e7f4b2914fd4157edeeb /tests | |
parent | 0c23ac056552102c42fa95a3a5edfeef894a5276 (diff) | |
download | gstreamer-plugins-bad-020c93b973a7e601a8f9ac1a0fad808074e130c8.tar.gz |
ofa: port to 1.0
Diffstat (limited to 'tests')
-rw-r--r-- | tests/check/elements/ofa.c | 65 |
1 files changed, 20 insertions, 45 deletions
diff --git a/tests/check/elements/ofa.c b/tests/check/elements/ofa.c index 1e589d6ef..b12a20d97 100644 --- a/tests/check/elements/ofa.c +++ b/tests/check/elements/ofa.c @@ -40,7 +40,6 @@ bus_handler (GstBus * bus, GstMessage * message, gpointer data) else gst_message_parse_error (message, &gerror, &debug); gst_object_default_error (GST_MESSAGE_SRC (message), gerror, debug); - gst_message_unref (message); g_error_free (gerror); g_free (debug); g_main_loop_quit (loop); @@ -53,6 +52,13 @@ bus_handler (GstBus * bus, GstMessage * message, gpointer data) gst_message_parse_tag (message, &tag_list); + GST_DEBUG ("tag message: %" GST_PTR_FORMAT, tag_list); + + if (!gst_tag_list_get_value_index (tag_list, "ofa-fingerprint", 0)) { + gst_tag_list_unref (tag_list); + break; + } + fail_unless (gst_tag_list_get_string (tag_list, "ofa-fingerprint", &fpr)); p = fpr; @@ -102,12 +108,8 @@ GST_START_TEST (test_ofa_le_1ch) capsfilter = gst_element_factory_make ("capsfilter", "capsfilter"); fail_unless (capsfilter != NULL); - caps = gst_caps_new_simple ("audio/x-raw-int", - "rate", G_TYPE_INT, 44100, - "channels", G_TYPE_INT, 1, - "endianness", G_TYPE_INT, G_LITTLE_ENDIAN, - "width", G_TYPE_INT, 16, - "depth", G_TYPE_INT, 16, "signed", G_TYPE_BOOLEAN, TRUE, NULL); + caps = gst_caps_new_simple ("audio/x-raw", "format", G_TYPE_STRING, "S16LE", + "rate", G_TYPE_INT, 44100, "channels", G_TYPE_INT, 1, NULL); g_object_set (G_OBJECT (capsfilter), "caps", caps, NULL); gst_caps_unref (caps); @@ -135,7 +137,7 @@ GST_START_TEST (test_ofa_le_1ch) gst_element_set_state (pipeline, GST_STATE_PLAYING); g_main_loop_run (loop); - fail_unless (gst_element_query_position (audiotestsrc, &fmt, &position)); + fail_unless (gst_element_query_position (audiotestsrc, fmt, &position)); fail_unless (position >= 135 * GST_SECOND); gst_element_set_state (pipeline, GST_STATE_NULL); @@ -173,12 +175,8 @@ GST_START_TEST (test_ofa_be_1ch) capsfilter = gst_element_factory_make ("capsfilter", "capsfilter"); fail_unless (capsfilter != NULL); - caps = gst_caps_new_simple ("audio/x-raw-int", - "rate", G_TYPE_INT, 44100, - "channels", G_TYPE_INT, 1, - "endianness", G_TYPE_INT, G_BIG_ENDIAN, - "width", G_TYPE_INT, 16, - "depth", G_TYPE_INT, 16, "signed", G_TYPE_BOOLEAN, TRUE, NULL); + caps = gst_caps_new_simple ("audio/x-raw", "format", G_TYPE_STRING, "S16BE", + "rate", G_TYPE_INT, 44100, "channels", G_TYPE_INT, 1, NULL); g_object_set (G_OBJECT (capsfilter), "caps", caps, NULL); gst_caps_unref (caps); @@ -206,7 +204,7 @@ GST_START_TEST (test_ofa_be_1ch) gst_element_set_state (pipeline, GST_STATE_PLAYING); g_main_loop_run (loop); - fail_unless (gst_element_query_position (audiotestsrc, &fmt, &position)); + fail_unless (gst_element_query_position (audiotestsrc, fmt, &position)); fail_unless (position >= 135 * GST_SECOND); gst_element_set_state (pipeline, GST_STATE_NULL); @@ -243,12 +241,8 @@ GST_START_TEST (test_ofa_le_2ch) capsfilter = gst_element_factory_make ("capsfilter", "capsfilter"); fail_unless (capsfilter != NULL); - caps = gst_caps_new_simple ("audio/x-raw-int", - "rate", G_TYPE_INT, 44100, - "channels", G_TYPE_INT, 2, - "endianness", G_TYPE_INT, G_LITTLE_ENDIAN, - "width", G_TYPE_INT, 16, - "depth", G_TYPE_INT, 16, "signed", G_TYPE_BOOLEAN, TRUE, NULL); + caps = gst_caps_new_simple ("audio/x-raw", "format", G_TYPE_STRING, "S16LE", + "rate", G_TYPE_INT, 44100, "channels", G_TYPE_INT, 2, NULL); g_object_set (G_OBJECT (capsfilter), "caps", caps, NULL); gst_caps_unref (caps); @@ -276,7 +270,7 @@ GST_START_TEST (test_ofa_le_2ch) gst_element_set_state (pipeline, GST_STATE_PLAYING); g_main_loop_run (loop); - fail_unless (gst_element_query_position (audiotestsrc, &fmt, &position)); + fail_unless (gst_element_query_position (audiotestsrc, fmt, &position)); fail_unless (position >= 135 * GST_SECOND); gst_element_set_state (pipeline, GST_STATE_NULL); @@ -314,12 +308,8 @@ GST_START_TEST (test_ofa_be_2ch) capsfilter = gst_element_factory_make ("capsfilter", "capsfilter"); fail_unless (capsfilter != NULL); - caps = gst_caps_new_simple ("audio/x-raw-int", - "rate", G_TYPE_INT, 44100, - "channels", G_TYPE_INT, 2, - "endianness", G_TYPE_INT, G_BIG_ENDIAN, - "width", G_TYPE_INT, 16, - "depth", G_TYPE_INT, 16, "signed", G_TYPE_BOOLEAN, TRUE, NULL); + caps = gst_caps_new_simple ("audio/x-raw", "format", G_TYPE_STRING, "S16BE", + "rate", G_TYPE_INT, 44100, "channels", G_TYPE_INT, 2, NULL); g_object_set (G_OBJECT (capsfilter), "caps", caps, NULL); gst_caps_unref (caps); @@ -347,7 +337,7 @@ GST_START_TEST (test_ofa_be_2ch) gst_element_set_state (pipeline, GST_STATE_PLAYING); g_main_loop_run (loop); - fail_unless (gst_element_query_position (audiotestsrc, &fmt, &position)); + fail_unless (gst_element_query_position (audiotestsrc, fmt, &position)); fail_unless (position >= 135 * GST_SECOND); gst_element_set_state (pipeline, GST_STATE_NULL); @@ -378,19 +368,4 @@ ofa_suite (void) return s; } -int -main (int argc, char **argv) -{ - int nf; - - Suite *s = ofa_suite (); - SRunner *sr = srunner_create (s); - - gst_check_init (&argc, &argv); - - srunner_run_all (sr, CK_NORMAL); - nf = srunner_ntests_failed (sr); - srunner_free (sr); - - return nf; -} +GST_CHECK_MAIN (ofa) |