/* gstreamermm - a C++ wrapper for gstreamer
 *
 * Copyright 2008 The gstreamermm Development Team
 *
 * This library is free software; you can redistribute it and/or
 * modify it under the terms of the GNU Lesser General Public
 * License as published by the Free Software Foundation; either
 * version 2.1 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
 * Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public
 * License along with this library; if not, write to the Free
 * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
 */

#include <gstreamermm/basetransform.h>
#include <gstreamermm/audioringbuffer.h>
#include <gstreamermm/audioinfo.h>

_DEFS(gstreamermm,gst)

namespace Gst
{

/** A base class for simple audio filters.
 * Gst::AudioFilter is a Gst::BaseTransform-derived base class for simple
 * audio filters, ie. those that output the same format that they get as input.
 *
 * Gst::AudioFilter will parse the input format for you (with error
 * checking) before calling your setup function. Also, elements deriving from
 * Gst::AudioFilter 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 Gst::AudioFilter::setup_vfunc() and
 * Gst::BaseTransform::transform_ip_vfunc() and/or
 * Gst::BaseTransform::transform_vfunc() virtual functions.
 *
 * @ingroup GstBaseClasses
 */
class AudioFilter : public Gst::BaseTransform
{
  _CLASS_GOBJECT(AudioFilter, GstAudioFilter, GST_AUDIO_FILTER, Gst::BaseTransform, GstBaseTransform)

public:
  /** Virtual function, called whenever the format changes.
   */
  virtual bool setup_vfunc(Gst::AudioInfo& info);

protected:
#m4begin
  _PUSH(SECTION_PCC_CLASS_INIT_VFUNCS)
  klass->setup = &setup_vfunc_callback;
  _SECTION(SECTION_PH_VFUNCS)
  static gboolean setup_vfunc_callback(GstAudioFilter* self, const GstAudioInfo* info);
  _POP()
#m4end
};

} // namespace Gst
