Debian Codegraph @

tools/element-templates/audioencoder

raw
1 /* vim: set filetype=c: */
2 % ClassName
3 GstAudioEncoder
4 % TYPE_CLASS_NAME
5 GST_TYPE_AUDIO_ENCODER
6 % pads
7 srcpad-simple
8 sinkpad-audio
9 % pkg-config
10 gstreamer-audio-1.0
11 % includes
12 #include <gst/audio/gstaudioencoder.h>
13 % prototypes
14 static gboolean gst_replace_start (GstAudioEncoder * encoder);
15 static gboolean gst_replace_stop (GstAudioEncoder * encoder);
16 static gboolean gst_replace_set_format (GstAudioEncoder * encoder,
17 GstAudioInfo * info);
18 static GstFlowReturn gst_replace_handle_frame (GstAudioEncoder * encoder,
19 GstBuffer * buffer);
20 static void gst_replace_flush (GstAudioEncoder * encoder);
21 static GstFlowReturn gst_replace_pre_push (GstAudioEncoder * encoder,
22 GstBuffer ** buffer);
23 static gboolean gst_replace_sink_event (GstAudioEncoder * encoder,
24 GstEvent * event);
25 static gboolean gst_replace_src_event (GstAudioEncoder * encoder, GstEvent * event);
26 static GstCaps *gst_replace_getcaps (GstAudioEncoder * encoder, GstCaps * filter);
27 static gboolean gst_replace_open (GstAudioEncoder * encoder);
28 static gboolean gst_replace_close (GstAudioEncoder * encoder);
29 static gboolean gst_replace_negotiate (GstAudioEncoder * encoder);
30 static gboolean gst_replace_decide_allocation (GstAudioEncoder * encoder,
31 GstQuery * query);
32 static 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
52 static gboolean
53 gst_replace_start (GstAudioEncoder * encoder)
54 {
55 GstReplace *replace = GST_REPLACE (encoder);
56
57 GST_DEBUG_OBJECT (replace, "start");
58
59 return TRUE;
60 }
61
62 static gboolean
63 gst_replace_stop (GstAudioEncoder * encoder)
64 {
65 GstReplace *replace = GST_REPLACE (encoder);
66
67 GST_DEBUG_OBJECT (replace, "stop");
68
69 return TRUE;
70 }
71
72 static gboolean
73 gst_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
82 static GstFlowReturn
83 gst_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
92 static void
93 gst_replace_flush (GstAudioEncoder * encoder)
94 {
95 GstReplace *replace = GST_REPLACE (encoder);
96
97 GST_DEBUG_OBJECT (replace, "flush");
98
99 }
100
101 static GstFlowReturn
102 gst_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
111 static gboolean
112 gst_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
121 static gboolean
122 gst_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
131 static GstCaps *
132 gst_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
141 static gboolean
142 gst_replace_open (GstAudioEncoder * encoder)
143 {
144 GstReplace *replace = GST_REPLACE (encoder);
145
146 GST_DEBUG_OBJECT (replace, "open");
147
148 return TRUE;
149 }
150
151 static gboolean
152 gst_replace_close (GstAudioEncoder * encoder)
153 {
154 GstReplace *replace = GST_REPLACE (encoder);
155
156 GST_DEBUG_OBJECT (replace, "close");
157
158 return TRUE;
159 }
160
161 static gboolean
162 gst_replace_negotiate (GstAudioEncoder * encoder)
163 {
164 GstReplace *replace = GST_REPLACE (encoder);
165
166 GST_DEBUG_OBJECT (replace, "negotiate");
167
168 return TRUE;
169 }
170
171 static gboolean
172 gst_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
181 static gboolean
182 gst_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