• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1/* vim: set filetype=c: */
2% ClassName
3GstVideoDecoder
4% TYPE_CLASS_NAME
5GST_TYPE_VIDEO_DECODER
6% pads
7sinkpad-simple
8srcpad-template-video
9% pkg-config
10gstreamer-video-1.0
11% includes
12#include <gst/video/video.h>
13#include <gst/video/gstvideodecoder.h>
14% prototypes
15static gboolean gst_replace_open (GstVideoDecoder * decoder);
16static gboolean gst_replace_close (GstVideoDecoder * decoder);
17static gboolean gst_replace_start (GstVideoDecoder * decoder);
18static gboolean gst_replace_stop (GstVideoDecoder * decoder);
19static GstFlowReturn gst_replace_parse (GstVideoDecoder * decoder,
20    GstVideoCodecFrame * frame, GstAdapter * adapter, gboolean at_eos);
21static gboolean gst_replace_set_format (GstVideoDecoder * decoder,
22    GstVideoCodecState * state);
23static gboolean gst_replace_reset (GstVideoDecoder * decoder, gboolean hard);
24static GstFlowReturn gst_replace_finish (GstVideoDecoder * decoder);
25static GstFlowReturn gst_replace_handle_frame (GstVideoDecoder * decoder,
26    GstVideoCodecFrame * frame);
27static gboolean gst_replace_sink_event (GstVideoDecoder * decoder,
28    GstEvent * event);
29static gboolean gst_replace_src_event (GstVideoDecoder * decoder,
30    GstEvent * event);
31static gboolean gst_replace_negotiate (GstVideoDecoder * decoder);
32static gboolean gst_replace_decide_allocation (GstVideoDecoder * decoder,
33    GstQuery * query);
34static gboolean gst_replace_propose_allocation (GstVideoDecoder * decoder,
35    GstQuery * query);
36% declare-class
37  GstVideoDecoderClass *video_decoder_class = GST_VIDEO_DECODER_CLASS (klass);
38% set-methods
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);
53% methods
54static gboolean
55gst_replace_open (GstVideoDecoder * decoder)
56{
57  GstReplace *replace = GST_REPLACE (decoder);
58
59  GST_DEBUG_OBJECT (replace, "open");
60
61  return TRUE;
62}
63
64static gboolean
65gst_replace_close (GstVideoDecoder * decoder)
66{
67  GstReplace *replace = GST_REPLACE (decoder);
68
69  GST_DEBUG_OBJECT (replace, "close");
70
71  return TRUE;
72}
73
74static gboolean
75gst_replace_start (GstVideoDecoder * decoder)
76{
77  GstReplace *replace = GST_REPLACE (decoder);
78
79  GST_DEBUG_OBJECT (replace, "start");
80
81  return TRUE;
82}
83
84static gboolean
85gst_replace_stop (GstVideoDecoder * decoder)
86{
87  GstReplace *replace = GST_REPLACE (decoder);
88
89  GST_DEBUG_OBJECT (replace, "stop");
90
91  return TRUE;
92}
93
94static GstFlowReturn
95gst_replace_parse (GstVideoDecoder * decoder, GstVideoCodecFrame * frame,
96    GstAdapter * adapter, gboolean at_eos)
97{
98  GstReplace *replace = GST_REPLACE (decoder);
99
100  GST_DEBUG_OBJECT (replace, "parse");
101
102  return GST_FLOW_OK;
103}
104
105static gboolean
106gst_replace_set_format (GstVideoDecoder * decoder, GstVideoCodecState * state)
107{
108  GstReplace *replace = GST_REPLACE (decoder);
109
110  GST_DEBUG_OBJECT (replace, "set_format");
111
112  return TRUE;
113}
114
115static gboolean
116gst_replace_reset (GstVideoDecoder * decoder, gboolean hard)
117{
118  GstReplace *replace = GST_REPLACE (decoder);
119
120  GST_DEBUG_OBJECT (replace, "reset");
121
122  return TRUE;
123}
124
125static GstFlowReturn
126gst_replace_finish (GstVideoDecoder * decoder)
127{
128  GstReplace *replace = GST_REPLACE (decoder);
129
130  GST_DEBUG_OBJECT (replace, "finish");
131
132  return GST_FLOW_OK;
133}
134
135static GstFlowReturn
136gst_replace_handle_frame (GstVideoDecoder * decoder, GstVideoCodecFrame * frame)
137{
138  GstReplace *replace = GST_REPLACE (decoder);
139
140  GST_DEBUG_OBJECT (replace, "handle_frame");
141
142  return GST_FLOW_OK;
143}
144
145static gboolean
146gst_replace_sink_event (GstVideoDecoder * decoder, GstEvent * event)
147{
148  GstReplace *replace = GST_REPLACE (decoder);
149
150  GST_DEBUG_OBJECT (replace, "sink_event");
151
152  return TRUE;
153}
154
155static gboolean
156gst_replace_src_event (GstVideoDecoder * decoder, GstEvent * event)
157{
158  GstReplace *replace = GST_REPLACE (decoder);
159
160  GST_DEBUG_OBJECT (replace, "src_event");
161
162  return TRUE;
163}
164
165static gboolean
166gst_replace_negotiate (GstVideoDecoder * decoder)
167{
168  GstReplace *replace = GST_REPLACE (decoder);
169
170  GST_DEBUG_OBJECT (replace, "negotiate");
171
172  return TRUE;
173}
174
175static gboolean
176gst_replace_decide_allocation (GstVideoDecoder * decoder, GstQuery * query)
177{
178  GstReplace *replace = GST_REPLACE (decoder);
179
180  GST_DEBUG_OBJECT (replace, "decide_allocation");
181
182  return TRUE;
183}
184
185static gboolean
186gst_replace_propose_allocation (GstVideoDecoder * decoder, GstQuery * query)
187{
188  GstReplace *replace = GST_REPLACE (decoder);
189
190  GST_DEBUG_OBJECT (replace, "propose_allocation");
191
192  return TRUE;
193}
194% end
195