gst-plugins-good  1.20.3
About: GStreamer (Good Plugins) is a library for constructing of graphs of media-handling components. A set of good-quality plug-ins (under LGPL license).
  Fossies Dox: gst-plugins-good-1.20.3.tar.xz  ("unofficial" and yet experimental doxygen-generated source code documentation)  

audioamplify.c File Reference
#include <gst/gst.h>
#include <gst/base/gstbasetransform.h>
#include <gst/audio/audio.h>
#include <gst/audio/gstaudiofilter.h>
#include "audioamplify.h"
Include dependency graph for audioamplify.c:

Go to the source code of this file.

Macros

#define GST_CAT_DEFAULT   gst_audio_amplify_debug
 
#define GST_TYPE_AUDIO_AMPLIFY_CLIPPING_METHOD   (gst_audio_amplify_clipping_method_get_type ())
 
#define ALLOWED_CAPS
 
#define MIN_gint8   G_MININT8
 
#define MAX_gint8   G_MAXINT8
 
#define MIN_gint16   G_MININT16
 
#define MAX_gint16   G_MAXINT16
 
#define MIN_gint32   G_MININT32
 
#define MAX_gint32   G_MAXINT32
 
#define MAKE_INT_FUNCS(type, largetype)
 
#define MAKE_FLOAT_FUNCS(type)
 

Enumerations

enum  { LAST_SIGNAL }
 
enum  { PROP_0 , PROP_AMPLIFICATION , PROP_CLIPPING_METHOD }
 
enum  {
  METHOD_CLIP = 0 , METHOD_WRAP_NEGATIVE , METHOD_WRAP_POSITIVE , METHOD_NOCLIP ,
  NUM_METHODS
}
 

Functions

 GST_DEBUG_CATEGORY_STATIC (gst_audio_amplify_debug)
 
static GType gst_audio_amplify_clipping_method_get_type (void)
 
 G_DEFINE_TYPE (GstAudioAmplify, gst_audio_amplify, GST_TYPE_AUDIO_FILTER)
 
 GST_ELEMENT_REGISTER_DEFINE (audioamplify, "audioamplify", GST_RANK_NONE,(gst_audio_amplify_get_type()))
 
static gboolean gst_audio_amplify_set_process_function (GstAudioAmplify *filter, gint clipping, GstAudioFormat format)
 
static void gst_audio_amplify_set_property (GObject *object, guint prop_id, const GValue *value, GParamSpec *pspec)
 
static void gst_audio_amplify_get_property (GObject *object, guint prop_id, GValue *value, GParamSpec *pspec)
 
static gboolean gst_audio_amplify_setup (GstAudioFilter *filter, const GstAudioInfo *info)
 
static GstFlowReturn gst_audio_amplify_transform_ip (GstBaseTransform *base, GstBuffer *buf)
 
static void gst_audio_amplify_transform_gint8_clip (GstAudioAmplify *filter, void *data, guint num_samples)
 
static void gst_audio_amplify_transform_gint8_wrap_negative (GstAudioAmplify *filter, void *data, guint num_samples)
 
static void gst_audio_amplify_transform_gint8_wrap_positive (GstAudioAmplify *filter, void *data, guint num_samples)
 
static void gst_audio_amplify_transform_gint8_noclip (GstAudioAmplify *filter, void *data, guint num_samples)
 
static void gst_audio_amplify_transform_gint16_clip (GstAudioAmplify *filter, void *data, guint num_samples)
 
static void gst_audio_amplify_transform_gint16_wrap_negative (GstAudioAmplify *filter, void *data, guint num_samples)
 
static void gst_audio_amplify_transform_gint16_wrap_positive (GstAudioAmplify *filter, void *data, guint num_samples)
 
static void gst_audio_amplify_transform_gint16_noclip (GstAudioAmplify *filter, void *data, guint num_samples)
 
static void gst_audio_amplify_transform_gint32_clip (GstAudioAmplify *filter, void *data, guint num_samples)
 
static void gst_audio_amplify_transform_gint32_wrap_negative (GstAudioAmplify *filter, void *data, guint num_samples)
 
static void gst_audio_amplify_transform_gint32_wrap_positive (GstAudioAmplify *filter, void *data, guint num_samples)
 
static void gst_audio_amplify_transform_gint32_noclip (GstAudioAmplify *filter, void *data, guint num_samples)
 
static void gst_audio_amplify_transform_gfloat_clip (GstAudioAmplify *filter, void *data, guint num_samples)
 
static void gst_audio_amplify_transform_gfloat_wrap_negative (GstAudioAmplify *filter, void *data, guint num_samples)
 
