summaryrefslogtreecommitdiff
path: root/tools/element-templates/audioencoder
blob: 82ff16aff04acb4eb030185fa9b0567150498567 (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
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
/* vim: set filetype=c: */
% ClassName
GstAudioEncoder
% TYPE_CLASS_NAME
GST_TYPE_AUDIO_ENCODER
% pads
srcpad-simple
sinkpad-audio
% pkg-config
gstreamer-audio-1.0
% includes
#include <gst/audio/gstaudioencoder.h>
% prototypes
static gboolean gst_replace_start (GstAudioEncoder * encoder);
static gboolean gst_replace_stop (GstAudioEncoder * encoder);
static gboolean gst_replace_set_format (GstAudioEncoder * encoder,
    GstAudioInfo * info);
static GstFlowReturn gst_replace_handle_frame (GstAudioEncoder * encoder,
    GstBuffer * buffer);
static void gst_replace_flush (GstAudioEncoder * encoder);
static GstFlowReturn gst_replace_pre_push (GstAudioEncoder * encoder,
    GstBuffer ** buffer);
static gboolean gst_replace_sink_event (GstAudioEncoder * encoder,
    GstEvent * event);
static gboolean gst_replace_src_event (GstAudioEncoder * encoder, GstEvent * event);
static GstCaps *gst_replace_getcaps (GstAudioEncoder * encoder, GstCaps * filter);
static gboolean gst_replace_open (GstAudioEncoder * encoder);
static gboolean gst_replace_close (GstAudioEncoder * encoder);
static gboolean gst_replace_negotiate (GstAudioEncoder * encoder);
static gboolean gst_replace_decide_allocation (GstAudioEncoder * encoder,
    GstQuery * query);
static gboolean gst_replace_propose_allocation (GstAudioEncoder * encoder,
    GstQuery * query);
% declare-class
  GstAudioEncoderClass *audio_encoder_class = GST_AUDIO_ENCODER_CLASS (klass);
% set-methods
  audio_encoder_class->start = GST_DEBUG_FUNCPTR (gst_replace_start);
  audio_encoder_class->stop = GST_DEBUG_FUNCPTR (gst_replace_stop);
  audio_encoder_class->set_format = GST_DEBUG_FUNCPTR (gst_replace_set_format);
  audio_encoder_class->handle_frame = GST_DEBUG_FUNCPTR (gst_replace_handle_frame);
  audio_encoder_class->flush = GST_DEBUG_FUNCPTR (gst_replace_flush);
  audio_encoder_class->pre_push = GST_DEBUG_FUNCPTR (gst_replace_pre_push);
  audio_encoder_class->sink_event = GST_DEBUG_FUNCPTR (gst_replace_sink_event);
  audio_encoder_class->src_event = GST_DEBUG_FUNCPTR (gst_replace_src_event);
  audio_encoder_class->getcaps = GST_DEBUG_FUNCPTR (gst_replace_getcaps);
  audio_encoder_class->open = GST_DEBUG_FUNCPTR (gst_replace_open);
  audio_encoder_class->close = GST_DEBUG_FUNCPTR (gst_replace_close);
  audio_encoder_class->negotiate = GST_DEBUG_FUNCPTR (gst_replace_negotiate);
  audio_encoder_class->decide_allocation = GST_DEBUG_FUNCPTR (gst_replace_decide_allocation);
  audio_encoder_class->propose_allocation = GST_DEBUG_FUNCPTR (gst_replace_propose_allocation);
% methods
static gboolean
gst_replace_start (GstAudioEncoder * encoder)
{
  GstReplace *replace = GST_REPLACE (encoder);

  GST_DEBUG_OBJECT (replace, "start");

  return TRUE;
}

static gboolean
gst_replace_stop (GstAudioEncoder * encoder)
{
  GstReplace *replace = GST_REPLACE (encoder);

  GST_DEBUG_OBJECT (replace, "stop");

  return TRUE;
}

static gboolean
gst_replace_set_format (GstAudioEncoder * encoder, GstAudioInfo * info)
{
  GstReplace *replace = GST_REPLACE (encoder);

  GST_DEBUG_OBJECT (replace, "set_format");

  return TRUE;
}

static GstFlowReturn
gst_replace_handle_frame (GstAudioEncoder * encoder, GstBuffer * buffer)
{
  GstReplace *replace = GST_REPLACE (encoder);

  GST_DEBUG_OBJECT (replace, "handle_frame");

  return GST_FLOW_OK;
}

static void
gst_replace_flush (GstAudioEncoder * encoder)
{
  GstReplace *replace = GST_REPLACE (encoder);

  GST_DEBUG_OBJECT (replace, "flush");

}

static GstFlowReturn
gst_replace_pre_push (GstAudioEncoder * encoder, GstBuffer ** buffer)
{
  GstReplace *replace = GST_REPLACE (encoder);

  GST_DEBUG_OBJECT (replace, "pre_push");

  return GST_FLOW_OK;
}

static gboolean
gst_replace_sink_event (GstAudioEncoder * encoder, GstEvent * event)
{
  GstReplace *replace = GST_REPLACE (encoder);

  GST_DEBUG_OBJECT (replace, "sink_event");

  return TRUE;
}

static gboolean
gst_replace_src_event (GstAudioEncoder * encoder, GstEvent * event)
{
  GstReplace *replace = GST_REPLACE (encoder);

  GST_DEBUG_OBJECT (replace, "src_event");

  return TRUE;
}

static GstCaps *
gst_replace_getcaps (GstAudioEncoder * encoder, GstCaps * filter)
{
  GstReplace *replace = GST_REPLACE (encoder);

  GST_DEBUG_OBJECT (replace, "getcaps");

  return NULL;
}

static gboolean
gst_replace_open (GstAudioEncoder * encoder)
{
  GstReplace *replace = GST_REPLACE (encoder);

  GST_DEBUG_OBJECT (replace, "open");

  return TRUE;
}

static gboolean
gst_replace_close (GstAudioEncoder * encoder)
{
  GstReplace *replace = GST_REPLACE (encoder);

  GST_DEBUG_OBJECT (replace, "close");

  return TRUE;
}

static gboolean
gst_replace_negotiate (GstAudioEncoder * encoder)
{
  GstReplace *replace = GST_REPLACE (encoder);

  GST_DEBUG_OBJECT (replace, "negotiate");

  return TRUE;
}

static gboolean
gst_replace_decide_allocation (GstAudioEncoder * encoder, GstQuery * query)
{
  GstReplace *replace = GST_REPLACE (encoder);

  GST_DEBUG_OBJECT (replace, "decide_allocation");

  return TRUE;
}

static gboolean
gst_replace_propose_allocation (GstAudioEncoder * encoder, GstQuery * query)
{
  GstReplace *replace = GST_REPLACE (encoder);

  GST_DEBUG_OBJECT (replace, "propose_allocation");

  return TRUE;
}
% end