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

Function avcodec_send_frame

libavcodec/encode.c:491–522  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

489}
490
491int attribute_align_arg avcodec_send_frame(AVCodecContext *avctx, const AVFrame *frame)
492{
493 AVCodecInternal *avci = avctx->internal;
494 int ret;
495
496 if (!avcodec_is_open(avctx) || !av_codec_is_encoder(avctx->codec))
497 return AVERROR(EINVAL);
498
499 if (avci->draining)
500 return AVERROR_EOF;
501
502 if (avci->buffer_frame->buf[0])
503 return AVERROR(EAGAIN);
504
505 if (!frame) {
506 avci->draining = 1;
507 } else {
508 ret = encode_send_frame_internal(avctx, frame);
509 if (ret < 0)
510 return ret;
511 }
512
513 if (!avci->buffer_pkt->data && !avci->buffer_pkt->side_data) {
514 ret = encode_receive_packet_internal(avctx, avci->buffer_pkt);
515 if (ret < 0 && ret != AVERROR(EAGAIN) && ret != AVERROR_EOF)
516 return ret;
517 }
518
519 avctx->frame_num++;
520
521 return 0;
522}
523
524int attribute_align_arg avcodec_receive_packet(AVCodecContext *avctx, AVPacket *avpkt)
525{

Callers 15

process_frameFunction · 0.85
encodeFunction · 0.85
encode_frameFunction · 0.85
encode_frameFunction · 0.85
filter_frameFunction · 0.85
filter_1phaseFunction · 0.85
run_testFunction · 0.85
encode_writeFunction · 0.85
encode_writeFunction · 0.85
encodeFunction · 0.85
write_frameFunction · 0.85
encode_writeFunction · 0.85

Calls 4

avcodec_is_openFunction · 0.85
av_codec_is_encoderFunction · 0.85

Tested by 2

process_frameFunction · 0.68
run_testFunction · 0.68