2010-12-15 20:45:38 +00:00
|
|
|
/* vim: set filetype=c: */
|
2010-04-14 23:32:34 +00:00
|
|
|
% ClassName
|
|
|
|
GstAudioFilter
|
|
|
|
% TYPE_CLASS_NAME
|
|
|
|
GST_TYPE_AUDIO_FILTER
|
2010-12-15 03:03:09 +00:00
|
|
|
% pads
|
|
|
|
sinkpad-simple srcpad-simple
|
2010-04-14 23:32:34 +00:00
|
|
|
% pkg-config
|
|
|
|
gstreamer-audio-0.10
|
|
|
|
% includes
|
|
|
|
#include <gst/audio/gstaudiofilter.h>
|
|
|
|
% prototypes
|
|
|
|
static gboolean
|
|
|
|
gst_replace_setup (GstAudioFilter * filter, GstRingBufferSpec * format);
|
2011-04-27 13:56:09 +00:00
|
|
|
static gboolean
|
|
|
|
gst_replace_start (GstBaseTransform * trans);
|
2011-04-26 11:10:05 +00:00
|
|
|
static GstFlowReturn
|
|
|
|
gst_replace_transform_ip (GstBaseTransform * trans, GstBuffer * buf);
|
2011-04-27 13:56:09 +00:00
|
|
|
static gboolean
|
|
|
|
gst_replace_stop (GstBaseTransform * trans);
|
2010-04-14 23:32:34 +00:00
|
|
|
% declare-class
|
2011-04-26 11:10:05 +00:00
|
|
|
GstAudioFilterClass *audio_filter_class = GST_AUDIO_FILTER_CLASS (klass);
|
|
|
|
GstBaseTransformClass *base_transform_class = GST_BASE_TRANSFORM_CLASS (klass);
|
2010-04-14 23:32:34 +00:00
|
|
|
% set-methods
|
2011-04-26 11:10:05 +00:00
|
|
|
audio_filter_class->setup = GST_DEBUG_FUNCPTR (gst_replace_setup);
|
2011-04-27 13:56:09 +00:00
|
|
|
base_transform_class->start = GST_DEBUG_FUNCPTR (gst_replace_start);
|
2011-04-26 11:10:05 +00:00
|
|
|
base_transform_class->transform_ip = GST_DEBUG_FUNCPTR (gst_replace_transform_ip);
|
2011-04-27 13:56:09 +00:00
|
|
|
base_transform_class->stop = GST_DEBUG_FUNCPTR (gst_replace_stop);
|
2010-04-14 23:32:34 +00:00
|
|
|
% methods
|
|
|
|
|
|
|
|
static gboolean
|
|
|
|
gst_replace_setup (GstAudioFilter * filter, GstRingBufferSpec * format)
|
2011-04-26 11:10:05 +00:00
|
|
|
{
|
2011-04-27 13:56:09 +00:00
|
|
|
/* GstReplace *replace = GST_REPLACE (filter); */
|
|
|
|
|
|
|
|
/* handle audio format changes */
|
|
|
|
return TRUE;
|
|
|
|
}
|
|
|
|
|
|
|
|
static gboolean
|
|
|
|
gst_replace_start (GstBaseTransform * trans)
|
|
|
|
{
|
|
|
|
/* GstReplace *replace = GST_REPLACE (trans); */
|
|
|
|
|
|
|
|
/* initialize processing */
|
2011-04-26 11:10:05 +00:00
|
|
|
return TRUE;
|
|
|
|
}
|
|
|
|
|
|
|
|
static GstFlowReturn
|
|
|
|
gst_replace_transform_ip (GstBaseTransform * trans, GstBuffer * buf)
|
2010-04-14 23:32:34 +00:00
|
|
|
{
|
2011-04-27 13:56:09 +00:00
|
|
|
/* GstReplace *replace = GST_REPLACE (trans); */
|
|
|
|
|
|
|
|
/* process the audio data in the buffer in-place */
|
|
|
|
return GST_FLOW_OK;
|
|
|
|
}
|
2010-04-14 23:32:34 +00:00
|
|
|
|
2011-04-27 13:56:09 +00:00
|
|
|
static gboolean
|
|
|
|
gst_replace_stop (GstBaseTransform * trans)
|
|
|
|
{
|
|
|
|
/* GstReplace *replace = GST_REPLACE (trans); */
|
|
|
|
|
|
|
|
/* finalize processing */
|
|
|
|
return TRUE;
|
2010-04-14 23:32:34 +00:00
|
|
|
}
|
2011-04-26 11:10:05 +00:00
|
|
|
|
2010-04-14 23:32:34 +00:00
|
|
|
% end
|