[MOVED FROM BAD 1/5] Fix up to use the newly ported (actually working) GstAudioFilter.
Original commit message from CVS:
* configure.ac:
* gst/equalizer/Makefile.am:
* gst/equalizer/gstiirequalizer.c: (gst_iir_equalizer_base_init),
(gst_iir_equalizer_class_init), (gst_iir_equalizer_init),
(setup_filter), (gst_iir_equalizer_compute_frequencies),
(gst_iir_equalizer_set_property), (gst_iir_equalizer_get_property),
(gst_iir_equalizer_transform_ip), (gst_iir_equalizer_setup),
(plugin_init):
* gst/equalizer/gstiirequalizer.h:
Fix up to use the newly ported (actually working) GstAudioFilter.
Bump core/base requirements to CVS for this.
* tests/icles/.cvsignore:
* tests/icles/Makefile.am:
* tests/icles/equalizer-test.c: (check_bus),
(equalizer_set_band_value), (equalizer_set_all_band_values),
(equalizer_set_band_value_and_wait),
(equalizer_set_all_band_values_and_wait), (do_slider_fiddling),
(main):
Add brain-dead interactive test for equalizer.
2007-02-03 23:35:26 +00:00
|
|
|
/* GStreamer test for the equalizer element
|
|
|
|
* Copyright (C) 2007 Tim-Philipp Müller <tim centricular net>
|
|
|
|
*
|
|
|
|
* This library is free software; you can redistribute it and/or
|
|
|
|
* modify it under the terms of the GNU Library General Public
|
|
|
|
* License as published by the Free Software Foundation; either
|
|
|
|
* version 2 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
|
|
|
|
* Library General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU Library General Public
|
|
|
|
* License along with this library; if not, write to the
|
|
|
|
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
|
|
|
|
* Boston, MA 02111-1307, USA.
|
|
|
|
*/
|
|
|
|
|
[MOVED FROM BAD 3/5] ChangeLog: ChangeLog surgery. gst/equalizer/gstiirequalizer.c (ARG_BAND_WIDTH, _do_init, ARG_GAIN, _GstIirEqualizerBa...
Original commit message from CVS:
* ChangeLog:
ChangeLog surgery.
* gst/equalizer/gstiirequalizer.c (ARG_BAND_WIDTH, _do_init, ARG_GAIN,
_GstIirEqualizerBand, object, _GstIirEqualizerBandClass,
parent_class, gst_iir_equalizer_band_set_property,
gst_iir_equalizer_band_class_init, gst_iir_equalizer_band_get_type,
gst_iir_equalizer_child_proxy_get_child_by_index,
gst_iir_equalizer_child_proxy_get_children_count,
gst_iir_equalizer_child_proxy_interface_init, setup_filter,
gst_iir_equalizer_compute_frequencies, plugin_init):
* tests/icles/equalizer-test.c:
Add fixme and comment for example.
2007-05-21 14:01:16 +00:00
|
|
|
/*
|
|
|
|
* Will tests the equalizer by fading all bands in and out one by one and
|
|
|
|
* finaly all together.
|
|
|
|
*/
|
|
|
|
|
[MOVED FROM BAD 1/5] Fix up to use the newly ported (actually working) GstAudioFilter.
Original commit message from CVS:
* configure.ac:
* gst/equalizer/Makefile.am:
* gst/equalizer/gstiirequalizer.c: (gst_iir_equalizer_base_init),
(gst_iir_equalizer_class_init), (gst_iir_equalizer_init),
(setup_filter), (gst_iir_equalizer_compute_frequencies),
(gst_iir_equalizer_set_property), (gst_iir_equalizer_get_property),
(gst_iir_equalizer_transform_ip), (gst_iir_equalizer_setup),
(plugin_init):
* gst/equalizer/gstiirequalizer.h:
Fix up to use the newly ported (actually working) GstAudioFilter.
Bump core/base requirements to CVS for this.
* tests/icles/.cvsignore:
* tests/icles/Makefile.am:
* tests/icles/equalizer-test.c: (check_bus),
(equalizer_set_band_value), (equalizer_set_all_band_values),
(equalizer_set_band_value_and_wait),
(equalizer_set_all_band_values_and_wait), (do_slider_fiddling),
(main):
Add brain-dead interactive test for equalizer.
2007-02-03 23:35:26 +00:00
|
|
|
#ifdef HAVE_CONFIG_H
|
|
|
|
# include "config.h"
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#include <gst/gst.h>
|
|
|
|
|
|
|
|
#include <stdlib.h>
|
|
|
|
#include <math.h>
|
|
|
|
|
|
|
|
GST_DEBUG_CATEGORY_STATIC (equalizer_test_debug);
|
|
|
|
#define GST_CAT_DEFAULT equalizer_test_debug
|
|
|
|
|
|
|
|
static GstBus *pipeline_bus;
|
|
|
|
|
|
|
|
static gboolean
|
|
|
|
check_bus (GstClockTime max_wait_time)
|
|
|
|
{
|
|
|
|
GstMessage *msg;
|
|
|
|
|
|
|
|
msg = gst_bus_poll (pipeline_bus, GST_MESSAGE_ERROR | GST_MESSAGE_EOS,
|
|
|
|
max_wait_time);
|
|
|
|
|
|
|
|
if (msg == NULL)
|
|
|
|
return FALSE;
|
|
|
|
|
|
|
|
if (GST_MESSAGE_TYPE (msg) == GST_MESSAGE_ERROR) {
|
|
|
|
GError *err = NULL;
|
|
|
|
gchar *debug = NULL;
|
|
|
|
|
|
|
|
g_assert (GST_MESSAGE_TYPE (msg) == GST_MESSAGE_ERROR);
|
|
|
|
gst_message_parse_error (msg, &err, &debug);
|
|
|
|
GST_ERROR ("ERROR: %s [%s]", err->message, debug);
|
|
|
|
g_print ("\n===========> ERROR: %s\n%s\n\n", err->message, debug);
|
|
|
|
g_error_free (err);
|
|
|
|
g_free (debug);
|
|
|
|
}
|
|
|
|
|
|
|
|
if (GST_MESSAGE_TYPE (msg) == GST_MESSAGE_EOS) {
|
|
|
|
g_print ("\n === EOS ===\n\n");
|
|
|
|
}
|
|
|
|
|
|
|
|
gst_message_unref (msg);
|
|
|
|
return TRUE;
|
|
|
|
}
|
|
|
|
|
2007-03-14 16:33:03 +00:00
|
|
|
// fix below
|
|
|
|
|
[MOVED FROM BAD 1/5] Fix up to use the newly ported (actually working) GstAudioFilter.
Original commit message from CVS:
* configure.ac:
* gst/equalizer/Makefile.am:
* gst/equalizer/gstiirequalizer.c: (gst_iir_equalizer_base_init),
(gst_iir_equalizer_class_init), (gst_iir_equalizer_init),
(setup_filter), (gst_iir_equalizer_compute_frequencies),
(gst_iir_equalizer_set_property), (gst_iir_equalizer_get_property),
(gst_iir_equalizer_transform_ip), (gst_iir_equalizer_setup),
(plugin_init):
* gst/equalizer/gstiirequalizer.h:
Fix up to use the newly ported (actually working) GstAudioFilter.
Bump core/base requirements to CVS for this.
* tests/icles/.cvsignore:
* tests/icles/Makefile.am:
* tests/icles/equalizer-test.c: (check_bus),
(equalizer_set_band_value), (equalizer_set_all_band_values),
(equalizer_set_band_value_and_wait),
(equalizer_set_all_band_values_and_wait), (do_slider_fiddling),
(main):
Add brain-dead interactive test for equalizer.
2007-02-03 23:35:26 +00:00
|
|
|
static void
|
2007-03-14 16:33:03 +00:00
|
|
|
equalizer_set_band_value (GstElement * eq, guint band, gdouble val)
|
[MOVED FROM BAD 1/5] Fix up to use the newly ported (actually working) GstAudioFilter.
Original commit message from CVS:
* configure.ac:
* gst/equalizer/Makefile.am:
* gst/equalizer/gstiirequalizer.c: (gst_iir_equalizer_base_init),
(gst_iir_equalizer_class_init), (gst_iir_equalizer_init),
(setup_filter), (gst_iir_equalizer_compute_frequencies),
(gst_iir_equalizer_set_property), (gst_iir_equalizer_get_property),
(gst_iir_equalizer_transform_ip), (gst_iir_equalizer_setup),
(plugin_init):
* gst/equalizer/gstiirequalizer.h:
Fix up to use the newly ported (actually working) GstAudioFilter.
Bump core/base requirements to CVS for this.
* tests/icles/.cvsignore:
* tests/icles/Makefile.am:
* tests/icles/equalizer-test.c: (check_bus),
(equalizer_set_band_value), (equalizer_set_all_band_values),
(equalizer_set_band_value_and_wait),
(equalizer_set_all_band_values_and_wait), (do_slider_fiddling),
(main):
Add brain-dead interactive test for equalizer.
2007-02-03 23:35:26 +00:00
|
|
|
{
|
2012-03-31 13:43:49 +00:00
|
|
|
GObject *child;
|
2007-03-14 16:33:03 +00:00
|
|
|
|
|
|
|
child = gst_child_proxy_get_child_by_index (GST_CHILD_PROXY (eq), band);
|
|
|
|
g_object_set (child, "gain", val, NULL);
|
2012-03-31 13:43:49 +00:00
|
|
|
g_object_unref (child);
|
[MOVED FROM BAD 1/5] Fix up to use the newly ported (actually working) GstAudioFilter.
Original commit message from CVS:
* configure.ac:
* gst/equalizer/Makefile.am:
* gst/equalizer/gstiirequalizer.c: (gst_iir_equalizer_base_init),
(gst_iir_equalizer_class_init), (gst_iir_equalizer_init),
(setup_filter), (gst_iir_equalizer_compute_frequencies),
(gst_iir_equalizer_set_property), (gst_iir_equalizer_get_property),
(gst_iir_equalizer_transform_ip), (gst_iir_equalizer_setup),
(plugin_init):
* gst/equalizer/gstiirequalizer.h:
Fix up to use the newly ported (actually working) GstAudioFilter.
Bump core/base requirements to CVS for this.
* tests/icles/.cvsignore:
* tests/icles/Makefile.am:
* tests/icles/equalizer-test.c: (check_bus),
(equalizer_set_band_value), (equalizer_set_all_band_values),
(equalizer_set_band_value_and_wait),
(equalizer_set_all_band_values_and_wait), (do_slider_fiddling),
(main):
Add brain-dead interactive test for equalizer.
2007-02-03 23:35:26 +00:00
|
|
|
g_print ("Band %2d: %.2f\n", band, val);
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2007-03-14 16:33:03 +00:00
|
|
|
equalizer_set_all_band_values (GstElement * eq, guint num, gdouble val)
|
[MOVED FROM BAD 1/5] Fix up to use the newly ported (actually working) GstAudioFilter.
Original commit message from CVS:
* configure.ac:
* gst/equalizer/Makefile.am:
* gst/equalizer/gstiirequalizer.c: (gst_iir_equalizer_base_init),
(gst_iir_equalizer_class_init), (gst_iir_equalizer_init),
(setup_filter), (gst_iir_equalizer_compute_frequencies),
(gst_iir_equalizer_set_property), (gst_iir_equalizer_get_property),
(gst_iir_equalizer_transform_ip), (gst_iir_equalizer_setup),
(plugin_init):
* gst/equalizer/gstiirequalizer.h:
Fix up to use the newly ported (actually working) GstAudioFilter.
Bump core/base requirements to CVS for this.
* tests/icles/.cvsignore:
* tests/icles/Makefile.am:
* tests/icles/equalizer-test.c: (check_bus),
(equalizer_set_band_value), (equalizer_set_all_band_values),
(equalizer_set_band_value_and_wait),
(equalizer_set_all_band_values_and_wait), (do_slider_fiddling),
(main):
Add brain-dead interactive test for equalizer.
2007-02-03 23:35:26 +00:00
|
|
|
{
|
|
|
|
gint i;
|
2012-03-31 13:43:49 +00:00
|
|
|
GObject *child;
|
[MOVED FROM BAD 1/5] Fix up to use the newly ported (actually working) GstAudioFilter.
Original commit message from CVS:
* configure.ac:
* gst/equalizer/Makefile.am:
* gst/equalizer/gstiirequalizer.c: (gst_iir_equalizer_base_init),
(gst_iir_equalizer_class_init), (gst_iir_equalizer_init),
(setup_filter), (gst_iir_equalizer_compute_frequencies),
(gst_iir_equalizer_set_property), (gst_iir_equalizer_get_property),
(gst_iir_equalizer_transform_ip), (gst_iir_equalizer_setup),
(plugin_init):
* gst/equalizer/gstiirequalizer.h:
Fix up to use the newly ported (actually working) GstAudioFilter.
Bump core/base requirements to CVS for this.
* tests/icles/.cvsignore:
* tests/icles/Makefile.am:
* tests/icles/equalizer-test.c: (check_bus),
(equalizer_set_band_value), (equalizer_set_all_band_values),
(equalizer_set_band_value_and_wait),
(equalizer_set_all_band_values_and_wait), (do_slider_fiddling),
(main):
Add brain-dead interactive test for equalizer.
2007-02-03 23:35:26 +00:00
|
|
|
|
2007-03-14 16:33:03 +00:00
|
|
|
for (i = 0; i < num; i++) {
|
|
|
|
child = gst_child_proxy_get_child_by_index (GST_CHILD_PROXY (eq), i);
|
|
|
|
g_object_set (child, "gain", val, NULL);
|
2012-03-31 13:43:49 +00:00
|
|
|
g_object_unref (child);
|
[MOVED FROM BAD 1/5] Fix up to use the newly ported (actually working) GstAudioFilter.
Original commit message from CVS:
* configure.ac:
* gst/equalizer/Makefile.am:
* gst/equalizer/gstiirequalizer.c: (gst_iir_equalizer_base_init),
(gst_iir_equalizer_class_init), (gst_iir_equalizer_init),
(setup_filter), (gst_iir_equalizer_compute_frequencies),
(gst_iir_equalizer_set_property), (gst_iir_equalizer_get_property),
(gst_iir_equalizer_transform_ip), (gst_iir_equalizer_setup),
(plugin_init):
* gst/equalizer/gstiirequalizer.h:
Fix up to use the newly ported (actually working) GstAudioFilter.
Bump core/base requirements to CVS for this.
* tests/icles/.cvsignore:
* tests/icles/Makefile.am:
* tests/icles/equalizer-test.c: (check_bus),
(equalizer_set_band_value), (equalizer_set_all_band_values),
(equalizer_set_band_value_and_wait),
(equalizer_set_all_band_values_and_wait), (do_slider_fiddling),
(main):
Add brain-dead interactive test for equalizer.
2007-02-03 23:35:26 +00:00
|
|
|
}
|
|
|
|
g_print ("All bands: %.2f\n", val);
|
|
|
|
}
|
|
|
|
|
2007-03-14 16:33:03 +00:00
|
|
|
// fix above
|
|
|
|
|
[MOVED FROM BAD 1/5] Fix up to use the newly ported (actually working) GstAudioFilter.
Original commit message from CVS:
* configure.ac:
* gst/equalizer/Makefile.am:
* gst/equalizer/gstiirequalizer.c: (gst_iir_equalizer_base_init),
(gst_iir_equalizer_class_init), (gst_iir_equalizer_init),
(setup_filter), (gst_iir_equalizer_compute_frequencies),
(gst_iir_equalizer_set_property), (gst_iir_equalizer_get_property),
(gst_iir_equalizer_transform_ip), (gst_iir_equalizer_setup),
(plugin_init):
* gst/equalizer/gstiirequalizer.h:
Fix up to use the newly ported (actually working) GstAudioFilter.
Bump core/base requirements to CVS for this.
* tests/icles/.cvsignore:
* tests/icles/Makefile.am:
* tests/icles/equalizer-test.c: (check_bus),
(equalizer_set_band_value), (equalizer_set_all_band_values),
(equalizer_set_band_value_and_wait),
(equalizer_set_all_band_values_and_wait), (do_slider_fiddling),
(main):
Add brain-dead interactive test for equalizer.
2007-02-03 23:35:26 +00:00
|
|
|
static gboolean
|
2007-03-14 16:33:03 +00:00
|
|
|
equalizer_set_band_value_and_wait (GstElement * eq, guint band, gdouble val)
|
[MOVED FROM BAD 1/5] Fix up to use the newly ported (actually working) GstAudioFilter.
Original commit message from CVS:
* configure.ac:
* gst/equalizer/Makefile.am:
* gst/equalizer/gstiirequalizer.c: (gst_iir_equalizer_base_init),
(gst_iir_equalizer_class_init), (gst_iir_equalizer_init),
(setup_filter), (gst_iir_equalizer_compute_frequencies),
(gst_iir_equalizer_set_property), (gst_iir_equalizer_get_property),
(gst_iir_equalizer_transform_ip), (gst_iir_equalizer_setup),
(plugin_init):
* gst/equalizer/gstiirequalizer.h:
Fix up to use the newly ported (actually working) GstAudioFilter.
Bump core/base requirements to CVS for this.
* tests/icles/.cvsignore:
* tests/icles/Makefile.am:
* tests/icles/equalizer-test.c: (check_bus),
(equalizer_set_band_value), (equalizer_set_all_band_values),
(equalizer_set_band_value_and_wait),
(equalizer_set_all_band_values_and_wait), (do_slider_fiddling),
(main):
Add brain-dead interactive test for equalizer.
2007-02-03 23:35:26 +00:00
|
|
|
{
|
2007-03-14 16:33:03 +00:00
|
|
|
equalizer_set_band_value (eq, band, val);
|
[MOVED FROM BAD 1/5] Fix up to use the newly ported (actually working) GstAudioFilter.
Original commit message from CVS:
* configure.ac:
* gst/equalizer/Makefile.am:
* gst/equalizer/gstiirequalizer.c: (gst_iir_equalizer_base_init),
(gst_iir_equalizer_class_init), (gst_iir_equalizer_init),
(setup_filter), (gst_iir_equalizer_compute_frequencies),
(gst_iir_equalizer_set_property), (gst_iir_equalizer_get_property),
(gst_iir_equalizer_transform_ip), (gst_iir_equalizer_setup),
(plugin_init):
* gst/equalizer/gstiirequalizer.h:
Fix up to use the newly ported (actually working) GstAudioFilter.
Bump core/base requirements to CVS for this.
* tests/icles/.cvsignore:
* tests/icles/Makefile.am:
* tests/icles/equalizer-test.c: (check_bus),
(equalizer_set_band_value), (equalizer_set_all_band_values),
(equalizer_set_band_value_and_wait),
(equalizer_set_all_band_values_and_wait), (do_slider_fiddling),
(main):
Add brain-dead interactive test for equalizer.
2007-02-03 23:35:26 +00:00
|
|
|
return check_bus (100 * GST_MSECOND);
|
|
|
|
}
|
|
|
|
|
|
|
|
static gboolean
|
2007-03-14 16:33:03 +00:00
|
|
|
equalizer_set_all_band_values_and_wait (GstElement * eq, guint num, gdouble val)
|
[MOVED FROM BAD 1/5] Fix up to use the newly ported (actually working) GstAudioFilter.
Original commit message from CVS:
* configure.ac:
* gst/equalizer/Makefile.am:
* gst/equalizer/gstiirequalizer.c: (gst_iir_equalizer_base_init),
(gst_iir_equalizer_class_init), (gst_iir_equalizer_init),
(setup_filter), (gst_iir_equalizer_compute_frequencies),
(gst_iir_equalizer_set_property), (gst_iir_equalizer_get_property),
(gst_iir_equalizer_transform_ip), (gst_iir_equalizer_setup),
(plugin_init):
* gst/equalizer/gstiirequalizer.h:
Fix up to use the newly ported (actually working) GstAudioFilter.
Bump core/base requirements to CVS for this.
* tests/icles/.cvsignore:
* tests/icles/Makefile.am:
* tests/icles/equalizer-test.c: (check_bus),
(equalizer_set_band_value), (equalizer_set_all_band_values),
(equalizer_set_band_value_and_wait),
(equalizer_set_all_band_values_and_wait), (do_slider_fiddling),
(main):
Add brain-dead interactive test for equalizer.
2007-02-03 23:35:26 +00:00
|
|
|
{
|
2007-03-14 16:33:03 +00:00
|
|
|
equalizer_set_all_band_values (eq, num, val);
|
[MOVED FROM BAD 1/5] Fix up to use the newly ported (actually working) GstAudioFilter.
Original commit message from CVS:
* configure.ac:
* gst/equalizer/Makefile.am:
* gst/equalizer/gstiirequalizer.c: (gst_iir_equalizer_base_init),
(gst_iir_equalizer_class_init), (gst_iir_equalizer_init),
(setup_filter), (gst_iir_equalizer_compute_frequencies),
(gst_iir_equalizer_set_property), (gst_iir_equalizer_get_property),
(gst_iir_equalizer_transform_ip), (gst_iir_equalizer_setup),
(plugin_init):
* gst/equalizer/gstiirequalizer.h:
Fix up to use the newly ported (actually working) GstAudioFilter.
Bump core/base requirements to CVS for this.
* tests/icles/.cvsignore:
* tests/icles/Makefile.am:
* tests/icles/equalizer-test.c: (check_bus),
(equalizer_set_band_value), (equalizer_set_all_band_values),
(equalizer_set_band_value_and_wait),
(equalizer_set_all_band_values_and_wait), (do_slider_fiddling),
(main):
Add brain-dead interactive test for equalizer.
2007-02-03 23:35:26 +00:00
|
|
|
return check_bus (100 * GST_MSECOND);
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
do_slider_fiddling (GstElement * playbin, GstElement * eq)
|
|
|
|
{
|
|
|
|
gboolean stop;
|
|
|
|
guint num_bands, i;
|
2007-11-07 15:36:59 +00:00
|
|
|
gdouble d, step = 0.5;
|
[MOVED FROM BAD 1/5] Fix up to use the newly ported (actually working) GstAudioFilter.
Original commit message from CVS:
* configure.ac:
* gst/equalizer/Makefile.am:
* gst/equalizer/gstiirequalizer.c: (gst_iir_equalizer_base_init),
(gst_iir_equalizer_class_init), (gst_iir_equalizer_init),
(setup_filter), (gst_iir_equalizer_compute_frequencies),
(gst_iir_equalizer_set_property), (gst_iir_equalizer_get_property),
(gst_iir_equalizer_transform_ip), (gst_iir_equalizer_setup),
(plugin_init):
* gst/equalizer/gstiirequalizer.h:
Fix up to use the newly ported (actually working) GstAudioFilter.
Bump core/base requirements to CVS for this.
* tests/icles/.cvsignore:
* tests/icles/Makefile.am:
* tests/icles/equalizer-test.c: (check_bus),
(equalizer_set_band_value), (equalizer_set_all_band_values),
(equalizer_set_band_value_and_wait),
(equalizer_set_all_band_values_and_wait), (do_slider_fiddling),
(main):
Add brain-dead interactive test for equalizer.
2007-02-03 23:35:26 +00:00
|
|
|
|
|
|
|
stop = FALSE;
|
|
|
|
|
|
|
|
g_object_get (eq, "num-bands", &num_bands, NULL);
|
|
|
|
|
|
|
|
g_print ("%u bands.\n", num_bands);
|
|
|
|
|
|
|
|
while (!stop) {
|
|
|
|
for (i = 0; !stop && i < num_bands; ++i) {
|
2007-11-07 15:36:59 +00:00
|
|
|
d = -24.0;
|
|
|
|
while (!stop && d <= 12.0) {
|
2007-03-14 16:33:03 +00:00
|
|
|
stop = equalizer_set_band_value_and_wait (eq, i, d);
|
[MOVED FROM BAD 1/5] Fix up to use the newly ported (actually working) GstAudioFilter.
Original commit message from CVS:
* configure.ac:
* gst/equalizer/Makefile.am:
* gst/equalizer/gstiirequalizer.c: (gst_iir_equalizer_base_init),
(gst_iir_equalizer_class_init), (gst_iir_equalizer_init),
(setup_filter), (gst_iir_equalizer_compute_frequencies),
(gst_iir_equalizer_set_property), (gst_iir_equalizer_get_property),
(gst_iir_equalizer_transform_ip), (gst_iir_equalizer_setup),
(plugin_init):
* gst/equalizer/gstiirequalizer.h:
Fix up to use the newly ported (actually working) GstAudioFilter.
Bump core/base requirements to CVS for this.
* tests/icles/.cvsignore:
* tests/icles/Makefile.am:
* tests/icles/equalizer-test.c: (check_bus),
(equalizer_set_band_value), (equalizer_set_all_band_values),
(equalizer_set_band_value_and_wait),
(equalizer_set_all_band_values_and_wait), (do_slider_fiddling),
(main):
Add brain-dead interactive test for equalizer.
2007-02-03 23:35:26 +00:00
|
|
|
d += step;
|
|
|
|
}
|
2007-11-07 15:36:59 +00:00
|
|
|
d = 12.0;
|
|
|
|
while (!stop && d >= -24.0) {
|
2007-03-14 16:33:03 +00:00
|
|
|
stop = equalizer_set_band_value_and_wait (eq, i, d);
|
[MOVED FROM BAD 1/5] Fix up to use the newly ported (actually working) GstAudioFilter.
Original commit message from CVS:
* configure.ac:
* gst/equalizer/Makefile.am:
* gst/equalizer/gstiirequalizer.c: (gst_iir_equalizer_base_init),
(gst_iir_equalizer_class_init), (gst_iir_equalizer_init),
(setup_filter), (gst_iir_equalizer_compute_frequencies),
(gst_iir_equalizer_set_property), (gst_iir_equalizer_get_property),
(gst_iir_equalizer_transform_ip), (gst_iir_equalizer_setup),
(plugin_init):
* gst/equalizer/gstiirequalizer.h:
Fix up to use the newly ported (actually working) GstAudioFilter.
Bump core/base requirements to CVS for this.
* tests/icles/.cvsignore:
* tests/icles/Makefile.am:
* tests/icles/equalizer-test.c: (check_bus),
(equalizer_set_band_value), (equalizer_set_all_band_values),
(equalizer_set_band_value_and_wait),
(equalizer_set_all_band_values_and_wait), (do_slider_fiddling),
(main):
Add brain-dead interactive test for equalizer.
2007-02-03 23:35:26 +00:00
|
|
|
d -= step;
|
|
|
|
}
|
2007-11-07 15:36:59 +00:00
|
|
|
d = -24.0;
|
|
|
|
while (!stop && d <= 12.0) {
|
2007-03-14 16:33:03 +00:00
|
|
|
stop = equalizer_set_band_value_and_wait (eq, i, d);
|
[MOVED FROM BAD 1/5] Fix up to use the newly ported (actually working) GstAudioFilter.
Original commit message from CVS:
* configure.ac:
* gst/equalizer/Makefile.am:
* gst/equalizer/gstiirequalizer.c: (gst_iir_equalizer_base_init),
(gst_iir_equalizer_class_init), (gst_iir_equalizer_init),
(setup_filter), (gst_iir_equalizer_compute_frequencies),
(gst_iir_equalizer_set_property), (gst_iir_equalizer_get_property),
(gst_iir_equalizer_transform_ip), (gst_iir_equalizer_setup),
(plugin_init):
* gst/equalizer/gstiirequalizer.h:
Fix up to use the newly ported (actually working) GstAudioFilter.
Bump core/base requirements to CVS for this.
* tests/icles/.cvsignore:
* tests/icles/Makefile.am:
* tests/icles/equalizer-test.c: (check_bus),
(equalizer_set_band_value), (equalizer_set_all_band_values),
(equalizer_set_band_value_and_wait),
(equalizer_set_all_band_values_and_wait), (do_slider_fiddling),
(main):
Add brain-dead interactive test for equalizer.
2007-02-03 23:35:26 +00:00
|
|
|
d += step;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
d = 0.0;
|
2007-11-07 15:36:59 +00:00
|
|
|
while (!stop && d <= 12.0) {
|
2007-03-14 16:33:03 +00:00
|
|
|
stop = equalizer_set_all_band_values_and_wait (eq, num_bands, d);
|
[MOVED FROM BAD 1/5] Fix up to use the newly ported (actually working) GstAudioFilter.
Original commit message from CVS:
* configure.ac:
* gst/equalizer/Makefile.am:
* gst/equalizer/gstiirequalizer.c: (gst_iir_equalizer_base_init),
(gst_iir_equalizer_class_init), (gst_iir_equalizer_init),
(setup_filter), (gst_iir_equalizer_compute_frequencies),
(gst_iir_equalizer_set_property), (gst_iir_equalizer_get_property),
(gst_iir_equalizer_transform_ip), (gst_iir_equalizer_setup),
(plugin_init):
* gst/equalizer/gstiirequalizer.h:
Fix up to use the newly ported (actually working) GstAudioFilter.
Bump core/base requirements to CVS for this.
* tests/icles/.cvsignore:
* tests/icles/Makefile.am:
* tests/icles/equalizer-test.c: (check_bus),
(equalizer_set_band_value), (equalizer_set_all_band_values),
(equalizer_set_band_value_and_wait),
(equalizer_set_all_band_values_and_wait), (do_slider_fiddling),
(main):
Add brain-dead interactive test for equalizer.
2007-02-03 23:35:26 +00:00
|
|
|
d += step;
|
|
|
|
}
|
2007-11-07 15:36:59 +00:00
|
|
|
d = 12.0;
|
|
|
|
while (!stop && d >= -24.0) {
|
2007-03-14 16:33:03 +00:00
|
|
|
stop = equalizer_set_all_band_values_and_wait (eq, num_bands, d);
|
[MOVED FROM BAD 1/5] Fix up to use the newly ported (actually working) GstAudioFilter.
Original commit message from CVS:
* configure.ac:
* gst/equalizer/Makefile.am:
* gst/equalizer/gstiirequalizer.c: (gst_iir_equalizer_base_init),
(gst_iir_equalizer_class_init), (gst_iir_equalizer_init),
(setup_filter), (gst_iir_equalizer_compute_frequencies),
(gst_iir_equalizer_set_property), (gst_iir_equalizer_get_property),
(gst_iir_equalizer_transform_ip), (gst_iir_equalizer_setup),
(plugin_init):
* gst/equalizer/gstiirequalizer.h:
Fix up to use the newly ported (actually working) GstAudioFilter.
Bump core/base requirements to CVS for this.
* tests/icles/.cvsignore:
* tests/icles/Makefile.am:
* tests/icles/equalizer-test.c: (check_bus),
(equalizer_set_band_value), (equalizer_set_all_band_values),
(equalizer_set_band_value_and_wait),
(equalizer_set_all_band_values_and_wait), (do_slider_fiddling),
(main):
Add brain-dead interactive test for equalizer.
2007-02-03 23:35:26 +00:00
|
|
|
d -= step;
|
|
|
|
}
|
2007-11-07 15:36:59 +00:00
|
|
|
d = -24.0;
|
[MOVED FROM BAD 1/5] Fix up to use the newly ported (actually working) GstAudioFilter.
Original commit message from CVS:
* configure.ac:
* gst/equalizer/Makefile.am:
* gst/equalizer/gstiirequalizer.c: (gst_iir_equalizer_base_init),
(gst_iir_equalizer_class_init), (gst_iir_equalizer_init),
(setup_filter), (gst_iir_equalizer_compute_frequencies),
(gst_iir_equalizer_set_property), (gst_iir_equalizer_get_property),
(gst_iir_equalizer_transform_ip), (gst_iir_equalizer_setup),
(plugin_init):
* gst/equalizer/gstiirequalizer.h:
Fix up to use the newly ported (actually working) GstAudioFilter.
Bump core/base requirements to CVS for this.
* tests/icles/.cvsignore:
* tests/icles/Makefile.am:
* tests/icles/equalizer-test.c: (check_bus),
(equalizer_set_band_value), (equalizer_set_all_band_values),
(equalizer_set_band_value_and_wait),
(equalizer_set_all_band_values_and_wait), (do_slider_fiddling),
(main):
Add brain-dead interactive test for equalizer.
2007-02-03 23:35:26 +00:00
|
|
|
while (!stop && d <= 0.0) {
|
2007-03-14 16:33:03 +00:00
|
|
|
stop = equalizer_set_all_band_values_and_wait (eq, num_bands, d);
|
[MOVED FROM BAD 1/5] Fix up to use the newly ported (actually working) GstAudioFilter.
Original commit message from CVS:
* configure.ac:
* gst/equalizer/Makefile.am:
* gst/equalizer/gstiirequalizer.c: (gst_iir_equalizer_base_init),
(gst_iir_equalizer_class_init), (gst_iir_equalizer_init),
(setup_filter), (gst_iir_equalizer_compute_frequencies),
(gst_iir_equalizer_set_property), (gst_iir_equalizer_get_property),
(gst_iir_equalizer_transform_ip), (gst_iir_equalizer_setup),
(plugin_init):
* gst/equalizer/gstiirequalizer.h:
Fix up to use the newly ported (actually working) GstAudioFilter.
Bump core/base requirements to CVS for this.
* tests/icles/.cvsignore:
* tests/icles/Makefile.am:
* tests/icles/equalizer-test.c: (check_bus),
(equalizer_set_band_value), (equalizer_set_all_band_values),
(equalizer_set_band_value_and_wait),
(equalizer_set_all_band_values_and_wait), (do_slider_fiddling),
(main):
Add brain-dead interactive test for equalizer.
2007-02-03 23:35:26 +00:00
|
|
|
d += step;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
int
|
|
|
|
main (int argc, char **argv)
|
|
|
|
{
|
|
|
|
gchar *opt_audiosink_str = NULL;
|
|
|
|
gchar **filenames = NULL;
|
|
|
|
const GOptionEntry test_goptions[] = {
|
|
|
|
{"audiosink", '\0', 0, G_OPTION_ARG_STRING, &opt_audiosink_str,
|
|
|
|
"audiosink to use (default: autoaudiosink)", NULL},
|
|
|
|
{G_OPTION_REMAINING, 0, 0, G_OPTION_ARG_FILENAME_ARRAY, &filenames, NULL},
|
|
|
|
{NULL, '\0', 0, 0, NULL, NULL, NULL}
|
|
|
|
};
|
|
|
|
GOptionContext *ctx;
|
|
|
|
GError *opt_err = NULL;
|
|
|
|
|
|
|
|
GstStateChangeReturn ret;
|
|
|
|
GstElement *playbin, *sink, *bin, *eq, *auconv;
|
|
|
|
GstPad *eq_sinkpad;
|
|
|
|
gchar *uri;
|
|
|
|
|
|
|
|
/* command line option parsing */
|
|
|
|
ctx = g_option_context_new ("FILENAME");
|
|
|
|
g_option_context_add_group (ctx, gst_init_get_option_group ());
|
|
|
|
g_option_context_add_main_entries (ctx, test_goptions, NULL);
|
|
|
|
|
|
|
|
if (!g_option_context_parse (ctx, &argc, &argv, &opt_err)) {
|
|
|
|
g_error ("Error parsing command line options: %s", opt_err->message);
|
|
|
|
return -1;
|
|
|
|
}
|
|
|
|
|
2011-02-16 14:23:50 +00:00
|
|
|
GST_DEBUG_CATEGORY_INIT (equalizer_test_debug, "equalizertest", 0, "eqtest");
|
|
|
|
|
[MOVED FROM BAD 1/5] Fix up to use the newly ported (actually working) GstAudioFilter.
Original commit message from CVS:
* configure.ac:
* gst/equalizer/Makefile.am:
* gst/equalizer/gstiirequalizer.c: (gst_iir_equalizer_base_init),
(gst_iir_equalizer_class_init), (gst_iir_equalizer_init),
(setup_filter), (gst_iir_equalizer_compute_frequencies),
(gst_iir_equalizer_set_property), (gst_iir_equalizer_get_property),
(gst_iir_equalizer_transform_ip), (gst_iir_equalizer_setup),
(plugin_init):
* gst/equalizer/gstiirequalizer.h:
Fix up to use the newly ported (actually working) GstAudioFilter.
Bump core/base requirements to CVS for this.
* tests/icles/.cvsignore:
* tests/icles/Makefile.am:
* tests/icles/equalizer-test.c: (check_bus),
(equalizer_set_band_value), (equalizer_set_all_band_values),
(equalizer_set_band_value_and_wait),
(equalizer_set_all_band_values_and_wait), (do_slider_fiddling),
(main):
Add brain-dead interactive test for equalizer.
2007-02-03 23:35:26 +00:00
|
|
|
if (filenames == NULL || *filenames == NULL) {
|
|
|
|
g_printerr ("Please specify a file to play back\n");
|
|
|
|
return -1;
|
|
|
|
}
|
|
|
|
|
|
|
|
playbin = gst_element_factory_make ("playbin", "playbin");
|
|
|
|
if (playbin == NULL) {
|
|
|
|
g_error ("Couldn't create 'playbin' element");
|
|
|
|
return -1;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (opt_audiosink_str) {
|
|
|
|
g_print ("Trying audiosink '%s' ...", opt_audiosink_str);
|
|
|
|
sink = gst_element_factory_make (opt_audiosink_str, "sink");
|
|
|
|
g_print ("%s\n", (sink) ? "ok" : "element couldn't be created");
|
|
|
|
} else {
|
|
|
|
sink = NULL;
|
|
|
|
}
|
|
|
|
if (sink == NULL) {
|
|
|
|
g_print ("Trying audiosink '%s' ...", "autoaudiosink");
|
|
|
|
sink = gst_element_factory_make ("autoaudiosink", "sink");
|
|
|
|
g_print ("%s\n", (sink) ? "ok" : "element couldn't be created");
|
|
|
|
}
|
|
|
|
if (sink == NULL) {
|
|
|
|
g_print ("Trying audiosink '%s' ...", "alsasink");
|
|
|
|
sink = gst_element_factory_make ("alsasink", "sink");
|
|
|
|
g_print ("%s\n", (sink) ? "ok" : "element couldn't be created");
|
|
|
|
}
|
|
|
|
if (sink == NULL) {
|
|
|
|
g_print ("Trying audiosink '%s' ...", "osssink");
|
|
|
|
sink = gst_element_factory_make ("osssink", "sink");
|
|
|
|
g_print ("%s\n", (sink) ? "ok" : "element couldn't be created");
|
|
|
|
}
|
|
|
|
|
|
|
|
g_assert (sink != NULL);
|
|
|
|
|
|
|
|
bin = gst_bin_new ("ausinkbin");
|
|
|
|
g_assert (bin != NULL);
|
|
|
|
|
2007-03-14 16:33:03 +00:00
|
|
|
eq = gst_element_factory_make ("equalizer-nbands", "equalizer");
|
[MOVED FROM BAD 1/5] Fix up to use the newly ported (actually working) GstAudioFilter.
Original commit message from CVS:
* configure.ac:
* gst/equalizer/Makefile.am:
* gst/equalizer/gstiirequalizer.c: (gst_iir_equalizer_base_init),
(gst_iir_equalizer_class_init), (gst_iir_equalizer_init),
(setup_filter), (gst_iir_equalizer_compute_frequencies),
(gst_iir_equalizer_set_property), (gst_iir_equalizer_get_property),
(gst_iir_equalizer_transform_ip), (gst_iir_equalizer_setup),
(plugin_init):
* gst/equalizer/gstiirequalizer.h:
Fix up to use the newly ported (actually working) GstAudioFilter.
Bump core/base requirements to CVS for this.
* tests/icles/.cvsignore:
* tests/icles/Makefile.am:
* tests/icles/equalizer-test.c: (check_bus),
(equalizer_set_band_value), (equalizer_set_all_band_values),
(equalizer_set_band_value_and_wait),
(equalizer_set_all_band_values_and_wait), (do_slider_fiddling),
(main):
Add brain-dead interactive test for equalizer.
2007-02-03 23:35:26 +00:00
|
|
|
g_assert (eq != NULL);
|
|
|
|
|
|
|
|
auconv = gst_element_factory_make ("audioconvert", "eqauconv");
|
|
|
|
g_assert (auconv != NULL);
|
|
|
|
|
|
|
|
gst_bin_add_many (GST_BIN (bin), eq, auconv, sink, NULL);
|
|
|
|
|
|
|
|
if (!gst_element_link (eq, auconv))
|
|
|
|
g_error ("Failed to link equalizer to audioconvert");
|
|
|
|
|
|
|
|
if (!gst_element_link (auconv, sink))
|
|
|
|
g_error ("Failed to link audioconvert to audio sink");
|
|
|
|
|
|
|
|
eq_sinkpad = gst_element_get_static_pad (eq, "sink");
|
|
|
|
g_assert (eq_sinkpad != NULL);
|
|
|
|
|
|
|
|
gst_element_add_pad (bin, gst_ghost_pad_new (NULL, eq_sinkpad));
|
|
|
|
gst_object_unref (eq_sinkpad);
|
|
|
|
|
|
|
|
g_object_set (playbin, "audio-sink", bin, NULL);
|
|
|
|
|
|
|
|
/* won't work: uri = gst_uri_construct ("file", filenames[0]); */
|
|
|
|
uri = g_strdup_printf ("file://%s", filenames[0]);
|
|
|
|
g_object_set (playbin, "uri", uri, NULL);
|
|
|
|
g_free (uri);
|
|
|
|
|
|
|
|
pipeline_bus = GST_ELEMENT_BUS (playbin);
|
|
|
|
|
|
|
|
ret = gst_element_set_state (playbin, GST_STATE_PLAYING);
|
|
|
|
if (ret == GST_STATE_CHANGE_FAILURE) {
|
|
|
|
g_printerr ("Failed to set playbin to PLAYING\n");
|
|
|
|
check_bus (1 * GST_SECOND);
|
|
|
|
return -1;
|
|
|
|
}
|
|
|
|
|
|
|
|
ret = gst_element_get_state (playbin, NULL, NULL, 5 * GST_SECOND);
|
|
|
|
if (ret == GST_STATE_CHANGE_ASYNC) {
|
|
|
|
g_printerr ("Failed to go to PLAYING in 5 seconds, bailing out\n");
|
|
|
|
return -1;
|
|
|
|
} else if (ret != GST_STATE_CHANGE_SUCCESS) {
|
|
|
|
g_printerr ("State change to PLAYING failed\n");
|
|
|
|
check_bus (1 * GST_SECOND);
|
|
|
|
return -1;
|
|
|
|
}
|
|
|
|
|
|
|
|
g_print ("Playing ...\n");
|
|
|
|
do_slider_fiddling (playbin, eq);
|
|
|
|
|
|
|
|
gst_element_set_state (playbin, GST_STATE_NULL);
|
|
|
|
gst_object_unref (playbin);
|
|
|
|
|
|
|
|
return 0;
|
|
|
|
}
|