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

Function lcevc_parse

libavcodec/lcevc_parser.c:214–247  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

212}
213
214static int lcevc_parse(AVCodecParserContext *s,
215 AVCodecContext *avctx,
216 const uint8_t **poutbuf, int *poutbuf_size,
217 const uint8_t *buf, int buf_size)
218{
219 LCEVCParserContext *ctx = s->priv_data;
220 ParseContext *pc = &ctx->pc;
221 int next;
222
223 if (!ctx->parsed_extradata && avctx->extradata_size > 4) {
224 ctx->parsed_extradata = 1;
225 ctx->is_lvcc = !!avctx->extradata[0];
226
227 if (ctx->is_lvcc)
228 ctx->nal_length_size = (avctx->extradata[4] >> 6) + 1;
229 }
230
231 if (s->flags & PARSER_FLAG_COMPLETE_FRAMES) {
232 next = buf_size;
233 } else {
234 next = lcevc_find_frame_end(s, buf, buf_size);
235 if (ff_combine_frame(pc, next, &buf, &buf_size) < 0) {
236 *poutbuf = NULL;
237 *poutbuf_size = 0;
238 return buf_size;
239 }
240 }
241
242 parse_nal_units(s, buf, buf_size, avctx);
243
244 *poutbuf = buf;
245 *poutbuf_size = buf_size;
246 return next;
247}
248
249static void lcevc_parser_close(AVCodecParserContext *s)
250{

Callers

nothing calls this directly

Calls 3

lcevc_find_frame_endFunction · 0.85
ff_combine_frameFunction · 0.85
parse_nal_unitsFunction · 0.70

Tested by

no test coverage detected