MCPcopy Create free account
hub / github.com/FFmpeg/FFmpeg / dirac_parse

Function dirac_parse

libavcodec/dirac_parser.c:210–240  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

208}
209
210static int dirac_parse(AVCodecParserContext *s, AVCodecContext *avctx,
211 const uint8_t **poutbuf, int *poutbuf_size,
212 const uint8_t *buf, int buf_size)
213{
214 DiracParseContext *pc = s->priv_data;
215 int next;
216
217 *poutbuf = NULL;
218 *poutbuf_size = 0;
219
220 if (s->flags & PARSER_FLAG_COMPLETE_FRAMES) {
221 next = buf_size;
222 *poutbuf = buf;
223 *poutbuf_size = buf_size;
224 /* Assume that data has been packetized into an encapsulation unit. */
225 } else {
226 next = find_frame_end(pc, buf, buf_size);
227 if (!pc->is_synced && next == -1) {
228 /* No frame start found yet. So throw away the entire buffer. */
229 return buf_size;
230 }
231
232 if (dirac_combine_frame(s, avctx, next, &buf, &buf_size) < 0) {
233 return buf_size;
234 }
235 }
236
237 *poutbuf = buf;
238 *poutbuf_size = buf_size;
239 return next;
240}
241
242static void dirac_parse_close(AVCodecParserContext *s)
243{

Callers 1

libdirac_decode_frameFunction · 0.85

Calls 2

dirac_combine_frameFunction · 0.85
find_frame_endFunction · 0.70

Tested by

no test coverage detected