summaryrefslogtreecommitdiffstats
path: root/tests/check/elements
diff options
context:
space:
mode:
authorJan Schmidt <thaytan@mad.scientist.com>2008-02-08 02:00:49 +0000
committerJan Schmidt <thaytan@mad.scientist.com>2008-02-08 02:00:49 +0000
commitd6e3e6d9c0fe39534930c647755c4219eb39f39f (patch)
tree523e56681ab8273336001affda080665a1640f41 /tests/check/elements
parent440f4cd1810f7150aed8cba41f31a47b5f796629 (diff)
downloadgst-plugins-bad-d6e3e6d9c0fe39534930c647755c4219eb39f39f.tar.gz
gst-plugins-bad-d6e3e6d9c0fe39534930c647755c4219eb39f39f.tar.bz2
gst-plugins-bad-d6e3e6d9c0fe39534930c647755c4219eb39f39f.zip
Remove the equalizer plugin, which has moved to -good
Original commit message from CVS: * configure.ac: * docs/plugins/Makefile.am: * docs/plugins/gst-plugins-bad-plugins-docs.sgml: * docs/plugins/gst-plugins-bad-plugins-sections.txt: * docs/plugins/inspect/plugin-equalizer.xml: * gst/equalizer/.cvsignore: * gst/equalizer/Makefile.am: * gst/equalizer/demo.c: * gst/equalizer/gstiirequalizer.c: * gst/equalizer/gstiirequalizer.h: * gst/equalizer/gstiirequalizer10bands.c: * gst/equalizer/gstiirequalizer10bands.h: * gst/equalizer/gstiirequalizer3bands.c: * gst/equalizer/gstiirequalizer3bands.h: * gst/equalizer/gstiirequalizernbands.c: * gst/equalizer/gstiirequalizernbands.h: * tests/check/Makefile.am: * tests/check/elements/.cvsignore: * tests/check/elements/equalizer.c: Remove the equalizer plugin, which has moved to -good
Diffstat (limited to 'tests/check/elements')
-rw-r--r--tests/check/elements/.gitignore3
-rw-r--r--tests/check/elements/equalizer.c331
2 files changed, 0 insertions, 334 deletions
diff --git a/tests/check/elements/.gitignore b/tests/check/elements/.gitignore
index 67933fff..3ec9ac29 100644
--- a/tests/check/elements/.gitignore
+++ b/tests/check/elements/.gitignore
@@ -1,11 +1,8 @@
.dirstamp
-bpwsinc
deinterleave
-equalizer
gdpdepay
gdppay
interleave
-lpwsinc
mpeg2enc
neonhttpsrc
souphttpsrc
diff --git a/tests/check/elements/equalizer.c b/tests/check/elements/equalizer.c
deleted file mode 100644
index 1563f4b4..00000000
--- a/tests/check/elements/equalizer.c
+++ /dev/null
@@ -1,331 +0,0 @@
-/* GStreamer
- *
- * Copyright (C) 2008 Sebastian Dröge <slomo@circular-chaos.org>
- *
- * equalizer.c: Unit test for the equalizer element
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public License
- * as published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
- * 02110-1301 USA
- */
-
-#include <gst/gst.h>
-#include <gst/base/gstbasetransform.h>
-#include <gst/check/gstcheck.h>
-
-#include <math.h>
-
-/* For ease of programming we use globals to keep refs for our floating
- * src and sink pads we create; otherwise we always have to do get_pad,
- * get_peer, and then remove references in every test function */
-GstPad *mysrcpad, *mysinkpad;
-
-#define EQUALIZER_CAPS_STRING \
- "audio/x-raw-float, " \
- "channels = (int) 1, " \
- "rate = (int) 48000, " \
- "endianness = (int) BYTE_ORDER, " \
- "width = (int) 64" \
-
-static GstStaticPadTemplate sinktemplate = GST_STATIC_PAD_TEMPLATE ("sink",
- GST_PAD_SINK,
- GST_PAD_ALWAYS,
- GST_STATIC_CAPS ("audio/x-raw-float, "
- "channels = (int) 1, "
- "rate = (int) 48000, "
- "endianness = (int) BYTE_ORDER, " "width = (int) 64 ")
- );
-static GstStaticPadTemplate srctemplate = GST_STATIC_PAD_TEMPLATE ("src",
- GST_PAD_SRC,
- GST_PAD_ALWAYS,
- GST_STATIC_CAPS ("audio/x-raw-float, "
- "channels = (int) 1, "
- "rate = (int) 48000, "
- "endianness = (int) BYTE_ORDER, " "width = (int) 64 ")
- );
-
-GstElement *
-setup_equalizer ()
-{
- GstElement *equalizer;
-
- GST_DEBUG ("setup_equalizer");
- equalizer = gst_check_setup_element ("equalizer-nbands");
- mysrcpad = gst_check_setup_src_pad (equalizer, &srctemplate, NULL);
- mysinkpad = gst_check_setup_sink_pad (equalizer, &sinktemplate, NULL);
- gst_pad_set_active (mysrcpad, TRUE);
- gst_pad_set_active (mysinkpad, TRUE);
-
- return equalizer;
-}
-
-void
-cleanup_equalizer (GstElement * equalizer)
-{
- GST_DEBUG ("cleanup_equalizer");
-
- g_list_foreach (buffers, (GFunc) gst_mini_object_unref, NULL);
- g_list_free (buffers);
- buffers = NULL;
-
- gst_pad_set_active (mysrcpad, FALSE);
- gst_pad_set_active (mysinkpad, FALSE);
- gst_check_teardown_src_pad (equalizer);
- gst_check_teardown_sink_pad (equalizer);
- gst_check_teardown_element (equalizer);
-}
-
-GST_START_TEST (test_equalizer_5bands_passthrough)
-{
- GstElement *equalizer;
- GstBuffer *inbuffer, *outbuffer;
- GstCaps *caps;
- gdouble *in, *res;
- gint i;
-
- equalizer = setup_equalizer ();
- g_object_set (G_OBJECT (equalizer), "num-bands", 5, NULL);
-
- fail_unless_equals_int (gst_child_proxy_get_children_count (GST_CHILD_PROXY
- (equalizer)), 5);
-
- fail_unless (gst_element_set_state (equalizer,
- GST_STATE_PLAYING) == GST_STATE_CHANGE_SUCCESS,
- "could not set to playing");
-
- inbuffer = gst_buffer_new_and_alloc (1024 * sizeof (gdouble));
- in = (gdouble *) GST_BUFFER_DATA (inbuffer);
- for (i = 0; i < 1024; i++)
- in[i] = g_random_double_range (-1.0, 1.0);
-
- caps = gst_caps_from_string (EQUALIZER_CAPS_STRING);
- gst_buffer_set_caps (inbuffer, caps);
- gst_caps_unref (caps);
- ASSERT_BUFFER_REFCOUNT (inbuffer, "inbuffer", 1);
-
- /* pushing gives away my reference ... */
- fail_unless (gst_pad_push (mysrcpad, inbuffer) == GST_FLOW_OK);
- fail_unless (gst_pad_push_event (mysrcpad, gst_event_new_eos ()));
- /* ... and puts a new buffer on the global list */
- fail_unless (g_list_length (buffers) == 1);
-
- res = (gdouble *) GST_BUFFER_DATA (GST_BUFFER (buffers->data));
-
- for (i = 0; i < 1024; i++)
- fail_unless_equals_float (in[i], res[i]);
-
- /* cleanup */
- cleanup_equalizer (equalizer);
-}
-
-GST_END_TEST;
-
-GST_START_TEST (test_equalizer_5bands_minus_24)
-{
- GstElement *equalizer;
- GstBuffer *inbuffer, *outbuffer;
- GstCaps *caps;
- gdouble *in, *res, rms_in, rms_out;
- gint i;
-
- equalizer = setup_equalizer ();
- g_object_set (G_OBJECT (equalizer), "num-bands", 5, NULL);
-
- fail_unless_equals_int (gst_child_proxy_get_children_count (GST_CHILD_PROXY
- (equalizer)), 5);
-
- for (i = 0; i < 5; i++) {
- GstObject *band =
- gst_child_proxy_get_child_by_index (GST_CHILD_PROXY (equalizer), i);
- fail_unless (band != NULL);
-
- g_object_set (G_OBJECT (band), "gain", -24.0, 0);
- g_object_unref (G_OBJECT (band));
- }
-
- fail_unless (gst_element_set_state (equalizer,
- GST_STATE_PLAYING) == GST_STATE_CHANGE_SUCCESS,
- "could not set to playing");
-
- inbuffer = gst_buffer_new_and_alloc (1024 * sizeof (gdouble));
- in = (gdouble *) GST_BUFFER_DATA (inbuffer);
- for (i = 0; i < 1024; i++)
- in[i] = g_random_double_range (-1.0, 1.0);
-
- rms_in = 0.0;
- for (i = 0; i < 1024; i++)
- rms_in += in[i] * in[i];
- rms_in = sqrt (rms_in / 1024);
-
- caps = gst_caps_from_string (EQUALIZER_CAPS_STRING);
- gst_buffer_set_caps (inbuffer, caps);
- gst_caps_unref (caps);
- ASSERT_BUFFER_REFCOUNT (inbuffer, "inbuffer", 1);
-
- /* pushing gives away my reference ... */
- fail_unless (gst_pad_push (mysrcpad, inbuffer) == GST_FLOW_OK);
- fail_unless (gst_pad_push_event (mysrcpad, gst_event_new_eos ()));
- /* ... and puts a new buffer on the global list */
- fail_unless (g_list_length (buffers) == 1);
-
- res = (gdouble *) GST_BUFFER_DATA (GST_BUFFER (buffers->data));
-
- rms_out = 0.0;
- for (i = 0; i < 1024; i++)
- rms_out += res[i] * res[i];
- rms_out = sqrt (rms_out / 1024);
-
- fail_unless (rms_in > rms_out);
-
- /* cleanup */
- cleanup_equalizer (equalizer);
-}
-
-GST_END_TEST;
-
-GST_START_TEST (test_equalizer_5bands_plus_12)
-{
- GstElement *equalizer;
- GstBuffer *inbuffer, *outbuffer;
- GstCaps *caps;
- gdouble *in, *res, rms_in, rms_out;
- gint i;
-
- equalizer = setup_equalizer ();
- g_object_set (G_OBJECT (equalizer), "num-bands", 5, NULL);
-
- fail_unless_equals_int (gst_child_proxy_get_children_count (GST_CHILD_PROXY
- (equalizer)), 5);
-
- for (i = 0; i < 5; i++) {
- GstObject *band =
- gst_child_proxy_get_child_by_index (GST_CHILD_PROXY (equalizer), i);
- fail_unless (band != NULL);
-
- g_object_set (G_OBJECT (band), "gain", 12.0, 0);
- g_object_unref (G_OBJECT (band));
- }
-
- fail_unless (gst_element_set_state (equalizer,
- GST_STATE_PLAYING) == GST_STATE_CHANGE_SUCCESS,
- "could not set to playing");
-
- inbuffer = gst_buffer_new_and_alloc (1024 * sizeof (gdouble));
- in = (gdouble *) GST_BUFFER_DATA (inbuffer);
- for (i = 0; i < 1024; i++)
- in[i] = g_random_double_range (-1.0, 1.0);
-
- rms_in = 0.0;
- for (i = 0; i < 1024; i++)
- rms_in += in[i] * in[i];
- rms_in = sqrt (rms_in / 1024);
-
- caps = gst_caps_from_string (EQUALIZER_CAPS_STRING);
- gst_buffer_set_caps (inbuffer, caps);
- gst_caps_unref (caps);
- ASSERT_BUFFER_REFCOUNT (inbuffer, "inbuffer", 1);
-
- /* pushing gives away my reference ... */
- fail_unless (gst_pad_push (mysrcpad, inbuffer) == GST_FLOW_OK);
- fail_unless (gst_pad_push_event (mysrcpad, gst_event_new_eos ()));
- /* ... and puts a new buffer on the global list */
- fail_unless (g_list_length (buffers) == 1);
-
- res = (gdouble *) GST_BUFFER_DATA (GST_BUFFER (buffers->data));
-
- rms_out = 0.0;
- for (i = 0; i < 1024; i++)
- rms_out += res[i] * res[i];
- rms_out = sqrt (rms_out / 1024);
-
- fail_unless (rms_in < rms_out);
-
- /* cleanup */
- cleanup_equalizer (equalizer);
-}
-
-GST_END_TEST;
-
-GST_START_TEST (test_equalizer_band_number_changing)
-{
- GstElement *equalizer;
- GstBuffer *inbuffer, *outbuffer;
- GstCaps *caps;
- gdouble *in, *res;
- gint i;
-
- equalizer = setup_equalizer ();
-
- g_object_set (G_OBJECT (equalizer), "num-bands", 5, NULL);
- fail_unless_equals_int (gst_child_proxy_get_children_count (GST_CHILD_PROXY
- (equalizer)), 5);
-
- for (i = 0; i < 5; i++) {
- GstObject *band;
- gdouble freq;
-
- band = gst_child_proxy_get_child_by_index (GST_CHILD_PROXY (equalizer), i);
- fail_unless (band != NULL);
- gst_object_unref (band);
- }
-
- g_object_set (G_OBJECT (equalizer), "num-bands", 10, NULL);
- fail_unless_equals_int (gst_child_proxy_get_children_count (GST_CHILD_PROXY
- (equalizer)), 10);
-
- for (i = 0; i < 10; i++) {
- GstObject *band;
-
- band = gst_child_proxy_get_child_by_index (GST_CHILD_PROXY (equalizer), i);
- fail_unless (band != NULL);
- gst_object_unref (band);
- }
-
- /* cleanup */
- cleanup_equalizer (equalizer);
-}
-
-GST_END_TEST;
-
-Suite *
-equalizer_suite (void)
-{
- Suite *s = suite_create ("equalizer");
- TCase *tc_chain = tcase_create ("general");
-
- suite_add_tcase (s, tc_chain);
- tcase_add_test (tc_chain, test_equalizer_5bands_passthrough);
- tcase_add_test (tc_chain, test_equalizer_5bands_minus_24);
- tcase_add_test (tc_chain, test_equalizer_5bands_plus_12);
- tcase_add_test (tc_chain, test_equalizer_band_number_changing);
-
- return s;
-}
-
-int
-main (int argc, char **argv)
-{
- int nf;
-
- Suite *s = equalizer_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;
-}