]> git.sesse.net Git - ffmpeg/blobdiff - libavcodec/xbmenc.c
Deprecate avctx.coded_frame
[ffmpeg] / libavcodec / xbmenc.c
index d6657dcd0862baaec8669fcec6ef954c1c3af29f..4840050984b5d305cd462015aa369f7f633f78b9 100644 (file)
 
 static av_cold int xbm_encode_init(AVCodecContext *avctx)
 {
-    avctx->coded_frame = av_frame_alloc();
-    if (!avctx->coded_frame)
-        return AVERROR(ENOMEM);
+#if FF_API_CODED_FRAME
+FF_DISABLE_DEPRECATION_WARNINGS
     avctx->coded_frame->pict_type = AV_PICTURE_TYPE_I;
+FF_ENABLE_DEPRECATION_WARNINGS
+#endif
 
     return 0;
 }
@@ -67,13 +68,6 @@ static int xbm_encode_frame(AVCodecContext *avctx, AVPacket *pkt,
     return 0;
 }
 
-static av_cold int xbm_encode_close(AVCodecContext *avctx)
-{
-    av_freep(&avctx->coded_frame);
-
-    return 0;
-}
-
 AVCodec ff_xbm_encoder = {
     .name         = "xbm",
     .long_name    = NULL_IF_CONFIG_SMALL("XBM (X BitMap) image"),
@@ -81,7 +75,6 @@ AVCodec ff_xbm_encoder = {
     .id           = AV_CODEC_ID_XBM,
     .init         = xbm_encode_init,
     .encode2      = xbm_encode_frame,
-    .close        = xbm_encode_close,
     .pix_fmts     = (const enum AVPixelFormat[]) { AV_PIX_FMT_MONOWHITE,
                                                  AV_PIX_FMT_NONE },
 };