]> git.sesse.net Git - ffmpeg/blobdiff - libavcodec/sunrastenc.c
Deprecate avctx.coded_frame
[ffmpeg] / libavcodec / sunrastenc.c
index e1b52112d4036b356eb37b29b925bba5c5d81e9c..ddf624eee280fbaed1192cd6e0495ed98a69e4f0 100644 (file)
@@ -25,7 +25,6 @@
 #include "sunrast.h"
 
 typedef struct SUNRASTContext {
-    AVFrame picture;
     PutByteContext p;
     int depth;      ///< depth of pixel
     int length;     ///< length (bytes) of image
@@ -154,9 +153,12 @@ static av_cold int sunrast_encode_init(AVCodecContext *avctx)
         return AVERROR(EINVAL);
     }
 
-    avctx->coded_frame            = &s->picture;
+#if FF_API_CODED_FRAME
+FF_DISABLE_DEPRECATION_WARNINGS
     avctx->coded_frame->key_frame = 1;
     avctx->coded_frame->pict_type = AV_PICTURE_TYPE_I;
+FF_ENABLE_DEPRECATION_WARNINGS
+#endif
     s->maptype                    = RMT_NONE;
     s->maplength                  = 0;
 
@@ -167,6 +169,7 @@ static av_cold int sunrast_encode_init(AVCodecContext *avctx)
     case AV_PIX_FMT_PAL8 :
         s->maptype   = RMT_EQUAL_RGB;
         s->maplength = 3 * 256;
+        /* fall-through */
     case AV_PIX_FMT_GRAY8:
         s->depth = 8;
         break;
@@ -214,6 +217,7 @@ static const AVCodecDefault sunrast_defaults[] = {
 
 AVCodec ff_sunrast_encoder = {
     .name           = "sunrast",
+    .long_name      = NULL_IF_CONFIG_SMALL("Sun Rasterfile image"),
     .type           = AVMEDIA_TYPE_VIDEO,
     .id             = AV_CODEC_ID_SUNRAST,
     .priv_data_size = sizeof(SUNRASTContext),
@@ -225,5 +229,4 @@ AVCodec ff_sunrast_encoder = {
                                                   AV_PIX_FMT_GRAY8,
                                                   AV_PIX_FMT_MONOWHITE,
                                                   AV_PIX_FMT_NONE },
-    .long_name      = NULL_IF_CONFIG_SMALL("Sun Rasterfile image"),
 };