static void gst_audio_amplify_transform_gfloat_wrap_positive (GstAudioAmplify *filter, void *data, guint num_samples)
 
static void gst_audio_amplify_transform_gfloat_noclip (GstAudioAmplify *filter, void *data, guint num_samples)
 
static void gst_audio_amplify_transform_gdouble_clip (GstAudioAmplify *filter, void *data, guint num_samples)
 
static void gst_audio_amplify_transform_gdouble_wrap_negative (GstAudioAmplify *filter, void *data, guint num_samples)
 
static void gst_audio_amplify_transform_gdouble_wrap_positive (GstAudioAmplify *filter, void *data, guint num_samples)
 
static void gst_audio_amplify_transform_gdouble_noclip (GstAudioAmplify *filter, void *data, guint num_samples)
 
static void gst_audio_amplify_class_init (GstAudioAmplifyClass *klass)
 
static void gst_audio_amplify_init (GstAudioAmplify *filter)
 
static GstAudioAmplifyProcessFunc gst_audio_amplify_process_function (gint clipping, GstAudioFormat format)
 

Macro Definition Documentation

◆ ALLOWED_CAPS

#define ALLOWED_CAPS
Value:
"audio/x-raw," \
" format=(string) {S8,"GST_AUDIO_NE(S16)","GST_AUDIO_NE(S32)"," \
GST_AUDIO_NE(F32)","GST_AUDIO_NE(F64)"}," \
" rate=(int)[1,MAX]," \
" channels=(int)[1,MAX], " \
" layout=(string) {interleaved, non-interleaved}"

Definition at line 97 of file audioamplify.c.

◆ GST_CAT_DEFAULT

#define GST_CAT_DEFAULT   gst_audio_amplify_debug

SECTION:element-audioamplify @title: audioamplify

Amplifies an audio stream by a given factor and allows the selection of different clipping modes. The difference between the clipping modes is best evaluated by testing.

Example launch line

|[ gst-launch-1.0 audiotestsrc wave=saw ! audioamplify amplification=1.5 ! alsasink gst-launch-1.0 filesrc location="melo1.ogg" ! oggdemux ! vorbisdec ! audioconvert ! audioamplify amplification=1.5 clipping-method=wrap-negative ! alsasink gst-launch-1.0 audiotestsrc wave=saw ! audioconvert ! audioamplify amplification=1.5 clipping-method=wrap-positive ! audioconvert ! alsasink ]|

Definition at line 49 of file audioamplify.c.

◆ GST_TYPE_AUDIO_AMPLIFY_CLIPPING_METHOD

#define GST_TYPE_AUDIO_AMPLIFY_CLIPPING_METHOD   (gst_audio_amplify_clipping_method_get_type ())

Definition at line 75 of file audioamplify.c.

◆ MAKE_FLOAT_FUNCS

#define MAKE_FLOAT_FUNCS (   type)

Definition at line 186 of file audioamplify.c.

◆ MAKE_INT_FUNCS

#define MAKE_INT_FUNCS (   type,
  largetype 
)

Definition at line 128 of file audioamplify.c.

◆ MAX_gint16

#define MAX_gint16   G_MAXINT16

Definition at line 124 of file audioamplify.c.

◆ MAX_gint32

#define MAX_gint32   G_MAXINT32

Definition at line 126 of file audioamplify.c.

◆ MAX_gint8

#define MAX_gint8   G_MAXINT8

Definition at line 122 of file audioamplify.c.

◆ MIN_gint16

#define MIN_gint16   G_MININT16

Definition at line 123 of file audioamplify.c.

◆ MIN_gint32

#define MIN_gint32   G_MININT32

Definition at line 125 of file audioamplify.c.

◆ MIN_gint8

#define MIN_gint8   G_MININT8

Definition at line 121 of file audioamplify.c.

Enumeration Type Documentation

◆ anonymous enum

anonymous enum
Enumerator
LAST_SIGNAL 

Definition at line 53 of file audioamplify.c.

◆ anonymous enum

anonymous enum
Enumerator
PROP_0 
PROP_AMPLIFICATION 
PROP_CLIPPING_METHOD 

Definition at line 59 of file audioamplify.c.

◆ anonymous enum

anonymous enum
Enumerator
METHOD_CLIP 
METHOD_WRAP_NEGATIVE 
METHOD_WRAP_POSITIVE 
METHOD_NOCLIP 
NUM_METHODS 

Definition at line 66 of file audioamplify.c.

Function Documentation

◆ G_DEFINE_TYPE()

G_DEFINE_TYPE ( GstAudioAmplify  ,
gst_audio_amplify  ,
GST_TYPE_AUDIO_FILTER   
)

◆ gst_audio_amplify_class_init()

static void gst_audio_amplify_class_init ( GstAudioAmplifyClass klass)
static

GstAudioAmplify:clipping-method

Clipping method: clip mode set values higher than the maximum to the maximum. The wrap-negative mode pushes those values back from the opposite side, wrap-positive pushes them back from the same side.

Definition at line 257 of file audioamplify.c.

References ALLOWED_CAPS, gst_audio_amplify_get_property(), gst_audio_amplify_set_property(), gst_audio_amplify_setup(), gst_audio_amplify_transform_ip(), GST_TYPE_AUDIO_AMPLIFY_CLIPPING_METHOD, METHOD_CLIP, PROP_AMPLIFICATION, and PROP_CLIPPING_METHOD.

◆ gst_audio_amplify_clipping_method_get_type()

static GType gst_audio_amplify_clipping_method_get_type ( void  )
static

Definition at line 77 of file audioamplify.c.

References METHOD_CLIP, METHOD_NOCLIP, METHOD_WRAP_NEGATIVE, and METHOD_WRAP_POSITIVE.

◆ gst_audio_amplify_get_property()

static void gst_audio_amplify_get_property ( GObject *  object,
guint  prop_id,
GValue *  value,
GParamSpec *  pspec 
)
static

◆ gst_audio_amplify_init()

static void gst_audio_amplify_init ( GstAudioAmplify filter)
static

◆ gst_audio_amplify_process_function()

◆ gst_audio_amplify_set_process_function()

static gboolean gst_audio_amplify_set_process_function ( GstAudioAmplify filter,
gint  clipping,
GstAudioFormat  format 
)
static

◆ gst_audio_amplify_set_property()

static void gst_audio_amplify_set_property ( GObject *  object,
guint  prop_id,
const GValue *  value,
GParamSpec *  pspec 
)
static

◆ gst_audio_amplify_setup()

static gboolean gst_audio_amplify_setup ( GstAudioFilter *  filter,
const GstAudioInfo *  info 
)
static

◆ gst_audio_amplify_transform_gdouble_clip()

static void gst_audio_amplify_transform_gdouble_clip ( GstAudioAmplify filter,
void *  data,
guint  num_samples 
)
static

Definition at line 251 of file audioamplify.c.

Referenced by gst_audio_amplify_process_function().

◆ gst_audio_amplify_transform_gdouble_noclip()

static void gst_audio_amplify_transform_gdouble_noclip ( GstAudioAmplify filter,
void *  data,
guint  num_samples 
)
static

Definition at line 251 of file audioamplify.c.

Referenced by gst_audio_amplify_process_function().

◆ gst_audio_amplify_transform_gdouble_wrap_negative()

static void gst_audio_amplify_transform_gdouble_wrap_negative ( GstAudioAmplify filter,
void *  data,
guint  num_samples 
)
static

Definition at line 251 of file audioamplify.c.

Referenced by gst_audio_amplify_process_function().

◆ gst_audio_amplify_transform_gdouble_wrap_positive()

static void gst_audio_amplify_transform_gdouble_wrap_positive ( GstAudioAmplify filter,
void *  data,
guint  num_samples 
)
static

Definition at line 251 of file audioamplify.c.

Referenced by gst_audio_amplify_process_function().

◆ gst_audio_amplify_transform_gfloat_clip()

static void gst_audio_amplify_transform_gfloat_clip ( GstAudioAmplify filter,
void *  data,
guint  num_samples 
)
static

Definition at line 250 of file audioamplify.c.

Referenced by gst_audio_amplify_process_function().

◆ gst_audio_amplify_transform_gfloat_noclip()

static void gst_audio_amplify_transform_gfloat_noclip ( GstAudioAmplify filter,
void *  data,
guint  num_samples 
)
static

Definition at line 250 of file audioamplify.c.

Referenced by gst_audio_amplify_process_function().

◆ gst_audio_amplify_transform_gfloat_wrap_negative()

static void gst_audio_amplify_transform_gfloat_wrap_negative ( GstAudioAmplify filter,
void *  data,
guint  num_samples 
)
static

Definition at line 250 of file audioamplify.c.

Referenced by gst_audio_amplify_process_function().

◆ gst_audio_amplify_transform_gfloat_wrap_positive()

static void gst_audio_amplify_transform_gfloat_wrap_positive ( GstAudioAmplify filter,
void *  data,
guint  num_samples 
)
static

