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)  

audiofxbasefirfilter.c File Reference
#include <string.h>
#include <math.h>
#include <gst/gst.h>
#include <gst/audio/gstaudiofilter.h>
#include "audiofxbasefirfilter.h"
Include dependency graph for audiofxbasefirfilter.c:

Go to the source code of this file.

Macros

#define GST_CAT_DEFAULT   gst_audio_fx_base_fir_filter_debug
 
#define ALLOWED_CAPS
 
#define FFT_THRESHOLD   32
 
#define DEFAULT_LOW_LATENCY   FALSE
 
#define DEFAULT_DRAIN_ON_CHANGES   TRUE
 
#define gst_audio_fx_base_fir_filter_parent_class   parent_class
 
#define DEFINE_PROCESS_FUNC(width, ctype)
 
#define DEFINE_PROCESS_FUNC_FIXED_CHANNELS(width, channels, ctype)
 
#define TIME_DOMAIN_CONVOLUTION_BODY(channels)
 
#define DEFINE_FFT_PROCESS_FUNC(width, ctype)
 
#define DEFINE_FFT_PROCESS_FUNC_FIXED_CHANNELS(width, channels, ctype)
 
#define FFT_CONVOLUTION_BODY(channels)
 

Enumerations

enum  { PROP_0 = 0 , PROP_LOW_LATENCY , PROP_DRAIN_ON_CHANGES }
 

Functions

 GST_DEBUG_CATEGORY_STATIC (gst_audio_fx_base_fir_filter_debug)
 
 G_DEFINE_TYPE (GstAudioFXBaseFIRFilter, gst_audio_fx_base_fir_filter, GST_TYPE_AUDIO_FILTER)
 
static GstFlowReturn gst_audio_fx_base_fir_filter_transform (GstBaseTransform *base, GstBuffer *inbuf, GstBuffer *outbuf)
 
static gboolean gst_audio_fx_base_fir_filter_start (GstBaseTransform *base)
 
static gboolean gst_audio_fx_base_fir_filter_stop (GstBaseTransform *base)
 
static gboolean gst_audio_fx_base_fir_filter_sink_event (GstBaseTransform *base, GstEvent *event)
 
static gboolean gst_audio_fx_base_fir_filter_transform_size (GstBaseTransform *base, GstPadDirection direction, GstCaps *caps, gsize size, GstCaps *othercaps, gsize *othersize)
 
static gboolean gst_audio_fx_base_fir_filter_setup (GstAudioFilter *base, const GstAudioInfo *info)
 
static gboolean gst_audio_fx_base_fir_filter_query (GstBaseTransform *trans, GstPadDirection direction, GstQuery *quer)
 
static guint process_32 (GstAudioFXBaseFIRFilter *self, const gfloat *src, gfloat *dst, guint input_samples)
 
static guint process_64 (GstAudioFXBaseFIRFilter *self, const gdouble *src, gdouble *dst, guint input_samples)
 
static guint process_1_32 (GstAudioFXBaseFIRFilter *self, const gfloat *src, gfloat *dst, guint input_samples)
 
static guint process_1_64 (GstAudioFXBaseFIRFilter *self, const gdouble *src, gdouble *dst, guint input_samples)
 
static guint process_2_32 (GstAudioFXBaseFIRFilter *self, const gfloat *src, gfloat *dst, guint input_samples)
 
static guint process_2_64 (GstAudioFXBaseFIRFilter *self, const gdouble *src, gdouble *dst, guint input_samples)
 
static guint process_fft_32 (GstAudioFXBaseFIRFilter *self, const gfloat *src, gfloat *dst, guint input_samples)
 
static guint process_fft_64 (GstAudioFXBaseFIRFilter *self, const gdouble *src, gdouble *dst, guint input_samples)
 
static guint process_fft_1_32 (GstAudioFXBaseFIRFilter *self, const gfloat *src, gfloat *dst, guint input_samples)
 
static guint process_fft_1_64 (GstAudioFXBaseFIRFilter *self, const gdouble *src, gdouble *dst, guint input_samples)
 
static guint process_fft_2_32 (GstAudioFXBaseFIRFilter *self, const gfloat *src, gfloat *dst, guint input_samples)
 
static guint process_fft_2_64 (GstAudioFXBaseFIRFilter *self, const gdouble *src, gdouble *dst, guint input_samples)
 
static void gst_audio_fx_base_fir_filter_calculate_frequency_response (GstAudioFXBaseFIRFilter *self)
 
static void gst_audio_fx_base_fir_filter_select_process_function (GstAudioFXBaseFIRFilter *self, GstAudioFormat format, gint channels)
 
static void gst_audio_fx_base_fir_filter_finalize (GObject *object)
 
static void gst_audio_fx_base_fir_filter_set_property (GObject *object, guint prop_id, const GValue *value, GParamSpec *pspec)
 
static void gst_audio_fx_base_fir_filter_get_property (GObject *object, guint prop_id, GValue *value, GParamSpec *pspec)
 
static void gst_audio_fx_base_fir_filter_class_init (GstAudioFXBaseFIRFilterClass *klass)
 
static void gst_audio_fx_base_fir_filter_init (GstAudioFXBaseFIRFilter *self)
 
void gst_audio_fx_base_fir_filter_push_residue (GstAudioFXBaseFIRFilter *self)
 
void gst_audio_fx_base_fir_filter_set_kernel (GstAudioFXBaseFIRFilter *self, gdouble *kernel, guint kernel_length, guint64 latency, const GstAudioInfo *info)
 

Macro Definition Documentation

◆ ALLOWED_CAPS

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

Definition at line 39 of file audiofxbasefirfilter.c.

◆ DEFAULT_DRAIN_ON_CHANGES

#define DEFAULT_DRAIN_ON_CHANGES   TRUE

Definition at line 57 of file audiofxbasefirfilter.c.

◆ DEFAULT_LOW_LATENCY

#define DEFAULT_LOW_LATENCY   FALSE

Definition at line 56 of file audiofxbasefirfilter.c.

◆ DEFINE_FFT_PROCESS_FUNC

#define DEFINE_FFT_PROCESS_FUNC (   width,
  ctype 
)
Value:
static guint \
process_fft_##width (GstAudioFXBaseFIRFilter * self, const g##ctype * src, \
g##ctype * dst, guint input_samples) \
{ \
gint channels = GST_AUDIO_FILTER_CHANNELS (self); \
FFT_CONVOLUTION_BODY (channels); \
}

Definition at line 226 of file audiofxbasefirfilter.c.

◆ DEFINE_FFT_PROCESS_FUNC_FIXED_CHANNELS

#define DEFINE_FFT_PROCESS_FUNC_FIXED_CHANNELS (   width,
  channels,
  ctype 
)
Value:
static guint \
process_fft_##channels##_##width (GstAudioFXBaseFIRFilter * self, const g##ctype * src, \
g##ctype * dst, guint input_samples) \
{ \
FFT_CONVOLUTION_BODY (channels); \
}
#define _(String)

Definition at line 235 of file audiofxbasefirfilter.c.

◆ DEFINE_PROCESS_FUNC

#define DEFINE_PROCESS_FUNC (   width,
  ctype 
)
Value:
static guint \
process_##width (GstAudioFXBaseFIRFilter * self, const g##ctype * src, g##ctype * dst, guint input_samples) \
{ \
gint channels = GST_AUDIO_FILTER_CHANNELS (self); \
TIME_DOMAIN_CONVOLUTION_BODY (channels); \
}

Definition at line 90 of file audiofxbasefirfilter.c.

◆ DEFINE_PROCESS_FUNC_FIXED_CHANNELS

#define DEFINE_PROCESS_FUNC_FIXED_CHANNELS (   width,
  channels,
  ctype 
)
Value:
static guint \
process_##channels##_##width (GstAudioFXBaseFIRFilter * self, const g##ctype * src, g##ctype * dst, guint input_samples) \
{ \
TIME_DOMAIN_CONVOLUTION_BODY (channels); \
}

Definition at line 98 of file audiofxbasefirfilter.c.

◆ FFT_CONVOLUTION_BODY

#define FFT_CONVOLUTION_BODY (   channels)

Definition at line 243 of file audiofxbasefirfilter.c.

◆ FFT_THRESHOLD

#define FFT_THRESHOLD   32

Definition at line 47 of file audiofxbasefirfilter.c.

◆ gst_audio_fx_base_fir_filter_parent_class

