Commit 99753365 authored by Sebastian Dröge's avatar Sebastian Dröge 🍵

Rename audioreverb to audioecho. Fixes bug #568395.

The element can add an echo and a simple reverb effect to
an audio stream but for a real reverb filter it would need
some additional filtering to prevent a metallic-sounding
result.
parent 16799b6b
......@@ -106,7 +106,7 @@ EXTRA_HFILES = \
$(top_srcdir)/gst/alpha/gstalphacolor.h \
$(top_srcdir)/gst/apetag/gstapedemux.h \
$(top_srcdir)/gst/audiofx/audioamplify.h \
$(top_srcdir)/gst/audiofx/audioreverb.h \
$(top_srcdir)/gst/audiofx/audioecho.h \
$(top_srcdir)/gst/audiofx/audiodynamic.h \
$(top_srcdir)/gst/audiofx/audioinvert.h \
$(top_srcdir)/gst/audiofx/audiokaraoke.h \
......
......@@ -23,7 +23,7 @@
<xi:include href="xml/element-audiowsincband.xml" />
<xi:include href="xml/element-audiowsinclimit.xml" />
<xi:include href="xml/element-audiofirfilter.xml" />
<xi:include href="xml/element-audioreverb.xml" />
<xi:include href="xml/element-audioecho.xml" />
<xi:include href="xml/element-audiodynamic.xml" />
<xi:include href="xml/element-audioinvert.xml" />
<xi:include href="xml/element-audiopanorama.xml" />
......
......@@ -117,19 +117,19 @@ gst_audio_iir_filter_get_type
</SECTION>
<SECTION>
<FILE>element-audioreverb</FILE>
<TITLE>audioreverb</TITLE>
GstAudioReverb
<SUBSECTION Standard>
GstAudioReverbClass
GstAudioReverbProcessFunc
GST_AUDIO_REVERB
GST_AUDIO_REVERB_CLASS
GST_AUDIO_REVERB_GET_CLASS
GST_IS_AUDIO_REVERB
GST_IS_AUDIO_REVERB_CLASS
GST_TYPE_AUDIO_REVERB
gst_audio_reverb_get_type
<FILE>element-audioecho</FILE>
<TITLE>audioecho</TITLE>
GstAudioEcho
<SUBSECTION Standard>
GstAudioEchoClass
GstAudioEchoProcessFunc
GST_AUDIO_ECHO
GST_AUDIO_ECHO_CLASS
GST_AUDIO_ECHO_GET_CLASS
GST_IS_AUDIO_ECHO
GST_IS_AUDIO_ECHO_CLASS
GST_TYPE_AUDIO_ECHO
gst_audio_echo_get_type
</SECTION>
<SECTION>
......
......@@ -19768,3 +19768,33 @@
<DEFAULT>0</DEFAULT>
</ARG>
<ARG>
<NAME>GstAudioEcho::delay</NAME>
<TYPE>guint64</TYPE>
<RANGE>>= 1</RANGE>
<FLAGS>rw</FLAGS>
<NICK>Delay</NICK>
<BLURB>Delay of the echo in nanosecondsecho.</BLURB>
<DEFAULT>1</DEFAULT>
</ARG>
<ARG>
<NAME>GstAudioEcho::feedback</NAME>
<TYPE>gfloat</TYPE>
<RANGE>[0,1]</RANGE>
<FLAGS>rw</FLAGS>
<NICK>Feedback</NICK>
<BLURB>Amount of feedback.</BLURB>
<DEFAULT>0</DEFAULT>
</ARG>
<ARG>
<NAME>GstAudioEcho::intensity</NAME>
<TYPE>gfloat</TYPE>
<RANGE>[0,1]</RANGE>
<FLAGS>rw</FLAGS>
<NICK>Intensity</NICK>
<BLURB>Intensity of the echo.</BLURB>
<DEFAULT>0</DEFAULT>
</ARG>
......@@ -64,7 +64,7 @@ GObject
GstAudioWSincLimit
GstAudioWSincBand
GstAudioFIRFilter
GstAudioReverb
GstAudioEcho
GstIirEqualizer
GstIirEqualizerNBands
GstIirEqualizer3Bands
......
......@@ -93,6 +93,27 @@
</caps>
</pads>
</element>
<element>
<name>audioecho</name>
<longname>Audio echo</longname>
<class>Filter/Effect/Audio</class>
<description>Adds an echo or reverb effect to an audio stream</description>
<author>Sebastian Dröge &lt;sebastian.droege@collabora.co.uk&gt;</author>
<pads>
<caps>
<name>sink</name>
<direction>sink</direction>
<presence>always</presence>
<details>audio/x-raw-float, width=(int){ 32, 64 }, endianness=(int)1234, rate=(int)[ 1, 2147483647 ], channels=(int)[ 1, 2147483647 ]</details>
</caps>
<caps>
<name>src</name>
<direction>source</direction>
<presence>always</presence>
<details>audio/x-raw-float, width=(int){ 32, 64 }, endianness=(int)1234, rate=(int)[ 1, 2147483647 ], channels=(int)[ 1, 2147483647 ]</details>
</caps>
</pads>
</element>
<element>
<name>audiofirfilter</name>
<longname>Audio FIR filter</longname>
......@@ -198,27 +219,6 @@
</caps>
</pads>
</element>
<element>
<name>audioreverb</name>
<longname>Audio reverb</longname>
<class>Filter/Effect/Audio</class>
<description>Adds an echo or reverb effect to an audio stream</description>
<author>Sebastian Dröge &lt;sebastian.droege@collabora.co.uk&gt;</author>
<pads>
<caps>
<name>sink</name>
<direction>sink</direction>
<presence>always</presence>
<details>audio/x-raw-float, width=(int){ 32, 64 }, endianness=(int)1234, rate=(int)[ 1, 2147483647 ], channels=(int)[ 1, 2147483647 ]</details>
</caps>
<caps>
<name>src</name>
<direction>source</direction>
<presence>always</presence>
<details>audio/x-raw-float, width=(int){ 32, 64 }, endianness=(int)1234, rate=(int)[ 1, 2147483647 ], channels=(int)[ 1, 2147483647 ]</details>
</caps>
</pads>
</element>
<element>
<name>audiowsincband</name>
<longname>Band pass &amp; band reject filter</longname>
......
This diff is collapsed.
......@@ -17,7 +17,7 @@ libgstaudiofx_la_SOURCES = audiofx.c\
audiowsincband.c \
audiowsinclimit.c \
audiofirfilter.c \
audioreverb.c
audioecho.c
# flags used to compile this plugin
libgstaudiofx_la_CFLAGS = $(GST_CFLAGS) \
......@@ -47,6 +47,6 @@ noinst_HEADERS = audiopanorama.h \
audiowsincband.h \
audiowsinclimit.h \
audiofirfilter.h \
audioreverb.h \
audioecho.h \
math_compat.h
......@@ -18,8 +18,8 @@
* Boston, MA 02111-1307, USA.
*/
#ifndef __GST_AUDIO_REVERB_H__
#define __GST_AUDIO_REVERB_H__
#ifndef __GST_AUDIO_ECHO_H__
#define __GST_AUDIO_ECHO_H__
#include <gst/gst.h>
#include <gst/base/gstbasetransform.h>
......@@ -28,18 +28,18 @@
G_BEGIN_DECLS
#define GST_TYPE_AUDIO_REVERB (gst_audio_reverb_get_type())
#define GST_AUDIO_REVERB(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj),GST_TYPE_AUDIO_REVERB,GstAudioReverb))
#define GST_IS_AUDIO_REVERB(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj),GST_TYPE_AUDIO_REVERB))
#define GST_AUDIO_REVERB_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass) ,GST_TYPE_AUDIO_REVERB,GstAudioReverbClass))
#define GST_IS_AUDIO_REVERB_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass) ,GST_TYPE_AUDIO_REVERB))
#define GST_AUDIO_REVERB_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS((obj) ,GST_TYPE_AUDIO_REVERB,GstAudioReverbClass))
typedef struct _GstAudioReverb GstAudioReverb;
typedef struct _GstAudioReverbClass GstAudioReverbClass;
#define GST_TYPE_AUDIO_ECHO (gst_audio_echo_get_type())
#define GST_AUDIO_ECHO(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj),GST_TYPE_AUDIO_ECHO,GstAudioEcho))
#define GST_IS_AUDIO_ECHO(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj),GST_TYPE_AUDIO_ECHO))
#define GST_AUDIO_ECHO_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass) ,GST_TYPE_AUDIO_ECHO,GstAudioEchoClass))
#define GST_IS_AUDIO_ECHO_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass) ,GST_TYPE_AUDIO_ECHO))
#define GST_AUDIO_ECHO_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS((obj) ,GST_TYPE_AUDIO_ECHO,GstAudioEchoClass))
typedef struct _GstAudioEcho GstAudioEcho;
typedef struct _GstAudioEchoClass GstAudioEchoClass;
typedef void (*GstAudioReverbProcessFunc) (GstAudioReverb *, guint8 *, guint);
typedef void (*GstAudioEchoProcessFunc) (GstAudioEcho *, guint8 *, guint);
struct _GstAudioReverb
struct _GstAudioEcho
{
GstAudioFilter audiofilter;
......@@ -48,7 +48,7 @@ struct _GstAudioReverb
gfloat feedback;
/* < private > */
GstAudioReverbProcessFunc process;
GstAudioEchoProcessFunc process;
guint delay_frames;
guint8 *buffer;
guint buffer_pos;
......@@ -56,13 +56,13 @@ struct _GstAudioReverb
guint buffer_size_frames;
};
struct _GstAudioReverbClass
struct _GstAudioEchoClass
{
GstAudioFilterClass parent;
};
GType gst_audio_reverb_get_type (void);
GType gst_audio_echo_get_type (void);
G_END_DECLS
#endif /* __GST_AUDIO_REVERB_H__ */
#endif /* __GST_AUDIO_ECHO_H__ */
......@@ -36,7 +36,7 @@
#include "audiowsincband.h"
#include "audiowsinclimit.h"
#include "audiofirfilter.h"
#include "audioreverb.h"
#include "audioecho.h"
/* entry point to initialize the plug-in
* initialize the plug-in itself
......@@ -71,8 +71,8 @@ plugin_init (GstPlugin * plugin)
GST_TYPE_AUDIO_WSINC_BAND) &&
gst_element_register (plugin, "audiofirfilter", GST_RANK_NONE,
GST_TYPE_AUDIO_FIR_FILTER) &&
gst_element_register (plugin, "audioreverb", GST_RANK_NONE,
GST_TYPE_AUDIO_REVERB));
gst_element_register (plugin, "audioecho", GST_RANK_NONE,
GST_TYPE_AUDIO_ECHO));
}
GST_PLUGIN_DEFINE (GST_VERSION_MAJOR,
......
......@@ -74,7 +74,7 @@ check_PROGRAMS = \
elements/audiocheblimit \
elements/audioiirfilter \
elements/audioamplify \
elements/audioreverb \
elements/audioecho \
elements/audiodynamic \
elements/audiowsincband \
elements/audiowsinclimit \
......
......@@ -27,7 +27,7 @@ gboolean have_eos = FALSE;
* get_peer, and then remove references in every test function */
GstPad *mysrcpad, *mysinkpad;
#define REVERB_CAPS_STRING \
#define ECHO_CAPS_STRING \
"audio/x-raw-float, " \
"channels = (int) 2, " \
"rate = (int) 100000, " \
......@@ -52,24 +52,24 @@ static GstStaticPadTemplate srctemplate = GST_STATIC_PAD_TEMPLATE ("src",
);
GstElement *
setup_reverb ()
setup_echo ()
{
GstElement *reverb;
GstElement *echo;
GST_DEBUG ("setup_reverb");
reverb = gst_check_setup_element ("audioreverb");
mysrcpad = gst_check_setup_src_pad (reverb, &srctemplate, NULL);
mysinkpad = gst_check_setup_sink_pad (reverb, &sinktemplate, NULL);
GST_DEBUG ("setup_echo");
echo = gst_check_setup_element ("audioecho");
mysrcpad = gst_check_setup_src_pad (echo, &srctemplate, NULL);
mysinkpad = gst_check_setup_sink_pad (echo, &sinktemplate, NULL);
gst_pad_set_active (mysrcpad, TRUE);
gst_pad_set_active (mysinkpad, TRUE);
return reverb;
return echo;
}
void
cleanup_reverb (GstElement * reverb)
cleanup_echo (GstElement * echo)
{
GST_DEBUG ("cleanup_reverb");
GST_DEBUG ("cleanup_echo");
g_list_foreach (buffers, (GFunc) gst_mini_object_unref, NULL);
g_list_free (buffers);
......@@ -77,30 +77,30 @@ cleanup_reverb (GstElement * reverb)
gst_pad_set_active (mysrcpad, FALSE);
gst_pad_set_active (mysinkpad, FALSE);
gst_check_teardown_src_pad (reverb);
gst_check_teardown_sink_pad (reverb);
gst_check_teardown_element (reverb);
gst_check_teardown_src_pad (echo);
gst_check_teardown_sink_pad (echo);
gst_check_teardown_element (echo);
}
GST_START_TEST (test_passthrough)
{
GstElement *reverb;
GstElement *echo;
GstBuffer *inbuffer, *outbuffer;
GstCaps *caps;
gdouble in[] = { 1.0, -1.0, 0.0, 0.5, -0.5, 0.0 };
gdouble *res;
reverb = setup_reverb ();
g_object_set (G_OBJECT (reverb), "delay", 1, "intensity", 0.0, "feedback",
echo = setup_echo ();
g_object_set (G_OBJECT (echo), "delay", 1, "intensity", 0.0, "feedback",
0.0, NULL);
fail_unless (gst_element_set_state (reverb,
fail_unless (gst_element_set_state (echo,
GST_STATE_PLAYING) == GST_STATE_CHANGE_SUCCESS,
"could not set to playing");
inbuffer = gst_buffer_new_and_alloc (sizeof (in));
memcpy (GST_BUFFER_DATA (inbuffer), in, sizeof (in));
fail_unless (memcmp (GST_BUFFER_DATA (inbuffer), in, sizeof (in)) == 0);
caps = gst_caps_from_string (REVERB_CAPS_STRING);
caps = gst_caps_from_string (ECHO_CAPS_STRING);
gst_buffer_set_caps (inbuffer, caps);
gst_caps_unref (caps);
ASSERT_BUFFER_REFCOUNT (inbuffer, "inbuffer", 1);
......@@ -119,31 +119,31 @@ GST_START_TEST (test_passthrough)
fail_unless (memcmp (GST_BUFFER_DATA (outbuffer), in, sizeof (in)) == 0);
/* cleanup */
cleanup_reverb (reverb);
cleanup_echo (echo);
}
GST_END_TEST;
GST_START_TEST (test_reverb)
GST_START_TEST (test_echo)
{
GstElement *reverb;
GstElement *echo;
GstBuffer *inbuffer, *outbuffer;
GstCaps *caps;
gdouble in[] = { 1.0, -1.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, };
gdouble out[] = { 1.0, -1.0, 0.0, 0.0, 1.0, -1.0, 0.0, 0.0, 0.0, 0.0 };
gdouble *res;
reverb = setup_reverb ();
g_object_set (G_OBJECT (reverb), "delay", 20000, "intensity", 1.0, "feedback",
echo = setup_echo ();
g_object_set (G_OBJECT (echo), "delay", 20000, "intensity", 1.0, "feedback",
0.0, NULL);
fail_unless (gst_element_set_state (reverb,
fail_unless (gst_element_set_state (echo,
GST_STATE_PLAYING) == GST_STATE_CHANGE_SUCCESS,
"could not set to playing");
inbuffer = gst_buffer_new_and_alloc (sizeof (in));
memcpy (GST_BUFFER_DATA (inbuffer), in, sizeof (in));
fail_unless (memcmp (GST_BUFFER_DATA (inbuffer), in, sizeof (in)) == 0);
caps = gst_caps_from_string (REVERB_CAPS_STRING);
caps = gst_caps_from_string (ECHO_CAPS_STRING);
gst_buffer_set_caps (inbuffer, caps);
gst_caps_unref (caps);
ASSERT_BUFFER_REFCOUNT (inbuffer, "inbuffer", 1);
......@@ -163,31 +163,31 @@ GST_START_TEST (test_reverb)
fail_unless (memcmp (GST_BUFFER_DATA (outbuffer), out, sizeof (out)) == 0);
/* cleanup */
cleanup_reverb (reverb);
cleanup_echo (echo);
}
GST_END_TEST;
GST_START_TEST (test_feedback)
{
GstElement *reverb;
GstElement *echo;
GstBuffer *inbuffer, *outbuffer;
GstCaps *caps;
gdouble in[] = { 1.0, -1.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, };
gdouble out[] = { 1.0, -1.0, 0.0, 0.0, 1.0, -1.0, 0.0, 0.0, 1.0, -1.0 };
gdouble *res;
reverb = setup_reverb ();
g_object_set (G_OBJECT (reverb), "delay", 20000, "intensity", 1.0, "feedback",
echo = setup_echo ();
g_object_set (G_OBJECT (echo), "delay", 20000, "intensity", 1.0, "feedback",
1.0, NULL);
fail_unless (gst_element_set_state (reverb,
fail_unless (gst_element_set_state (echo,
GST_STATE_PLAYING) == GST_STATE_CHANGE_SUCCESS,
"could not set to playing");
inbuffer = gst_buffer_new_and_alloc (sizeof (in));
memcpy (GST_BUFFER_DATA (inbuffer), in, sizeof (in));
fail_unless (memcmp (GST_BUFFER_DATA (inbuffer), in, sizeof (in)) == 0);
caps = gst_caps_from_string (REVERB_CAPS_STRING);
caps = gst_caps_from_string (ECHO_CAPS_STRING);
gst_buffer_set_caps (inbuffer, caps);
gst_caps_unref (caps);
ASSERT_BUFFER_REFCOUNT (inbuffer, "inbuffer", 1);
......@@ -207,23 +207,23 @@ GST_START_TEST (test_feedback)
fail_unless (memcmp (GST_BUFFER_DATA (outbuffer), out, sizeof (out)) == 0);
/* cleanup */
cleanup_reverb (reverb);
cleanup_echo (echo);
}
GST_END_TEST;
static Suite *
audioreverb_suite (void)
audioecho_suite (void)
{
Suite *s = suite_create ("audioreverb");
Suite *s = suite_create ("audioecho");
TCase *tc_chain = tcase_create ("general");
suite_add_tcase (s, tc_chain);
tcase_add_test (tc_chain, test_passthrough);
tcase_add_test (tc_chain, test_reverb);
tcase_add_test (tc_chain, test_echo);
tcase_add_test (tc_chain, test_feedback);
return s;
}
GST_CHECK_MAIN (audioreverb);
GST_CHECK_MAIN (audioecho);
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment