• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1/* vim: set filetype=c: */
2% ClassName
3GstAudioEncoder
4% TYPE_CLASS_NAME
5GST_TYPE_AUDIO_ENCODER
6% pads
7srcpad-simple
8sinkpad-audio
9% pkg-config
10gstreamer-audio-1.0
11% includes
12#include <gst/audio/gstaudioencoder.h>
13% prototypes
14static gboolean gst_replace_start (GstAudioEncoder * encoder);
15static gboolean gst_replace_stop (GstAudioEncoder * encoder);
16static gboolean gst_replace_set_format (GstAudioEncoder * encoder,
17    GstAudioInfo * info);
18static GstFlowReturn gst_replace_handle_frame (GstAudioEncoder * encoder,
19    GstBuffer * buffer);
20static void gst_replace_flush (GstAudioEncoder * encoder);
21static GstFlowReturn gst_replace_pre_push (GstAudioEncoder * encoder,
22    GstBuffer ** buffer);
23static gboolean gst_replace_sink_event (GstAudioEncoder * encoder,
24    GstEvent * event);
25static gboolean gst_replace_src_event (GstAudioEncoder * encoder, GstEvent * event);
26static GstCaps *gst_replace_getcaps (GstAudioEncoder * encoder, GstCaps * filter);
27static gboolean gst_replace_open (GstAudioEncoder * encoder);
28static gboolean gst_replace_close (GstAudioEncoder * encoder);
29static gboolean gst_replace_negotiate (GstAudioEncoder * encoder);
30static gboolean gst_replace_decide_allocation (GstAudioEncoder * encoder,
31    GstQuery * query);
32static gboolean gst_replace_propose_allocation (GstAudioEncoder * encoder,
33    GstQuery * query);
34% declare-class
35  GstAudioEncoderClass *audio_encoder_class = GST_AUDIO_ENCODER_CLASS (klass);
36% set-methods
37  audio_encoder_class->start = GST_DEBUG_FUNCPTR (gst_replace_start);
38  audio_encoder_class->stop = GST_DEBUG_FUNCPTR (gst_replace_stop);
39  audio_encoder_class->set_format = GST_DEBUG_FUNCPTR (gst_replace_set_format);
40  audio_encoder_class->handle_frame = GST_DEBUG_FUNCPTR (gst_replace_handle_frame);
41  audio_encoder_class->flush = GST_DEBUG_FUNCPTR (gst_replace_flush);
42  audio_encoder_class->pre_push = GST_DEBUG_FUNCPTR (gst_replace_pre_push);
43  audio_encoder_class->sink_event = GST_DEBUG_FUNCPTR (gst_replace_sink_event);
44  audio_encoder_class->src_event = GST_DEBUG_FUNCPTR (gst_replace_src_event);
45  audio_encoder_class->getcaps = GST_DEBUG_FUNCPTR (gst_replace_getcaps);
46  audio_encoder_class->open = GST_DEBUG_FUNCPTR (gst_replace_open);
47  audio_encoder_class->close = GST_DEBUG_FUNCPTR (gst_replace_close);
48  audio_encoder_class->negotiate = GST_DEBUG_FUNCPTR (gst_replace_negotiate);
49  audio_encoder_class->decide_allocation = GST_DEBUG_FUNCPTR (gst_replace_decide_allocation);
50  audio_encoder_class->propose_allocation = GST_DEBUG_FUNCPTR (gst_replace_propose_allocation);
51% methods
52static gboolean
53gst_replace_start (GstAudioEncoder * encoder)
54{
55  GstReplace *replace = GST_REPLACE (encoder);
56
57  GST_DEBUG_OBJECT (replace, "start");
58
59  return TRUE;
60}
61
62static gboolean
63gst_replace_stop (GstAudioEncoder * encoder)
64{
65  GstReplace *replace = GST_REPLACE (encoder);
66
67  GST_DEBUG_OBJECT (replace, "stop");
68
69  return TRUE;
70}
71
72static gboolean
73gst_replace_set_format (GstAudioEncoder * encoder, GstAudioInfo * info)
74{
75  GstReplace *replace = GST_REPLACE (encoder);
76
77  GST_DEBUG_OBJECT (replace, "set_format");
78
79  return TRUE;
80}
81
82static GstFlowReturn
83gst_replace_handle_frame (GstAudioEncoder * encoder, GstBuffer * buffer)
84{
85  GstReplace *replace = GST_REPLACE (encoder);
86
87  GST_DEBUG_OBJECT (replace, "handle_frame");
88
89  return GST_FLOW_OK;
90}
91
92static void
93gst_replace_flush (GstAudioEncoder * encoder)
94{
95  GstReplace *replace = GST_REPLACE (encoder);
96
97  GST_DEBUG_OBJECT (replace, "flush");
98
99}
100
101static GstFlowReturn
102gst_replace_pre_push (GstAudioEncoder * encoder, GstBuffer ** buffer)
103{
104  GstReplace *replace = GST_REPLACE (encoder);
105
106  GST_DEBUG_OBJECT (replace, "pre_push");
107
108  return GST_FLOW_OK;
109}
110
111static gboolean
112gst_replace_sink_event (GstAudioEncoder * encoder, GstEvent * event)
113{
114  GstReplace *replace = GST_REPLACE (encoder);
115
116  GST_DEBUG_OBJECT (replace, "sink_event");
117
118  return TRUE;
119}
120
121static gboolean
122gst_replace_src_event (GstAudioEncoder * encoder, GstEvent * event)
123{
124  GstReplace *replace = GST_REPLACE (encoder);
125
126  GST_DEBUG_OBJECT (replace, "src_event");
127
128  return TRUE;
129}
130
131static GstCaps *
132gst_replace_getcaps (GstAudioEncoder * encoder, GstCaps * filter)
133{
134  GstReplace *replace = GST_REPLACE (encoder);
135
136  GST_DEBUG_OBJECT (replace, "getcaps");
137
138  return NULL;
139}
140
141static gboolean
142gst_replace_open (GstAudioEncoder * encoder)
143{
144  GstReplace *replace = GST_REPLACE (encoder);
145
146  GST_DEBUG_OBJECT (replace, "open");
147
148  return TRUE;
149}
150
151static gboolean
152gst_replace_close (GstAudioEncoder * encoder)
153{
154  GstReplace *replace = GST_REPLACE (encoder);
155
156  GST_DEBUG_OBJECT (replace, "close");
157
158  return TRUE;
159}
160
161static gboolean
162gst_replace_negotiate (GstAudioEncoder * encoder)
163{
164  GstReplace *replace = GST_REPLACE (encoder);
165
166  GST_DEBUG_OBJECT (replace, "negotiate");
167
168  return TRUE;
169}
170
171static gboolean
172gst_replace_decide_allocation (GstAudioEncoder * encoder, GstQuery * query)
173{
174  GstReplace *replace = GST_REPLACE (encoder);
175
176  GST_DEBUG_OBJECT (replace, "decide_allocation");
177
178  return TRUE;
179}
180
181static gboolean
182gst_replace_propose_allocation (GstAudioEncoder * encoder, GstQuery * query)
183{
184  GstReplace *replace = GST_REPLACE (encoder);
185
186  GST_DEBUG_OBJECT (replace, "propose_allocation");
187
188  return TRUE;
189}
190% end
191