#define gst_audio_fx_base_fir_filter_parent_class   parent_class

Definition at line 59 of file audiofxbasefirfilter.c.

◆ GST_CAT_DEFAULT

#define GST_CAT_DEFAULT   gst_audio_fx_base_fir_filter_debug

Definition at line 36 of file audiofxbasefirfilter.c.

◆ TIME_DOMAIN_CONVOLUTION_BODY

#define TIME_DOMAIN_CONVOLUTION_BODY (   channels)

Definition at line 105 of file audiofxbasefirfilter.c.

Enumeration Type Documentation

◆ anonymous enum

anonymous enum
Enumerator
PROP_0 
PROP_LOW_LATENCY 
PROP_DRAIN_ON_CHANGES 

Definition at line 49 of file audiofxbasefirfilter.c.

Function Documentation

◆ G_DEFINE_TYPE()

G_DEFINE_TYPE ( GstAudioFXBaseFIRFilter  ,
gst_audio_fx_base_fir_filter  ,
GST_TYPE_AUDIO_FILTER   
)

◆ gst_audio_fx_base_fir_filter_calculate_frequency_response()

static void gst_audio_fx_base_fir_filter_calculate_frequency_response ( GstAudioFXBaseFIRFilter self)
static

Definition at line 358 of file audiofxbasefirfilter.c.

◆ gst_audio_fx_base_fir_filter_class_init()

static void gst_audio_fx_base_fir_filter_class_init ( GstAudioFXBaseFIRFilterClass klass)
static

GstAudioFXBaseFIRFilter:low-latency:

Work in low-latency mode. This mode is much slower for large filter sizes but the latency is always only the pre-latency of the filter.

GstAudioFXBaseFIRFilter:drain-on-changes:

Whether the filter should be drained when its coefficients change

Note: Currently this only works if the kernel size is not changed! Support for drainless kernel size changes will be added in the future.

Definition at line 522 of file audiofxbasefirfilter.c.

◆ gst_audio_fx_base_fir_filter_finalize()

static void gst_audio_fx_base_fir_filter_finalize ( GObject *  object)
static

Definition at line 446 of file audiofxbasefirfilter.c.

◆ gst_audio_fx_base_fir_filter_get_property()

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

Definition at line 503 of file audiofxbasefirfilter.c.

◆ gst_audio_fx_base_fir_filter_init()

static void gst_audio_fx_base_fir_filter_init ( GstAudioFXBaseFIRFilter self)
static

Definition at line 583 of file audiofxbasefirfilter.c.

◆ gst_audio_fx_base_fir_filter_push_residue()

void gst_audio_fx_base_fir_filter_push_residue ( GstAudioFXBaseFIRFilter self)

◆ gst_audio_fx_base_fir_filter_query()

static gboolean gst_audio_fx_base_fir_filter_query ( GstBaseTransform *  trans,
GstPadDirection  direction,
GstQuery *  quer 
)
static

Definition at line 942 of file audiofxbasefirfilter.c.

◆ gst_audio_fx_base_fir_filter_select_process_function()

static void gst_audio_fx_base_fir_filter_select_process_function ( GstAudioFXBaseFIRFilter self,
GstAudioFormat  format,
gint  channels 
)
static

◆ gst_audio_fx_base_fir_filter_set_kernel()

void gst_audio_fx_base_fir_filter_set_kernel ( GstAudioFXBaseFIRFilter self,
gdouble *  kernel,
guint  kernel_length,
guint64  latency,
const GstAudioInfo *  info 
)

◆ gst_audio_fx_base_fir_filter_set_property()

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

Definition at line 462 of file audiofxbasefirfilter.c.

◆ gst_audio_fx_base_fir_filter_setup()

static gboolean gst_audio_fx_base_fir_filter_setup ( GstAudioFilter *  base,
const GstAudioInfo *  info 
)
static

Definition at line 723 of file audiofxbasefirfilter.c.

◆ gst_audio_fx_base_fir_filter_sink_event()

static gboolean gst_audio_fx_base_fir_filter_sink_event ( GstBaseTransform *  base,
GstEvent *  event 
)
static

Definition at line 999 of file audiofxbasefirfilter.c.

◆ gst_audio_fx_base_fir_filter_start()

static gboolean gst_audio_fx_base_fir_filter_start ( GstBaseTransform *  base)
static

