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

Function xan_decode_frame

libavcodec/xxan.c:402–434  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

400}
401
402static int xan_decode_frame(AVCodecContext *avctx, AVFrame *rframe,
403 int *got_frame, AVPacket *avpkt)
404{
405 XanContext *s = avctx->priv_data;
406 int ftype;
407 int ret;
408
409 if ((ret = ff_reget_buffer(avctx, s->pic, 0)) < 0)
410 return ret;
411
412 bytestream2_init(&s->gb, avpkt->data, avpkt->size);
413 ftype = bytestream2_get_le32(&s->gb);
414 switch (ftype) {
415 case 0:
416 ret = xan_decode_frame_type0(avctx);
417 break;
418 case 1:
419 ret = xan_decode_frame_type1(avctx);
420 break;
421 default:
422 av_log(avctx, AV_LOG_ERROR, "Unknown frame type %d\n", ftype);
423 return AVERROR_INVALIDDATA;
424 }
425 if (ret)
426 return ret;
427
428 if ((ret = av_frame_ref(rframe, s->pic)) < 0)
429 return ret;
430
431 *got_frame = 1;
432
433 return avpkt->size;
434}
435
436const FFCodec ff_xan_wc4_decoder = {
437 .p.name = "xan_wc4",

Callers

nothing calls this directly

Calls 6

ff_reget_bufferFunction · 0.85
bytestream2_initFunction · 0.85
xan_decode_frame_type0Function · 0.85
xan_decode_frame_type1Function · 0.85
av_logFunction · 0.85
av_frame_refFunction · 0.85

Tested by

no test coverage detected