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

Function ff_decode_receive_frame_internal

libavcodec/decode.c:614–648  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

612}
613
614int ff_decode_receive_frame_internal(AVCodecContext *avctx, AVFrame *frame)
615{
616 AVCodecInternal *avci = avctx->internal;
617 DecodeContext *dc = decode_ctx(avci);
618 const FFCodec *const codec = ffcodec(avctx->codec);
619 int ret;
620
621 av_assert0(!frame->buf[0]);
622
623 if (codec->cb_type == FF_CODEC_CB_TYPE_RECEIVE_FRAME) {
624 while (1) {
625 frame->pict_type = dc->initial_pict_type;
626 frame->flags |= dc->intra_only_flag;
627 ret = codec->cb.receive_frame(avctx, frame);
628 emms_c();
629 if (!ret) {
630 if (avctx->codec->type == AVMEDIA_TYPE_AUDIO) {
631 int64_t discarded_samples = 0;
632 ret = discard_samples(avctx, frame, &discarded_samples);
633 }
634 if (ret == AVERROR(EAGAIN) || (frame->flags & AV_FRAME_FLAG_DISCARD)) {
635 av_frame_unref(frame);
636 continue;
637 }
638 }
639 break;
640 }
641 } else
642 ret = decode_simple_receive_frame(avctx, frame);
643
644 if (ret == AVERROR_EOF)
645 avci->draining_done = 1;
646
647 return ret;
648}
649
650static int decode_receive_frame_internal(AVCodecContext *avctx, AVFrame *frame,
651 unsigned flags)

Callers 2

frame_worker_threadFunction · 0.85

Calls 6

decode_ctxFunction · 0.85
ffcodecFunction · 0.85
emms_cFunction · 0.85
discard_samplesFunction · 0.85
av_frame_unrefFunction · 0.85

Tested by

no test coverage detected