| 1 |
/* vim: set filetype=c: */ |
| 2 |
% ClassName |
| 3 |
GstVideoDecoder |
| 4 |
% TYPE_CLASS_NAME |
| 5 |
GST_TYPE_VIDEO_DECODER |
| 6 |
% pads |
| 7 |
sinkpad-simple |
| 8 |
srcpad-template-video |
| 9 |
% pkg-config |
| 10 |
gstreamer-video-1.0 |
| 11 |
% includes |
| 12 |
#include <gst/video/video.h> |
| 13 |
#include <gst/video/gstvideodecoder.h> |
| 14 |
% prototypes |
| 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, |
| 28 |
GstEvent * event); |
| 29 |
static gboolean gst_replace_src_event (GstVideoDecoder * decoder, |
| 30 |
GstEvent * event); |
| 31 |
static gboolean gst_replace_negotiate (GstVideoDecoder * decoder); |
| 32 |
static gboolean gst_replace_decide_allocation (GstVideoDecoder * decoder, |
| 33 |
GstQuery * query); |
| 34 |
static 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 |
| 54 |
static gboolean |
| 55 |
gst_replace_open (GstVideoDecoder * decoder) |
| 56 |
{ |
| 57 |
GstReplace *replace = GST_REPLACE (decoder); |
| 58 |
|
| 59 |
GST_DEBUG_OBJECT (replace, "open"); |
| 60 |
|
| 61 |
return TRUE; |
| 62 |
} |
| 63 |
|
| 64 |
static gboolean |
| 65 |
gst_replace_close (GstVideoDecoder * decoder) |
| 66 |
{ |
| 67 |
GstReplace *replace = GST_REPLACE (decoder); |
| 68 |
|
| 69 |
GST_DEBUG_OBJECT (replace, "close"); |
| 70 |
|
| 71 |
return TRUE; |
| 72 |
} |
| 73 |
|
| 74 |
static gboolean |
| 75 |
gst_replace_start (GstVideoDecoder * decoder) |
| 76 |
{ |
| 77 |
GstReplace *replace = GST_REPLACE (decoder); |
| 78 |
|
| 79 |
GST_DEBUG_OBJECT (replace, "start"); |
| 80 |
|
| 81 |
return TRUE; |
| 82 |
} |
| 83 |
|
| 84 |
static gboolean |
| 85 |
gst_replace_stop (GstVideoDecoder * decoder) |
| 86 |
{ |
| 87 |
GstReplace *replace = GST_REPLACE (decoder); |
| 88 |
|
| 89 |
GST_DEBUG_OBJECT (replace, "stop"); |
| 90 |
|
| 91 |
return TRUE; |
| 92 |
} |
| 93 |
|
| 94 |
static GstFlowReturn |
| 95 |
gst_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 |
|
| 105 |
static gboolean |
| 106 |
gst_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 |
|
| 115 |
static gboolean |
| 116 |
gst_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 |
|
| 125 |
static GstFlowReturn |
| 126 |
gst_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 |
|
| 135 |
static GstFlowReturn |
| 136 |
gst_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 |
|
| 145 |
static gboolean |
| 146 |
gst_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 |
|
| 155 |
static gboolean |
| 156 |
gst_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 |
|
| 165 |
static gboolean |
| 166 |
gst_replace_negotiate (GstVideoDecoder * decoder) |
| 167 |
{ |
| 168 |
GstReplace *replace = GST_REPLACE (decoder); |
| 169 |
|
| 170 |
GST_DEBUG_OBJECT (replace, "negotiate"); |
| 171 |
|
| 172 |
return TRUE; |
| 173 |
} |
| 174 |
|
| 175 |
static gboolean |
| 176 |
gst_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 |
|
| 185 |
static gboolean |
| 186 |
gst_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 |