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

Function ff_encode_alloc_frame

libavcodec/encode.c:838–858  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

836}
837
838int ff_encode_alloc_frame(AVCodecContext *avctx, AVFrame *frame)
839{
840 int ret;
841
842 av_assert1(avctx->codec_type == AVMEDIA_TYPE_VIDEO);
843
844 frame->format = avctx->pix_fmt;
845 if (frame->width <= 0 || frame->height <= 0) {
846 frame->width = avctx->width;
847 frame->height = avctx->height;
848 }
849
850 ret = avcodec_default_get_buffer2(avctx, frame, 0);
851 if (ret < 0) {
852 av_log(avctx, AV_LOG_ERROR, "get_buffer() failed\n");
853 av_frame_unref(frame);
854 return ret;
855 }
856
857 return 0;
858}
859
860int ff_encode_receive_frame(AVCodecContext *avctx, AVFrame *frame)
861{

Callers 5

get_encode_bufferFunction · 0.85
svq1_encode_initFunction · 0.85
roq_encode_frameFunction · 0.85
prepare_pictureFunction · 0.85
librav1e_receive_packetFunction · 0.85

Calls 3

av_logFunction · 0.85
av_frame_unrefFunction · 0.85

Tested by

no test coverage detected