From 9b6939b996ecf5c66bc7e4947cd2a25501a92417 Mon Sep 17 00:00:00 2001 From: Andy Wingo Date: Sat, 22 Dec 2001 23:26:33 +0000 Subject: [PATCH 01/38] Initial revision Original commit message from CVS: Initial revision --- gst/audiofx/gststereo.c | 226 ++++++++++++++++++++++++++++++++++++++++ gst/audiofx/gststereo.h | 68 ++++++++++++ 2 files changed, 294 insertions(+) create mode 100644 gst/audiofx/gststereo.c create mode 100644 gst/audiofx/gststereo.h diff --git a/gst/audiofx/gststereo.c b/gst/audiofx/gststereo.c new file mode 100644 index 000000000..622dd5d44 --- /dev/null +++ b/gst/audiofx/gststereo.c @@ -0,0 +1,226 @@ +/* Gnome-Streamer + * Copyright (C) <1999> Erik Walthinsen + * + * 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. + */ + +#include + + +static GstElementDetails stereo_details = { + "Stereo effect", + "Filter/Effect", + "Muck with the stereo signal, enhance it's 'stereo-ness'", + VERSION, + "Erik Walthinsen ", + "(C) 1999", +}; + + +/* Stereo signals and args */ +enum { + /* FILL ME */ + LAST_SIGNAL +}; + +enum { + ARG_0, + ARG_ACTIVE, + ARG_STEREO +}; + + +static void gst_stereo_class_init (GstStereoClass *klass); +static void gst_stereo_init (GstStereo *stereo); + +static void gst_stereo_set_property (GObject *object, guint prop_id, const GValue *value, GParamSpec *pspec); +static void gst_stereo_get_property (GObject *object, guint prop_id, GValue *value, GParamSpec *pspec); + +static void gst_stereo_chain (GstPad *pad, GstBuffer *buf); + +static GstElementClass *parent_class = NULL; +//static guint gst_stereo_signals[LAST_SIGNAL] = { 0 }; + +GType +gst_stereo_get_type(void) { + static GType stereo_type = 0; + + if (!stereo_type) { + static const GTypeInfo stereo_info = { + sizeof(GstStereoClass), NULL, + NULL, + (GClassInitFunc)gst_stereo_class_init, + NULL, + NULL, + sizeof(GstStereo), + 0, + (GInstanceInitFunc)gst_stereo_init, + }; + stereo_type = g_type_register_static(GST_TYPE_ELEMENT, "GstStereo", &stereo_info, 0); + } + return stereo_type; +} + +static void +gst_stereo_class_init (GstStereoClass *klass) +{ + GObjectClass *gobject_class; + GstElementClass *gstelement_class; + + gobject_class = (GObjectClass*)klass; + gstelement_class = (GstElementClass*)klass; + + parent_class = g_type_class_ref(GST_TYPE_ELEMENT); + + g_object_class_install_property(G_OBJECT_CLASS(klass), ARG_ACTIVE, + g_param_spec_int("active","active","active", + G_MININT,G_MAXINT,0,G_PARAM_READWRITE)); // CHECKME + g_object_class_install_property(G_OBJECT_CLASS(klass), ARG_STEREO, + g_param_spec_float("stereo","stereo","stereo", + 0.0,1.0,0.0,G_PARAM_READWRITE)); // CHECKME + + gobject_class->set_property = gst_stereo_set_property; + gobject_class->get_property = gst_stereo_get_property; +} + +static void +gst_stereo_init (GstStereo *stereo) +{ + stereo->sinkpad = gst_pad_new("sink",GST_PAD_SINK); + gst_element_add_pad(GST_ELEMENT(stereo),stereo->sinkpad); + gst_pad_set_chain_function(stereo->sinkpad,gst_stereo_chain); + stereo->srcpad = gst_pad_new("src",GST_PAD_SRC); + gst_element_add_pad(GST_ELEMENT(stereo),stereo->srcpad); + + stereo->active = FALSE; + stereo->stereo = 2.5; +} + +static void +gst_stereo_chain (GstPad *pad,GstBuffer *buf) +{ + GstStereo *stereo; + gint16 *data; + gint samples; + gint i; + gdouble avg,ldiff,rdiff,tmp,mul; + + g_return_if_fail(pad != NULL); + g_return_if_fail(GST_IS_PAD(pad)); + g_return_if_fail(buf != NULL); + + stereo = GST_STEREO(GST_OBJECT_PARENT (pad)); + g_return_if_fail(stereo != NULL); + g_return_if_fail(GST_IS_STEREO(stereo)); + +// FIXME +// if (buf->meta) +// memcpy(&stereo->meta,buf->meta,sizeof(stereo->meta)); + + if (stereo->active) { + + //if (stereo->meta.channels == 2 && stereo->meta.format == AFMT_S16_LE) { + data = (gint16 *)GST_BUFFER_DATA(buf); + samples = GST_BUFFER_SIZE(buf) / 2; + mul = stereo->stereo; + for (i = 0; i < samples / 2; i += 2) { + avg = (data[i] + data[i + 1]) / 2; + ldiff = data[i] - avg; + rdiff = data[i + 1] - avg; + + tmp = avg + ldiff * mul; + if (tmp < -32768) + tmp = -32768; + if (tmp > 32767) + tmp = 32767; + data[i] = tmp; + + tmp = avg + rdiff * mul; + if (tmp < -32768) + tmp = -32768; + if (tmp > 32767) + tmp = 32767; + data[i + 1] = tmp; + } + //} + } + + gst_pad_push(stereo->srcpad,buf); +} + +static void +gst_stereo_set_property (GObject *object, guint prop_id, const GValue *value, GParamSpec *pspec) +{ + GstStereo *stereo; + + /* it's not null if we got it, but it might not be ours */ + g_return_if_fail(GST_IS_STEREO(object)); + stereo = GST_STEREO(object); + + switch (prop_id) { + case ARG_ACTIVE: + stereo->active = g_value_get_int (value); + break; + case ARG_STEREO: + stereo->stereo = g_value_get_float (value) * 10.0; + break; + default: + break; + } +} + +static void +gst_stereo_get_property (GObject *object, guint prop_id, GValue *value, GParamSpec *pspec) +{ + GstStereo *stereo; + + /* it's not null if we got it, but it might not be ours */ + g_return_if_fail(GST_IS_STEREO(object)); + stereo = GST_STEREO(object); + + switch (prop_id) { + case ARG_ACTIVE: + g_value_set_int (value, stereo->active); + break; + case ARG_STEREO: + g_value_set_float (value, stereo->stereo / 10.0); + break; + default: + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); + break; + } +} + +static gboolean +plugin_init (GModule *module, GstPlugin *plugin) +{ + GstElementFactory *factory; + + factory = gst_elementfactory_new("stereo",GST_TYPE_STEREO, + &stereo_details); + g_return_val_if_fail(factory != NULL, FALSE); + gst_plugin_add_feature (plugin, GST_PLUGIN_FEATURE (factory)); + + return TRUE; +} + +GstPluginDesc plugin_desc = { + GST_VERSION_MAJOR, + GST_VERSION_MINOR, + "stereo", + plugin_init +}; + diff --git a/gst/audiofx/gststereo.h b/gst/audiofx/gststereo.h new file mode 100644 index 000000000..f775f850d --- /dev/null +++ b/gst/audiofx/gststereo.h @@ -0,0 +1,68 @@ +/* Gnome-Streamer + * Copyright (C) <1999> Erik Walthinsen + * + * 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. + */ + + +#ifndef __GST_STEREO_H__ +#define __GST_STEREO_H__ + + +#include +#include + + +#ifdef __cplusplus +extern "C" { +#endif /* __cplusplus */ + + +#define GST_TYPE_STEREO \ + (gst_stereo_get_type()) +#define GST_STEREO(obj) \ + (G_TYPE_CHECK_INSTANCE_CAST((obj),GST_TYPE_STEREO,GstStereo)) +#define GST_STEREO_CLASS(klass) \ + (G_TYPE_CHECK_CLASS_CAST((klass),GST_TYPE_STEREO,GstStereo)) +#define GST_IS_STEREO(obj) \ + (G_TYPE_CHECK_INSTANCE_TYPE((obj),GST_TYPE_STEREO)) +#define GST_IS_STEREO_CLASS(obj) \ + (G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_STEREO)) + +typedef struct _GstStereo GstStereo; +typedef struct _GstStereoClass GstStereoClass; + +struct _GstStereo { + GstElement element; + + GstPad *sinkpad,*srcpad; + + gint8 active; + gfloat stereo; +}; + +struct _GstStereoClass { + GstElementClass parent_class; +}; + +GType gst_stereo_get_type(void); + +#ifdef __cplusplus +} +#endif /* __cplusplus */ + + +#endif /* __GST_STEREO_H__ */ -- GitLab From d098323a51accef744de9056a85589dcaaa7bc0f Mon Sep 17 00:00:00 2001 From: Andy Wingo Date: Tue, 19 Mar 2002 04:10:06 +0000 Subject: [PATCH 02/38] removal of //-style comments don't link plugins to core libs -- the versioning is done internally to the plugins with... Original commit message from CVS: * removal of //-style comments * don't link plugins to core libs -- the versioning is done internally to the plugins with the plugin_info struct, and symbol resolution is lazy, so we can always know if a plugin can be loaded by the plugin_info data. in theory. --- gst/audiofx/gststereo.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/gst/audiofx/gststereo.c b/gst/audiofx/gststereo.c index 622dd5d44..99b69ddda 100644 --- a/gst/audiofx/gststereo.c +++ b/gst/audiofx/gststereo.c @@ -52,7 +52,7 @@ static void gst_stereo_get_property (GObject *object, guint prop_id, GValue *va static void gst_stereo_chain (GstPad *pad, GstBuffer *buf); static GstElementClass *parent_class = NULL; -//static guint gst_stereo_signals[LAST_SIGNAL] = { 0 }; +/*static guint gst_stereo_signals[LAST_SIGNAL] = { 0 }; */ GType gst_stereo_get_type(void) { @@ -87,10 +87,10 @@ gst_stereo_class_init (GstStereoClass *klass) g_object_class_install_property(G_OBJECT_CLASS(klass), ARG_ACTIVE, g_param_spec_int("active","active","active", - G_MININT,G_MAXINT,0,G_PARAM_READWRITE)); // CHECKME + G_MININT,G_MAXINT,0,G_PARAM_READWRITE)); /* CHECKME */ g_object_class_install_property(G_OBJECT_CLASS(klass), ARG_STEREO, g_param_spec_float("stereo","stereo","stereo", - 0.0,1.0,0.0,G_PARAM_READWRITE)); // CHECKME + 0.0,1.0,0.0,G_PARAM_READWRITE)); /* CHECKME */ gobject_class->set_property = gst_stereo_set_property; gobject_class->get_property = gst_stereo_get_property; @@ -126,13 +126,13 @@ gst_stereo_chain (GstPad *pad,GstBuffer *buf) g_return_if_fail(stereo != NULL); g_return_if_fail(GST_IS_STEREO(stereo)); -// FIXME -// if (buf->meta) -// memcpy(&stereo->meta,buf->meta,sizeof(stereo->meta)); +/* FIXME */ +/* if (buf->meta) */ +/* memcpy(&stereo->meta,buf->meta,sizeof(stereo->meta)); */ if (stereo->active) { - //if (stereo->meta.channels == 2 && stereo->meta.format == AFMT_S16_LE) { + /*if (stereo->meta.channels == 2 && stereo->meta.format == AFMT_S16_LE) { */ data = (gint16 *)GST_BUFFER_DATA(buf); samples = GST_BUFFER_SIZE(buf) / 2; mul = stereo->stereo; @@ -155,7 +155,7 @@ gst_stereo_chain (GstPad *pad,GstBuffer *buf) tmp = 32767; data[i + 1] = tmp; } - //} + /*} */ } gst_pad_push(stereo->srcpad,buf); -- GitLab From 71c11ff0e2cb0310c7902aa8a55338839c2f9fe7 Mon Sep 17 00:00:00 2001 From: Andy Wingo Date: Wed, 20 Mar 2002 21:45:04 +0000 Subject: [PATCH 03/38] s/Gnome-Streamer/GStreamer/ Original commit message from CVS: s/Gnome-Streamer/GStreamer/ --- gst/audiofx/gststereo.c | 2 +- gst/audiofx/gststereo.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/gst/audiofx/gststereo.c b/gst/audiofx/gststereo.c index 99b69ddda..05d98c121 100644 --- a/gst/audiofx/gststereo.c +++ b/gst/audiofx/gststereo.c @@ -1,4 +1,4 @@ -/* Gnome-Streamer +/* GStreamer * Copyright (C) <1999> Erik Walthinsen * * This library is free software; you can redistribute it and/or diff --git a/gst/audiofx/gststereo.h b/gst/audiofx/gststereo.h index f775f850d..238ec1a89 100644 --- a/gst/audiofx/gststereo.h +++ b/gst/audiofx/gststereo.h @@ -1,4 +1,4 @@ -/* Gnome-Streamer +/* GStreamer * Copyright (C) <1999> Erik Walthinsen * * This library is free software; you can redistribute it and/or -- GitLab From 94741b81b9b611790a0e0b6444d8618c3d8eceaa Mon Sep 17 00:00:00 2001 From: Andy Wingo Date: Thu, 11 Apr 2002 20:42:26 +0000 Subject: [PATCH 04/38] GstPadTemplate <-> gst_pad_template <-> GST_PAD_TEMPLATE same with *factory and typefind. Original commit message from CVS: GstPadTemplate <-> gst_pad_template <-> GST_PAD_TEMPLATE same with *factory and typefind. also, some -Werror fixes. --- gst/audiofx/gststereo.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gst/audiofx/gststereo.c b/gst/audiofx/gststereo.c index 05d98c121..6b243db01 100644 --- a/gst/audiofx/gststereo.c +++ b/gst/audiofx/gststereo.c @@ -209,7 +209,7 @@ plugin_init (GModule *module, GstPlugin *plugin) { GstElementFactory *factory; - factory = gst_elementfactory_new("stereo",GST_TYPE_STEREO, + factory = gst_element_factory_new("stereo",GST_TYPE_STEREO, &stereo_details); g_return_val_if_fail(factory != NULL, FALSE); gst_plugin_add_feature (plugin, GST_PLUGIN_FEATURE (factory)); -- GitLab From 580ada45a2f4fec9d30dce00e007b7069b58ba50 Mon Sep 17 00:00:00 2001 From: Andy Wingo Date: Sat, 20 Apr 2002 21:42:51 +0000 Subject: [PATCH 05/38] a hack to work around intltool's brokenness a current check for mpeg2dec details->klass reorganizations an element br... Original commit message from CVS: * a hack to work around intltool's brokenness * a current check for mpeg2dec * details->klass reorganizations * an element browser that uses details->klass * separated cdxa parse out from the avi directory --- gst/audiofx/gststereo.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gst/audiofx/gststereo.c b/gst/audiofx/gststereo.c index 6b243db01..0d84c84f6 100644 --- a/gst/audiofx/gststereo.c +++ b/gst/audiofx/gststereo.c @@ -22,7 +22,7 @@ static GstElementDetails stereo_details = { "Stereo effect", - "Filter/Effect", + "Filter/Audio/Effect", "Muck with the stereo signal, enhance it's 'stereo-ness'", VERSION, "Erik Walthinsen ", -- GitLab From 94012a7479b934dfc41bed92fc028bc40d81ea37 Mon Sep 17 00:00:00 2001 From: Christian Schaller Date: Wed, 18 Sep 2002 19:02:52 +0000 Subject: [PATCH 06/38] plugins part of license field patch Original commit message from CVS: plugins part of license field patch --- gst/audiofx/gststereo.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/gst/audiofx/gststereo.c b/gst/audiofx/gststereo.c index 0d84c84f6..2bb2bab80 100644 --- a/gst/audiofx/gststereo.c +++ b/gst/audiofx/gststereo.c @@ -19,10 +19,11 @@ #include - +/* elementfactory information */ static GstElementDetails stereo_details = { "Stereo effect", "Filter/Audio/Effect", + "LGPL", "Muck with the stereo signal, enhance it's 'stereo-ness'", VERSION, "Erik Walthinsen ", -- GitLab From e0a36ecc20b6234f0b3de79e89a1ab22944e3d79 Mon Sep 17 00:00:00 2001 From: Benjamin Otte Date: Sun, 29 Jun 2003 19:46:13 +0000 Subject: [PATCH 07/38] compatibility fix for new GST_DEBUG stuff. Original commit message from CVS: compatibility fix for new GST_DEBUG stuff. Includes fixes for missing includes for config.h and unistd.h I only ensured for plugins I can build that they work, so if some of them are still broken, you gotta fix them yourselves unfortunately. --- gst/audiofx/gststereo.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/gst/audiofx/gststereo.c b/gst/audiofx/gststereo.c index 2bb2bab80..55f58996a 100644 --- a/gst/audiofx/gststereo.c +++ b/gst/audiofx/gststereo.c @@ -17,6 +17,9 @@ * Boston, MA 02111-1307, USA. */ +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif #include /* elementfactory information */ -- GitLab From 5cd6db68e902e8a8b6f1913851ae99442866c325 Mon Sep 17 00:00:00 2001 From: Andy Wingo Date: Wed, 8 Oct 2003 16:08:19 +0000 Subject: [PATCH 08/38] /GstBuffer/GstData/ in the API where you can pass events. Fix the plugins to deal with that. Fixes #113488. Original commit message from CVS: /GstBuffer/GstData/ in the API where you can pass events. Fix the plugins to deal with that. Fixes #113488. --- gst/audiofx/gststereo.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/gst/audiofx/gststereo.c b/gst/audiofx/gststereo.c index 55f58996a..2ff34092e 100644 --- a/gst/audiofx/gststereo.c +++ b/gst/audiofx/gststereo.c @@ -53,7 +53,7 @@ static void gst_stereo_init (GstStereo *stereo); static void gst_stereo_set_property (GObject *object, guint prop_id, const GValue *value, GParamSpec *pspec); static void gst_stereo_get_property (GObject *object, guint prop_id, GValue *value, GParamSpec *pspec); -static void gst_stereo_chain (GstPad *pad, GstBuffer *buf); +static void gst_stereo_chain (GstPad *pad, GstData *_data); static GstElementClass *parent_class = NULL; /*static guint gst_stereo_signals[LAST_SIGNAL] = { 0 }; */ @@ -114,8 +114,9 @@ gst_stereo_init (GstStereo *stereo) } static void -gst_stereo_chain (GstPad *pad,GstBuffer *buf) +gst_stereo_chain (GstPad *pad,GstData *_data) { + GstBuffer *buf = GST_BUFFER (_data); GstStereo *stereo; gint16 *data; gint samples; @@ -162,7 +163,7 @@ gst_stereo_chain (GstPad *pad,GstBuffer *buf) /*} */ } - gst_pad_push(stereo->srcpad,buf); + gst_pad_push(stereo->srcpad,GST_DATA (buf)); } static void -- GitLab From 4473c13a889733f8bf56049ed95a12c970a53dc1 Mon Sep 17 00:00:00 2001 From: Benjamin Otte Date: Sun, 2 Nov 2003 22:34:11 +0000 Subject: [PATCH 09/38] fix for new plugin system Original commit message from CVS: fix for new plugin system --- gst/audiofx/gststereo.c | 47 ++++++++++++++++++++++++----------------- 1 file changed, 28 insertions(+), 19 deletions(-) diff --git a/gst/audiofx/gststereo.c b/gst/audiofx/gststereo.c index 2ff34092e..cb8ff0ddc 100644 --- a/gst/audiofx/gststereo.c +++ b/gst/audiofx/gststereo.c @@ -17,21 +17,23 @@ * Boston, MA 02111-1307, USA. */ +/* This effect is borrowed from xmms-0.6.1, though I mangled it so badly in + * the process of copying it over that the xmms people probably won't want + * any credit for it ;-) + */ + #ifdef HAVE_CONFIG_H #include "config.h" #endif #include /* elementfactory information */ -static GstElementDetails stereo_details = { +static GstElementDetails stereo_details = GST_ELEMENT_DETAILS ( "Stereo effect", "Filter/Audio/Effect", - "LGPL", "Muck with the stereo signal, enhance it's 'stereo-ness'", - VERSION, - "Erik Walthinsen ", - "(C) 1999", -}; + "Erik Walthinsen " +); /* Stereo signals and args */ @@ -47,6 +49,7 @@ enum { }; +static void gst_stereo_base_init (gpointer g_class); static void gst_stereo_class_init (GstStereoClass *klass); static void gst_stereo_init (GstStereo *stereo); @@ -64,7 +67,8 @@ gst_stereo_get_type(void) { if (!stereo_type) { static const GTypeInfo stereo_info = { - sizeof(GstStereoClass), NULL, + sizeof(GstStereoClass), + gst_stereo_base_init, NULL, (GClassInitFunc)gst_stereo_class_init, NULL, @@ -78,6 +82,12 @@ gst_stereo_get_type(void) { return stereo_type; } +static void +gst_stereo_base_init (gpointer g_class) +{ + GstElementClass *element_class = GST_ELEMENT_CLASS (g_class); + gst_element_class_set_details (element_class, &stereo_details); +} static void gst_stereo_class_init (GstStereoClass *klass) { @@ -210,22 +220,21 @@ gst_stereo_get_property (GObject *object, guint prop_id, GValue *value, GParamSp } static gboolean -plugin_init (GModule *module, GstPlugin *plugin) +plugin_init (GstPlugin *plugin) { - GstElementFactory *factory; - - factory = gst_element_factory_new("stereo",GST_TYPE_STEREO, - &stereo_details); - g_return_val_if_fail(factory != NULL, FALSE); - gst_plugin_add_feature (plugin, GST_PLUGIN_FEATURE (factory)); - - return TRUE; + return gst_element_register (plugin, "stereo", GST_RANK_NONE, GST_TYPE_STEREO); } -GstPluginDesc plugin_desc = { +GST_PLUGIN_DEFINE ( GST_VERSION_MAJOR, GST_VERSION_MINOR, "stereo", - plugin_init -}; + "Muck with the stereo signal, enhance it's 'stereo-ness'", + plugin_init, + VERSION, + GST_LICENSE, + GST_COPYRIGHT, + GST_PACKAGE, + GST_ORIGIN +) -- GitLab From a6fa08fb997086626a8d0d0b4aa641285771bf96 Mon Sep 17 00:00:00 2001 From: "Ronald S. Bultje" Date: Fri, 7 Nov 2003 12:47:02 +0000 Subject: [PATCH 10/38] Remove all config.h includes from header files, add it to each source file and remove duplicate config.h includes fro... Original commit message from CVS: Remove all config.h includes from header files, add it to each source file and remove duplicate config.h includes from several source files --- gst/audiofx/gststereo.h | 1 - 1 file changed, 1 deletion(-) diff --git a/gst/audiofx/gststereo.h b/gst/audiofx/gststereo.h index 238ec1a89..8b78f25eb 100644 --- a/gst/audiofx/gststereo.h +++ b/gst/audiofx/gststereo.h @@ -22,7 +22,6 @@ #define __GST_STEREO_H__ -#include #include -- GitLab From 000e3221421ad115ea1c6f8b35ec2521429de81b Mon Sep 17 00:00:00 2001 From: Leif Johnson Date: Sun, 16 Nov 2003 22:02:23 +0000 Subject: [PATCH 11/38] + checking in plugin category changes Original commit message from CVS: + checking in plugin category changes --- gst/audiofx/gststereo.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/gst/audiofx/gststereo.c b/gst/audiofx/gststereo.c index cb8ff0ddc..0e315c7ce 100644 --- a/gst/audiofx/gststereo.c +++ b/gst/audiofx/gststereo.c @@ -30,8 +30,8 @@ /* elementfactory information */ static GstElementDetails stereo_details = GST_ELEMENT_DETAILS ( "Stereo effect", - "Filter/Audio/Effect", - "Muck with the stereo signal, enhance it's 'stereo-ness'", + "Filter/Effect/Audio", + "Muck with the stereo signal to enhance its 'stereo-ness'", "Erik Walthinsen " ); -- GitLab From 10f1ae0d1b618b121e0f75f653051450270f95f6 Mon Sep 17 00:00:00 2001 From: Andy Wingo Date: Thu, 4 Dec 2003 10:37:38 +0000 Subject: [PATCH 12/38] remove copyright field from plugins Original commit message from CVS: remove copyright field from plugins --- gst/audiofx/gststereo.c | 1 - 1 file changed, 1 deletion(-) diff --git a/gst/audiofx/gststereo.c b/gst/audiofx/gststereo.c index 0e315c7ce..f2e9a79d4 100644 --- a/gst/audiofx/gststereo.c +++ b/gst/audiofx/gststereo.c @@ -233,7 +233,6 @@ GST_PLUGIN_DEFINE ( plugin_init, VERSION, GST_LICENSE, - GST_COPYRIGHT, GST_PACKAGE, GST_ORIGIN ) -- GitLab From 89b52fa125989cea109e474d3fdf4bf84d3df587 Mon Sep 17 00:00:00 2001 From: Thomas Vander Stichele Date: Sun, 14 Mar 2004 22:34:33 +0000 Subject: [PATCH 13/38] gst-indent Original commit message from CVS: gst-indent --- gst/audiofx/gststereo.c | 172 ++++++++++++++++++++-------------------- gst/audiofx/gststereo.h | 35 ++++---- 2 files changed, 104 insertions(+), 103 deletions(-) diff --git a/gst/audiofx/gststereo.c b/gst/audiofx/gststereo.c index f2e9a79d4..947c3885c 100644 --- a/gst/audiofx/gststereo.c +++ b/gst/audiofx/gststereo.c @@ -28,56 +28,61 @@ #include /* elementfactory information */ -static GstElementDetails stereo_details = GST_ELEMENT_DETAILS ( - "Stereo effect", - "Filter/Effect/Audio", - "Muck with the stereo signal to enhance its 'stereo-ness'", - "Erik Walthinsen " -); +static GstElementDetails stereo_details = GST_ELEMENT_DETAILS ("Stereo effect", + "Filter/Effect/Audio", + "Muck with the stereo signal to enhance its 'stereo-ness'", + "Erik Walthinsen "); /* Stereo signals and args */ -enum { +enum +{ /* FILL ME */ LAST_SIGNAL }; -enum { +enum +{ ARG_0, ARG_ACTIVE, ARG_STEREO }; -static void gst_stereo_base_init (gpointer g_class); -static void gst_stereo_class_init (GstStereoClass *klass); -static void gst_stereo_init (GstStereo *stereo); +static void gst_stereo_base_init (gpointer g_class); +static void gst_stereo_class_init (GstStereoClass * klass); +static void gst_stereo_init (GstStereo * stereo); -static void gst_stereo_set_property (GObject *object, guint prop_id, const GValue *value, GParamSpec *pspec); -static void gst_stereo_get_property (GObject *object, guint prop_id, GValue *value, GParamSpec *pspec); +static void gst_stereo_set_property (GObject * object, guint prop_id, + const GValue * value, GParamSpec * pspec); +static void gst_stereo_get_property (GObject * object, guint prop_id, + GValue * value, GParamSpec * pspec); -static void gst_stereo_chain (GstPad *pad, GstData *_data); +static void gst_stereo_chain (GstPad * pad, GstData * _data); static GstElementClass *parent_class = NULL; + /*static guint gst_stereo_signals[LAST_SIGNAL] = { 0 }; */ GType -gst_stereo_get_type(void) { +gst_stereo_get_type (void) +{ static GType stereo_type = 0; if (!stereo_type) { static const GTypeInfo stereo_info = { - sizeof(GstStereoClass), + sizeof (GstStereoClass), gst_stereo_base_init, NULL, - (GClassInitFunc)gst_stereo_class_init, + (GClassInitFunc) gst_stereo_class_init, NULL, NULL, - sizeof(GstStereo), + sizeof (GstStereo), 0, - (GInstanceInitFunc)gst_stereo_init, + (GInstanceInitFunc) gst_stereo_init, }; - stereo_type = g_type_register_static(GST_TYPE_ELEMENT, "GstStereo", &stereo_info, 0); + stereo_type = + g_type_register_static (GST_TYPE_ELEMENT, "GstStereo", &stereo_info, 0); } return stereo_type; } @@ -86,60 +91,57 @@ static void gst_stereo_base_init (gpointer g_class) { GstElementClass *element_class = GST_ELEMENT_CLASS (g_class); + gst_element_class_set_details (element_class, &stereo_details); } static void -gst_stereo_class_init (GstStereoClass *klass) +gst_stereo_class_init (GstStereoClass * klass) { GObjectClass *gobject_class; GstElementClass *gstelement_class; - gobject_class = (GObjectClass*)klass; - gstelement_class = (GstElementClass*)klass; + gobject_class = (GObjectClass *) klass; + gstelement_class = (GstElementClass *) klass; - parent_class = g_type_class_ref(GST_TYPE_ELEMENT); + parent_class = g_type_class_ref (GST_TYPE_ELEMENT); - g_object_class_install_property(G_OBJECT_CLASS(klass), ARG_ACTIVE, - g_param_spec_int("active","active","active", - G_MININT,G_MAXINT,0,G_PARAM_READWRITE)); /* CHECKME */ - g_object_class_install_property(G_OBJECT_CLASS(klass), ARG_STEREO, - g_param_spec_float("stereo","stereo","stereo", - 0.0,1.0,0.0,G_PARAM_READWRITE)); /* CHECKME */ + g_object_class_install_property (G_OBJECT_CLASS (klass), ARG_ACTIVE, g_param_spec_int ("active", "active", "active", G_MININT, G_MAXINT, 0, G_PARAM_READWRITE)); /* CHECKME */ + g_object_class_install_property (G_OBJECT_CLASS (klass), ARG_STEREO, g_param_spec_float ("stereo", "stereo", "stereo", 0.0, 1.0, 0.0, G_PARAM_READWRITE)); /* CHECKME */ gobject_class->set_property = gst_stereo_set_property; gobject_class->get_property = gst_stereo_get_property; } static void -gst_stereo_init (GstStereo *stereo) +gst_stereo_init (GstStereo * stereo) { - stereo->sinkpad = gst_pad_new("sink",GST_PAD_SINK); - gst_element_add_pad(GST_ELEMENT(stereo),stereo->sinkpad); - gst_pad_set_chain_function(stereo->sinkpad,gst_stereo_chain); - stereo->srcpad = gst_pad_new("src",GST_PAD_SRC); - gst_element_add_pad(GST_ELEMENT(stereo),stereo->srcpad); + stereo->sinkpad = gst_pad_new ("sink", GST_PAD_SINK); + gst_element_add_pad (GST_ELEMENT (stereo), stereo->sinkpad); + gst_pad_set_chain_function (stereo->sinkpad, gst_stereo_chain); + stereo->srcpad = gst_pad_new ("src", GST_PAD_SRC); + gst_element_add_pad (GST_ELEMENT (stereo), stereo->srcpad); stereo->active = FALSE; stereo->stereo = 2.5; } static void -gst_stereo_chain (GstPad *pad,GstData *_data) +gst_stereo_chain (GstPad * pad, GstData * _data) { GstBuffer *buf = GST_BUFFER (_data); GstStereo *stereo; gint16 *data; gint samples; gint i; - gdouble avg,ldiff,rdiff,tmp,mul; + gdouble avg, ldiff, rdiff, tmp, mul; - g_return_if_fail(pad != NULL); - g_return_if_fail(GST_IS_PAD(pad)); - g_return_if_fail(buf != NULL); + g_return_if_fail (pad != NULL); + g_return_if_fail (GST_IS_PAD (pad)); + g_return_if_fail (buf != NULL); - stereo = GST_STEREO(GST_OBJECT_PARENT (pad)); - g_return_if_fail(stereo != NULL); - g_return_if_fail(GST_IS_STEREO(stereo)); + stereo = GST_STEREO (GST_OBJECT_PARENT (pad)); + g_return_if_fail (stereo != NULL); + g_return_if_fail (GST_IS_STEREO (stereo)); /* FIXME */ /* if (buf->meta) */ @@ -148,42 +150,43 @@ gst_stereo_chain (GstPad *pad,GstData *_data) if (stereo->active) { /*if (stereo->meta.channels == 2 && stereo->meta.format == AFMT_S16_LE) { */ - data = (gint16 *)GST_BUFFER_DATA(buf); - samples = GST_BUFFER_SIZE(buf) / 2; - mul = stereo->stereo; - for (i = 0; i < samples / 2; i += 2) { - avg = (data[i] + data[i + 1]) / 2; - ldiff = data[i] - avg; - rdiff = data[i + 1] - avg; - - tmp = avg + ldiff * mul; - if (tmp < -32768) - tmp = -32768; - if (tmp > 32767) - tmp = 32767; - data[i] = tmp; - - tmp = avg + rdiff * mul; - if (tmp < -32768) - tmp = -32768; - if (tmp > 32767) - tmp = 32767; - data[i + 1] = tmp; - } + data = (gint16 *) GST_BUFFER_DATA (buf); + samples = GST_BUFFER_SIZE (buf) / 2; + mul = stereo->stereo; + for (i = 0; i < samples / 2; i += 2) { + avg = (data[i] + data[i + 1]) / 2; + ldiff = data[i] - avg; + rdiff = data[i + 1] - avg; + + tmp = avg + ldiff * mul; + if (tmp < -32768) + tmp = -32768; + if (tmp > 32767) + tmp = 32767; + data[i] = tmp; + + tmp = avg + rdiff * mul; + if (tmp < -32768) + tmp = -32768; + if (tmp > 32767) + tmp = 32767; + data[i + 1] = tmp; + } /*} */ } - gst_pad_push(stereo->srcpad,GST_DATA (buf)); + gst_pad_push (stereo->srcpad, GST_DATA (buf)); } static void -gst_stereo_set_property (GObject *object, guint prop_id, const GValue *value, GParamSpec *pspec) +gst_stereo_set_property (GObject * object, guint prop_id, const GValue * value, + GParamSpec * pspec) { GstStereo *stereo; /* it's not null if we got it, but it might not be ours */ - g_return_if_fail(GST_IS_STEREO(object)); - stereo = GST_STEREO(object); + g_return_if_fail (GST_IS_STEREO (object)); + stereo = GST_STEREO (object); switch (prop_id) { case ARG_ACTIVE: @@ -198,13 +201,14 @@ gst_stereo_set_property (GObject *object, guint prop_id, const GValue *value, GP } static void -gst_stereo_get_property (GObject *object, guint prop_id, GValue *value, GParamSpec *pspec) +gst_stereo_get_property (GObject * object, guint prop_id, GValue * value, + GParamSpec * pspec) { GstStereo *stereo; /* it's not null if we got it, but it might not be ours */ - g_return_if_fail(GST_IS_STEREO(object)); - stereo = GST_STEREO(object); + g_return_if_fail (GST_IS_STEREO (object)); + stereo = GST_STEREO (object); switch (prop_id) { case ARG_ACTIVE: @@ -220,20 +224,14 @@ gst_stereo_get_property (GObject *object, guint prop_id, GValue *value, GParamSp } static gboolean -plugin_init (GstPlugin *plugin) +plugin_init (GstPlugin * plugin) { - return gst_element_register (plugin, "stereo", GST_RANK_NONE, GST_TYPE_STEREO); + return gst_element_register (plugin, "stereo", GST_RANK_NONE, + GST_TYPE_STEREO); } -GST_PLUGIN_DEFINE ( - GST_VERSION_MAJOR, - GST_VERSION_MINOR, - "stereo", - "Muck with the stereo signal, enhance it's 'stereo-ness'", - plugin_init, - VERSION, - GST_LICENSE, - GST_PACKAGE, - GST_ORIGIN -) - +GST_PLUGIN_DEFINE (GST_VERSION_MAJOR, + GST_VERSION_MINOR, + "stereo", + "Muck with the stereo signal, enhance it's 'stereo-ness'", + plugin_init, VERSION, GST_LICENSE, GST_PACKAGE, GST_ORIGIN) diff --git a/gst/audiofx/gststereo.h b/gst/audiofx/gststereo.h index 8b78f25eb..b665432b2 100644 --- a/gst/audiofx/gststereo.h +++ b/gst/audiofx/gststereo.h @@ -26,8 +26,9 @@ #ifdef __cplusplus -extern "C" { -#endif /* __cplusplus */ +extern "C" +{ +#endif /* __cplusplus */ #define GST_TYPE_STEREO \ @@ -41,27 +42,29 @@ extern "C" { #define GST_IS_STEREO_CLASS(obj) \ (G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_STEREO)) -typedef struct _GstStereo GstStereo; -typedef struct _GstStereoClass GstStereoClass; + typedef struct _GstStereo GstStereo; + typedef struct _GstStereoClass GstStereoClass; -struct _GstStereo { - GstElement element; + struct _GstStereo + { + GstElement element; - GstPad *sinkpad,*srcpad; + GstPad *sinkpad, *srcpad; - gint8 active; - gfloat stereo; -}; + gint8 active; + gfloat stereo; + }; -struct _GstStereoClass { - GstElementClass parent_class; -}; + struct _GstStereoClass + { + GstElementClass parent_class; + }; -GType gst_stereo_get_type(void); + GType gst_stereo_get_type (void); #ifdef __cplusplus } -#endif /* __cplusplus */ +#endif /* __cplusplus */ -#endif /* __GST_STEREO_H__ */ +#endif /* __GST_STEREO_H__ */ -- GitLab From 583a2aa96b95da6163cd2b53b4b0298f0fec91d7 Mon Sep 17 00:00:00 2001 From: Johan Dahlin Date: Mon, 15 Mar 2004 16:32:54 +0000 Subject: [PATCH 14/38] *.h: Revert indenting Original commit message from CVS: * *.h: Revert indenting --- gst/audiofx/gststereo.h | 35 ++++++++++++++++------------------- 1 file changed, 16 insertions(+), 19 deletions(-) diff --git a/gst/audiofx/gststereo.h b/gst/audiofx/gststereo.h index b665432b2..8b78f25eb 100644 --- a/gst/audiofx/gststereo.h +++ b/gst/audiofx/gststereo.h @@ -26,9 +26,8 @@ #ifdef __cplusplus -extern "C" -{ -#endif /* __cplusplus */ +extern "C" { +#endif /* __cplusplus */ #define GST_TYPE_STEREO \ @@ -42,29 +41,27 @@ extern "C" #define GST_IS_STEREO_CLASS(obj) \ (G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_STEREO)) - typedef struct _GstStereo GstStereo; - typedef struct _GstStereoClass GstStereoClass; +typedef struct _GstStereo GstStereo; +typedef struct _GstStereoClass GstStereoClass; - struct _GstStereo - { - GstElement element; +struct _GstStereo { + GstElement element; - GstPad *sinkpad, *srcpad; + GstPad *sinkpad,*srcpad; - gint8 active; - gfloat stereo; - }; + gint8 active; + gfloat stereo; +}; - struct _GstStereoClass - { - GstElementClass parent_class; - }; +struct _GstStereoClass { + GstElementClass parent_class; +}; - GType gst_stereo_get_type (void); +GType gst_stereo_get_type(void); #ifdef __cplusplus } -#endif /* __cplusplus */ +#endif /* __cplusplus */ -#endif /* __GST_STEREO_H__ */ +#endif /* __GST_STEREO_H__ */ -- GitLab From c3ceea31074762434ad1956c681421a2d70a07c4 Mon Sep 17 00:00:00 2001 From: Thomas Vander Stichele Date: Mon, 15 Mar 2004 19:32:27 +0000 Subject: [PATCH 15/38] don't mix tabs and spaces Original commit message from CVS: don't mix tabs and spaces --- gst/audiofx/gststereo.c | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/gst/audiofx/gststereo.c b/gst/audiofx/gststereo.c index 947c3885c..a0fb74a38 100644 --- a/gst/audiofx/gststereo.c +++ b/gst/audiofx/gststereo.c @@ -81,8 +81,9 @@ gst_stereo_get_type (void) 0, (GInstanceInitFunc) gst_stereo_init, }; + stereo_type = - g_type_register_static (GST_TYPE_ELEMENT, "GstStereo", &stereo_info, 0); + g_type_register_static (GST_TYPE_ELEMENT, "GstStereo", &stereo_info, 0); } return stereo_type; } @@ -105,8 +106,8 @@ gst_stereo_class_init (GstStereoClass * klass) parent_class = g_type_class_ref (GST_TYPE_ELEMENT); - g_object_class_install_property (G_OBJECT_CLASS (klass), ARG_ACTIVE, g_param_spec_int ("active", "active", "active", G_MININT, G_MAXINT, 0, G_PARAM_READWRITE)); /* CHECKME */ - g_object_class_install_property (G_OBJECT_CLASS (klass), ARG_STEREO, g_param_spec_float ("stereo", "stereo", "stereo", 0.0, 1.0, 0.0, G_PARAM_READWRITE)); /* CHECKME */ + g_object_class_install_property (G_OBJECT_CLASS (klass), ARG_ACTIVE, g_param_spec_int ("active", "active", "active", G_MININT, G_MAXINT, 0, G_PARAM_READWRITE)); /* CHECKME */ + g_object_class_install_property (G_OBJECT_CLASS (klass), ARG_STEREO, g_param_spec_float ("stereo", "stereo", "stereo", 0.0, 1.0, 0.0, G_PARAM_READWRITE)); /* CHECKME */ gobject_class->set_property = gst_stereo_set_property; gobject_class->get_property = gst_stereo_get_property; @@ -160,16 +161,16 @@ gst_stereo_chain (GstPad * pad, GstData * _data) tmp = avg + ldiff * mul; if (tmp < -32768) - tmp = -32768; + tmp = -32768; if (tmp > 32767) - tmp = 32767; + tmp = 32767; data[i] = tmp; tmp = avg + rdiff * mul; if (tmp < -32768) - tmp = -32768; + tmp = -32768; if (tmp > 32767) - tmp = 32767; + tmp = 32767; data[i + 1] = tmp; } /*} */ -- GitLab From f59e0a7cdadac428dc3d3f3c22e4214c4c3851b8 Mon Sep 17 00:00:00 2001 From: Steve Lhomme Date: Tue, 27 Jul 2004 21:51:30 +0000 Subject: [PATCH 16/38] fix local includes and 64 bits constants Original commit message from CVS: fix local includes and 64 bits constants --- gst/audiofx/gststereo.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gst/audiofx/gststereo.c b/gst/audiofx/gststereo.c index a0fb74a38..50aea79af 100644 --- a/gst/audiofx/gststereo.c +++ b/gst/audiofx/gststereo.c @@ -25,7 +25,7 @@ #ifdef HAVE_CONFIG_H #include "config.h" #endif -#include +#include "gststereo.h" /* elementfactory information */ static GstElementDetails stereo_details = GST_ELEMENT_DETAILS ("Stereo effect", -- GitLab From d0cf6fabc4c1256dba3a3d1f09331d01608c0f53 Mon Sep 17 00:00:00 2001 From: Andy Wingo Date: Tue, 5 Jul 2005 10:51:49 +0000 Subject: [PATCH 17/38] Way, way, way too many files: Remove crack comment from the 2000 era. Original commit message from CVS: 2005-07-05 Andy Wingo * Way, way, way too many files: Remove crack comment from the 2000 era. --- gst/audiofx/gststereo.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/gst/audiofx/gststereo.c b/gst/audiofx/gststereo.c index 50aea79af..317d55701 100644 --- a/gst/audiofx/gststereo.c +++ b/gst/audiofx/gststereo.c @@ -185,7 +185,6 @@ gst_stereo_set_property (GObject * object, guint prop_id, const GValue * value, { GstStereo *stereo; - /* it's not null if we got it, but it might not be ours */ g_return_if_fail (GST_IS_STEREO (object)); stereo = GST_STEREO (object); @@ -207,7 +206,6 @@ gst_stereo_get_property (GObject * object, guint prop_id, GValue * value, { GstStereo *stereo; - /* it's not null if we got it, but it might not be ours */ g_return_if_fail (GST_IS_STEREO (object)); stereo = GST_STEREO (object); -- GitLab From 2b1908d99a0a1eca03f3a686d82aab9fd3e5bd9e Mon Sep 17 00:00:00 2001 From: Thomas Vander Stichele Date: Sat, 1 Apr 2006 10:09:11 +0000 Subject: [PATCH 18/38] rework build; add translations for v4l2 Original commit message from CVS: rework build; add translations for v4l2 --- gst/audiofx/gststereo.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gst/audiofx/gststereo.c b/gst/audiofx/gststereo.c index 317d55701..9d2142016 100644 --- a/gst/audiofx/gststereo.c +++ b/gst/audiofx/gststereo.c @@ -233,4 +233,4 @@ GST_PLUGIN_DEFINE (GST_VERSION_MAJOR, GST_VERSION_MINOR, "stereo", "Muck with the stereo signal, enhance it's 'stereo-ness'", - plugin_init, VERSION, GST_LICENSE, GST_PACKAGE, GST_ORIGIN) + plugin_init, VERSION, GST_LICENSE, GST_PACKAGE_NAME, GST_PACKAGE_ORIGIN) -- GitLab From a68f9a2345dab802ebfe45c0bc6231acc7c42909 Mon Sep 17 00:00:00 2001 From: Stefan Kost Date: Sat, 8 Apr 2006 21:48:01 +0000 Subject: [PATCH 19/38] Fix #337365 (g_type_class_ref <-> g_type_class_peek_parent) Original commit message from CVS: * ext/amrwb/gstamrwbdec.c: (gst_amrwbdec_class_init): * ext/amrwb/gstamrwbenc.c: (gst_amrwbenc_class_init): * ext/amrwb/gstamrwbparse.c: (gst_amrwbparse_class_init): * ext/arts/gst_arts.c: (gst_arts_class_init): * ext/artsd/gstartsdsink.c: (gst_artsdsink_class_init): * ext/audiofile/gstafsink.c: (gst_afsink_class_init): * ext/audiofile/gstafsrc.c: (gst_afsrc_class_init): * ext/audioresample/gstaudioresample.c: * ext/cdaudio/gstcdaudio.c: (gst_cdaudio_class_init): * ext/directfb/dfbvideosink.c: (gst_dfbvideosink_class_init): * ext/divx/gstdivxdec.c: (gst_divxdec_class_init): * ext/hermes/gsthermescolorspace.c: (gst_hermes_colorspace_class_init): * ext/ivorbis/vorbisfile.c: (gst_ivorbisfile_class_init): * ext/jack/gstjack.c: (gst_jack_class_init): * ext/jack/gstjackbin.c: (gst_jack_bin_class_init): * ext/lcs/gstcolorspace.c: (gst_colorspace_class_init): * ext/libfame/gstlibfame.c: (gst_fameenc_class_init): * ext/musicbrainz/gsttrm.c: (gst_musicbrainz_class_init): * ext/nas/nassink.c: (gst_nassink_class_init): * ext/shout/gstshout.c: (gst_icecastsend_class_init): * ext/snapshot/gstsnapshot.c: (gst_snapshot_class_init): * ext/sndfile/gstsf.c: (gst_sf_class_init): * ext/swfdec/gstswfdec.c: (gst_swfdecbuffer_class_init), (gst_swfdec_class_init): * ext/tarkin/gsttarkindec.c: (gst_tarkindec_class_init): * ext/tarkin/gsttarkinenc.c: (gst_tarkinenc_class_init): * gst/cdxaparse/gstcdxastrip.c: (gst_cdxastrip_class_init): * gst/chart/gstchart.c: (gst_chart_class_init): * gst/colorspace/gstcolorspace.c: (gst_colorspace_class_init): * gst/deinterlace/gstdeinterlace.c: (gst_deinterlace_class_init): * gst/festival/gstfestival.c: (gst_festival_class_init): * gst/filter/gstbpwsinc.c: (gst_bpwsinc_class_init): * gst/filter/gstiir.c: (gst_iir_class_init): * gst/filter/gstlpwsinc.c: (gst_lpwsinc_class_init): * gst/librfb/gstrfbsrc.c: (gst_rfbsrc_class_init): * gst/mixmatrix/mixmatrix.c: (gst_mixmatrix_class_init): * gst/mpeg1sys/gstmpeg1systemencode.c: (gst_system_encode_class_init): * gst/mpeg1videoparse/gstmp1videoparse.c: (gst_mp1videoparse_class_init): * gst/mpeg2sub/gstmpeg2subt.c: (gst_mpeg2subt_class_init): * gst/mpegaudioparse/gstmpegaudioparse.c: (gst_mp3parse_class_init): * gst/overlay/gstoverlay.c: (gst_overlay_class_init): * gst/passthrough/gstpassthrough.c: (passthrough_class_init): * gst/playondemand/gstplayondemand.c: (play_on_demand_class_init): * gst/rtjpeg/gstrtjpegdec.c: (gst_rtjpegdec_class_init): * gst/rtjpeg/gstrtjpegenc.c: (gst_rtjpegenc_class_init): * gst/smooth/gstsmooth.c: (gst_smooth_class_init): * gst/smoothwave/gstsmoothwave.c: (gst_smoothwave_class_init): * gst/spectrum/gstspectrum.c: (gst_spectrum_class_init): * gst/stereo/gststereo.c: (gst_stereo_class_init): * gst/switch/gstswitch.c: (gst_switch_class_init): * gst/tta/gstttadec.c: (gst_tta_dec_class_init): * gst/tta/gstttaparse.c: (gst_tta_parse_class_init): * gst/vbidec/gstvbidec.c: (gst_vbidec_class_init): * gst/videocrop/gstvideocrop.c: (gst_video_crop_class_init): * gst/virtualdub/gstxsharpen.c: (gst_xsharpen_class_init): * gst/y4m/gsty4mencode.c: (gst_y4mencode_class_init): * sys/cdrom/gstcdplayer.c: (cdplayer_class_init): * sys/directsound/gstdirectsoundsink.c: (gst_directsoundsink_class_init): * sys/dxr3/dxr3audiosink.c: (dxr3audiosink_class_init): * sys/dxr3/dxr3spusink.c: (dxr3spusink_class_init): * sys/dxr3/dxr3videosink.c: (dxr3videosink_class_init): * sys/qcam/gstqcamsrc.c: (gst_qcamsrc_class_init): * sys/v4l2/gstv4l2colorbalance.c: (gst_v4l2_color_balance_channel_class_init): * sys/v4l2/gstv4l2tuner.c: (gst_v4l2_tuner_channel_class_init), (gst_v4l2_tuner_norm_class_init): * sys/ximagesrc/ximagesrc.c: (gst_ximagesrc_class_init): Fix #337365 (g_type_class_ref <-> g_type_class_peek_parent) --- gst/audiofx/gststereo.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gst/audiofx/gststereo.c b/gst/audiofx/gststereo.c index 9d2142016..9354ff83d 100644 --- a/gst/audiofx/gststereo.c +++ b/gst/audiofx/gststereo.c @@ -104,7 +104,7 @@ gst_stereo_class_init (GstStereoClass * klass) gobject_class = (GObjectClass *) klass; gstelement_class = (GstElementClass *) klass; - parent_class = g_type_class_ref (GST_TYPE_ELEMENT); + parent_class = g_type_class_peek_parent (klass); g_object_class_install_property (G_OBJECT_CLASS (klass), ARG_ACTIVE, g_param_spec_int ("active", "active", "active", G_MININT, G_MAXINT, 0, G_PARAM_READWRITE)); /* CHECKME */ g_object_class_install_property (G_OBJECT_CLASS (klass), ARG_STEREO, g_param_spec_float ("stereo", "stereo", "stereo", 0.0, 1.0, 0.0, G_PARAM_READWRITE)); /* CHECKME */ -- GitLab From c8de8f4d5d7479c557cb2f597df743a576d2618a Mon Sep 17 00:00:00 2001 From: Stefan Kost Date: Tue, 25 Apr 2006 21:56:38 +0000 Subject: [PATCH 20/38] Define GstElementDetails as const and also static (when defined as global) Original commit message from CVS: * ext/amrwb/gstamrwbdec.c: * ext/amrwb/gstamrwbenc.c: * ext/amrwb/gstamrwbparse.c: * ext/arts/gst_arts.c: * ext/artsd/gstartsdsink.c: * ext/audiofile/gstafparse.c: * ext/audiofile/gstafsink.c: * ext/audiofile/gstafsrc.c: * ext/audioresample/gstaudioresample.c: * ext/bz2/gstbz2dec.c: * ext/bz2/gstbz2enc.c: * ext/cdaudio/gstcdaudio.c: * ext/directfb/dfbvideosink.c: * ext/divx/gstdivxdec.c: * ext/divx/gstdivxenc.c: * ext/dts/gstdtsdec.c: (gst_dtsdec_base_init): * ext/faac/gstfaac.c: (gst_faac_base_init): * ext/faad/gstfaad.c: * ext/gsm/gstgsmdec.c: * ext/gsm/gstgsmenc.c: * ext/hermes/gsthermescolorspace.c: * ext/ivorbis/vorbisfile.c: * ext/lcs/gstcolorspace.c: * ext/libfame/gstlibfame.c: * ext/libmms/gstmms.c: (gst_mms_base_init): * ext/musepack/gstmusepackdec.c: (gst_musepackdec_base_init): * ext/musicbrainz/gsttrm.c: (gst_musicbrainz_base_init): * ext/nas/nassink.c: (gst_nassink_base_init): * ext/neon/gstneonhttpsrc.c: * ext/sdl/sdlaudiosink.c: * ext/sdl/sdlvideosink.c: * ext/shout/gstshout.c: * ext/snapshot/gstsnapshot.c: * ext/sndfile/gstsf.c: * ext/swfdec/gstswfdec.c: * ext/tarkin/gsttarkindec.c: * ext/tarkin/gsttarkinenc.c: * ext/theora/theoradec.c: * ext/wavpack/gstwavpackdec.c: (gst_wavpack_dec_base_init): * ext/wavpack/gstwavpackparse.c: (gst_wavpack_parse_base_init): * ext/xvid/gstxviddec.c: * ext/xvid/gstxvidenc.c: * gst/cdxaparse/gstcdxaparse.c: (gst_cdxa_parse_base_init): * gst/cdxaparse/gstcdxastrip.c: (gst_cdxastrip_base_init): * gst/chart/gstchart.c: * gst/colorspace/gstcolorspace.c: * gst/deinterlace/gstdeinterlace.c: * gst/equalizer/gstiirequalizer.c: (gst_iir_equalizer_base_init): * gst/festival/gstfestival.c: * gst/filter/gstbpwsinc.c: * gst/filter/gstiir.c: * gst/filter/gstlpwsinc.c: * gst/freeze/gstfreeze.c: * gst/games/gstpuzzle.c: (gst_puzzle_base_init): * gst/librfb/gstrfbsrc.c: * gst/mixmatrix/mixmatrix.c: * gst/mpeg1sys/gstmpeg1systemencode.c: * gst/mpeg1videoparse/gstmp1videoparse.c: * gst/mpeg2sub/gstmpeg2subt.c: * gst/mpegaudioparse/gstmpegaudioparse.c: * gst/multifilesink/gstmultifilesink.c: * gst/overlay/gstoverlay.c: * gst/passthrough/gstpassthrough.c: * gst/playondemand/gstplayondemand.c: * gst/qtdemux/qtdemux.c: * gst/rtjpeg/gstrtjpegdec.c: * gst/rtjpeg/gstrtjpegenc.c: * gst/smooth/gstsmooth.c: * gst/smoothwave/gstsmoothwave.c: * gst/spectrum/gstspectrum.c: * gst/speed/gstspeed.c: * gst/stereo/gststereo.c: * gst/switch/gstswitch.c: * gst/tta/gstttadec.c: (gst_tta_dec_base_init): * gst/tta/gstttaparse.c: (gst_tta_parse_base_init): * gst/vbidec/gstvbidec.c: * gst/videocrop/gstvideocrop.c: * gst/videodrop/gstvideodrop.c: * gst/virtualdub/gstxsharpen.c: * gst/xingheader/gstxingmux.c: (gst_xing_mux_base_init): * gst/y4m/gsty4mencode.c: * sys/cdrom/gstcdplayer.c: * sys/directdraw/gstdirectdrawsink.c: * sys/directsound/gstdirectsoundsink.c: * sys/glsink/glimagesink.c: * sys/qcam/gstqcamsrc.c: * sys/v4l2/gstv4l2src.c: * sys/vcd/vcdsrc.c: (gst_vcdsrc_base_init): * sys/ximagesrc/ximagesrc.c: Define GstElementDetails as const and also static (when defined as global) --- gst/audiofx/gststereo.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/gst/audiofx/gststereo.c b/gst/audiofx/gststereo.c index 9354ff83d..d99da1573 100644 --- a/gst/audiofx/gststereo.c +++ b/gst/audiofx/gststereo.c @@ -28,7 +28,8 @@ #include "gststereo.h" /* elementfactory information */ -static GstElementDetails stereo_details = GST_ELEMENT_DETAILS ("Stereo effect", +static const GstElementDetails stereo_details = +GST_ELEMENT_DETAILS ("Stereo effect", "Filter/Effect/Audio", "Muck with the stereo signal to enhance its 'stereo-ness'", "Erik Walthinsen "); -- GitLab From d88cf896deb9f8219f8c6af5e94ab689528a24c3 Mon Sep 17 00:00:00 2001 From: Stefan Kost Date: Thu, 1 Jun 2006 22:00:26 +0000 Subject: [PATCH 21/38] Fix more gobject macros: obj<->klass, GstXXX<->GstXXXClass Original commit message from CVS: * ext/alsaspdif/alsaspdifsink.h: * ext/amrwb/gstamrwbdec.h: * ext/amrwb/gstamrwbenc.h: * ext/amrwb/gstamrwbparse.h: * ext/arts/gst_arts.h: * ext/artsd/gstartsdsink.h: * ext/audiofile/gstafparse.h: * ext/audiofile/gstafsink.h: * ext/audiofile/gstafsrc.h: * ext/audioresample/gstaudioresample.h: * ext/bz2/gstbz2dec.h: * ext/bz2/gstbz2enc.h: * ext/dirac/gstdiracdec.h: * ext/directfb/dfbvideosink.h: * ext/divx/gstdivxdec.h: * ext/divx/gstdivxenc.h: * ext/dts/gstdtsdec.h: * ext/faac/gstfaac.h: * ext/gsm/gstgsmdec.h: * ext/gsm/gstgsmenc.h: * ext/ivorbis/vorbisenc.h: * ext/libfame/gstlibfame.h: * ext/nas/nassink.h: * ext/neon/gstneonhttpsrc.h: * ext/polyp/polypsink.h: * ext/sdl/sdlaudiosink.h: * ext/sdl/sdlvideosink.h: * ext/shout/gstshout.h: * ext/snapshot/gstsnapshot.h: * ext/sndfile/gstsf.h: * ext/swfdec/gstswfdec.h: * ext/tarkin/gsttarkindec.h: * ext/tarkin/gsttarkinenc.h: * ext/theora/theoradec.h: * ext/wavpack/gstwavpackdec.h: * ext/wavpack/gstwavpackparse.h: * ext/xine/gstxine.h: * ext/xvid/gstxviddec.h: * ext/xvid/gstxvidenc.h: * gst/cdxaparse/gstcdxaparse.h: * gst/cdxaparse/gstcdxastrip.h: * gst/colorspace/gstcolorspace.h: * gst/festival/gstfestival.h: * gst/freeze/gstfreeze.h: * gst/gdp/gstgdpdepay.h: * gst/gdp/gstgdppay.h: * gst/modplug/gstmodplug.h: * gst/mpeg1sys/gstmpeg1systemencode.h: * gst/mpeg1videoparse/gstmp1videoparse.h: * gst/mpeg2sub/gstmpeg2subt.h: * gst/mpegaudioparse/gstmpegaudioparse.h: * gst/multifilesink/gstmultifilesink.h: * gst/overlay/gstoverlay.h: * gst/playondemand/gstplayondemand.h: * gst/qtdemux/qtdemux.h: * gst/rtjpeg/gstrtjpegdec.h: * gst/rtjpeg/gstrtjpegenc.h: * gst/smooth/gstsmooth.h: * gst/smoothwave/gstsmoothwave.h: * gst/spectrum/gstspectrum.h: * gst/speed/gstspeed.h: * gst/stereo/gststereo.h: * gst/switch/gstswitch.h: * gst/tta/gstttadec.h: * gst/tta/gstttaparse.h: * gst/videodrop/gstvideodrop.h: * gst/xingheader/gstxingmux.h: * sys/directdraw/gstdirectdrawsink.h: * sys/directsound/gstdirectsoundsink.h: * sys/dxr3/dxr3audiosink.h: * sys/dxr3/dxr3spusink.h: * sys/dxr3/dxr3videosink.h: * sys/qcam/gstqcamsrc.h: * sys/vcd/vcdsrc.h: Fix more gobject macros: obj<->klass, GstXXX<->GstXXXClass --- gst/audiofx/gststereo.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/gst/audiofx/gststereo.h b/gst/audiofx/gststereo.h index 8b78f25eb..6c4954dd1 100644 --- a/gst/audiofx/gststereo.h +++ b/gst/audiofx/gststereo.h @@ -35,10 +35,10 @@ extern "C" { #define GST_STEREO(obj) \ (G_TYPE_CHECK_INSTANCE_CAST((obj),GST_TYPE_STEREO,GstStereo)) #define GST_STEREO_CLASS(klass) \ - (G_TYPE_CHECK_CLASS_CAST((klass),GST_TYPE_STEREO,GstStereo)) + (G_TYPE_CHECK_CLASS_CAST((klass),GST_TYPE_STEREO,GstStereoClass)) #define GST_IS_STEREO(obj) \ (G_TYPE_CHECK_INSTANCE_TYPE((obj),GST_TYPE_STEREO)) -#define GST_IS_STEREO_CLASS(obj) \ +#define GST_IS_STEREO_CLASS(klass) \ (G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_STEREO)) typedef struct _GstStereo GstStereo; -- GitLab From d6ced7a35ea38148a674ab96c8156080651ba94e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20Dr=C3=B6ge?= Date: Thu, 9 Aug 2007 17:39:47 +0000 Subject: [PATCH 22/38] Port the stereo element to GStreamer 0.10. Original commit message from CVS: * configure.ac: * gst/stereo/Makefile.am: * gst/stereo/gststereo.c: (gst_stereo_base_init), (gst_stereo_class_init), (gst_stereo_init), (gst_stereo_transform_ip), (gst_stereo_set_property), (gst_stereo_get_property): * gst/stereo/gststereo.h: Port the stereo element to GStreamer 0.10. --- gst/audiofx/gststereo.c | 127 ++++++++++++++++++---------------------- gst/audiofx/gststereo.h | 20 ++----- 2 files changed, 61 insertions(+), 86 deletions(-) diff --git a/gst/audiofx/gststereo.c b/gst/audiofx/gststereo.c index d99da1573..405449e2a 100644 --- a/gst/audiofx/gststereo.c +++ b/gst/audiofx/gststereo.c @@ -27,6 +27,13 @@ #endif #include "gststereo.h" +#include +#include +#include +#include +#include + + /* elementfactory information */ static const GstElementDetails stereo_details = GST_ELEMENT_DETAILS ("Stereo effect", @@ -35,6 +42,15 @@ GST_ELEMENT_DETAILS ("Stereo effect", "Erik Walthinsen "); +#define ALLOWED_CAPS \ + "audio/x-raw-int," \ + " depth = (int) 16, " \ + " width = (int) 16, " \ + " endianness = (int) BYTE_ORDER," \ + " rate = (int) [ 1, MAX ]," \ + " channels = (int) 2, " \ + " signed = (boolean) TRUE" + /* Stereo signals and args */ enum { @@ -49,112 +65,83 @@ enum ARG_STEREO }; - -static void gst_stereo_base_init (gpointer g_class); -static void gst_stereo_class_init (GstStereoClass * klass); -static void gst_stereo_init (GstStereo * stereo); - static void gst_stereo_set_property (GObject * object, guint prop_id, const GValue * value, GParamSpec * pspec); static void gst_stereo_get_property (GObject * object, guint prop_id, GValue * value, GParamSpec * pspec); -static void gst_stereo_chain (GstPad * pad, GstData * _data); - -static GstElementClass *parent_class = NULL; +static GstFlowReturn gst_stereo_transform_ip (GstBaseTransform * base, + GstBuffer * outbuf); /*static guint gst_stereo_signals[LAST_SIGNAL] = { 0 }; */ -GType -gst_stereo_get_type (void) -{ - static GType stereo_type = 0; - - if (!stereo_type) { - static const GTypeInfo stereo_info = { - sizeof (GstStereoClass), - gst_stereo_base_init, - NULL, - (GClassInitFunc) gst_stereo_class_init, - NULL, - NULL, - sizeof (GstStereo), - 0, - (GInstanceInitFunc) gst_stereo_init, - }; - - stereo_type = - g_type_register_static (GST_TYPE_ELEMENT, "GstStereo", &stereo_info, 0); - } - return stereo_type; -} +GST_BOILERPLATE (GstStereo, gst_stereo, GstAudioFilter, GST_TYPE_AUDIO_FILTER); static void gst_stereo_base_init (gpointer g_class) { GstElementClass *element_class = GST_ELEMENT_CLASS (g_class); + GstCaps *caps; gst_element_class_set_details (element_class, &stereo_details); + + caps = gst_caps_from_string (ALLOWED_CAPS); + gst_audio_filter_class_add_pad_templates (GST_AUDIO_FILTER_CLASS (g_class), + caps); + gst_caps_unref (caps); } + static void gst_stereo_class_init (GstStereoClass * klass) { GObjectClass *gobject_class; GstElementClass *gstelement_class; + GstBaseTransformClass *trans_class; gobject_class = (GObjectClass *) klass; gstelement_class = (GstElementClass *) klass; + trans_class = (GstBaseTransformClass *) klass; parent_class = g_type_class_peek_parent (klass); - g_object_class_install_property (G_OBJECT_CLASS (klass), ARG_ACTIVE, g_param_spec_int ("active", "active", "active", G_MININT, G_MAXINT, 0, G_PARAM_READWRITE)); /* CHECKME */ - g_object_class_install_property (G_OBJECT_CLASS (klass), ARG_STEREO, g_param_spec_float ("stereo", "stereo", "stereo", 0.0, 1.0, 0.0, G_PARAM_READWRITE)); /* CHECKME */ + gobject_class->set_property = GST_DEBUG_FUNCPTR (gst_stereo_set_property); + gobject_class->get_property = GST_DEBUG_FUNCPTR (gst_stereo_get_property); + + g_object_class_install_property (gobject_class, ARG_ACTIVE, + g_param_spec_boolean ("active", "active", "active", + TRUE, G_PARAM_READWRITE | GST_PARAM_CONTROLLABLE)); - gobject_class->set_property = gst_stereo_set_property; - gobject_class->get_property = gst_stereo_get_property; + g_object_class_install_property (gobject_class, ARG_STEREO, + g_param_spec_float ("stereo", "stereo", "stereo", + 0.0, 1.0, 0.1, G_PARAM_READWRITE | GST_PARAM_CONTROLLABLE)); + + trans_class->transform_ip = GST_DEBUG_FUNCPTR (gst_stereo_transform_ip); } static void -gst_stereo_init (GstStereo * stereo) +gst_stereo_init (GstStereo * stereo, GstStereoClass * klass) { - stereo->sinkpad = gst_pad_new ("sink", GST_PAD_SINK); - gst_element_add_pad (GST_ELEMENT (stereo), stereo->sinkpad); - gst_pad_set_chain_function (stereo->sinkpad, gst_stereo_chain); - stereo->srcpad = gst_pad_new ("src", GST_PAD_SRC); - gst_element_add_pad (GST_ELEMENT (stereo), stereo->srcpad); - - stereo->active = FALSE; - stereo->stereo = 2.5; + stereo->active = TRUE; + stereo->stereo = 0.1; } -static void -gst_stereo_chain (GstPad * pad, GstData * _data) +static GstFlowReturn +gst_stereo_transform_ip (GstBaseTransform * base, GstBuffer * outbuf) { - GstBuffer *buf = GST_BUFFER (_data); - GstStereo *stereo; - gint16 *data; - gint samples; + GstStereo *stereo = GST_STEREO (base); + gint16 *data = (gint16 *) GST_BUFFER_DATA (outbuf); + gint samples = GST_BUFFER_SIZE (outbuf) / 2; gint i; - gdouble avg, ldiff, rdiff, tmp, mul; - - g_return_if_fail (pad != NULL); - g_return_if_fail (GST_IS_PAD (pad)); - g_return_if_fail (buf != NULL); + gdouble avg, ldiff, rdiff, tmp; + gdouble mul = stereo->stereo; - stereo = GST_STEREO (GST_OBJECT_PARENT (pad)); - g_return_if_fail (stereo != NULL); - g_return_if_fail (GST_IS_STEREO (stereo)); + if (!gst_buffer_is_writable (outbuf)) + return GST_FLOW_OK; -/* FIXME */ -/* if (buf->meta) */ -/* memcpy(&stereo->meta,buf->meta,sizeof(stereo->meta)); */ + if (GST_CLOCK_TIME_IS_VALID (GST_BUFFER_TIMESTAMP (outbuf))) + gst_object_sync_values (G_OBJECT (stereo), GST_BUFFER_TIMESTAMP (outbuf)); if (stereo->active) { - - /*if (stereo->meta.channels == 2 && stereo->meta.format == AFMT_S16_LE) { */ - data = (gint16 *) GST_BUFFER_DATA (buf); - samples = GST_BUFFER_SIZE (buf) / 2; - mul = stereo->stereo; for (i = 0; i < samples / 2; i += 2) { avg = (data[i] + data[i + 1]) / 2; ldiff = data[i] - avg; @@ -174,10 +161,9 @@ gst_stereo_chain (GstPad * pad, GstData * _data) tmp = 32767; data[i + 1] = tmp; } - /*} */ } - gst_pad_push (stereo->srcpad, GST_DATA (buf)); + return GST_FLOW_OK; } static void @@ -191,12 +177,13 @@ gst_stereo_set_property (GObject * object, guint prop_id, const GValue * value, switch (prop_id) { case ARG_ACTIVE: - stereo->active = g_value_get_int (value); + stereo->active = g_value_get_boolean (value); break; case ARG_STEREO: stereo->stereo = g_value_get_float (value) * 10.0; break; default: + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); break; } } @@ -212,7 +199,7 @@ gst_stereo_get_property (GObject * object, guint prop_id, GValue * value, switch (prop_id) { case ARG_ACTIVE: - g_value_set_int (value, stereo->active); + g_value_set_boolean (value, stereo->active); break; case ARG_STEREO: g_value_set_float (value, stereo->stereo / 10.0); diff --git a/gst/audiofx/gststereo.h b/gst/audiofx/gststereo.h index 6c4954dd1..27724646f 100644 --- a/gst/audiofx/gststereo.h +++ b/gst/audiofx/gststereo.h @@ -23,12 +23,7 @@ #include - - -#ifdef __cplusplus -extern "C" { -#endif /* __cplusplus */ - +#include #define GST_TYPE_STEREO \ (gst_stereo_get_type()) @@ -45,23 +40,16 @@ typedef struct _GstStereo GstStereo; typedef struct _GstStereoClass GstStereoClass; struct _GstStereo { - GstElement element; + GstAudioFilter element; - GstPad *sinkpad,*srcpad; - - gint8 active; + gboolean active; gfloat stereo; }; struct _GstStereoClass { - GstElementClass parent_class; + GstAudioFilterClass parent_class; }; GType gst_stereo_get_type(void); -#ifdef __cplusplus -} -#endif /* __cplusplus */ - - #endif /* __GST_STEREO_H__ */ -- GitLab From 47063257e0d3193d074527ffe0441f8633c0fb42 Mon Sep 17 00:00:00 2001 From: Stefan Kost Date: Thu, 10 Jul 2008 18:51:11 +0000 Subject: [PATCH 23/38] Document one more. Original commit message from CVS: * docs/plugins/Makefile.am: * docs/plugins/gst-plugins-bad-plugins-docs.sgml: * docs/plugins/gst-plugins-bad-plugins-sections.txt: * docs/plugins/gst-plugins-bad-plugins.args: * docs/plugins/gst-plugins-bad-plugins.hierarchy: * docs/plugins/gst-plugins-bad-plugins.interfaces: * docs/plugins/gst-plugins-bad-plugins.prerequisites: * docs/plugins/gst-plugins-bad-plugins.signals: * docs/plugins/inspect/plugin-stereo.xml: * gst/stereo/gststereo.c: Document one more. --- gst/audiofx/gststereo.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/gst/audiofx/gststereo.c b/gst/audiofx/gststereo.c index 405449e2a..2dafc75f9 100644 --- a/gst/audiofx/gststereo.c +++ b/gst/audiofx/gststereo.c @@ -21,6 +21,18 @@ * the process of copying it over that the xmms people probably won't want * any credit for it ;-) */ +/** + * SECTION:element-stereo + * + * Create a wide stereo effect. + * + * + * Example pipelines + * |[ + * gst-launch -v filesrc location=sine.ogg ! oggdemux ! vorbisdec ! audioconvert ! stereo ! audioconvert ! audioresample ! alsasink + * ]| Play an Ogg/Vorbis file. + * + */ #ifdef HAVE_CONFIG_H #include "config.h" -- GitLab From a002e0f104e42f7782f13c780964b54cee44a84e Mon Sep 17 00:00:00 2001 From: Benjamin Otte Date: Thu, 18 Mar 2010 17:30:26 +0100 Subject: [PATCH 24/38] gst_element_class_set_details => gst_element_class_set_details_simple --- gst/audiofx/gststereo.c | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) diff --git a/gst/audiofx/gststereo.c b/gst/audiofx/gststereo.c index 2dafc75f9..e782f93ce 100644 --- a/gst/audiofx/gststereo.c +++ b/gst/audiofx/gststereo.c @@ -45,15 +45,6 @@ #include #include - -/* elementfactory information */ -static const GstElementDetails stereo_details = -GST_ELEMENT_DETAILS ("Stereo effect", - "Filter/Effect/Audio", - "Muck with the stereo signal to enhance its 'stereo-ness'", - "Erik Walthinsen "); - - #define ALLOWED_CAPS \ "audio/x-raw-int," \ " depth = (int) 16, " \ @@ -95,7 +86,10 @@ gst_stereo_base_init (gpointer g_class) GstElementClass *element_class = GST_ELEMENT_CLASS (g_class); GstCaps *caps; - gst_element_class_set_details (element_class, &stereo_details); + gst_element_class_set_details_simple (element_class, "Stereo effect", + "Filter/Effect/Audio", + "Muck with the stereo signal to enhance its 'stereo-ness'", + "Erik Walthinsen "); caps = gst_caps_from_string (ALLOWED_CAPS); gst_audio_filter_class_add_pad_templates (GST_AUDIO_FILTER_CLASS (g_class), -- GitLab From 0af53c121230b2471ea03106f68ae0ca7d03c739 Mon Sep 17 00:00:00 2001 From: Stefan Kost Date: Tue, 19 Oct 2010 13:43:14 +0300 Subject: [PATCH 25/38] various (gst): add missing G_PARAM_STATIC_STRINGS flags Canonicalize property names as needed. --- gst/audiofx/gststereo.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/gst/audiofx/gststereo.c b/gst/audiofx/gststereo.c index e782f93ce..4571a0ba8 100644 --- a/gst/audiofx/gststereo.c +++ b/gst/audiofx/gststereo.c @@ -115,11 +115,13 @@ gst_stereo_class_init (GstStereoClass * klass) g_object_class_install_property (gobject_class, ARG_ACTIVE, g_param_spec_boolean ("active", "active", "active", - TRUE, G_PARAM_READWRITE | GST_PARAM_CONTROLLABLE)); + TRUE, + G_PARAM_READWRITE | GST_PARAM_CONTROLLABLE | G_PARAM_STATIC_STRINGS)); g_object_class_install_property (gobject_class, ARG_STEREO, g_param_spec_float ("stereo", "stereo", "stereo", - 0.0, 1.0, 0.1, G_PARAM_READWRITE | GST_PARAM_CONTROLLABLE)); + 0.0, 1.0, 0.1, + G_PARAM_READWRITE | GST_PARAM_CONTROLLABLE | G_PARAM_STATIC_STRINGS)); trans_class->transform_ip = GST_DEBUG_FUNCPTR (gst_stereo_transform_ip); } -- GitLab From 3c1e728acd3df8e609bb222b9c52bc9d09302220 Mon Sep 17 00:00:00 2001 From: Edward Hervey Date: Thu, 25 Nov 2010 19:24:56 +0100 Subject: [PATCH 26/38] stereo: Remove dead assignments --- gst/audiofx/gststereo.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/gst/audiofx/gststereo.c b/gst/audiofx/gststereo.c index 4571a0ba8..db054c4f3 100644 --- a/gst/audiofx/gststereo.c +++ b/gst/audiofx/gststereo.c @@ -101,11 +101,9 @@ static void gst_stereo_class_init (GstStereoClass * klass) { GObjectClass *gobject_class; - GstElementClass *gstelement_class; GstBaseTransformClass *trans_class; gobject_class = (GObjectClass *) klass; - gstelement_class = (GstElementClass *) klass; trans_class = (GstBaseTransformClass *) klass; parent_class = g_type_class_peek_parent (klass); -- GitLab From e6b4176d0a7b0eb9a1dde505c56fa325820b6f96 Mon Sep 17 00:00:00 2001 From: Stefan Sauer Date: Fri, 4 Nov 2011 18:52:35 +0100 Subject: [PATCH 27/38] controller: port to new controller location and api --- gst/audiofx/gststereo.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gst/audiofx/gststereo.c b/gst/audiofx/gststereo.c index db054c4f3..8b45e583c 100644 --- a/gst/audiofx/gststereo.c +++ b/gst/audiofx/gststereo.c @@ -145,7 +145,7 @@ gst_stereo_transform_ip (GstBaseTransform * base, GstBuffer * outbuf) return GST_FLOW_OK; if (GST_CLOCK_TIME_IS_VALID (GST_BUFFER_TIMESTAMP (outbuf))) - gst_object_sync_values (G_OBJECT (stereo), GST_BUFFER_TIMESTAMP (outbuf)); + gst_object_sync_values (GST_OBJECT (stereo), GST_BUFFER_TIMESTAMP (outbuf)); if (stereo->active) { for (i = 0; i < samples / 2; i += 2) { -- GitLab From 8061b3ca67e38db351db12b13ffb557f09a5b712 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20Dr=C3=B6ge?= Date: Thu, 5 Apr 2012 18:02:56 +0200 Subject: [PATCH 28/38] gst: Update for GST_PLUGIN_DEFINE() API changes --- gst/audiofx/gststereo.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gst/audiofx/gststereo.c b/gst/audiofx/gststereo.c index 8b45e583c..c994b3146 100644 --- a/gst/audiofx/gststereo.c +++ b/gst/audiofx/gststereo.c @@ -225,6 +225,6 @@ plugin_init (GstPlugin * plugin) GST_PLUGIN_DEFINE (GST_VERSION_MAJOR, GST_VERSION_MINOR, - "stereo", + stereo, "Muck with the stereo signal, enhance it's 'stereo-ness'", plugin_init, VERSION, GST_LICENSE, GST_PACKAGE_NAME, GST_PACKAGE_ORIGIN) -- GitLab From a3da960c906341a8e6a0d3850aec5cdb57e9ee21 Mon Sep 17 00:00:00 2001 From: Mark Nauwelaerts Date: Fri, 14 Sep 2012 17:08:49 +0200 Subject: [PATCH 29/38] replace gst_element_class_set_details_simple with gst_element_class_set_metadata --- gst/audiofx/gststereo.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gst/audiofx/gststereo.c b/gst/audiofx/gststereo.c index c994b3146..767ee42ad 100644 --- a/gst/audiofx/gststereo.c +++ b/gst/audiofx/gststereo.c @@ -86,7 +86,7 @@ gst_stereo_base_init (gpointer g_class) GstElementClass *element_class = GST_ELEMENT_CLASS (g_class); GstCaps *caps; - gst_element_class_set_details_simple (element_class, "Stereo effect", + gst_element_class_set_metadata (element_class, "Stereo effect", "Filter/Effect/Audio", "Muck with the stereo signal to enhance its 'stereo-ness'", "Erik Walthinsen "); -- GitLab From abe580f653325278f85e38aa85c950d1be5a2fb8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tim-Philipp=20M=C3=BCller?= Date: Wed, 17 Oct 2012 17:34:26 +0100 Subject: [PATCH 30/38] Use gst_element_class_set_static_metadata() where possible. Avoids some string copies. Also re-indent some stuff. Also some indent fixes here and there. --- gst/audiofx/gststereo.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gst/audiofx/gststereo.c b/gst/audiofx/gststereo.c index 767ee42ad..25d996599 100644 --- a/gst/audiofx/gststereo.c +++ b/gst/audiofx/gststereo.c @@ -86,7 +86,7 @@ gst_stereo_base_init (gpointer g_class) GstElementClass *element_class = GST_ELEMENT_CLASS (g_class); GstCaps *caps; - gst_element_class_set_metadata (element_class, "Stereo effect", + gst_element_class_set_static_metadata (element_class, "Stereo effect", "Filter/Effect/Audio", "Muck with the stereo signal to enhance its 'stereo-ness'", "Erik Walthinsen "); -- GitLab From 7d12db0ccbd94f765cf699117be42089fd03d378 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tim-Philipp=20M=C3=BCller?= Date: Sat, 3 Nov 2012 20:38:00 +0000 Subject: [PATCH 31/38] Fix FSF address https://bugzilla.gnome.org/show_bug.cgi?id=687520 --- gst/audiofx/gststereo.c | 4 ++-- gst/audiofx/gststereo.h | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/gst/audiofx/gststereo.c b/gst/audiofx/gststereo.c index 25d996599..d3a6a7f28 100644 --- a/gst/audiofx/gststereo.c +++ b/gst/audiofx/gststereo.c @@ -13,8 +13,8 @@ * * 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. + * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, + * Boston, MA 02110-1301, USA. */ /* This effect is borrowed from xmms-0.6.1, though I mangled it so badly in diff --git a/gst/audiofx/gststereo.h b/gst/audiofx/gststereo.h index 27724646f..bd7b6c15b 100644 --- a/gst/audiofx/gststereo.h +++ b/gst/audiofx/gststereo.h @@ -13,8 +13,8 @@ * * 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. + * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, + * Boston, MA 02110-1301, USA. */ -- GitLab From d914cb9298f1f4f071e303861c3c857561e8baf0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Olivier=20Cr=C3=AAte?= Date: Fri, 6 Dec 2013 17:58:13 -0500 Subject: [PATCH 32/38] stereo: Port to GStreamer 1.0 API --- gst/audiofx/gststereo.c | 68 ++++++++++++++++------------------------- 1 file changed, 26 insertions(+), 42 deletions(-) diff --git a/gst/audiofx/gststereo.c b/gst/audiofx/gststereo.c index d3a6a7f28..4247e4dcd 100644 --- a/gst/audiofx/gststereo.c +++ b/gst/audiofx/gststereo.c @@ -43,16 +43,12 @@ #include #include #include -#include #define ALLOWED_CAPS \ - "audio/x-raw-int," \ - " depth = (int) 16, " \ - " width = (int) 16, " \ - " endianness = (int) BYTE_ORDER," \ - " rate = (int) [ 1, MAX ]," \ - " channels = (int) 2, " \ - " signed = (boolean) TRUE" + "audio/x-raw," \ + " format = "GST_AUDIO_NE (S16) "," \ + " rate = (int) [ 1, MAX ]," \ + " channels = (int) 2" /* Stereo signals and args */ enum @@ -76,14 +72,15 @@ static void gst_stereo_get_property (GObject * object, guint prop_id, static GstFlowReturn gst_stereo_transform_ip (GstBaseTransform * base, GstBuffer * outbuf); -/*static guint gst_stereo_signals[LAST_SIGNAL] = { 0 }; */ - -GST_BOILERPLATE (GstStereo, gst_stereo, GstAudioFilter, GST_TYPE_AUDIO_FILTER); +G_DEFINE_TYPE (GstStereo, gst_stereo, GST_TYPE_AUDIO_FILTER); static void -gst_stereo_base_init (gpointer g_class) +gst_stereo_class_init (GstStereoClass * klass) { - GstElementClass *element_class = GST_ELEMENT_CLASS (g_class); + GObjectClass *gobject_class = G_OBJECT_CLASS (klass); + GstElementClass *element_class = GST_ELEMENT_CLASS (klass); + GstBaseTransformClass *trans_class = GST_BASE_TRANSFORM_CLASS (klass); + GstAudioFilterClass *audiofilter_class = GST_AUDIO_FILTER_CLASS (klass); GstCaps *caps; gst_element_class_set_static_metadata (element_class, "Stereo effect", @@ -92,24 +89,11 @@ gst_stereo_base_init (gpointer g_class) "Erik Walthinsen "); caps = gst_caps_from_string (ALLOWED_CAPS); - gst_audio_filter_class_add_pad_templates (GST_AUDIO_FILTER_CLASS (g_class), - caps); + gst_audio_filter_class_add_pad_templates (audiofilter_class, caps); gst_caps_unref (caps); -} - -static void -gst_stereo_class_init (GstStereoClass * klass) -{ - GObjectClass *gobject_class; - GstBaseTransformClass *trans_class; - gobject_class = (GObjectClass *) klass; - trans_class = (GstBaseTransformClass *) klass; - - parent_class = g_type_class_peek_parent (klass); - - gobject_class->set_property = GST_DEBUG_FUNCPTR (gst_stereo_set_property); - gobject_class->get_property = GST_DEBUG_FUNCPTR (gst_stereo_get_property); + gobject_class->set_property = gst_stereo_set_property; + gobject_class->get_property = gst_stereo_get_property; g_object_class_install_property (gobject_class, ARG_ACTIVE, g_param_spec_boolean ("active", "active", "active", @@ -125,7 +109,7 @@ gst_stereo_class_init (GstStereoClass * klass) } static void -gst_stereo_init (GstStereo * stereo, GstStereoClass * klass) +gst_stereo_init (GstStereo * stereo) { stereo->active = TRUE; stereo->stereo = 0.1; @@ -135,14 +119,18 @@ static GstFlowReturn gst_stereo_transform_ip (GstBaseTransform * base, GstBuffer * outbuf) { GstStereo *stereo = GST_STEREO (base); - gint16 *data = (gint16 *) GST_BUFFER_DATA (outbuf); - gint samples = GST_BUFFER_SIZE (outbuf) / 2; + gint samples; gint i; gdouble avg, ldiff, rdiff, tmp; gdouble mul = stereo->stereo; + gint16 *data; + GstMapInfo info; + + if (!gst_buffer_map (outbuf, &info, GST_MAP_READWRITE)) + return GST_FLOW_ERROR; - if (!gst_buffer_is_writable (outbuf)) - return GST_FLOW_OK; + data = (gint16 *) info.data; + samples = info.size / 2; if (GST_CLOCK_TIME_IS_VALID (GST_BUFFER_TIMESTAMP (outbuf))) gst_object_sync_values (GST_OBJECT (stereo), GST_BUFFER_TIMESTAMP (outbuf)); @@ -169,6 +157,8 @@ gst_stereo_transform_ip (GstBaseTransform * base, GstBuffer * outbuf) } } + gst_buffer_unmap (outbuf, &info); + return GST_FLOW_OK; } @@ -176,10 +166,7 @@ static void gst_stereo_set_property (GObject * object, guint prop_id, const GValue * value, GParamSpec * pspec) { - GstStereo *stereo; - - g_return_if_fail (GST_IS_STEREO (object)); - stereo = GST_STEREO (object); + GstStereo *stereo = GST_STEREO (object); switch (prop_id) { case ARG_ACTIVE: @@ -198,10 +185,7 @@ static void gst_stereo_get_property (GObject * object, guint prop_id, GValue * value, GParamSpec * pspec) { - GstStereo *stereo; - - g_return_if_fail (GST_IS_STEREO (object)); - stereo = GST_STEREO (object); + GstStereo *stereo = GST_STEREO (object); switch (prop_id) { case ARG_ACTIVE: -- GitLab From 78da74736a3fba22b866f6287b3a80b955d3adc6 Mon Sep 17 00:00:00 2001 From: Luis de Bethencourt Date: Mon, 27 Apr 2015 10:55:13 +0100 Subject: [PATCH 33/38] Rename property enums from ARG_ to PROP_ Property enum items should be named PROP_ for consistency and readability. --- gst/audiofx/gststereo.c | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/gst/audiofx/gststereo.c b/gst/audiofx/gststereo.c index 4247e4dcd..ebadf9a4d 100644 --- a/gst/audiofx/gststereo.c +++ b/gst/audiofx/gststereo.c @@ -59,9 +59,9 @@ enum enum { - ARG_0, - ARG_ACTIVE, - ARG_STEREO + PROP_0, + PROP_ACTIVE, + PROP_STEREO }; static void gst_stereo_set_property (GObject * object, guint prop_id, @@ -95,12 +95,12 @@ gst_stereo_class_init (GstStereoClass * klass) gobject_class->set_property = gst_stereo_set_property; gobject_class->get_property = gst_stereo_get_property; - g_object_class_install_property (gobject_class, ARG_ACTIVE, + g_object_class_install_property (gobject_class, PROP_ACTIVE, g_param_spec_boolean ("active", "active", "active", TRUE, G_PARAM_READWRITE | GST_PARAM_CONTROLLABLE | G_PARAM_STATIC_STRINGS)); - g_object_class_install_property (gobject_class, ARG_STEREO, + g_object_class_install_property (gobject_class, PROP_STEREO, g_param_spec_float ("stereo", "stereo", "stereo", 0.0, 1.0, 0.1, G_PARAM_READWRITE | GST_PARAM_CONTROLLABLE | G_PARAM_STATIC_STRINGS)); @@ -169,10 +169,10 @@ gst_stereo_set_property (GObject * object, guint prop_id, const GValue * value, GstStereo *stereo = GST_STEREO (object); switch (prop_id) { - case ARG_ACTIVE: + case PROP_ACTIVE: stereo->active = g_value_get_boolean (value); break; - case ARG_STEREO: + case PROP_STEREO: stereo->stereo = g_value_get_float (value) * 10.0; break; default: @@ -188,10 +188,10 @@ gst_stereo_get_property (GObject * object, guint prop_id, GValue * value, GstStereo *stereo = GST_STEREO (object); switch (prop_id) { - case ARG_ACTIVE: + case PROP_ACTIVE: g_value_set_boolean (value, stereo->active); break; - case ARG_STEREO: + case PROP_STEREO: g_value_set_float (value, stereo->stereo / 10.0); break; default: -- GitLab From 37df358c5ef8f38a823be17d595e2aa22a23eaec Mon Sep 17 00:00:00 2001 From: Vineeth TM Date: Mon, 14 Dec 2015 11:09:46 +0900 Subject: [PATCH 34/38] plugins-bad: Fix example pipelines rename gst-launch --> gst-launch-1.0 replace old elements with new elements(ffmpegcolorspace -> videoconvert, ffenc_** -> avenc_**) fix caps in examples https://bugzilla.gnome.org/show_bug.cgi?id=759432 --- gst/audiofx/gststereo.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gst/audiofx/gststereo.c b/gst/audiofx/gststereo.c index ebadf9a4d..f7e013bc3 100644 --- a/gst/audiofx/gststereo.c +++ b/gst/audiofx/gststereo.c @@ -29,7 +29,7 @@ * * Example pipelines * |[ - * gst-launch -v filesrc location=sine.ogg ! oggdemux ! vorbisdec ! audioconvert ! stereo ! audioconvert ! audioresample ! alsasink + * gst-launch-1.0 -v filesrc location=sine.ogg ! oggdemux ! vorbisdec ! audioconvert ! stereo ! audioconvert ! audioresample ! alsasink * ]| Play an Ogg/Vorbis file. * */ -- GitLab From 4e4b568f654b7b9640a23165f4b9b135b0d5ba45 Mon Sep 17 00:00:00 2001 From: Nirbheek Chauhan Date: Thu, 27 Oct 2016 09:11:26 +0530 Subject: [PATCH 35/38] Explicitly define float constants as float With MSVC, this gives the following warning: warning C4305: 'function': truncation from 'double' to 'gfloat' Apparently, MSVC does not figure out what type to use for constants based on the assignment. This warning is very spammy, so let's try to fix it. --- gst/audiofx/gststereo.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/gst/audiofx/gststereo.c b/gst/audiofx/gststereo.c index f7e013bc3..35990104a 100644 --- a/gst/audiofx/gststereo.c +++ b/gst/audiofx/gststereo.c @@ -102,7 +102,7 @@ gst_stereo_class_init (GstStereoClass * klass) g_object_class_install_property (gobject_class, PROP_STEREO, g_param_spec_float ("stereo", "stereo", "stereo", - 0.0, 1.0, 0.1, + 0.0, 1.0, 0.1f, G_PARAM_READWRITE | GST_PARAM_CONTROLLABLE | G_PARAM_STATIC_STRINGS)); trans_class->transform_ip = GST_DEBUG_FUNCPTR (gst_stereo_transform_ip); @@ -112,7 +112,7 @@ static void gst_stereo_init (GstStereo * stereo) { stereo->active = TRUE; - stereo->stereo = 0.1; + stereo->stereo = 0.1f; } static GstFlowReturn -- GitLab From c85322480f30879f733ba070892cd6f53ae350d1 Mon Sep 17 00:00:00 2001 From: Thibault Saunier Date: Wed, 8 Mar 2017 15:01:13 -0300 Subject: [PATCH 36/38] docs: Port all docstring to gtk-doc markdown --- gst/audiofx/gststereo.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/gst/audiofx/gststereo.c b/gst/audiofx/gststereo.c index 35990104a..72539d6e1 100644 --- a/gst/audiofx/gststereo.c +++ b/gst/audiofx/gststereo.c @@ -23,15 +23,15 @@ */ /** * SECTION:element-stereo + * @title: stereo * * Create a wide stereo effect. * - * - * Example pipelines + * ## Example pipelines * |[ * gst-launch-1.0 -v filesrc location=sine.ogg ! oggdemux ! vorbisdec ! audioconvert ! stereo ! audioconvert ! audioresample ! alsasink * ]| Play an Ogg/Vorbis file. - * + * */ #ifdef HAVE_CONFIG_H -- GitLab From 6370d7e89095029aa37b75dbde82a18489df4c5f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tim-Philipp=20M=C3=BCller?= Date: Thu, 18 May 2017 10:53:48 +0100 Subject: [PATCH 37/38] stereo: fix typo in plugin description --- gst/audiofx/gststereo.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gst/audiofx/gststereo.c b/gst/audiofx/gststereo.c index 72539d6e1..95ca3526a 100644 --- a/gst/audiofx/gststereo.c +++ b/gst/audiofx/gststereo.c @@ -210,5 +210,5 @@ plugin_init (GstPlugin * plugin) GST_PLUGIN_DEFINE (GST_VERSION_MAJOR, GST_VERSION_MINOR, stereo, - "Muck with the stereo signal, enhance it's 'stereo-ness'", + "Muck with the stereo signal, enhance its 'stereo-ness'", plugin_init, VERSION, GST_LICENSE, GST_PACKAGE_NAME, GST_PACKAGE_ORIGIN) -- GitLab From f4802618151cc5bfd75777727d3ea92b59495da2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tim-Philipp=20M=C3=BCller?= Date: Tue, 25 Dec 2018 14:51:38 +0100 Subject: [PATCH 38/38] audiofx: add stereo element which was moved from -bad to build Fixes https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/issues/457 --- docs/plugins/Makefile.am | 1 + docs/plugins/gst-plugins-good-plugins.args | 19 +++++++++++++++++ .../gst-plugins-good-plugins.hierarchy | 1 + docs/plugins/inspect/plugin-audiofx.xml | 21 +++++++++++++++++++ gst/audiofx/Makefile.am | 4 +++- gst/audiofx/audiofx.c | 4 +++- gst/audiofx/gststereo.c | 13 ------------ gst/audiofx/meson.build | 3 ++- 8 files changed, 50 insertions(+), 16 deletions(-) diff --git a/docs/plugins/Makefile.am b/docs/plugins/Makefile.am index 942a0bd4d..5257826d8 100644 --- a/docs/plugins/Makefile.am +++ b/docs/plugins/Makefile.am @@ -99,6 +99,7 @@ EXTRA_HFILES = \ $(top_srcdir)/gst/audiofx/audiowsinclimit.h \ $(top_srcdir)/gst/audiofx/audiofirfilter.h \ $(top_srcdir)/gst/audiofx/gstscaletempo.h \ + $(top_srcdir)/gst/audiofx/gststereo.h \ $(top_srcdir)/gst/audioparsers/gstaacparse.h \ $(top_srcdir)/gst/audioparsers/gstac3parse.h \ $(top_srcdir)/gst/audioparsers/gstamrparse.h \ diff --git a/docs/plugins/gst-plugins-good-plugins.args b/docs/plugins/gst-plugins-good-plugins.args index 0e2d0116c..167122915 100644 --- a/docs/plugins/gst-plugins-good-plugins.args +++ b/docs/plugins/gst-plugins-good-plugins.args @@ -24938,3 +24938,22 @@ 0 + +GstStereo::active +gboolean + +rw +active +active. +TRUE + + + +GstStereo::stereo +gfloat +[0,1] +rw +stereo +stereo. +0.1 + diff --git a/docs/plugins/gst-plugins-good-plugins.hierarchy b/docs/plugins/gst-plugins-good-plugins.hierarchy index 1f947d451..f6e7d2309 100644 --- a/docs/plugins/gst-plugins-good-plugins.hierarchy +++ b/docs/plugins/gst-plugins-good-plugins.hierarchy @@ -118,6 +118,7 @@ GObject GstIirEqualizer3Bands GstIirEqualizerNBands GstSpectrum + GstStereo GstAudioPanorama GstBreakMyData GstCapsSetter diff --git a/docs/plugins/inspect/plugin-audiofx.xml b/docs/plugins/inspect/plugin-audiofx.xml index 8662390b9..dbbe6c2f8 100644 --- a/docs/plugins/inspect/plugin-audiofx.xml +++ b/docs/plugins/inspect/plugin-audiofx.xml @@ -282,5 +282,26 @@ + + stereo + Stereo effect + Filter/Effect/Audio + Muck with the stereo signal to enhance its 'stereo-ness' + Erik Walthinsen <omega@cse.ogi.edu> + + + sink + sink + always +
audio/x-raw, format=(string)S16LE, rate=(int)[ 1, 2147483647 ], channels=(int)2
+
+ + src + source + always +
audio/x-raw, format=(string)S16LE, rate=(int)[ 1, 2147483647 ], channels=(int)2
+
+
+
\ No newline at end of file diff --git a/gst/audiofx/Makefile.am b/gst/audiofx/Makefile.am index 13ee7d978..793b8dea8 100644 --- a/gst/audiofx/Makefile.am +++ b/gst/audiofx/Makefile.am @@ -24,7 +24,8 @@ libgstaudiofx_la_SOURCES = audiofx.c\ audiowsinclimit.c \ audiofirfilter.c \ audioecho.c \ - gstscaletempo.c + gstscaletempo.c \ + gststereo.c nodist_libgstaudiofx_la_SOURCES = $(ORC_NODIST_SOURCES) # flags used to compile this plugin @@ -57,4 +58,5 @@ noinst_HEADERS = audiopanorama.h \ audiofirfilter.h \ audioecho.h \ gstscaletempo.h \ + gststereo.h \ math_compat.h diff --git a/gst/audiofx/audiofx.c b/gst/audiofx/audiofx.c index dbddabef1..b44a62280 100644 --- a/gst/audiofx/audiofx.c +++ b/gst/audiofx/audiofx.c @@ -37,6 +37,7 @@ #include "audiofirfilter.h" #include "audioecho.h" #include "gstscaletempo.h" +#include "gststereo.h" /* entry point to initialize the plug-in * initialize the plug-in itself @@ -71,7 +72,8 @@ plugin_init (GstPlugin * plugin) gst_element_register (plugin, "audioecho", GST_RANK_NONE, GST_TYPE_AUDIO_ECHO) && gst_element_register (plugin, "scaletempo", GST_RANK_NONE, - GST_TYPE_SCALETEMPO)); + GST_TYPE_SCALETEMPO) && + gst_element_register (plugin, "stereo", GST_RANK_NONE, GST_TYPE_STEREO)); } GST_PLUGIN_DEFINE (GST_VERSION_MAJOR, diff --git a/gst/audiofx/gststereo.c b/gst/audiofx/gststereo.c index 95ca3526a..1a1ef75c4 100644 --- a/gst/audiofx/gststereo.c +++ b/gst/audiofx/gststereo.c @@ -199,16 +199,3 @@ gst_stereo_get_property (GObject * object, guint prop_id, GValue * value, break; } } - -static gboolean -plugin_init (GstPlugin * plugin) -{ - return gst_element_register (plugin, "stereo", GST_RANK_NONE, - GST_TYPE_STEREO); -} - -GST_PLUGIN_DEFINE (GST_VERSION_MAJOR, - GST_VERSION_MINOR, - stereo, - "Muck with the stereo signal, enhance its 'stereo-ness'", - plugin_init, VERSION, GST_LICENSE, GST_PACKAGE_NAME, GST_PACKAGE_ORIGIN) diff --git a/gst/audiofx/meson.build b/gst/audiofx/meson.build index 45f0536ae..b3460a660 100644 --- a/gst/audiofx/meson.build +++ b/gst/audiofx/meson.build @@ -14,7 +14,8 @@ audiofx_sources = [ 'audiowsinclimit.c', 'audiofirfilter.c', 'audioecho.c', - 'gstscaletempo.c' + 'gstscaletempo.c', + 'gststereo.c' ] orcsrc = 'audiopanoramaorc' -- GitLab