diff options
author | Stefan Kost <ensonic@users.sf.net> | 2011-04-27 16:56:09 +0300 |
---|---|---|
committer | Stefan Kost <ensonic@users.sf.net> | 2011-05-18 10:31:38 +0300 |
commit | c46725845b91631b7b7bbd44765f592c3c83408b (patch) | |
tree | 8b53b8cd59b0f74c50aca865e4ec726adce41f3f /tools | |
parent | f76feeb6321d0ec205049d3543f1e7949c294f99 (diff) | |
download | gstreamer-plugins-bad-c46725845b91631b7b7bbd44765f592c3c83408b.tar.gz |
element-templates: improve the audiofilter template
Add comments. Add start/stop methods. Add (commented) instance casts at the
begin of the method. Make transform_ip returning FLOW_OK by default.
Diffstat (limited to 'tools')
-rw-r--r-- | tools/element-templates/audiofilter | 31 |
1 files changed, 30 insertions, 1 deletions
diff --git a/tools/element-templates/audiofilter b/tools/element-templates/audiofilter index cf10fc120..5e7ea376b 100644 --- a/tools/element-templates/audiofilter +++ b/tools/element-templates/audiofilter @@ -12,27 +12,56 @@ gstreamer-audio-0.10 % prototypes static gboolean gst_replace_setup (GstAudioFilter * filter, GstRingBufferSpec * format); +static gboolean +gst_replace_start (GstBaseTransform * trans); static GstFlowReturn gst_replace_transform_ip (GstBaseTransform * trans, GstBuffer * buf); +static gboolean +gst_replace_stop (GstBaseTransform * trans); % declare-class GstAudioFilterClass *audio_filter_class = GST_AUDIO_FILTER_CLASS (klass); GstBaseTransformClass *base_transform_class = GST_BASE_TRANSFORM_CLASS (klass); % set-methods audio_filter_class->setup = GST_DEBUG_FUNCPTR (gst_replace_setup); + base_transform_class->start = GST_DEBUG_FUNCPTR (gst_replace_start); base_transform_class->transform_ip = GST_DEBUG_FUNCPTR (gst_replace_transform_ip); + base_transform_class->stop = GST_DEBUG_FUNCPTR (gst_replace_stop); % methods static gboolean gst_replace_setup (GstAudioFilter * filter, GstRingBufferSpec * format) { + /* 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 */ return TRUE; } static GstFlowReturn gst_replace_transform_ip (GstBaseTransform * trans, GstBuffer * buf) { + /* GstReplace *replace = GST_REPLACE (trans); */ + + /* process the audio data in the buffer in-place */ + return GST_FLOW_OK; +} - return GST_FLOW_ERROR; +static gboolean +gst_replace_stop (GstBaseTransform * trans) +{ + /* GstReplace *replace = GST_REPLACE (trans); */ + + /* finalize processing */ + return TRUE; } % end |