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

Function avcodec_encode_video

libavcodec/utils.c:551–568  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

549}
550
551int attribute_align_arg avcodec_encode_video(AVCodecContext *avctx, uint8_t *buf, int buf_size,
552 const AVFrame *pict)
553{
554 if(buf_size < FF_MIN_BUFFER_SIZE){
555 av_log(avctx, AV_LOG_ERROR, "buffer smaller than minimum size\n");
556 return -1;
557 }
558 if(avcodec_check_dimensions(avctx,avctx->width,avctx->height))
559 return -1;
560 if((avctx->codec->capabilities & CODEC_CAP_DELAY) || pict){
561 int ret = avctx->codec->encode(avctx, buf, buf_size, pict);
562 avctx->frame_number++;
563 emms_c(); //needed to avoid an emms_c() call before every return;
564
565 return ret;
566 }else
567 return 0;
568}
569
570int avcodec_encode_subtitle(AVCodecContext *avctx, uint8_t *buf, int buf_size,
571 const AVSubtitle *sub)

Callers 5

do_video_outFunction · 0.85
output_packetFunction · 0.85
write_video_frameFunction · 0.85
video_encode_exampleFunction · 0.85
estimate_best_b_countFunction · 0.85

Calls 2

av_logFunction · 0.85
avcodec_check_dimensionsFunction · 0.85

Tested by

no test coverage detected