diff --git a/ChangeLog b/ChangeLog index 7b021c2aa7..6c6ee4de8f 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,19 @@ +2008-05-28 Stefan Kost + + * 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/gst-plugins-good-plugins.hierarchy: + * docs/plugins/inspect/plugin-audiofx.xml: + * gst/audiofx/Makefile.am: + * gst/audiofx/audiofx.c: + * gst/audiofx/audiokaraoke.c: + * gst/audiofx/audiokaraoke.h: + * gst/audiofx/audiovoice.c: + * gst/audiofx/audiovoice.h: + Rename audiovoice to audiokaraoke and add it to the docs. + 2008-05-28 Stefan Kost * REQUIREMENTS: diff --git a/docs/plugins/Makefile.am b/docs/plugins/Makefile.am index e8dd002f79..00d31b853b 100644 --- a/docs/plugins/Makefile.am +++ b/docs/plugins/Makefile.am @@ -102,6 +102,7 @@ EXTRA_HFILES = \ $(top_srcdir)/gst/audiofx/audioamplify.h \ $(top_srcdir)/gst/audiofx/audiodynamic.h \ $(top_srcdir)/gst/audiofx/audioinvert.h \ + $(top_srcdir)/gst/audiofx/audiokaraoke.h \ $(top_srcdir)/gst/audiofx/audiopanorama.h \ $(top_srcdir)/gst/audiofx/audiocheblimit.h \ $(top_srcdir)/gst/audiofx/audiochebband.h \ diff --git a/docs/plugins/gst-plugins-good-plugins-docs.sgml b/docs/plugins/gst-plugins-good-plugins-docs.sgml index add34ba70b..1dea9b9699 100644 --- a/docs/plugins/gst-plugins-good-plugins-docs.sgml +++ b/docs/plugins/gst-plugins-good-plugins-docs.sgml @@ -24,6 +24,7 @@ + diff --git a/docs/plugins/gst-plugins-good-plugins-sections.txt b/docs/plugins/gst-plugins-good-plugins-sections.txt index 120bad21fb..b30bc3c641 100644 --- a/docs/plugins/gst-plugins-good-plugins-sections.txt +++ b/docs/plugins/gst-plugins-good-plugins-sections.txt @@ -135,6 +135,22 @@ GST_TYPE_AUDIO_INVERT gst_audio_invert_get_type +
+element-audiokaraoke +audiokaraoke +GstAudioKaraoke + +GstAudioKaraokeClass +GstAudioKaraokeProcessFunc +GST_AUDIO_KARAOKE +GST_AUDIO_KARAOKE_CLASS +GST_AUDIO_KARAOKE_GET_CLASS +GST_IS_AUDIO_KARAOKE +GST_IS_AUDIO_KARAOKE_CLASS +GST_TYPE_AUDIO_KARAOKE +gst_audio_karaoke_get_type +
+
element-audiopanorama audiopanorama diff --git a/docs/plugins/gst-plugins-good-plugins.args b/docs/plugins/gst-plugins-good-plugins.args index d6255b0129..cdf8444dfb 100644 --- a/docs/plugins/gst-plugins-good-plugins.args +++ b/docs/plugins/gst-plugins-good-plugins.args @@ -19208,3 +19208,43 @@ TRUE + +GstAudioKaraoke::filter-band +gfloat +[0,441] +rw +Filter Band +The Frequency band of the filter. +220 + + + +GstAudioKaraoke::filter-width +gfloat +[0,100] +rw +Filter Width +The Frequency width of the filter. +100 + + + +GstAudioKaraoke::level +gfloat +[0,1] +rw +Level +Level of the effect (1.0 = full). +1 + + + +GstAudioKaraoke::mono-level +gfloat +[0,1] +rw +Mono Level +Level of the mono channel (1.0 = full). +1 + + diff --git a/docs/plugins/gst-plugins-good-plugins.hierarchy b/docs/plugins/gst-plugins-good-plugins.hierarchy index acad396e0b..ecedf9ffe9 100644 --- a/docs/plugins/gst-plugins-good-plugins.hierarchy +++ b/docs/plugins/gst-plugins-good-plugins.hierarchy @@ -45,6 +45,7 @@ GObject GstAudioPanorama GstAudioFilter GstAudioInvert + GstAudioKaraoke GstAudioAmplify GstAudioDynamic GstAudioChebLimit diff --git a/docs/plugins/inspect/plugin-audiofx.xml b/docs/plugins/inspect/plugin-audiofx.xml index a005d516a8..f9cceb986a 100644 --- a/docs/plugins/inspect/plugin-audiofx.xml +++ b/docs/plugins/inspect/plugin-audiofx.xml @@ -114,6 +114,27 @@ + + audiokaraoke + AudioKaraoke + Filter/Effect/Audio + Removes voice from sound + Wim Taymans <wim.taymans@gmail.com> + + + src + source + always +
audio/x-raw-int, depth=(int)16, width=(int)16, endianness=(int)1234, signed=(boolean)true, rate=(int)[ 1, 2147483647 ], channels=(int)[ 1, 2147483647 ]; audio/x-raw-float, width=(int)32, endianness=(int)1234, rate=(int)[ 1, 2147483647 ], channels=(int)[ 1, 2147483647 ]
+
+ + sink + sink + always +
audio/x-raw-int, depth=(int)16, width=(int)16, endianness=(int)1234, signed=(boolean)true, rate=(int)[ 1, 2147483647 ], channels=(int)[ 1, 2147483647 ]; audio/x-raw-float, width=(int)32, endianness=(int)1234, rate=(int)[ 1, 2147483647 ], channels=(int)[ 1, 2147483647 ]
+
+
+
audiopanorama Stereo positioning diff --git a/gst/audiofx/Makefile.am b/gst/audiofx/Makefile.am index 28de5e2a90..5754eba966 100644 --- a/gst/audiofx/Makefile.am +++ b/gst/audiofx/Makefile.am @@ -8,7 +8,7 @@ libgstaudiofx_la_SOURCES = audiofx.c\ audioinvert.c \ audioamplify.c \ audiodynamic.c \ - audiovoice.c \ + audiokaraoke.c \ audiocheblimit.c \ audiochebband.c \ audiowsincband.c \ @@ -32,7 +32,7 @@ noinst_HEADERS = audiopanorama.h \ audioinvert.h \ audioamplify.h \ audiodynamic.h \ - audiovoice.h \ + audiokaraoke.h \ audiocheblimit.h \ audiochebband.h \ audiowsincband.h \ diff --git a/gst/audiofx/audiofx.c b/gst/audiofx/audiofx.c index f9b62ca943..43d1b0cc48 100644 --- a/gst/audiofx/audiofx.c +++ b/gst/audiofx/audiofx.c @@ -27,7 +27,7 @@ #include "audiopanorama.h" #include "audioinvert.h" -#include "audiovoice.h" +#include "audiokaraoke.h" #include "audioamplify.h" #include "audiodynamic.h" #include "audiocheblimit.h" @@ -50,8 +50,8 @@ plugin_init (GstPlugin * plugin) GST_TYPE_AUDIO_PANORAMA) && gst_element_register (plugin, "audioinvert", GST_RANK_NONE, GST_TYPE_AUDIO_INVERT) && - gst_element_register (plugin, "audiovoice", GST_RANK_NONE, - GST_TYPE_AUDIO_VOICE) && + gst_element_register (plugin, "audiokaraoke", GST_RANK_NONE, + GST_TYPE_AUDIO_KARAOKE) && gst_element_register (plugin, "audioamplify", GST_RANK_NONE, GST_TYPE_AUDIO_AMPLIFY) && gst_element_register (plugin, "audiodynamic", GST_RANK_NONE, diff --git a/gst/audiofx/audiovoice.c b/gst/audiofx/audiokaraoke.c similarity index 79% rename from gst/audiofx/audiovoice.c rename to gst/audiofx/audiokaraoke.c index 08916c113c..ec50568101 100644 --- a/gst/audiofx/audiovoice.c +++ b/gst/audiofx/audiokaraoke.c @@ -19,16 +19,16 @@ */ /** - * SECTION:element-audiovoice + * SECTION:element-audiokaraoke * @short_description: Voice removal element * * - * Remove the voice from audio by removing the center channel. + * Remove the voice from audio by filtering the center channel. * This plugin is useful for karaoke applications. * Example launch line * * - * gst-launch filesrc location="song.ogg" ! oggdemux ! vorbisdec ! audiovoice ! audioconvert ! alsasink + * gst-launch filesrc location=song.ogg ! oggdemux ! vorbisdec ! audiokaraoke ! audioconvert ! alsasink * * * @@ -46,13 +46,13 @@ #include #include -#include "audiovoice.h" +#include "audiokaraoke.h" -#define GST_CAT_DEFAULT gst_audio_voice_debug +#define GST_CAT_DEFAULT gst_audio_karaoke_debug GST_DEBUG_CATEGORY_STATIC (GST_CAT_DEFAULT); static const GstElementDetails element_details = -GST_ELEMENT_DETAILS ("AudioVoice", +GST_ELEMENT_DETAILS ("AudioKaraoke", "Filter/Effect/Audio", "Removes voice from sound", "Wim Taymans "); @@ -94,30 +94,30 @@ enum " channels=(int)[1,MAX]" #define DEBUG_INIT(bla) \ - GST_DEBUG_CATEGORY_INIT (gst_audio_voice_debug, "audiovoice", 0, "audiovoice element"); + GST_DEBUG_CATEGORY_INIT (gst_audio_karaoke_debug, "audiokaraoke", 0, "audiokaraoke element"); -GST_BOILERPLATE_FULL (GstAudioVoice, gst_audio_voice, GstAudioFilter, +GST_BOILERPLATE_FULL (GstAudioKaraoke, gst_audio_karaoke, GstAudioFilter, GST_TYPE_AUDIO_FILTER, DEBUG_INIT); -static void gst_audio_voice_set_property (GObject * object, guint prop_id, +static void gst_audio_karaoke_set_property (GObject * object, guint prop_id, const GValue * value, GParamSpec * pspec); -static void gst_audio_voice_get_property (GObject * object, guint prop_id, +static void gst_audio_karaoke_get_property (GObject * object, guint prop_id, GValue * value, GParamSpec * pspec); -static gboolean gst_audio_voice_setup (GstAudioFilter * filter, +static gboolean gst_audio_karaoke_setup (GstAudioFilter * filter, GstRingBufferSpec * format); -static GstFlowReturn gst_audio_voice_transform_ip (GstBaseTransform * base, +static GstFlowReturn gst_audio_karaoke_transform_ip (GstBaseTransform * base, GstBuffer * buf); -static void gst_audio_voice_transform_int (GstAudioVoice * filter, +static void gst_audio_karaoke_transform_int (GstAudioKaraoke * filter, gint16 * data, guint num_samples); -static void gst_audio_voice_transform_float (GstAudioVoice * filter, +static void gst_audio_karaoke_transform_float (GstAudioKaraoke * filter, gfloat * data, guint num_samples); /* GObject vmethod implementations */ static void -gst_audio_voice_base_init (gpointer klass) +gst_audio_karaoke_base_init (gpointer klass) { GstElementClass *element_class = GST_ELEMENT_CLASS (klass); GstCaps *caps; @@ -131,13 +131,13 @@ gst_audio_voice_base_init (gpointer klass) } static void -gst_audio_voice_class_init (GstAudioVoiceClass * klass) +gst_audio_karaoke_class_init (GstAudioKaraokeClass * klass) { GObjectClass *gobject_class; gobject_class = (GObjectClass *) klass; - gobject_class->set_property = gst_audio_voice_set_property; - gobject_class->get_property = gst_audio_voice_get_property; + gobject_class->set_property = gst_audio_karaoke_set_property; + gobject_class->get_property = gst_audio_karaoke_get_property; g_object_class_install_property (gobject_class, PROP_LEVEL, g_param_spec_float ("level", "Level", @@ -160,13 +160,13 @@ gst_audio_voice_class_init (GstAudioVoiceClass * klass) G_PARAM_READWRITE | GST_PARAM_CONTROLLABLE)); GST_AUDIO_FILTER_CLASS (klass)->setup = - GST_DEBUG_FUNCPTR (gst_audio_voice_setup); + GST_DEBUG_FUNCPTR (gst_audio_karaoke_setup); GST_BASE_TRANSFORM_CLASS (klass)->transform_ip = - GST_DEBUG_FUNCPTR (gst_audio_voice_transform_ip); + GST_DEBUG_FUNCPTR (gst_audio_karaoke_transform_ip); } static void -gst_audio_voice_init (GstAudioVoice * filter, GstAudioVoiceClass * klass) +gst_audio_karaoke_init (GstAudioKaraoke * filter, GstAudioKaraokeClass * klass) { gst_base_transform_set_in_place (GST_BASE_TRANSFORM (filter), TRUE); gst_base_transform_set_gap_aware (GST_BASE_TRANSFORM (filter), TRUE); @@ -178,7 +178,7 @@ gst_audio_voice_init (GstAudioVoice * filter, GstAudioVoiceClass * klass) } static void -update_filter (GstAudioVoice * filter, gint rate) +update_filter (GstAudioKaraoke * filter, gint rate) { gfloat A, B, C; @@ -197,12 +197,12 @@ update_filter (GstAudioVoice * filter, gint rate) } static void -gst_audio_voice_set_property (GObject * object, guint prop_id, +gst_audio_karaoke_set_property (GObject * object, guint prop_id, const GValue * value, GParamSpec * pspec) { - GstAudioVoice *filter; + GstAudioKaraoke *filter; - filter = GST_AUDIO_VOICE (object); + filter = GST_AUDIO_KARAOKE (object); switch (prop_id) { case PROP_LEVEL: @@ -226,12 +226,12 @@ gst_audio_voice_set_property (GObject * object, guint prop_id, } static void -gst_audio_voice_get_property (GObject * object, guint prop_id, +gst_audio_karaoke_get_property (GObject * object, guint prop_id, GValue * value, GParamSpec * pspec) { - GstAudioVoice *filter; + GstAudioKaraoke *filter; - filter = GST_AUDIO_VOICE (object); + filter = GST_AUDIO_KARAOKE (object); switch (prop_id) { case PROP_LEVEL: @@ -255,20 +255,20 @@ gst_audio_voice_get_property (GObject * object, guint prop_id, /* GstAudioFilter vmethod implementations */ static gboolean -gst_audio_voice_setup (GstAudioFilter * base, GstRingBufferSpec * format) +gst_audio_karaoke_setup (GstAudioFilter * base, GstRingBufferSpec * format) { - GstAudioVoice *filter = GST_AUDIO_VOICE (base); + GstAudioKaraoke *filter = GST_AUDIO_KARAOKE (base); gboolean ret = TRUE; filter->channels = format->channels; filter->rate = format->rate; if (format->type == GST_BUFTYPE_FLOAT && format->width == 32) - filter->process = (GstAudioVoiceProcessFunc) - gst_audio_voice_transform_float; + filter->process = (GstAudioKaraokeProcessFunc) + gst_audio_karaoke_transform_float; else if (format->type == GST_BUFTYPE_LINEAR && format->width == 16) - filter->process = (GstAudioVoiceProcessFunc) - gst_audio_voice_transform_int; + filter->process = (GstAudioKaraokeProcessFunc) + gst_audio_karaoke_transform_int; else ret = FALSE; @@ -278,7 +278,7 @@ gst_audio_voice_setup (GstAudioFilter * base, GstRingBufferSpec * format) } static void -gst_audio_voice_transform_int (GstAudioVoice * filter, +gst_audio_karaoke_transform_int (GstAudioKaraoke * filter, gint16 * data, guint num_samples) { gint i, l, r, o, x; @@ -311,7 +311,7 @@ gst_audio_voice_transform_int (GstAudioVoice * filter, } static void -gst_audio_voice_transform_float (GstAudioVoice * filter, +gst_audio_karaoke_transform_float (GstAudioKaraoke * filter, gfloat * data, guint num_samples) { gint i; @@ -340,9 +340,9 @@ gst_audio_voice_transform_float (GstAudioVoice * filter, /* GstBaseTransform vmethod implementations */ static GstFlowReturn -gst_audio_voice_transform_ip (GstBaseTransform * base, GstBuffer * buf) +gst_audio_karaoke_transform_ip (GstBaseTransform * base, GstBuffer * buf) { - GstAudioVoice *filter = GST_AUDIO_VOICE (base); + GstAudioKaraoke *filter = GST_AUDIO_KARAOKE (base); guint num_samples = GST_BUFFER_SIZE (buf) / (GST_AUDIO_FILTER (filter)->format.width / 8); diff --git a/gst/audiofx/audiovoice.h b/gst/audiofx/audiokaraoke.h similarity index 54% rename from gst/audiofx/audiovoice.h rename to gst/audiofx/audiokaraoke.h index cf3ff4f6f6..727fafaeed 100644 --- a/gst/audiofx/audiovoice.h +++ b/gst/audiofx/audiokaraoke.h @@ -18,8 +18,8 @@ * Boston, MA 02111-1307, USA. */ -#ifndef __GST_AUDIO_VOICE_H__ -#define __GST_AUDIO_VOICE_H__ +#ifndef __GST_AUDIO_KARAOKE_H__ +#define __GST_AUDIO_KARAOKE_H__ #include #include @@ -27,18 +27,18 @@ #include G_BEGIN_DECLS -#define GST_TYPE_AUDIO_VOICE (gst_audio_voice_get_type()) -#define GST_AUDIO_VOICE(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj),GST_TYPE_AUDIO_VOICE,GstAudioVoice)) -#define GST_IS_AUDIO_VOICE(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj),GST_TYPE_AUDIO_VOICE)) -#define GST_AUDIO_VOICE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass) ,GST_TYPE_AUDIO_VOICE,GstAudioVoiceClass)) -#define GST_IS_AUDIO_VOICE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass) ,GST_TYPE_AUDIO_VOICE)) -#define GST_AUDIO_VOICE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS((obj) ,GST_TYPE_AUDIO_VOICE,GstAudioVoiceClass)) -typedef struct _GstAudioVoice GstAudioVoice; -typedef struct _GstAudioVoiceClass GstAudioVoiceClass; +#define GST_TYPE_AUDIO_KARAOKE (gst_audio_karaoke_get_type()) +#define GST_AUDIO_KARAOKE(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj),GST_TYPE_AUDIO_KARAOKE,GstAudioKaraoke)) +#define GST_IS_AUDIO_KARAOKE(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj),GST_TYPE_AUDIO_KARAOKE)) +#define GST_AUDIO_KARAOKE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass) ,GST_TYPE_AUDIO_KARAOKE,GstAudioKaraokeClass)) +#define GST_IS_AUDIO_KARAOKE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass) ,GST_TYPE_AUDIO_KARAOKE)) +#define GST_AUDIO_KARAOKE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS((obj) ,GST_TYPE_AUDIO_KARAOKE,GstAudioKaraokeClass)) +typedef struct _GstAudioKaraoke GstAudioKaraoke; +typedef struct _GstAudioKaraokeClass GstAudioKaraokeClass; -typedef void (*GstAudioVoiceProcessFunc) (GstAudioVoice *, guint8 *, guint); +typedef void (*GstAudioKaraokeProcessFunc) (GstAudioKaraoke *, guint8 *, guint); -struct _GstAudioVoice +struct _GstAudioKaraoke { GstAudioFilter audiofilter; @@ -56,15 +56,15 @@ struct _GstAudioVoice gfloat y1, y2; /* < private > */ - GstAudioVoiceProcessFunc process; + GstAudioKaraokeProcessFunc process; }; -struct _GstAudioVoiceClass +struct _GstAudioKaraokeClass { GstAudioFilterClass parent; }; -GType gst_audio_voice_get_type (void); +GType gst_audio_karaoke_get_type (void); G_END_DECLS -#endif /* __GST_AUDIO_VOICE_H__ */ +#endif /* __GST_AUDIO_KARAOKE_H__ */