1 /* vim: set filetype=c: */
12 #include <gst/audio/gstaudiodecoder.h>
14 static gboolean gst_replace_start (GstAudioDecoder * decoder);
15 static gboolean gst_replace_stop (GstAudioDecoder * decoder);
16 static gboolean gst_replace_set_format (GstAudioDecoder * decoder, GstCaps * caps);
17 static GstFlowReturn gst_replace_parse (GstAudioDecoder * decoder,
18 GstAdapter * adapter, gint * offset, gint * length);
19 static GstFlowReturn gst_replace_handle_frame (GstAudioDecoder * decoder,
21 static void gst_replace_flush (GstAudioDecoder * decoder, gboolean hard);
22 static GstFlowReturn gst_replace_pre_push (GstAudioDecoder * decoder,
24 static gboolean gst_replace_sink_event (GstAudioDecoder * decoder,
26 static gboolean gst_replace_src_event (GstAudioDecoder * decoder, GstEvent * event);
27 static gboolean gst_replace_open (GstAudioDecoder * decoder);
28 static gboolean gst_replace_close (GstAudioDecoder * decoder);
29 static gboolean gst_replace_negotiate (GstAudioDecoder * decoder);
30 static gboolean gst_replace_decide_allocation (GstAudioDecoder * decoder,
32 static gboolean gst_replace_propose_allocation (GstAudioDecoder * decoder,
35 GstAudioDecoderClass *audio_decoder_class = GST_AUDIO_DECODER_CLASS (klass);
37 audio_decoder_class->start = GST_DEBUG_FUNCPTR (gst_replace_start);
38 audio_decoder_class->stop = GST_DEBUG_FUNCPTR (gst_replace_stop);
39 audio_decoder_class->set_format = GST_DEBUG_FUNCPTR (gst_replace_set_format);
40 audio_decoder_class->parse = GST_DEBUG_FUNCPTR (gst_replace_parse);
41 audio_decoder_class->handle_frame = GST_DEBUG_FUNCPTR (gst_replace_handle_frame);
42 audio_decoder_class->flush = GST_DEBUG_FUNCPTR (gst_replace_flush);
43 audio_decoder_class->pre_push = GST_DEBUG_FUNCPTR (gst_replace_pre_push);
44 audio_decoder_class->sink_event = GST_DEBUG_FUNCPTR (gst_replace_sink_event);
45 audio_decoder_class->src_event = GST_DEBUG_FUNCPTR (gst_replace_src_event);
46 audio_decoder_class->open = GST_DEBUG_FUNCPTR (gst_replace_open);
47 audio_decoder_class->close = GST_DEBUG_FUNCPTR (gst_replace_close);
48 audio_decoder_class->negotiate = GST_DEBUG_FUNCPTR (gst_replace_negotiate);
49 audio_decoder_class->decide_allocation = GST_DEBUG_FUNCPTR (gst_replace_decide_allocation);
50 audio_decoder_class->propose_allocation = GST_DEBUG_FUNCPTR (gst_replace_propose_allocation);
53 gst_replace_start (GstAudioDecoder * decoder)
55 GstReplace *replace = GST_REPLACE (decoder);
57 GST_DEBUG_OBJECT (replace, "start");
63 gst_replace_stop (GstAudioDecoder * decoder)
65 GstReplace *replace = GST_REPLACE (decoder);
67 GST_DEBUG_OBJECT (replace, "stop");
73 gst_replace_set_format (GstAudioDecoder * decoder, GstCaps * caps)
75 GstReplace *replace = GST_REPLACE (decoder);
77 GST_DEBUG_OBJECT (replace, "set_format");
83 gst_replace_parse (GstAudioDecoder * decoder, GstAdapter * adapter, gint * offset,
86 GstReplace *replace = GST_REPLACE (decoder);
88 GST_DEBUG_OBJECT (replace, "parse");
94 gst_replace_handle_frame (GstAudioDecoder * decoder, GstBuffer * buffer)
96 GstReplace *replace = GST_REPLACE (decoder);
98 GST_DEBUG_OBJECT (replace, "handle_frame");
104 gst_replace_flush (GstAudioDecoder * decoder, gboolean hard)
106 GstReplace *replace = GST_REPLACE (decoder);
108 GST_DEBUG_OBJECT (replace, "flush");
113 gst_replace_pre_push (GstAudioDecoder * decoder, GstBuffer ** buffer)
115 GstReplace *replace = GST_REPLACE (decoder);
117 GST_DEBUG_OBJECT (replace, "pre_push");
123 gst_replace_sink_event (GstAudioDecoder * decoder, GstEvent * event)
125 GstReplace *replace = GST_REPLACE (decoder);
127 GST_DEBUG_OBJECT (replace, "sink_event");
133 gst_replace_src_event (GstAudioDecoder * decoder, GstEvent * event)
135 GstReplace *replace = GST_REPLACE (decoder);
137 GST_DEBUG_OBJECT (replace, "src_event");
143 gst_replace_open (GstAudioDecoder * decoder)
145 GstReplace *replace = GST_REPLACE (decoder);
147 GST_DEBUG_OBJECT (replace, "open");
153 gst_replace_close (GstAudioDecoder * decoder)
155 GstReplace *replace = GST_REPLACE (decoder);
157 GST_DEBUG_OBJECT (replace, "close");
163 gst_replace_negotiate (GstAudioDecoder * decoder)
165 GstReplace *replace = GST_REPLACE (decoder);
167 GST_DEBUG_OBJECT (replace, "negotiate");
173 gst_replace_decide_allocation (GstAudioDecoder * decoder, GstQuery * query)
175 GstReplace *replace = GST_REPLACE (decoder);
177 GST_DEBUG_OBJECT (replace, "decide_allocation");
183 gst_replace_propose_allocation (GstAudioDecoder * decoder, GstQuery * query)
185 GstReplace *replace = GST_REPLACE (decoder);
187 GST_DEBUG_OBJECT (replace, "propose_allocation");