Definition at line 250 of file audioamplify.c.

Referenced by gst_audio_amplify_process_function().

◆ gst_audio_amplify_transform_gint16_clip()

static void gst_audio_amplify_transform_gint16_clip ( GstAudioAmplify filter,
void *  data,
guint  num_samples 
)
static

Definition at line 248 of file audioamplify.c.

Referenced by gst_audio_amplify_process_function().

◆ gst_audio_amplify_transform_gint16_noclip()

static void gst_audio_amplify_transform_gint16_noclip ( GstAudioAmplify filter,
void *  data,
guint  num_samples 
)
static

Definition at line 248 of file audioamplify.c.

Referenced by gst_audio_amplify_process_function().

◆ gst_audio_amplify_transform_gint16_wrap_negative()

static void gst_audio_amplify_transform_gint16_wrap_negative ( GstAudioAmplify filter,
void *  data,
guint  num_samples 
)
static

Definition at line 248 of file audioamplify.c.

Referenced by gst_audio_amplify_process_function().

◆ gst_audio_amplify_transform_gint16_wrap_positive()

static void gst_audio_amplify_transform_gint16_wrap_positive ( GstAudioAmplify filter,
void *  data,
guint  num_samples 
)
static

Definition at line 248 of file audioamplify.c.

Referenced by gst_audio_amplify_process_function().

◆ gst_audio_amplify_transform_gint32_clip()

static void gst_audio_amplify_transform_gint32_clip ( GstAudioAmplify filter,
void *  data,
guint  num_samples 
)
static

Definition at line 249 of file audioamplify.c.

Referenced by gst_audio_amplify_process_function().

◆ gst_audio_amplify_transform_gint32_noclip()

static void gst_audio_amplify_transform_gint32_noclip ( GstAudioAmplify filter,
void *  data,
guint  num_samples 
)
static

Definition at line 249 of file audioamplify.c.

Referenced by gst_audio_amplify_process_function().

◆ gst_audio_amplify_transform_gint32_wrap_negative()

static void gst_audio_amplify_transform_gint32_wrap_negative ( GstAudioAmplify filter,
void *  data,
guint  num_samples 
)
static

Definition at line 249 of file audioamplify.c.

Referenced by gst_audio_amplify_process_function().

◆ gst_audio_amplify_transform_gint32_wrap_positive()

static void gst_audio_amplify_transform_gint32_wrap_positive ( GstAudioAmplify filter,
void *  data,
guint  num_samples 
)
static

Definition at line 249 of file audioamplify.c.

Referenced by gst_audio_amplify_process_function().

◆ gst_audio_amplify_transform_gint8_clip()

static void gst_audio_amplify_transform_gint8_clip ( GstAudioAmplify filter,
void *  data,
guint  num_samples 
)
static

Definition at line 247 of file audioamplify.c.

Referenced by gst_audio_amplify_process_function().

◆ gst_audio_amplify_transform_gint8_noclip()

static void gst_audio_amplify_transform_gint8_noclip ( GstAudioAmplify filter,
void *  data,
guint  num_samples 
)
static

Definition at line 247 of file audioamplify.c.

Referenced by gst_audio_amplify_process_function().

◆ gst_audio_amplify_transform_gint8_wrap_negative()

static void gst_audio_amplify_transform_gint8_wrap_negative ( GstAudioAmplify filter,
void *  data,
guint  num_samples 
)
static

Definition at line 247 of file audioamplify.c.

Referenced by gst_audio_amplify_process_function().

◆ gst_audio_amplify_transform_gint8_wrap_positive()

static void gst_audio_amplify_transform_gint8_wrap_positive ( GstAudioAmplify filter,
void *  data,
guint  num_samples 
)
static

Definition at line 247 of file audioamplify.c.

Referenced by gst_audio_amplify_process_function().

◆ gst_audio_amplify_transform_ip()

static GstFlowReturn gst_audio_amplify_transform_ip ( GstBaseTransform *  base,
GstBuffer *  buf 
)
static

Definition at line 452 of file audioamplify.c.

References GST_AUDIO_AMPLIFY, and _GstAudioAmplify::process.

Referenced by gst_audio_amplify_class_init().

◆ GST_DEBUG_CATEGORY_STATIC()

GST_DEBUG_CATEGORY_STATIC ( gst_audio_amplify_debug  )

◆ GST_ELEMENT_REGISTER_DEFINE()

GST_ELEMENT_REGISTER_DEFINE ( audioamplify  ,
"audioamplify"  ,
GST_RANK_NONE  ,
(gst_audio_amplify_get_type())   
)