Commit 54b10ebf authored by Sebastian Dröge's avatar Sebastian Dröge 🍵

gst/audiofx/: Add new element "audioamplify". This allows scaling of raw audio...

gst/audiofx/: Add new element "audioamplify". This allows scaling of raw audio samples, similar to the "volume" eleme...

Original commit message from CVS:
reviewed by: Stefan Kost  <ensonic@users.sf.net>
* gst/audiofx/Makefile.am:
* gst/audiofx/audioamplify.c:
(gst_audio_amplify_clipping_method_get_type),
(gst_audio_amplify_base_init), (gst_audio_amplify_class_init),
(gst_audio_amplify_init), (gst_audio_amplify_set_process_function),
(gst_audio_amplify_set_property), (gst_audio_amplify_get_property),
(gst_audio_amplify_set_caps),
(gst_audio_amplify_transform_int_clip),
(gst_audio_amplify_transform_int_wrap_negative),
(gst_audio_amplify_transform_int_wrap_positive),
(gst_audio_amplify_transform_float_clip),
(gst_audio_amplify_transform_float_wrap_negative),
(gst_audio_amplify_transform_float_wrap_positive),
(gst_audio_amplify_transform_ip):
* gst/audiofx/audioamplify.h:
* gst/audiofx/audiofx.c: (plugin_init):
Add new element "audioamplify". This allows scaling of raw audio
samples, similar to the "volume" element, but provides different modes
for clipping and allows unlimited amplification. It's mainly targeted
for creative sound design and not as a replacement of the "volume"
element. Fixes #397162
* 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/inspect/plugin-audiofx.xml:
Add docs for audioamplify and integrate them into the build system
* tests/check/Makefile.am:
* tests/check/elements/audioamplify.c: (setup_amplify),
(cleanup_amplify), (GST_START_TEST), (amplify_suite), (main):
Add fairly extensive unit test suite for audioamplify
parent 1f51fd97
2007-01-24 Sebastian Dröge <slomo@circular-chaos.org>
reviewed by: Stefan Kost <ensonic@users.sf.net>
* gst/audiofx/Makefile.am:
* gst/audiofx/audioamplify.c:
(gst_audio_amplify_clipping_method_get_type),
(gst_audio_amplify_base_init), (gst_audio_amplify_class_init),
(gst_audio_amplify_init), (gst_audio_amplify_set_process_function),
(gst_audio_amplify_set_property), (gst_audio_amplify_get_property),
(gst_audio_amplify_set_caps),
(gst_audio_amplify_transform_int_clip),
(gst_audio_amplify_transform_int_wrap_negative),
(gst_audio_amplify_transform_int_wrap_positive),
(gst_audio_amplify_transform_float_clip),
(gst_audio_amplify_transform_float_wrap_negative),
(gst_audio_amplify_transform_float_wrap_positive),
(gst_audio_amplify_transform_ip):
* gst/audiofx/audioamplify.h:
* gst/audiofx/audiofx.c: (plugin_init):
Add new element "audioamplify". This allows scaling of raw audio
samples, similar to the "volume" element, but provides different modes
for clipping and allows unlimited amplification. It's mainly targeted
for creative sound design and not as a replacement of the "volume"
element. Fixes #397162
* 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/inspect/plugin-audiofx.xml:
Add docs for audioamplify and integrate them into the build system
* tests/check/Makefile.am:
* tests/check/elements/audioamplify.c: (setup_amplify),
(cleanup_amplify), (GST_START_TEST), (amplify_suite), (main):
Add fairly extensive unit test suite for audioamplify
2007-01-24 Wim Taymans <wim@fluendo.com> 2007-01-24 Wim Taymans <wim@fluendo.com>
* gst/rtsp/gstrtspsrc.c: (pad_unblocked), (pad_blocked): * gst/rtsp/gstrtspsrc.c: (pad_unblocked), (pad_blocked):
......
...@@ -77,6 +77,7 @@ EXTRA_HFILES = \ ...@@ -77,6 +77,7 @@ EXTRA_HFILES = \
$(top_srcdir)/gst/apetag/gstapedemux.h \ $(top_srcdir)/gst/apetag/gstapedemux.h \
$(top_srcdir)/gst/audiofx/audiopanorama.h \ $(top_srcdir)/gst/audiofx/audiopanorama.h \
$(top_srcdir)/gst/audiofx/audioinvert.h \ $(top_srcdir)/gst/audiofx/audioinvert.h \
$(top_srcdir)/gst/audiofx/audioamplify.h \
$(top_srcdir)/gst/autodetect/gstautoaudiosink.h \ $(top_srcdir)/gst/autodetect/gstautoaudiosink.h \
$(top_srcdir)/gst/autodetect/gstautovideosink.h \ $(top_srcdir)/gst/autodetect/gstautovideosink.h \
$(top_srcdir)/gst/avi/gstavidemux.h \ $(top_srcdir)/gst/avi/gstavidemux.h \
......
...@@ -16,6 +16,7 @@ ...@@ -16,6 +16,7 @@
<xi:include href="xml/element-apev2mux.xml" /> <xi:include href="xml/element-apev2mux.xml" />
<xi:include href="xml/element-audiopanorama.xml" /> <xi:include href="xml/element-audiopanorama.xml" />
<xi:include href="xml/element-audioinvert.xml" /> <xi:include href="xml/element-audioinvert.xml" />
<xi:include href="xml/element-audioamplify.xml" />
<xi:include href="xml/element-autoaudiosink.xml" /> <xi:include href="xml/element-autoaudiosink.xml" />
<xi:include href="xml/element-autovideosink.xml" /> <xi:include href="xml/element-autovideosink.xml" />
<xi:include href="xml/element-avidemux.xml" /> <xi:include href="xml/element-avidemux.xml" />
......
...@@ -47,6 +47,16 @@ GST_AUDIO_INVERT ...@@ -47,6 +47,16 @@ GST_AUDIO_INVERT
GST_AUDIO_INVERT_CLASS GST_AUDIO_INVERT_CLASS
</SECTION> </SECTION>
<SECTION>
<FILE>element-audioamplify</FILE>
GstAudioAmplify
<TITLE>audioamplify</TITLE>
<SUBSECTION Standard>
GstAudioAmplifyClass
GST_AUDIO_AMPLIFY
GST_AUDIO_AMPLIFY_CLASS
</SECTION>
<SECTION> <SECTION>
<FILE>element-autoaudiosink</FILE> <FILE>element-autoaudiosink</FILE>
GstAutoAudioSink GstAutoAudioSink
......
...@@ -16648,3 +16648,23 @@ ...@@ -16648,3 +16648,23 @@
<DEFAULT>0</DEFAULT> <DEFAULT>0</DEFAULT>
</ARG> </ARG>
<ARG>
<NAME>GstAudioAmplify::amplification</NAME>
<TYPE>gfloat</TYPE>
<RANGE>>= 0</RANGE>
<FLAGS>rw</FLAGS>
<NICK>Amplification</NICK>
<BLURB>Factor of amplification.</BLURB>
<DEFAULT>1</DEFAULT>
</ARG>
<ARG>
<NAME>GstAudioAmplify::clipping-method</NAME>
<TYPE>GstAudioPanoramaClippingMethod</TYPE>
<RANGE></RANGE>
<FLAGS>rw</FLAGS>
<NICK>Clipping method</NICK>
<BLURB>Selects how to handle values higher than the maximum.</BLURB>
<DEFAULT>Normal Clipping (default)</DEFAULT>
</ARG>
...@@ -9,6 +9,13 @@ ...@@ -9,6 +9,13 @@
<package>GStreamer</package> <package>GStreamer</package>
<origin>http://gstreamer.net/</origin> <origin>http://gstreamer.net/</origin>
<elements> <elements>
<element>
<name>audioamplify</name>
<longname>AudioAmplify</longname>
<class>Filter/Effect/Audio</class>
<description>Amplifies an audio stream by a given factor</description>
<author>Sebastian Dröge &lt;slomo@circular-chaos.org&gt;</author>
</element>
<element> <element>
<name>audioinvert</name> <name>audioinvert</name>
<longname>AudioInvert</longname> <longname>AudioInvert</longname>
......
...@@ -5,7 +5,8 @@ plugin_LTLIBRARIES = libgstaudiofx.la ...@@ -5,7 +5,8 @@ plugin_LTLIBRARIES = libgstaudiofx.la
# sources used to compile this plug-in # sources used to compile this plug-in
libgstaudiofx_la_SOURCES = audiofx.c\ libgstaudiofx_la_SOURCES = audiofx.c\
audiopanorama.c \ audiopanorama.c \
audioinvert.c audioinvert.c \
audioamplify.c
# flags used to compile this plugin # flags used to compile this plugin
libgstaudiofx_la_CFLAGS = $(GST_CFLAGS) \ libgstaudiofx_la_CFLAGS = $(GST_CFLAGS) \
...@@ -18,4 +19,5 @@ libgstaudiofx_la_LDFLAGS = $(GST_PLUGIN_LDFLAGS) ...@@ -18,4 +19,5 @@ libgstaudiofx_la_LDFLAGS = $(GST_PLUGIN_LDFLAGS)
# headers we need but don't want installed # headers we need but don't want installed
noinst_HEADERS = audiopanorama.h \ noinst_HEADERS = audiopanorama.h \
audioinvert.h audioinvert.h \
audioamplify.h
This diff is collapsed.
/*
* GStreamer
* Copyright (C) 2007 Sebastian Dröge <slomo@circular-chaos.org>
* Copyright (C) 2006 Stefan Kost <ensonic@users.sf.net>
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Library General Public License for more details.
*
* You should have received a copy of the GNU Library General Public
* License along with this library; if not, write to the
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
* Boston, MA 02111-1307, USA.
*/
#ifndef __GST_AUDIO_AMPLIFY_H__
#define __GST_AUDIO_AMPLIFY_H__
#include <gst/gst.h>
#include <gst/base/gstbasetransform.h>
G_BEGIN_DECLS
#define GST_TYPE_AUDIO_AMPLIFY (gst_audio_amplify_get_type())
#define GST_AUDIO_AMPLIFY(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj),GST_TYPE_AUDIO_AMPLIFY,GstAudioAmplify))
#define GST_IS_AUDIO_AMPLIFY(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj),GST_TYPE_AUDIO_AMPLIFY))
#define GST_AUDIO_AMPLIFY_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass) ,GST_TYPE_AUDIO_AMPLIFY,GstAudioAmplifyClass))
#define GST_IS_AUDIO_AMPLIFY_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass) ,GST_TYPE_AUDIO_AMPLIFY))
#define GST_AUDIO_AMPLIFY_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS((obj) ,GST_TYPE_AUDIO_AMPLIFY,GstAudioAmplifyClass))
typedef struct _GstAudioAmplify GstAudioAmplify;
typedef struct _GstAudioAmplifyClass GstAudioAmplifyClass;
typedef void (*GstAudioAmplifyProcessFunc) (GstAudioAmplify *, guint8 *, guint);
struct _GstAudioAmplify
{
GstBaseTransform element;
gfloat amplification;
/* < private > */
GstAudioAmplifyProcessFunc process;
gint clipping_method;
gint width;
gboolean format_float;
};
struct _GstAudioAmplifyClass
{
GstBaseTransformClass parent;
};
GType gst_audio_amplify_get_type (void);
G_END_DECLS
#endif /* __GST_AUDIO_AMPLIFY_H__ */
...@@ -27,6 +27,7 @@ ...@@ -27,6 +27,7 @@
#include "audiopanorama.h" #include "audiopanorama.h"
#include "audioinvert.h" #include "audioinvert.h"
#include "audioamplify.h"
/* entry point to initialize the plug-in /* entry point to initialize the plug-in
* initialize the plug-in itself * initialize the plug-in itself
...@@ -42,7 +43,9 @@ plugin_init (GstPlugin * plugin) ...@@ -42,7 +43,9 @@ plugin_init (GstPlugin * plugin)
return (gst_element_register (plugin, "audiopanorama", GST_RANK_NONE, return (gst_element_register (plugin, "audiopanorama", GST_RANK_NONE,
GST_TYPE_AUDIO_PANORAMA) && GST_TYPE_AUDIO_PANORAMA) &&
gst_element_register (plugin, "audioinvert", GST_RANK_NONE, gst_element_register (plugin, "audioinvert", GST_RANK_NONE,
GST_TYPE_AUDIO_INVERT)); GST_TYPE_AUDIO_INVERT) &&
gst_element_register (plugin, "audioamplify", GST_RANK_NONE,
GST_TYPE_AUDIO_AMPLIFY));
} }
GST_PLUGIN_DEFINE (GST_VERSION_MAJOR, GST_PLUGIN_DEFINE (GST_VERSION_MAJOR,
......
...@@ -35,6 +35,7 @@ check_PROGRAMS = \ ...@@ -35,6 +35,7 @@ check_PROGRAMS = \
$(check_annodex) \ $(check_annodex) \
elements/audiopanorama \ elements/audiopanorama \
elements/audioinvert \ elements/audioinvert \
elements/audioamplify \
elements/avimux \ elements/avimux \
elements/level \ elements/level \
elements/matroskamux \ elements/matroskamux \
......
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment