gstaudiofilter — Base class for simple audio filters


#include <gst/audio/gstaudiofilter.h>

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

Object Hierarchy



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 class_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 (


struct GstAudioFilter

struct GstAudioFilter;

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

struct GstAudioFilterClass

struct GstAudioFilterClass {
  GstBaseTransformClass basetransformclass;

  /* virtual function, called whenever the format changes */
  gboolean  (*setup) (GstAudioFilter * filter, const GstAudioInfo * info);

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

gst_audio_filter_class_add_pad_templates ()

void                gst_audio_filter_class_add_pad_templates
                                                        (GstAudioFilterClass *klass,
                                                         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 class_init function.

klass :

an GstAudioFilterClass

allowed_caps :

what formats the filter can handle, as GstCaps