1 /* vim: set filetype=c: */
12 #include <gst/video/video.h>
13 #include <gst/video/gstvideodecoder.h>
15 static gboolean gst_replace_open (GstVideoDecoder * decoder);
16 static gboolean gst_replace_close (GstVideoDecoder * decoder);
17 static gboolean gst_replace_start (GstVideoDecoder * decoder);
18 static gboolean gst_replace_stop (GstVideoDecoder * decoder);
19 static GstFlowReturn gst_replace_parse (GstVideoDecoder * decoder,
20 GstVideoCodecFrame * frame, GstAdapter * adapter, gboolean at_eos);
21 static gboolean gst_replace_set_format (GstVideoDecoder * decoder,
22 GstVideoCodecState * state);
23 static gboolean gst_replace_reset (GstVideoDecoder * decoder, gboolean hard);
24 static GstFlowReturn gst_replace_finish (GstVideoDecoder * decoder);
25 static GstFlowReturn gst_replace_handle_frame (GstVideoDecoder * decoder,
26 GstVideoCodecFrame * frame);
27 static gboolean gst_replace_sink_event (GstVideoDecoder * decoder,
29 static gboolean gst_replace_src_event (GstVideoDecoder * decoder,
31 static gboolean gst_replace_negotiate (GstVideoDecoder * decoder);
32 static gboolean gst_replace_decide_allocation (GstVideoDecoder * decoder,
34 static gboolean gst_replace_propose_allocation (GstVideoDecoder * decoder,
37 GstVideoDecoderClass *video_decoder_class = GST_VIDEO_DECODER_CLASS (klass);
39 video_decoder_class->open = GST_DEBUG_FUNCPTR (gst_replace_open);
40 video_decoder_class->close = GST_DEBUG_FUNCPTR (gst_replace_close);
41 video_decoder_class->start = GST_DEBUG_FUNCPTR (gst_replace_start);
42 video_decoder_class->stop = GST_DEBUG_FUNCPTR (gst_replace_stop);
43 video_decoder_class->parse = GST_DEBUG_FUNCPTR (gst_replace_parse);
44 video_decoder_class->set_format = GST_DEBUG_FUNCPTR (gst_replace_set_format);
45 video_decoder_class->reset = GST_DEBUG_FUNCPTR (gst_replace_reset);
46 video_decoder_class->finish = GST_DEBUG_FUNCPTR (gst_replace_finish);
47 video_decoder_class->handle_frame = GST_DEBUG_FUNCPTR (gst_replace_handle_frame);
48 video_decoder_class->sink_event = GST_DEBUG_FUNCPTR (gst_replace_sink_event);
49 video_decoder_class->src_event = GST_DEBUG_FUNCPTR (gst_replace_src_event);
50 video_decoder_class->negotiate = GST_DEBUG_FUNCPTR (gst_replace_negotiate);
51 video_decoder_class->decide_allocation = GST_DEBUG_FUNCPTR (gst_replace_decide_allocation);
52 video_decoder_class->propose_allocation = GST_DEBUG_FUNCPTR (gst_replace_propose_allocation);
55 gst_replace_open (GstVideoDecoder * decoder)
57 GstReplace *replace = GST_REPLACE (decoder);
59 GST_DEBUG_OBJECT (replace, "open");
65 gst_replace_close (GstVideoDecoder * decoder)
67 GstReplace *replace = GST_REPLACE (decoder);
69 GST_DEBUG_OBJECT (replace, "close");
75 gst_replace_start (GstVideoDecoder * decoder)
77 GstReplace *replace = GST_REPLACE (decoder);
79 GST_DEBUG_OBJECT (replace, "start");
85 gst_replace_stop (GstVideoDecoder * decoder)
87 GstReplace *replace = GST_REPLACE (decoder);
89 GST_DEBUG_OBJECT (replace, "stop");
95 gst_replace_parse (GstVideoDecoder * decoder, GstVideoCodecFrame * frame,
96 GstAdapter * adapter, gboolean at_eos)
98 GstReplace *replace = GST_REPLACE (decoder);
100 GST_DEBUG_OBJECT (replace, "parse");
106 gst_replace_set_format (GstVideoDecoder * decoder, GstVideoCodecState * state)
108 GstReplace *replace = GST_REPLACE (decoder);
110 GST_DEBUG_OBJECT (replace, "set_format");
116 gst_replace_reset (GstVideoDecoder * decoder, gboolean hard)
118 GstReplace *replace = GST_REPLACE (decoder);
120 GST_DEBUG_OBJECT (replace, "reset");
126 gst_replace_finish (GstVideoDecoder * decoder)
128 GstReplace *replace = GST_REPLACE (decoder);
130 GST_DEBUG_OBJECT (replace, "finish");
136 gst_replace_handle_frame (GstVideoDecoder * decoder, GstVideoCodecFrame * frame)
138 GstReplace *replace = GST_REPLACE (decoder);
140 GST_DEBUG_OBJECT (replace, "handle_frame");
146 gst_replace_sink_event (GstVideoDecoder * decoder, GstEvent * event)
148 GstReplace *replace = GST_REPLACE (decoder);
150 GST_DEBUG_OBJECT (replace, "sink_event");
156 gst_replace_src_event (GstVideoDecoder * decoder, GstEvent * event)
158 GstReplace *replace = GST_REPLACE (decoder);
160 GST_DEBUG_OBJECT (replace, "src_event");
166 gst_replace_negotiate (GstVideoDecoder * decoder)
168 GstReplace *replace = GST_REPLACE (decoder);
170 GST_DEBUG_OBJECT (replace, "negotiate");
176 gst_replace_decide_allocation (GstVideoDecoder * decoder, GstQuery * query)
178 GstReplace *replace = GST_REPLACE (decoder);
180 GST_DEBUG_OBJECT (replace, "decide_allocation");
186 gst_replace_propose_allocation (GstVideoDecoder * decoder, GstQuery * query)
188 GstReplace *replace = GST_REPLACE (decoder);
190 GST_DEBUG_OBJECT (replace, "propose_allocation");