| 836 | } |
| 837 | |
| 838 | int 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 | |
| 860 | int ff_encode_receive_frame(AVCodecContext *avctx, AVFrame *frame) |
| 861 | { |
no test coverage detected