summaryrefslogtreecommitdiff
path: root/tools/element-templates/audiofilter
blob: 5e7ea376bff15a5375b6d0dc5ff741728f9ab922 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
/* vim: set filetype=c: */
% ClassName
GstAudioFilter
% TYPE_CLASS_NAME
GST_TYPE_AUDIO_FILTER
% pads
sinkpad-simple srcpad-simple
% pkg-config
gstreamer-audio-0.10
% includes
#include <gst/audio/gstaudiofilter.h>
% 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;
}

static gboolean
gst_replace_stop (GstBaseTransform * trans)
{
  /* GstReplace *replace = GST_REPLACE (trans); */

  /* finalize processing */
  return TRUE;
}

% end