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

Function avcodec_send_packet

libavcodec/decode.c:711–742  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

709}
710
711int attribute_align_arg avcodec_send_packet(AVCodecContext *avctx, const AVPacket *avpkt)
712{
713 AVCodecInternal *avci = avctx->internal;
714 DecodeContext *dc = decode_ctx(avci);
715 int ret;
716
717 if (!avcodec_is_open(avctx) || !av_codec_is_decoder(avctx->codec))
718 return AVERROR(EINVAL);
719
720 if (dc->draining_started)
721 return AVERROR_EOF;
722
723 if (avpkt && !avpkt->size && avpkt->data)
724 return AVERROR(EINVAL);
725
726 if (avpkt && (avpkt->data || avpkt->side_data_elems)) {
727 if (!AVPACKET_IS_EMPTY(avci->buffer_pkt))
728 return AVERROR(EAGAIN);
729 ret = av_packet_ref(avci->buffer_pkt, avpkt);
730 if (ret < 0)
731 return ret;
732 } else
733 dc->draining_started = 1;
734
735 if (!avci->buffer_frame->buf[0] && !dc->draining_started) {
736 ret = decode_receive_frame_internal(avctx, avci->buffer_frame, 0);
737 if (ret < 0 && ret != AVERROR(EAGAIN) && ret != AVERROR_EOF)
738 return ret;
739 }
740
741 return 0;
742}
743
744static int apply_cropping(AVCodecContext *avctx, AVFrame *frame)
745{

Callers 15

LLVMFuzzerTestOneInputFunction · 0.85
process_frameFunction · 0.85
ds_runFunction · 0.85
try_decode_frameFunction · 0.85
decoder_decode_frameFunction · 0.85
packet_decodeFunction · 0.85
process_frameFunction · 0.85
cri_decode_frameFunction · 0.85
imm5_decode_frameFunction · 0.85
ftr_decode_frameFunction · 0.85
dng_decode_jpegFunction · 0.85
tdsc_decode_jpeg_tileFunction · 0.85

Calls 5

decode_ctxFunction · 0.85
avcodec_is_openFunction · 0.85
av_codec_is_decoderFunction · 0.85
av_packet_refFunction · 0.85

Tested by 7

process_frameFunction · 0.68
decodeFunction · 0.68
video_decodeFunction · 0.68
compute_crc_of_packetsFunction · 0.68
dump_stream_metaFunction · 0.68
run_testFunction · 0.68
video_decode_exampleFunction · 0.68