## gstaudiofilter gstaudiofilter — Base class for simple audio filters |

## Synopsis

    #include <gst/audio/gstaudiofilter.h>

                        GstAudioFilter;
                        GstAudioFilterClass;
    void                gst_audio_filter_class_add_pad_templates
                                                            (GstAudioFilterClass *klass,
                                                             const GstCaps *allowed_caps);

## Object Hierarchy

      GObject
       +----GstObject
             +----GstElement
                   +----GstBaseTransform
                         +----GstAudioFilter

## Description

GstAudioFilter is a GstBaseTransform-derived base class for simple audio filters, ie. those that output the same format that they get as input.

GstAudioFilter will parse the input format for you (with error checking) before calling your setup function. Also, elements deriving from GstAudioFilter may use `gst_audio_filter_class_add_pad_templates()` from their base_init function to easily configure the set of caps/formats that the element is able to handle.

Derived classes should override the GstAudioFilterClass.`setup()` and GstBaseTransformClass.`transform_ip()` and/or GstBaseTransformClass.`transform()` virtual functions in their class_init function.

Last reviewed on 2007-02-03 (0.10.11.1)

## Details

### GstAudioFilter

    typedef struct _GstAudioFilter GstAudioFilter;

Base class for audio filters with the same format for input and output.

Since 0.10.12

### GstAudioFilterClass

    typedef struct {
      GstBaseTransformClass basetransformclass;

      /* virtual function, called whenever the format changes */
      gboolean  (*setup) (GstAudioFilter * filter, GstRingBufferSpec * format);
    } GstAudioFilterClass;

In addition to the `setup` virtual function, you should also override the GstBaseTransform::transform and/or GstBaseTransform::transform_ip virtual function.

GstBaseTransformClass `basetransformclass`; | parent class
`setup` () | virtual function called whenever the format changes

Since 0.10.12

### gst_audio_filter_class_add_pad_templates ()

    void                gst_audio_filter_class_add_pad_templates
                                                            (GstAudioFilterClass *klass,
                                                             const GstCaps *allowed_caps);

Convenience function to add pad templates to this element class, with `allowed_caps` as the caps that can be handled.

This function is usually used from within a GObject base_init function.

`klass` : | an GstAudioFilterClass
`allowed_caps` : | what formats the filter can handle, as GstCaps

Since 0.10.12