diff options
author | Jan Schmidt <thaytan@mad.scientist.com> | 2008-02-07 21:57:54 +0000 |
---|---|---|
committer | Jan Schmidt <thaytan@mad.scientist.com> | 2008-02-07 21:57:54 +0000 |
commit | 6fe3c141d711f0796a893369b3d715b7ef11c00b (patch) | |
tree | ee4df2692acc61cde72a07e1fde68969e521d620 /tests | |
parent | 6d166987a0cce4e56faa888c4bbb7929e7866faf (diff) |
Move the lpwsinc and bpwsinc elements from gst-plugins-bad into the audiofx plugin, and rename to audiowsinclimit and...
Original commit message from CVS:
* docs/plugins/Makefile.am:
* docs/plugins/gst-plugins-good-plugins-docs.sgml:
* docs/plugins/gst-plugins-good-plugins-sections.txt:
* docs/plugins/gst-plugins-good-plugins.args:
* docs/plugins/inspect/plugin-audiofx.xml:
* gst/audiofx/Makefile.am:
* gst/audiofx/audiofx.c:
* gst/audiofx/audiowsincband.c:
* gst/audiofx/audiowsincband.h:
* gst/audiofx/audiowsinclimit.c:
* gst/audiofx/audiowsinclimit.h:
* tests/check/Makefile.am:
* tests/check/elements/audiowsincband.c:
* tests/check/elements/audiowsinclimit.c:
Move the lpwsinc and bpwsinc elements from gst-plugins-bad into
the audiofx plugin, and rename to audiowsinclimit and audiowsincband
respectively.
Fixes: #467666
Diffstat (limited to 'tests')
-rw-r--r-- | tests/check/Makefile.am | 2 | ||||
-rw-r--r-- | tests/check/elements/audiowsincband.c | 342 | ||||
-rw-r--r-- | tests/check/elements/audiowsinclimit.c | 198 |
3 files changed, 270 insertions, 272 deletions
diff --git a/tests/check/Makefile.am b/tests/check/Makefile.am index dac5d16c..68abd275 100644 --- a/tests/check/Makefile.am +++ b/tests/check/Makefile.am @@ -59,6 +59,8 @@ check_PROGRAMS = \ elements/audiocheblimit \ elements/audioamplify \ elements/audiodynamic \ + elements/audiowsincband \ + elements/audiowsinclimit \ elements/avimux \ elements/avisubtitle \ elements/icydemux \ diff --git a/tests/check/elements/audiowsincband.c b/tests/check/elements/audiowsincband.c index 7d2e416e..c3ea37f0 100644 --- a/tests/check/elements/audiowsincband.c +++ b/tests/check/elements/audiowsincband.c @@ -2,7 +2,7 @@ * * Copyright (C) 2007 Sebastian Dröge <slomo@circular-chaos.org> * - * bpwsinc.c: Unit test for the bpwsinc element + * audiowsincband.c: Unit test for the audiowsincband element * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public License @@ -31,14 +31,14 @@ * get_peer, and then remove references in every test function */ GstPad *mysrcpad, *mysinkpad; -#define BPWSINC_CAPS_STRING_32 \ +#define AUDIO_WSINC_BAND_CAPS_STRING_32 \ "audio/x-raw-float, " \ "channels = (int) 1, " \ "rate = (int) 44100, " \ "endianness = (int) BYTE_ORDER, " \ "width = (int) 32" \ -#define BPWSINC_CAPS_STRING_64 \ +#define AUDIO_WSINC_BAND_CAPS_STRING_64 \ "audio/x-raw-float, " \ "channels = (int) 1, " \ "rate = (int) 44100, " \ @@ -63,24 +63,24 @@ static GstStaticPadTemplate srctemplate = GST_STATIC_PAD_TEMPLATE ("src", ); GstElement * -setup_bpwsinc () +setup_audiowsincband () { - GstElement *bpwsinc; + GstElement *audiowsincband; - GST_DEBUG ("setup_bpwsinc"); - bpwsinc = gst_check_setup_element ("bpwsinc"); - mysrcpad = gst_check_setup_src_pad (bpwsinc, &srctemplate, NULL); - mysinkpad = gst_check_setup_sink_pad (bpwsinc, &sinktemplate, NULL); + GST_DEBUG ("setup_audiowsincband"); + audiowsincband = gst_check_setup_element ("audiowsincband"); + mysrcpad = gst_check_setup_src_pad (audiowsincband, &srctemplate, NULL); + mysinkpad = gst_check_setup_sink_pad (audiowsincband, &sinktemplate, NULL); gst_pad_set_active (mysrcpad, TRUE); gst_pad_set_active (mysinkpad, TRUE); - return bpwsinc; + return audiowsincband; } void -cleanup_bpwsinc (GstElement * bpwsinc) +cleanup_audiowsincband (GstElement * audiowsincband) { - GST_DEBUG ("cleanup_bpwsinc"); + GST_DEBUG ("cleanup_audiowsincband"); g_list_foreach (buffers, (GFunc) gst_mini_object_unref, NULL); g_list_free (buffers); @@ -88,9 +88,9 @@ cleanup_bpwsinc (GstElement * bpwsinc) gst_pad_set_active (mysrcpad, FALSE); gst_pad_set_active (mysinkpad, FALSE); - gst_check_teardown_src_pad (bpwsinc); - gst_check_teardown_sink_pad (bpwsinc); - gst_check_teardown_element (bpwsinc); + gst_check_teardown_src_pad (audiowsincband); + gst_check_teardown_sink_pad (audiowsincband); + gst_check_teardown_element (audiowsincband); } /* Test if data containing only one frequency component @@ -98,32 +98,32 @@ cleanup_bpwsinc (GstElement * bpwsinc) * 2000Hz frequency band around rate/4 */ GST_START_TEST (test_32_bp_0hz) { - GstElement *bpwsinc; + GstElement *audiowsincband; GstBuffer *inbuffer, *outbuffer; GstCaps *caps; gfloat *in, *res, rms; gint i; GList *node; - bpwsinc = setup_bpwsinc (); + audiowsincband = setup_audiowsincband (); /* Set to bandpass */ - g_object_set (G_OBJECT (bpwsinc), "mode", 0, NULL); - g_object_set (G_OBJECT (bpwsinc), "length", 31, NULL); + g_object_set (G_OBJECT (audiowsincband), "mode", 0, NULL); + g_object_set (G_OBJECT (audiowsincband), "length", 31, NULL); - fail_unless (gst_element_set_state (bpwsinc, + fail_unless (gst_element_set_state (audiowsincband, GST_STATE_PLAYING) == GST_STATE_CHANGE_SUCCESS, "could not set to playing"); - g_object_set (G_OBJECT (bpwsinc), "lower-frequency", 44100 / 4.0 - 1000, - NULL); - g_object_set (G_OBJECT (bpwsinc), "upper-frequency", 44100 / 4.0 + 1000, - NULL); + g_object_set (G_OBJECT (audiowsincband), "lower-frequency", + 44100 / 4.0 - 1000, NULL); + g_object_set (G_OBJECT (audiowsincband), "upper-frequency", + 44100 / 4.0 + 1000, NULL); inbuffer = gst_buffer_new_and_alloc (1024 * sizeof (gfloat)); in = (gfloat *) GST_BUFFER_DATA (inbuffer); for (i = 0; i < 1024; i++) in[i] = 1.0; - caps = gst_caps_from_string (BPWSINC_CAPS_STRING_32); + caps = gst_caps_from_string (AUDIO_WSINC_BAND_CAPS_STRING_32); gst_buffer_set_caps (inbuffer, caps); gst_caps_unref (caps); ASSERT_BUFFER_REFCOUNT (inbuffer, "inbuffer", 1); @@ -149,7 +149,7 @@ GST_START_TEST (test_32_bp_0hz) } /* cleanup */ - cleanup_bpwsinc (bpwsinc); + cleanup_audiowsincband (audiowsincband); } GST_END_TEST; @@ -159,26 +159,26 @@ GST_END_TEST; * and a 2000Hz frequency band around rate/4 */ GST_START_TEST (test_32_bp_11025hz) { - GstElement *bpwsinc; + GstElement *audiowsincband; GstBuffer *inbuffer, *outbuffer; GstCaps *caps; gfloat *in, *res, rms; gint i; GList *node; - bpwsinc = setup_bpwsinc (); + audiowsincband = setup_audiowsincband (); /* Set to bandpass */ - g_object_set (G_OBJECT (bpwsinc), "mode", 0, NULL); - g_object_set (G_OBJECT (bpwsinc), "length", 31, NULL); + g_object_set (G_OBJECT (audiowsincband), "mode", 0, NULL); + g_object_set (G_OBJECT (audiowsincband), "length", 31, NULL); - fail_unless (gst_element_set_state (bpwsinc, + fail_unless (gst_element_set_state (audiowsincband, GST_STATE_PLAYING) == GST_STATE_CHANGE_SUCCESS, "could not set to playing"); - g_object_set (G_OBJECT (bpwsinc), "lower-frequency", 44100 / 4.0 - 1000, - NULL); - g_object_set (G_OBJECT (bpwsinc), "upper-frequency", 44100 / 4.0 + 1000, - NULL); + g_object_set (G_OBJECT (audiowsincband), "lower-frequency", + 44100 / 4.0 - 1000, NULL); + g_object_set (G_OBJECT (audiowsincband), "upper-frequency", + 44100 / 4.0 + 1000, NULL); inbuffer = gst_buffer_new_and_alloc (1024 * sizeof (gfloat)); in = (gfloat *) GST_BUFFER_DATA (inbuffer); for (i = 0; i < 1024; i += 4) { @@ -188,7 +188,7 @@ GST_START_TEST (test_32_bp_11025hz) in[i + 3] = -1.0; } - caps = gst_caps_from_string (BPWSINC_CAPS_STRING_32); + caps = gst_caps_from_string (AUDIO_WSINC_BAND_CAPS_STRING_32); gst_buffer_set_caps (inbuffer, caps); gst_caps_unref (caps); ASSERT_BUFFER_REFCOUNT (inbuffer, "inbuffer", 1); @@ -214,7 +214,7 @@ GST_START_TEST (test_32_bp_11025hz) } /* cleanup */ - cleanup_bpwsinc (bpwsinc); + cleanup_audiowsincband (audiowsincband); } GST_END_TEST; @@ -225,26 +225,26 @@ GST_END_TEST; * 2000Hz frequency band around rate/4 */ GST_START_TEST (test_32_bp_22050hz) { - GstElement *bpwsinc; + GstElement *audiowsincband; GstBuffer *inbuffer, *outbuffer; GstCaps *caps; gfloat *in, *res, rms; gint i; GList *node; - bpwsinc = setup_bpwsinc (); + audiowsincband = setup_audiowsincband (); /* Set to bandpass */ - g_object_set (G_OBJECT (bpwsinc), "mode", 0, NULL); - g_object_set (G_OBJECT (bpwsinc), "length", 31, NULL); + g_object_set (G_OBJECT (audiowsincband), "mode", 0, NULL); + g_object_set (G_OBJECT (audiowsincband), "length", 31, NULL); - fail_unless (gst_element_set_state (bpwsinc, + fail_unless (gst_element_set_state (audiowsincband, GST_STATE_PLAYING) == GST_STATE_CHANGE_SUCCESS, "could not set to playing"); - g_object_set (G_OBJECT (bpwsinc), "lower-frequency", 44100 / 4.0 - 1000, - NULL); - g_object_set (G_OBJECT (bpwsinc), "upper-frequency", 44100 / 4.0 + 1000, - NULL); + g_object_set (G_OBJECT (audiowsincband), "lower-frequency", + 44100 / 4.0 - 1000, NULL); + g_object_set (G_OBJECT (audiowsincband), "upper-frequency", + 44100 / 4.0 + 1000, NULL); inbuffer = gst_buffer_new_and_alloc (1024 * sizeof (gfloat)); in = (gfloat *) GST_BUFFER_DATA (inbuffer); for (i = 0; i < 1024; i += 2) { @@ -252,7 +252,7 @@ GST_START_TEST (test_32_bp_22050hz) in[i + 1] = -1.0; } - caps = gst_caps_from_string (BPWSINC_CAPS_STRING_32); + caps = gst_caps_from_string (AUDIO_WSINC_BAND_CAPS_STRING_32); gst_buffer_set_caps (inbuffer, caps); gst_caps_unref (caps); ASSERT_BUFFER_REFCOUNT (inbuffer, "inbuffer", 1); @@ -278,7 +278,7 @@ GST_START_TEST (test_32_bp_22050hz) } /* cleanup */ - cleanup_bpwsinc (bpwsinc); + cleanup_audiowsincband (audiowsincband); } GST_END_TEST; @@ -288,32 +288,32 @@ GST_END_TEST; * 2000Hz frequency band around rate/4 */ GST_START_TEST (test_32_br_0hz) { - GstElement *bpwsinc; + GstElement *audiowsincband; GstBuffer *inbuffer, *outbuffer; GstCaps *caps; gfloat *in, *res, rms; gint i; GList *node; - bpwsinc = setup_bpwsinc (); + audiowsincband = setup_audiowsincband (); /* Set to bandreject */ - g_object_set (G_OBJECT (bpwsinc), "mode", 1, NULL); - g_object_set (G_OBJECT (bpwsinc), "length", 31, NULL); + g_object_set (G_OBJECT (audiowsincband), "mode", 1, NULL); + g_object_set (G_OBJECT (audiowsincband), "length", 31, NULL); - fail_unless (gst_element_set_state (bpwsinc, + fail_unless (gst_element_set_state (audiowsincband, GST_STATE_PLAYING) == GST_STATE_CHANGE_SUCCESS, "could not set to playing"); - g_object_set (G_OBJECT (bpwsinc), "lower-frequency", 44100 / 4.0 - 1000, - NULL); - g_object_set (G_OBJECT (bpwsinc), "upper-frequency", 44100 / 4.0 + 1000, - NULL); + g_object_set (G_OBJECT (audiowsincband), "lower-frequency", + 44100 / 4.0 - 1000, NULL); + g_object_set (G_OBJECT (audiowsincband), "upper-frequency", + 44100 / 4.0 + 1000, NULL); inbuffer = gst_buffer_new_and_alloc (1024 * sizeof (gfloat)); in = (gfloat *) GST_BUFFER_DATA (inbuffer); for (i = 0; i < 1024; i++) in[i] = 1.0; - caps = gst_caps_from_string (BPWSINC_CAPS_STRING_32); + caps = gst_caps_from_string (AUDIO_WSINC_BAND_CAPS_STRING_32); gst_buffer_set_caps (inbuffer, caps); gst_caps_unref (caps); ASSERT_BUFFER_REFCOUNT (inbuffer, "inbuffer", 1); @@ -339,7 +339,7 @@ GST_START_TEST (test_32_br_0hz) } /* cleanup */ - cleanup_bpwsinc (bpwsinc); + cleanup_audiowsincband (audiowsincband); } GST_END_TEST; @@ -349,26 +349,26 @@ GST_END_TEST; * and a 2000Hz frequency band around rate/4 */ GST_START_TEST (test_32_br_11025hz) { - GstElement *bpwsinc; + GstElement *audiowsincband; GstBuffer *inbuffer, *outbuffer; GstCaps *caps; gfloat *in, *res, rms; gint i; GList *node; - bpwsinc = setup_bpwsinc (); + audiowsincband = setup_audiowsincband (); /* Set to bandreject */ - g_object_set (G_OBJECT (bpwsinc), "mode", 1, NULL); - g_object_set (G_OBJECT (bpwsinc), "length", 31, NULL); + g_object_set (G_OBJECT (audiowsincband), "mode", 1, NULL); + g_object_set (G_OBJECT (audiowsincband), "length", 31, NULL); - fail_unless (gst_element_set_state (bpwsinc, + fail_unless (gst_element_set_state (audiowsincband, GST_STATE_PLAYING) == GST_STATE_CHANGE_SUCCESS, "could not set to playing"); - g_object_set (G_OBJECT (bpwsinc), "lower-frequency", 44100 / 4.0 - 1000, - NULL); - g_object_set (G_OBJECT (bpwsinc), "upper-frequency", 44100 / 4.0 + 1000, - NULL); + g_object_set (G_OBJECT (audiowsincband), "lower-frequency", + 44100 / 4.0 - 1000, NULL); + g_object_set (G_OBJECT (audiowsincband), "upper-frequency", + 44100 / 4.0 + 1000, NULL); inbuffer = gst_buffer_new_and_alloc (1024 * sizeof (gfloat)); in = (gfloat *) GST_BUFFER_DATA (inbuffer); @@ -379,7 +379,7 @@ GST_START_TEST (test_32_br_11025hz) in[i + 3] = -1.0; } - caps = gst_caps_from_string (BPWSINC_CAPS_STRING_32); + caps = gst_caps_from_string (AUDIO_WSINC_BAND_CAPS_STRING_32); gst_buffer_set_caps (inbuffer, caps); gst_caps_unref (caps); ASSERT_BUFFER_REFCOUNT (inbuffer, "inbuffer", 1); @@ -405,7 +405,7 @@ GST_START_TEST (test_32_br_11025hz) } /* cleanup */ - cleanup_bpwsinc (bpwsinc); + cleanup_audiowsincband (audiowsincband); } GST_END_TEST; @@ -416,26 +416,26 @@ GST_END_TEST; * 2000Hz frequency band around rate/4 */ GST_START_TEST (test_32_br_22050hz) { - GstElement *bpwsinc; + GstElement *audiowsincband; GstBuffer *inbuffer, *outbuffer; GstCaps *caps; gfloat *in, *res, rms; gint i; GList *node; - bpwsinc = setup_bpwsinc (); + audiowsincband = setup_audiowsincband (); /* Set to bandreject */ - g_object_set (G_OBJECT (bpwsinc), "mode", 1, NULL); - g_object_set (G_OBJECT (bpwsinc), "length", 31, NULL); + g_object_set (G_OBJECT (audiowsincband), "mode", 1, NULL); + g_object_set (G_OBJECT (audiowsincband), "length", 31, NULL); - fail_unless (gst_element_set_state (bpwsinc, + fail_unless (gst_element_set_state (audiowsincband, GST_STATE_PLAYING) == GST_STATE_CHANGE_SUCCESS, "could not set to playing"); - g_object_set (G_OBJECT (bpwsinc), "lower-frequency", 44100 / 4.0 - 1000, - NULL); - g_object_set (G_OBJECT (bpwsinc), "upper-frequency", 44100 / 4.0 + 1000, - NULL); + g_object_set (G_OBJECT (audiowsincband), "lower-frequency", + 44100 / 4.0 - 1000, NULL); + g_object_set (G_OBJECT (audiowsincband), "upper-frequency", + 44100 / 4.0 + 1000, NULL); inbuffer = gst_buffer_new_and_alloc (1024 * sizeof (gfloat)); in = (gfloat *) GST_BUFFER_DATA (inbuffer); for (i = 0; i < 1024; i += 2) { @@ -443,7 +443,7 @@ GST_START_TEST (test_32_br_22050hz) in[i + 1] = -1.0; } - caps = gst_caps_from_string (BPWSINC_CAPS_STRING_32); + caps = gst_caps_from_string (AUDIO_WSINC_BAND_CAPS_STRING_32); gst_buffer_set_caps (inbuffer, caps); gst_caps_unref (caps); ASSERT_BUFFER_REFCOUNT (inbuffer, "inbuffer", 1); @@ -469,7 +469,7 @@ GST_START_TEST (test_32_br_22050hz) } /* cleanup */ - cleanup_bpwsinc (bpwsinc); + cleanup_audiowsincband (audiowsincband); } GST_END_TEST; @@ -478,32 +478,31 @@ GST_END_TEST; * correctly without accessing wrong memory areas */ GST_START_TEST (test_32_small_buffer) { - GstElement *bpwsinc; - GstBuffer *inbuffer, *outbuffer; + GstElement *audiowsincband; + GstBuffer *inbuffer; GstCaps *caps; gfloat *in; - gfloat *res; gint i; - bpwsinc = setup_bpwsinc (); + audiowsincband = setup_audiowsincband (); /* Set to bandpass */ - g_object_set (G_OBJECT (bpwsinc), "mode", 0, NULL); - g_object_set (G_OBJECT (bpwsinc), "length", 101, NULL); + g_object_set (G_OBJECT (audiowsincband), "mode", 0, NULL); + g_object_set (G_OBJECT (audiowsincband), "length", 101, NULL); - fail_unless (gst_element_set_state (bpwsinc, + fail_unless (gst_element_set_state (audiowsincband, GST_STATE_PLAYING) == GST_STATE_CHANGE_SUCCESS, "could not set to playing"); - g_object_set (G_OBJECT (bpwsinc), "lower-frequency", + g_object_set (G_OBJECT (audiowsincband), "lower-frequency", 44100 / 4.0 - 44100 / 16.0, NULL); - g_object_set (G_OBJECT (bpwsinc), "upper-frequency", + g_object_set (G_OBJECT (audiowsincband), "upper-frequency", 44100 / 4.0 + 44100 / 16.0, NULL); inbuffer = gst_buffer_new_and_alloc (20 * sizeof (gfloat)); in = (gfloat *) GST_BUFFER_DATA (inbuffer); for (i = 0; i < 20; i++) in[i] = 1.0; - caps = gst_caps_from_string (BPWSINC_CAPS_STRING_32); + caps = gst_caps_from_string (AUDIO_WSINC_BAND_CAPS_STRING_32); gst_buffer_set_caps (inbuffer, caps); gst_caps_unref (caps); ASSERT_BUFFER_REFCOUNT (inbuffer, "inbuffer", 1); @@ -515,7 +514,7 @@ GST_START_TEST (test_32_small_buffer) fail_unless (g_list_length (buffers) >= 1); /* cleanup */ - cleanup_bpwsinc (bpwsinc); + cleanup_audiowsincband (audiowsincband); } GST_END_TEST; @@ -533,32 +532,32 @@ GST_END_TEST; * 2000Hz frequency band around rate/4 */ GST_START_TEST (test_64_bp_0hz) { - GstElement *bpwsinc; + GstElement *audiowsincband; GstBuffer *inbuffer, *outbuffer; GstCaps *caps; gdouble *in, *res, rms; gint i; GList *node; - bpwsinc = setup_bpwsinc (); + audiowsincband = setup_audiowsincband (); /* Set to bandpass */ - g_object_set (G_OBJECT (bpwsinc), "mode", 0, NULL); - g_object_set (G_OBJECT (bpwsinc), "length", 31, NULL); + g_object_set (G_OBJECT (audiowsincband), "mode", 0, NULL); + g_object_set (G_OBJECT (audiowsincband), "length", 31, NULL); - fail_unless (gst_element_set_state (bpwsinc, + fail_unless (gst_element_set_state (audiowsincband, GST_STATE_PLAYING) == GST_STATE_CHANGE_SUCCESS, "could not set to playing"); - g_object_set (G_OBJECT (bpwsinc), "lower-frequency", 44100 / 4.0 - 1000, - NULL); - g_object_set (G_OBJECT (bpwsinc), "upper-frequency", 44100 / 4.0 + 1000, - NULL); + g_object_set (G_OBJECT (audiowsincband), "lower-frequency", + 44100 / 4.0 - 1000, NULL); + g_object_set (G_OBJECT (audiowsincband), "upper-frequency", + 44100 / 4.0 + 1000, NULL); inbuffer = gst_buffer_new_and_alloc (1024 * sizeof (gdouble)); in = (gdouble *) GST_BUFFER_DATA (inbuffer); for (i = 0; i < 1024; i++) in[i] = 1.0; - caps = gst_caps_from_string (BPWSINC_CAPS_STRING_64); + caps = gst_caps_from_string (AUDIO_WSINC_BAND_CAPS_STRING_64); gst_buffer_set_caps (inbuffer, caps); gst_caps_unref (caps); ASSERT_BUFFER_REFCOUNT (inbuffer, "inbuffer", 1); @@ -584,7 +583,7 @@ GST_START_TEST (test_64_bp_0hz) } /* cleanup */ - cleanup_bpwsinc (bpwsinc); + cleanup_audiowsincband (audiowsincband); } GST_END_TEST; @@ -594,26 +593,26 @@ GST_END_TEST; * and a 2000Hz frequency band around rate/4 */ GST_START_TEST (test_64_bp_11025hz) { - GstElement *bpwsinc; + GstElement *audiowsincband; GstBuffer *inbuffer, *outbuffer; GstCaps *caps; gdouble *in, *res, rms; gint i; GList *node; - bpwsinc = setup_bpwsinc (); + audiowsincband = setup_audiowsincband (); /* Set to bandpass */ - g_object_set (G_OBJECT (bpwsinc), "mode", 0, NULL); - g_object_set (G_OBJECT (bpwsinc), "length", 31, NULL); + g_object_set (G_OBJECT (audiowsincband), "mode", 0, NULL); + g_object_set (G_OBJECT (audiowsincband), "length", 31, NULL); - fail_unless (gst_element_set_state (bpwsinc, + fail_unless (gst_element_set_state (audiowsincband, GST_STATE_PLAYING) == GST_STATE_CHANGE_SUCCESS, "could not set to playing"); - g_object_set (G_OBJECT (bpwsinc), "lower-frequency", 44100 / 4.0 - 1000, - NULL); - g_object_set (G_OBJECT (bpwsinc), "upper-frequency", 44100 / 4.0 + 1000, - NULL); + g_object_set (G_OBJECT (audiowsincband), "lower-frequency", + 44100 / 4.0 - 1000, NULL); + g_object_set (G_OBJECT (audiowsincband), "upper-frequency", + 44100 / 4.0 + 1000, NULL); inbuffer = gst_buffer_new_and_alloc (1024 * sizeof (gdouble)); in = (gdouble *) GST_BUFFER_DATA (inbuffer); for (i = 0; i < 1024; i += 4) { @@ -623,7 +622,7 @@ GST_START_TEST (test_64_bp_11025hz) in[i + 3] = -1.0; } - caps = gst_caps_from_string (BPWSINC_CAPS_STRING_64); + caps = gst_caps_from_string (AUDIO_WSINC_BAND_CAPS_STRING_64); gst_buffer_set_caps (inbuffer, caps); gst_caps_unref (caps); ASSERT_BUFFER_REFCOUNT (inbuffer, "inbuffer", 1); @@ -649,7 +648,7 @@ GST_START_TEST (test_64_bp_11025hz) } /* cleanup */ - cleanup_bpwsinc (bpwsinc); + cleanup_audiowsincband (audiowsincband); } GST_END_TEST; @@ -660,26 +659,26 @@ GST_END_TEST; * 2000Hz frequency band around rate/4 */ GST_START_TEST (test_64_bp_22050hz) { - GstElement *bpwsinc; + GstElement *audiowsincband; GstBuffer *inbuffer, *outbuffer; GstCaps *caps; gdouble *in, *res, rms; gint i; GList *node; - bpwsinc = setup_bpwsinc (); + audiowsincband = setup_audiowsincband (); /* Set to bandpass */ - g_object_set (G_OBJECT (bpwsinc), "mode", 0, NULL); - g_object_set (G_OBJECT (bpwsinc), "length", 31, NULL); + g_object_set (G_OBJECT (audiowsincband), "mode", 0, NULL); + g_object_set (G_OBJECT (audiowsincband), "length", 31, NULL); - fail_unless (gst_element_set_state (bpwsinc, + fail_unless (gst_element_set_state (audiowsincband, GST_STATE_PLAYING) == GST_STATE_CHANGE_SUCCESS, "could not set to playing"); - g_object_set (G_OBJECT (bpwsinc), "lower-frequency", 44100 / 4.0 - 1000, - NULL); - g_object_set (G_OBJECT (bpwsinc), "upper-frequency", 44100 / 4.0 + 1000, - NULL); + g_object_set (G_OBJECT (audiowsincband), "lower-frequency", + 44100 / 4.0 - 1000, NULL); + g_object_set (G_OBJECT (audiowsincband), "upper-frequency", + 44100 / 4.0 + 1000, NULL); inbuffer = gst_buffer_new_and_alloc (1024 * sizeof (gdouble)); in = (gdouble *) GST_BUFFER_DATA (inbuffer); for (i = 0; i < 1024; i += 2) { @@ -687,7 +686,7 @@ GST_START_TEST (test_64_bp_22050hz) in[i + 1] = -1.0; } - caps = gst_caps_from_string (BPWSINC_CAPS_STRING_64); + caps = gst_caps_from_string (AUDIO_WSINC_BAND_CAPS_STRING_64); gst_buffer_set_caps (inbuffer, caps); gst_caps_unref (caps); ASSERT_BUFFER_REFCOUNT (inbuffer, "inbuffer", 1); @@ -713,7 +712,7 @@ GST_START_TEST (test_64_bp_22050hz) } /* cleanup */ - cleanup_bpwsinc (bpwsinc); + cleanup_audiowsincband (audiowsincband); } GST_END_TEST; @@ -723,32 +722,32 @@ GST_END_TEST; * 2000Hz frequency band around rate/4 */ GST_START_TEST (test_64_br_0hz) { - GstElement *bpwsinc; + GstElement *audiowsincband; GstBuffer *inbuffer, *outbuffer; GstCaps *caps; gdouble *in, *res, rms; gint i; GList *node; - bpwsinc = setup_bpwsinc (); + audiowsincband = setup_audiowsincband (); /* Set to bandreject */ - g_object_set (G_OBJECT (bpwsinc), "mode", 1, NULL); - g_object_set (G_OBJECT (bpwsinc), "length", 31, NULL); + g_object_set (G_OBJECT (audiowsincband), "mode", 1, NULL); + g_object_set (G_OBJECT (audiowsincband), "length", 31, NULL); - fail_unless (gst_element_set_state (bpwsinc, + fail_unless (gst_element_set_state (audiowsincband, GST_STATE_PLAYING) == GST_STATE_CHANGE_SUCCESS, "could not set to playing"); - g_object_set (G_OBJECT (bpwsinc), "lower-frequency", 44100 / 4.0 - 1000, - NULL); - g_object_set (G_OBJECT (bpwsinc), "upper-frequency", 44100 / 4.0 + 1000, - NULL); + g_object_set (G_OBJECT (audiowsincband), "lower-frequency", + 44100 / 4.0 - 1000, NULL); + g_object_set (G_OBJECT (audiowsincband), "upper-frequency", + 44100 / 4.0 + 1000, NULL); inbuffer = gst_buffer_new_and_alloc (1024 * sizeof (gdouble)); in = (gdouble *) GST_BUFFER_DATA (inbuffer); for (i = 0; i < 1024; i++) in[i] = 1.0; - caps = gst_caps_from_string (BPWSINC_CAPS_STRING_64); + caps = gst_caps_from_string (AUDIO_WSINC_BAND_CAPS_STRING_64); gst_buffer_set_caps (inbuffer, caps); gst_caps_unref (caps); ASSERT_BUFFER_REFCOUNT (inbuffer, "inbuffer", 1); @@ -774,7 +773,7 @@ GST_START_TEST (test_64_br_0hz) } /* cleanup */ - cleanup_bpwsinc (bpwsinc); + cleanup_audiowsincband (audiowsincband); } GST_END_TEST; @@ -784,26 +783,26 @@ GST_END_TEST; * and a 2000Hz frequency band around rate/4 */ GST_START_TEST (test_64_br_11025hz) { - GstElement *bpwsinc; + GstElement *audiowsincband; GstBuffer *inbuffer, *outbuffer; GstCaps *caps; gdouble *in, *res, rms; gint i; GList *node; - bpwsinc = setup_bpwsinc (); + audiowsincband = setup_audiowsincband (); /* Set to bandreject */ - g_object_set (G_OBJECT (bpwsinc), "mode", 1, NULL); - g_object_set (G_OBJECT (bpwsinc), "length", 31, NULL); + g_object_set (G_OBJECT (audiowsincband), "mode", 1, NULL); + g_object_set (G_OBJECT (audiowsincband), "length", 31, NULL); - fail_unless (gst_element_set_state (bpwsinc, + fail_unless (gst_element_set_state (audiowsincband, GST_STATE_PLAYING) == GST_STATE_CHANGE_SUCCESS, "could not set to playing"); - g_object_set (G_OBJECT (bpwsinc), "lower-frequency", 44100 / 4.0 - 1000, - NULL); - g_object_set (G_OBJECT (bpwsinc), "upper-frequency", 44100 / 4.0 + 1000, - NULL); + g_object_set (G_OBJECT (audiowsincband), "lower-frequency", + 44100 / 4.0 - 1000, NULL); + g_object_set (G_OBJECT (audiowsincband), "upper-frequency", + 44100 / 4.0 + 1000, NULL); inbuffer = gst_buffer_new_and_alloc (1024 * sizeof (gdouble)); in = (gdouble *) GST_BUFFER_DATA (inbuffer); @@ -814,7 +813,7 @@ GST_START_TEST (test_64_br_11025hz) in[i + 3] = -1.0; } - caps = gst_caps_from_string (BPWSINC_CAPS_STRING_64); + caps = gst_caps_from_string (AUDIO_WSINC_BAND_CAPS_STRING_64); gst_buffer_set_caps (inbuffer, caps); gst_caps_unref (caps); ASSERT_BUFFER_REFCOUNT (inbuffer, "inbuffer", 1); @@ -840,7 +839,7 @@ GST_START_TEST (test_64_br_11025hz) } /* cleanup */ - cleanup_bpwsinc (bpwsinc); + cleanup_audiowsincband (audiowsincband); } GST_END_TEST; @@ -851,26 +850,26 @@ GST_END_TEST; * 2000Hz frequency band around rate/4 */ GST_START_TEST (test_64_br_22050hz) { - GstElement *bpwsinc; + GstElement *audiowsincband; GstBuffer *inbuffer, *outbuffer; GstCaps *caps; gdouble *in, *res, rms; gint i; GList *node; - bpwsinc = setup_bpwsinc (); + audiowsincband = setup_audiowsincband (); /* Set to bandreject */ - g_object_set (G_OBJECT (bpwsinc), "mode", 1, NULL); - g_object_set (G_OBJECT (bpwsinc), "length", 31, NULL); + g_object_set (G_OBJECT (audiowsincband), "mode", 1, NULL); + g_object_set (G_OBJECT (audiowsincband), "length", 31, NULL); - fail_unless (gst_element_set_state (bpwsinc, + fail_unless (gst_element_set_state (audiowsincband, GST_STATE_PLAYING) == GST_STATE_CHANGE_SUCCESS, "could not set to playing"); - g_object_set (G_OBJECT (bpwsinc), "lower-frequency", 44100 / 4.0 - 1000, - NULL); - g_object_set (G_OBJECT (bpwsinc), "upper-frequency", 44100 / 4.0 + 1000, - NULL); + g_object_set (G_OBJECT (audiowsincband), "lower-frequency", + 44100 / 4.0 - 1000, NULL); + g_object_set (G_OBJECT (audiowsincband), "upper-frequency", + 44100 / 4.0 + 1000, NULL); inbuffer = gst_buffer_new_and_alloc (1024 * sizeof (gdouble)); in = (gdouble *) GST_BUFFER_DATA (inbuffer); for (i = 0; i < 1024; i += 2) { @@ -878,7 +877,7 @@ GST_START_TEST (test_64_br_22050hz) in[i + 1] = -1.0; } - caps = gst_caps_from_string (BPWSINC_CAPS_STRING_64); + caps = gst_caps_from_string (AUDIO_WSINC_BAND_CAPS_STRING_64); gst_buffer_set_caps (inbuffer, caps); gst_caps_unref (caps); ASSERT_BUFFER_REFCOUNT (inbuffer, "inbuffer", 1); @@ -904,7 +903,7 @@ GST_START_TEST (test_64_br_22050hz) } /* cleanup */ - cleanup_bpwsinc (bpwsinc); + cleanup_audiowsincband (audiowsincband); } GST_END_TEST; @@ -913,32 +912,31 @@ GST_END_TEST; * correctly without accessing wrong memory areas */ GST_START_TEST (test_64_small_buffer) { - GstElement *bpwsinc; - GstBuffer *inbuffer, *outbuffer; + GstElement *audiowsincband; + GstBuffer *inbuffer; GstCaps *caps; gdouble *in; - gdouble *res; gint i; - bpwsinc = setup_bpwsinc (); + audiowsincband = setup_audiowsincband (); /* Set to bandpass */ - g_object_set (G_OBJECT (bpwsinc), "mode", 0, NULL); - g_object_set (G_OBJECT (bpwsinc), "length", 101, NULL); + g_object_set (G_OBJECT (audiowsincband), "mode", 0, NULL); + g_object_set (G_OBJECT (audiowsincband), "length", 101, NULL); - fail_unless (gst_element_set_state (bpwsinc, + fail_unless (gst_element_set_state (audiowsincband, GST_STATE_PLAYING) == GST_STATE_CHANGE_SUCCESS, "could not set to playing"); - g_object_set (G_OBJECT (bpwsinc), "lower-frequency", + g_object_set (G_OBJECT (audiowsincband), "lower-frequency", 44100 / 4.0 - 44100 / 16.0, NULL); - g_object_set (G_OBJECT (bpwsinc), "upper-frequency", + g_object_set (G_OBJECT (audiowsincband), "upper-frequency", 44100 / 4.0 + 44100 / 16.0, NULL); inbuffer = gst_buffer_new_and_alloc (20 * sizeof (gdouble)); in = (gdouble *) GST_BUFFER_DATA (inbuffer); for (i = 0; i < 20; i++) in[i] = 1.0; - caps = gst_caps_from_string (BPWSINC_CAPS_STRING_64); + caps = gst_caps_from_string (AUDIO_WSINC_BAND_CAPS_STRING_64); gst_buffer_set_caps (inbuffer, caps); gst_caps_unref (caps); ASSERT_BUFFER_REFCOUNT (inbuffer, "inbuffer", 1); @@ -950,15 +948,15 @@ GST_START_TEST (test_64_small_buffer) fail_unless (g_list_length (buffers) >= 1); /* cleanup */ - cleanup_bpwsinc (bpwsinc); + cleanup_audiowsincband (audiowsincband); } GST_END_TEST; Suite * -bpwsinc_suite (void) +audiowsincband_suite (void) { - Suite *s = suite_create ("bpwsinc"); + Suite *s = suite_create ("audiowsincband"); TCase *tc_chain = tcase_create ("general"); suite_add_tcase (s, tc_chain); @@ -985,7 +983,7 @@ main (int argc, char **argv) { int nf; - Suite *s = bpwsinc_suite (); + Suite *s = audiowsincband_suite (); SRunner *sr = srunner_create (s); gst_check_init (&argc, &argv); diff --git a/tests/check/elements/audiowsinclimit.c b/tests/check/elements/audiowsinclimit.c index 934a29db..da176049 100644 --- a/tests/check/elements/audiowsinclimit.c +++ b/tests/check/elements/audiowsinclimit.c @@ -2,7 +2,7 @@ * * Copyright (C) 2007 Sebastian Dröge <slomo@circular-chaos.org> * - * lpwsinc.c: Unit test for the lpwsinc element + * audiowsinclimit.c: Unit test for the audiowsinclimit element * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public License @@ -31,14 +31,14 @@ * get_peer, and then remove references in every test function */ GstPad *mysrcpad, *mysinkpad; -#define LPWSINC_CAPS_STRING_32 \ +#define AUDIO_WSINC_LIMIT_CAPS_STRING_32 \ "audio/x-raw-float, " \ "channels = (int) 1, " \ "rate = (int) 44100, " \ "endianness = (int) BYTE_ORDER, " \ "width = (int) 32" \ -#define LPWSINC_CAPS_STRING_64 \ +#define AUDIO_WSINC_LIMIT_CAPS_STRING_64 \ "audio/x-raw-float, " \ "channels = (int) 1, " \ "rate = (int) 44100, " \ @@ -63,24 +63,24 @@ static GstStaticPadTemplate srctemplate = GST_STATIC_PAD_TEMPLATE ("src", ); GstElement * -setup_lpwsinc () +setup_audiowsinclimit () { - GstElement *lpwsinc; + GstElement *audiowsinclimit; - GST_DEBUG ("setup_lpwsinc"); - lpwsinc = gst_check_setup_element ("lpwsinc"); - mysrcpad = gst_check_setup_src_pad (lpwsinc, &srctemplate, NULL); - mysinkpad = gst_check_setup_sink_pad (lpwsinc, &sinktemplate, NULL); + GST_DEBUG ("setup_audiowsinclimit"); + audiowsinclimit = gst_check_setup_element ("audiowsinclimit"); + mysrcpad = gst_check_setup_src_pad (audiowsinclimit, &srctemplate, NULL); + mysinkpad = gst_check_setup_sink_pad (audiowsinclimit, &sinktemplate, NULL); gst_pad_set_active (mysrcpad, TRUE); gst_pad_set_active (mysinkpad, TRUE); - return lpwsinc; + return audiowsinclimit; } void -cleanup_lpwsinc (GstElement * lpwsinc) +cleanup_audiowsinclimit (GstElement * audiowsinclimit) { - GST_DEBUG ("cleanup_lpwsinc"); + GST_DEBUG ("cleanup_audiowsinclimit"); g_list_foreach (buffers, (GFunc) gst_mini_object_unref, NULL); g_list_free (buffers); @@ -88,9 +88,9 @@ cleanup_lpwsinc (GstElement * lpwsinc) gst_pad_set_active (mysrcpad, FALSE); gst_pad_set_active (mysinkpad, FALSE); - gst_check_teardown_src_pad (lpwsinc); - gst_check_teardown_sink_pad (lpwsinc); - gst_check_teardown_element (lpwsinc); + gst_check_teardown_src_pad (audiowsinclimit); + gst_check_teardown_sink_pad (audiowsinclimit); + gst_check_teardown_element (audiowsinclimit); } /* Test if data containing only one frequency component @@ -98,30 +98,30 @@ cleanup_lpwsinc (GstElement * lpwsinc) * at rate/4 */ GST_START_TEST (test_32_lp_0hz) { - GstElement *lpwsinc; + GstElement *audiowsinclimit; GstBuffer *inbuffer, *outbuffer; GstCaps *caps; gfloat *in, *res, rms; gint i; GList *node; - lpwsinc = setup_lpwsinc (); + audiowsinclimit = setup_audiowsinclimit (); /* Set to lowpass */ - g_object_set (G_OBJECT (lpwsinc), "mode", 0, NULL); - g_object_set (G_OBJECT (lpwsinc), "length", 21, NULL); + g_object_set (G_OBJECT (audiowsinclimit), "mode", 0, NULL); + g_object_set (G_OBJECT (audiowsinclimit), "length", 21, NULL); - fail_unless (gst_element_set_state (lpwsinc, + fail_unless (gst_element_set_state (audiowsinclimit, GST_STATE_PLAYING) == GST_STATE_CHANGE_SUCCESS, "could not set to playing"); /* cutoff = sampling rate / 4, data = 0 */ - g_object_set (G_OBJECT (lpwsinc), "cutoff", 44100 / 4.0, NULL); + g_object_set (G_OBJECT (audiowsinclimit), "cutoff", 44100 / 4.0, NULL); inbuffer = gst_buffer_new_and_alloc (128 * sizeof (gfloat)); in = (gfloat *) GST_BUFFER_DATA (inbuffer); for (i = 0; i < 128; i++) in[i] = 1.0; - caps = gst_caps_from_string (LPWSINC_CAPS_STRING_32); + caps = gst_caps_from_string (AUDIO_WSINC_LIMIT_CAPS_STRING_32); gst_buffer_set_caps (inbuffer, caps); gst_caps_unref (caps); ASSERT_BUFFER_REFCOUNT (inbuffer, "inbuffer", 1); @@ -147,7 +147,7 @@ GST_START_TEST (test_32_lp_0hz) } /* cleanup */ - cleanup_lpwsinc (lpwsinc); + cleanup_audiowsinclimit (audiowsinclimit); } GST_END_TEST; @@ -157,23 +157,23 @@ GST_END_TEST; * at rate/4 */ GST_START_TEST (test_32_lp_22050hz) { - GstElement *lpwsinc; + GstElement *audiowsinclimit; GstBuffer *inbuffer, *outbuffer; GstCaps *caps; gfloat *in, *res, rms; gint i; GList *node; - lpwsinc = setup_lpwsinc (); + audiowsinclimit = setup_audiowsinclimit (); /* Set to lowpass */ - g_object_set (G_OBJECT (lpwsinc), "mode", 0, NULL); - g_object_set (G_OBJECT (lpwsinc), "length", 21, NULL); + g_object_set (G_OBJECT (audiowsinclimit), "mode", 0, NULL); + g_object_set (G_OBJECT (audiowsinclimit), "length", 21, NULL); - fail_unless (gst_element_set_state (lpwsinc, + fail_unless (gst_element_set_state (audiowsinclimit, GST_STATE_PLAYING) == GST_STATE_CHANGE_SUCCESS, "could not set to playing"); - g_object_set (G_OBJECT (lpwsinc), "cutoff", 44100 / 4.0, NULL); + g_object_set (G_OBJECT (audiowsinclimit), "cutoff", 44100 / 4.0, NULL); inbuffer = gst_buffer_new_and_alloc (128 * sizeof (gfloat)); in = (gfloat *) GST_BUFFER_DATA (inbuffer); for (i = 0; i < 128; i += 2) { @@ -181,7 +181,7 @@ GST_START_TEST (test_32_lp_22050hz) in[i + 1] = -1.0; } - caps = gst_caps_from_string (LPWSINC_CAPS_STRING_32); + caps = gst_caps_from_string (AUDIO_WSINC_LIMIT_CAPS_STRING_32); gst_buffer_set_caps (inbuffer, caps); gst_caps_unref (caps); ASSERT_BUFFER_REFCOUNT (inbuffer, "inbuffer", 1); @@ -207,7 +207,7 @@ GST_START_TEST (test_32_lp_22050hz) } /* cleanup */ - cleanup_lpwsinc (lpwsinc); + cleanup_audiowsinclimit (audiowsinclimit); } GST_END_TEST; @@ -217,29 +217,29 @@ GST_END_TEST; * at rate/4 */ GST_START_TEST (test_32_hp_0hz) { - GstElement *lpwsinc; + GstElement *audiowsinclimit; GstBuffer *inbuffer, *outbuffer; GstCaps *caps; gfloat *in, *res, rms; gint i; GList *node; - lpwsinc = setup_lpwsinc (); + audiowsinclimit = setup_audiowsinclimit (); /* Set to highpass */ - g_object_set (G_OBJECT (lpwsinc), "mode", 1, NULL); - g_object_set (G_OBJECT (lpwsinc), "length", 21, NULL); + g_object_set (G_OBJECT (audiowsinclimit), "mode", 1, NULL); + g_object_set (G_OBJECT (audiowsinclimit), "length", 21, NULL); - fail_unless (gst_element_set_state (lpwsinc, + fail_unless (gst_element_set_state (audiowsinclimit, GST_STATE_PLAYING) == GST_STATE_CHANGE_SUCCESS, "could not set to playing"); - g_object_set (G_OBJECT (lpwsinc), "cutoff", 44100 / 4.0, NULL); + g_object_set (G_OBJECT (audiowsinclimit), "cutoff", 44100 / 4.0, NULL); inbuffer = gst_buffer_new_and_alloc (128 * sizeof (gfloat)); in = (gfloat *) GST_BUFFER_DATA (inbuffer); for (i = 0; i < 128; i++) in[i] = 1.0; - caps = gst_caps_from_string (LPWSINC_CAPS_STRING_32); + caps = gst_caps_from_string (AUDIO_WSINC_LIMIT_CAPS_STRING_32); gst_buffer_set_caps (inbuffer, caps); gst_caps_unref (caps); ASSERT_BUFFER_REFCOUNT (inbuffer, "inbuffer", 1); @@ -265,7 +265,7 @@ GST_START_TEST (test_32_hp_0hz) } /* cleanup */ - cleanup_lpwsinc (lpwsinc); + cleanup_audiowsinclimit (audiowsinclimit); } GST_END_TEST; @@ -275,23 +275,23 @@ GST_END_TEST; * at rate/4 */ GST_START_TEST (test_32_hp_22050hz) { - GstElement *lpwsinc; + GstElement *audiowsinclimit; GstBuffer *inbuffer, *outbuffer; GstCaps *caps; gfloat *in, *res, rms; gint i; GList *node; - lpwsinc = setup_lpwsinc (); + audiowsinclimit = setup_audiowsinclimit (); /* Set to highpass */ - g_object_set (G_OBJECT (lpwsinc), "mode", 1, NULL); - g_object_set (G_OBJECT (lpwsinc), "length", 21, NULL); + g_object_set (G_OBJECT (audiowsinclimit), "mode", 1, NULL); + g_object_set (G_OBJECT (audiowsinclimit), "length", 21, NULL); - fail_unless (gst_element_set_state (lpwsinc, + fail_unless (gst_element_set_state (audiowsinclimit, GST_STATE_PLAYING) == GST_STATE_CHANGE_SUCCESS, "could not set to playing"); - g_object_set (G_OBJECT (lpwsinc), "cutoff", 44100 / 4.0, NULL); + g_object_set (G_OBJECT (audiowsinclimit), "cutoff", 44100 / 4.0, NULL); inbuffer = gst_buffer_new_and_alloc (128 * sizeof (gfloat)); in = (gfloat *) GST_BUFFER_DATA (inbuffer); for (i = 0; i < 128; i += 2) { @@ -299,7 +299,7 @@ GST_START_TEST (test_32_hp_22050hz) in[i + 1] = -1.0; } - caps = gst_caps_from_string (LPWSINC_CAPS_STRING_32); + caps = gst_caps_from_string (AUDIO_WSINC_LIMIT_CAPS_STRING_32); gst_buffer_set_caps (inbuffer, caps); gst_caps_unref (caps); ASSERT_BUFFER_REFCOUNT (inbuffer, "inbuffer", 1); @@ -326,7 +326,7 @@ GST_START_TEST (test_32_hp_22050hz) } /* cleanup */ - cleanup_lpwsinc (lpwsinc); + cleanup_audiowsinclimit (audiowsinclimit); } GST_END_TEST; @@ -335,29 +335,28 @@ GST_END_TEST; * correctly without accessing wrong memory areas */ GST_START_TEST (test_32_small_buffer) { - GstElement *lpwsinc; + GstElement *audiowsinclimit; GstBuffer *inbuffer, *outbuffer; GstCaps *caps; gfloat *in; - gfloat *res; gint i; - lpwsinc = setup_lpwsinc (); + audiowsinclimit = setup_audiowsinclimit (); /* Set to lowpass */ - g_object_set (G_OBJECT (lpwsinc), "mode", 0, NULL); - g_object_set (G_OBJECT (lpwsinc), "length", 101, NULL); + g_object_set (G_OBJECT (audiowsinclimit), "mode", 0, NULL); + g_object_set (G_OBJECT (audiowsinclimit), "length", 101, NULL); - fail_unless (gst_element_set_state (lpwsinc, + fail_unless (gst_element_set_state (audiowsinclimit, GST_STATE_PLAYING) == GST_STATE_CHANGE_SUCCESS, "could not set to playing"); - g_object_set (G_OBJECT (lpwsinc), "cutoff", 44100 / 4.0, NULL); + g_object_set (G_OBJECT (audiowsinclimit), "cutoff", 44100 / 4.0, NULL); inbuffer = gst_buffer_new_and_alloc (20 * sizeof (gfloat)); in = (gfloat *) GST_BUFFER_DATA (inbuffer); for (i = 0; i < 20; i++) in[i] = 1.0; - caps = gst_caps_from_string (LPWSINC_CAPS_STRING_32); + caps = gst_caps_from_string (AUDIO_WSINC_LIMIT_CAPS_STRING_32); gst_buffer_set_caps (inbuffer, caps); gst_caps_unref (caps); ASSERT_BUFFER_REFCOUNT (inbuffer, "inbuffer", 1); @@ -370,7 +369,7 @@ GST_START_TEST (test_32_small_buffer) fail_if ((outbuffer = (GstBuffer *) buffers->data) == NULL); /* cleanup */ - cleanup_lpwsinc (lpwsinc); + cleanup_audiowsinclimit (audiowsinclimit); } GST_END_TEST; @@ -380,30 +379,30 @@ GST_END_TEST; * at rate/4 */ GST_START_TEST (test_64_lp_0hz) { - GstElement *lpwsinc; + GstElement *audiowsinclimit; GstBuffer *inbuffer, *outbuffer; GstCaps *caps; gdouble *in, *res, rms; gint i; GList *node; - lpwsinc = setup_lpwsinc (); + audiowsinclimit = setup_audiowsinclimit (); /* Set to lowpass */ - g_object_set (G_OBJECT (lpwsinc), "mode", 0, NULL); - g_object_set (G_OBJECT (lpwsinc), "length", 21, NULL); + g_object_set (G_OBJECT (audiowsinclimit), "mode", 0, NULL); + g_object_set (G_OBJECT (audiowsinclimit), "length", 21, NULL); - fail_unless (gst_element_set_state (lpwsinc, + fail_unless (gst_element_set_state (audiowsinclimit, GST_STATE_PLAYING) == GST_STATE_CHANGE_SUCCESS, "could not set to playing"); /* cutoff = sampling rate / 4, data = 0 */ - g_object_set (G_OBJECT (lpwsinc), "cutoff", 44100 / 4.0, NULL); + g_object_set (G_OBJECT (audiowsinclimit), "cutoff", 44100 / 4.0, NULL); inbuffer = gst_buffer_new_and_alloc (128 * sizeof (gdouble)); in = (gdouble *) GST_BUFFER_DATA (inbuffer); for (i = 0; i < 128; i++) in[i] = 1.0; - caps = gst_caps_from_string (LPWSINC_CAPS_STRING_64); + caps = gst_caps_from_string (AUDIO_WSINC_LIMIT_CAPS_STRING_64); gst_buffer_set_caps (inbuffer, caps); gst_caps_unref (caps); ASSERT_BUFFER_REFCOUNT (inbuffer, "inbuffer", 1); @@ -429,7 +428,7 @@ GST_START_TEST (test_64_lp_0hz) } /* cleanup */ - cleanup_lpwsinc (lpwsinc); + cleanup_audiowsinclimit (audiowsinclimit); } GST_END_TEST; @@ -439,23 +438,23 @@ GST_END_TEST; * at rate/4 */ GST_START_TEST (test_64_lp_22050hz) { - GstElement *lpwsinc; + GstElement *audiowsinclimit; GstBuffer *inbuffer, *outbuffer; GstCaps *caps; gdouble *in, *res, rms; gint i; GList *node; - lpwsinc = setup_lpwsinc (); + audiowsinclimit = setup_audiowsinclimit (); /* Set to lowpass */ - g_object_set (G_OBJECT (lpwsinc), "mode", 0, NULL); - g_object_set (G_OBJECT (lpwsinc), "length", 21, NULL); + g_object_set (G_OBJECT (audiowsinclimit), "mode", 0, NULL); + g_object_set (G_OBJECT (audiowsinclimit), "length", 21, NULL); - fail_unless (gst_element_set_state (lpwsinc, + fail_unless (gst_element_set_state (audiowsinclimit, GST_STATE_PLAYING) == GST_STATE_CHANGE_SUCCESS, "could not set to playing"); - g_object_set (G_OBJECT (lpwsinc), "cutoff", 44100 / 4.0, NULL); + g_object_set (G_OBJECT (audiowsinclimit), "cutoff", 44100 / 4.0, NULL); inbuffer = gst_buffer_new_and_alloc (128 * sizeof (gdouble)); in = (gdouble *) GST_BUFFER_DATA (inbuffer); for (i = 0; i < 128; i += 2) { @@ -463,7 +462,7 @@ GST_START_TEST (test_64_lp_22050hz) in[i + 1] = -1.0; } - caps = gst_caps_from_string (LPWSINC_CAPS_STRING_64); + caps = gst_caps_from_string (AUDIO_WSINC_LIMIT_CAPS_STRING_64); gst_buffer_set_caps (inbuffer, caps); gst_caps_unref (caps); ASSERT_BUFFER_REFCOUNT (inbuffer, "inbuffer", 1); @@ -489,7 +488,7 @@ GST_START_TEST (test_64_lp_22050hz) } /* cleanup */ - cleanup_lpwsinc (lpwsinc); + cleanup_audiowsinclimit (audiowsinclimit); } GST_END_TEST; @@ -499,29 +498,29 @@ GST_END_TEST; * at rate/4 */ GST_START_TEST (test_64_hp_0hz) { - GstElement *lpwsinc; + GstElement *audiowsinclimit; GstBuffer *inbuffer, *outbuffer; GstCaps *caps; gdouble *in, *res, rms; gint i; GList *node; - lpwsinc = setup_lpwsinc (); + audiowsinclimit = setup_audiowsinclimit (); /* Set to highpass */ - g_object_set (G_OBJECT (lpwsinc), "mode", 1, NULL); - g_object_set (G_OBJECT (lpwsinc), "length", 21, NULL); + g_object_set (G_OBJECT (audiowsinclimit), "mode", 1, NULL); + g_object_set (G_OBJECT (audiowsinclimit), "length", 21, NULL); - fail_unless (gst_element_set_state (lpwsinc, + fail_unless (gst_element_set_state (audiowsinclimit, GST_STATE_PLAYING) == GST_STATE_CHANGE_SUCCESS, "could not set to playing"); - g_object_set (G_OBJECT (lpwsinc), "cutoff", 44100 / 4.0, NULL); + g_object_set (G_OBJECT (audiowsinclimit), "cutoff", 44100 / 4.0, NULL); inbuffer = gst_buffer_new_and_alloc (128 * sizeof (gdouble)); in = (gdouble *) GST_BUFFER_DATA (inbuffer); for (i = 0; i < 128; i++) in[i] = 1.0; - caps = gst_caps_from_string (LPWSINC_CAPS_STRING_64); + caps = gst_caps_from_string (AUDIO_WSINC_LIMIT_CAPS_STRING_64); gst_buffer_set_caps (inbuffer, caps); gst_caps_unref (caps); ASSERT_BUFFER_REFCOUNT (inbuffer, "inbuffer", 1); @@ -547,7 +546,7 @@ GST_START_TEST (test_64_hp_0hz) } /* cleanup */ - cleanup_lpwsinc (lpwsinc); + cleanup_audiowsinclimit (audiowsinclimit); } GST_END_TEST; @@ -557,23 +556,23 @@ GST_END_TEST; * at rate/4 */ GST_START_TEST (test_64_hp_22050hz) { - GstElement *lpwsinc; + GstElement *audiowsinclimit; GstBuffer *inbuffer, *outbuffer; GstCaps *caps; gdouble *in, *res, rms; gint i; GList *node; - lpwsinc = setup_lpwsinc (); + audiowsinclimit = setup_audiowsinclimit (); /* Set to highpass */ - g_object_set (G_OBJECT (lpwsinc), "mode", 1, NULL); - g_object_set (G_OBJECT (lpwsinc), "length", 21, NULL); + g_object_set (G_OBJECT (audiowsinclimit), "mode", 1, NULL); + g_object_set (G_OBJECT (audiowsinclimit), "length", 21, NULL); - fail_unless (gst_element_set_state (lpwsinc, + fail_unless (gst_element_set_state (audiowsinclimit, GST_STATE_PLAYING) == GST_STATE_CHANGE_SUCCESS, "could not set to playing"); - g_object_set (G_OBJECT (lpwsinc), "cutoff", 44100 / 4.0, NULL); + g_object_set (G_OBJECT (audiowsinclimit), "cutoff", 44100 / 4.0, NULL); inbuffer = gst_buffer_new_and_alloc (128 * sizeof (gdouble)); in = (gdouble *) GST_BUFFER_DATA (inbuffer); for (i = 0; i < 128; i += 2) { @@ -581,7 +580,7 @@ GST_START_TEST (test_64_hp_22050hz) in[i + 1] = -1.0; } - caps = gst_caps_from_string (LPWSINC_CAPS_STRING_64); + caps = gst_caps_from_string (AUDIO_WSINC_LIMIT_CAPS_STRING_64); gst_buffer_set_caps (inbuffer, caps); gst_caps_unref (caps); ASSERT_BUFFER_REFCOUNT (inbuffer, "inbuffer", 1); @@ -608,7 +607,7 @@ GST_START_TEST (test_64_hp_22050hz) } /* cleanup */ - cleanup_lpwsinc (lpwsinc); + cleanup_audiowsinclimit (audiowsinclimit); } GST_END_TEST; @@ -617,29 +616,28 @@ GST_END_TEST; * correctly without accessing wrong memory areas */ GST_START_TEST (test_64_small_buffer) { - GstElement *lpwsinc; + GstElement *audiowsinclimit; GstBuffer *inbuffer, *outbuffer; GstCaps *caps; gdouble *in; - gdouble *res; gint i; - lpwsinc = setup_lpwsinc (); + audiowsinclimit = setup_audiowsinclimit (); /* Set to lowpass */ - g_object_set (G_OBJECT (lpwsinc), "mode", 0, NULL); - g_object_set (G_OBJECT (lpwsinc), "length", 101, NULL); + g_object_set (G_OBJECT (audiowsinclimit), "mode", 0, NULL); + g_object_set (G_OBJECT (audiowsinclimit), "length", 101, NULL); - fail_unless (gst_element_set_state (lpwsinc, + fail_unless (gst_element_set_state (audiowsinclimit, GST_STATE_PLAYING) == GST_STATE_CHANGE_SUCCESS, "could not set to playing"); - g_object_set (G_OBJECT (lpwsinc), "cutoff", 44100 / 4.0, NULL); + g_object_set (G_OBJECT (audiowsinclimit), "cutoff", 44100 / 4.0, NULL); inbuffer = gst_buffer_new_and_alloc (20 * sizeof (gdouble)); in = (gdouble *) GST_BUFFER_DATA (inbuffer); for (i = 0; i < 20; i++) in[i] = 1.0; - caps = gst_caps_from_string (LPWSINC_CAPS_STRING_64); + caps = gst_caps_from_string (AUDIO_WSINC_LIMIT_CAPS_STRING_64); gst_buffer_set_caps (inbuffer, caps); gst_caps_unref (caps); ASSERT_BUFFER_REFCOUNT (inbuffer, "inbuffer", 1); @@ -652,15 +650,15 @@ GST_START_TEST (test_64_small_buffer) fail_if ((outbuffer = (GstBuffer *) buffers->data) == NULL); /* cleanup */ - cleanup_lpwsinc (lpwsinc); + cleanup_audiowsinclimit (audiowsinclimit); } GST_END_TEST; Suite * -lpwsinc_suite (void) +audiowsinclimit_suite (void) { - Suite *s = suite_create ("lpwsinc"); + Suite *s = suite_create ("audiowsinclimit"); TCase *tc_chain = tcase_create ("general"); suite_add_tcase (s, tc_chain); @@ -683,7 +681,7 @@ main (int argc, char **argv) { int nf; - Suite *s = lpwsinc_suite (); + Suite *s = audiowsinclimit_suite (); SRunner *sr = srunner_create (s); gst_check_init (&argc, &argv); |