Definition at line 914 of file audiofxbasefirfilter.c.

References _GstAudioFXBaseFIRFilter::lock.

◆ gst_audio_fx_base_fir_filter_stop()

static gboolean gst_audio_fx_base_fir_filter_stop ( GstBaseTransform *  base)
static

Definition at line 930 of file audiofxbasefirfilter.c.

◆ gst_audio_fx_base_fir_filter_transform()

static GstFlowReturn gst_audio_fx_base_fir_filter_transform ( GstBaseTransform *  base,
GstBuffer *  inbuf,
GstBuffer *  outbuf 
)
static

Definition at line 779 of file audiofxbasefirfilter.c.

◆ gst_audio_fx_base_fir_filter_transform_size()

static gboolean gst_audio_fx_base_fir_filter_transform_size ( GstBaseTransform *  base,
GstPadDirection  direction,
GstCaps *  caps,
gsize  size,
GstCaps *  othercaps,
gsize *  othersize 
)
static

Definition at line 751 of file audiofxbasefirfilter.c.

◆ GST_DEBUG_CATEGORY_STATIC()

GST_DEBUG_CATEGORY_STATIC ( gst_audio_fx_base_fir_filter_debug  )

◆ process_1_32()

static guint process_1_32 ( GstAudioFXBaseFIRFilter self,
const gfloat *  src,
gfloat *  dst,
guint  input_samples 
)
static

Definition at line 163 of file audiofxbasefirfilter.c.

◆ process_1_64()

static guint process_1_64 ( GstAudioFXBaseFIRFilter self,
const gdouble *  src,
gdouble *  dst,
guint  input_samples 
)
static

Definition at line 164 of file audiofxbasefirfilter.c.

◆ process_2_32()

static guint process_2_32 ( GstAudioFXBaseFIRFilter self,
const gfloat *  src,
gfloat *  dst,
guint  input_samples 
)
static

Definition at line 166 of file audiofxbasefirfilter.c.

◆ process_2_64()

static guint process_2_64 ( GstAudioFXBaseFIRFilter self,
const gdouble *  src,
gdouble *  dst,
guint  input_samples 
)
static

Definition at line 167 of file audiofxbasefirfilter.c.

◆ process_32()

static guint process_32 ( GstAudioFXBaseFIRFilter self,
const gfloat *  src,
gfloat *  dst,
guint  input_samples 
)
static

Definition at line 160 of file audiofxbasefirfilter.c.

◆ process_64()

static guint process_64 ( GstAudioFXBaseFIRFilter self,
const gdouble *  src,
gdouble *  dst,
guint  input_samples 
)
static

Definition at line 161 of file audiofxbasefirfilter.c.

◆ process_fft_1_32()

static guint process_fft_1_32 ( GstAudioFXBaseFIRFilter self,
const gfloat *  src,
gfloat *  dst,
guint  input_samples 
)
static

Definition at line 346 of file audiofxbasefirfilter.c.

◆ process_fft_1_64()

static guint process_fft_1_64 ( GstAudioFXBaseFIRFilter self,
const gdouble *  src,
gdouble *  dst,
guint  input_samples 
)
static

Definition at line 347 of file audiofxbasefirfilter.c.

◆ process_fft_2_32()

static guint process_fft_2_32 ( GstAudioFXBaseFIRFilter self,
const gfloat *  src,
gfloat *  dst,
guint  input_samples 
)
static

Definition at line 349 of file audiofxbasefirfilter.c.

◆ process_fft_2_64()

static guint process_fft_2_64 ( GstAudioFXBaseFIRFilter self,
const gdouble *  src,
gdouble *  dst,
guint  input_samples 
)
static

Definition at line 350 of file audiofxbasefirfilter.c.

◆ process_fft_32()

static guint process_fft_32 ( GstAudioFXBaseFIRFilter self,
const gfloat *  src,
gfloat *  dst,
guint  input_samples 
)
static

Definition at line 343 of file audiofxbasefirfilter.c.

◆ process_fft_64()

static guint process_fft_64 ( GstAudioFXBaseFIRFilter self,
const gdouble *  src,
gdouble *  dst,
guint  input_samples 
)
static

Definition at line 344 of file audiofxbasefirfilter.c.