diff mbox series

[FFmpeg-devel,19/20] avcodec: deprecate v408 de/encoder

Message ID 20241007122955.309-19-jamrial@gmail.com
State New
Headers show
Series [FFmpeg-devel,01/20] swscale/output: add missing yuv2packed1 and yuv2packed2 support for VUY{X, A} | expand

Commit Message

James Almer Oct. 7, 2024, 12:29 p.m. UTC
The uyva pixel format was recently added, so this lavc workaround is no longer
needed.

Signed-off-by: James Almer <jamrial@gmail.com>
---
 libavcodec/allcodecs.c     | 2 ++
 libavcodec/codec_desc.c    | 2 ++
 libavcodec/codec_id.h      | 2 ++
 libavcodec/v408dec.c       | 2 ++
 libavcodec/v408enc.c       | 2 ++
 libavcodec/version_major.h | 1 +
 libavformat/isom_tags.c    | 2 ++
 libavformat/movenc.c       | 2 ++
 8 files changed, 15 insertions(+)
diff mbox series

Patch

diff --git a/libavcodec/allcodecs.c b/libavcodec/allcodecs.c
index aa0fc47647..356a78f6e0 100644
--- a/libavcodec/allcodecs.c
+++ b/libavcodec/allcodecs.c
@@ -347,8 +347,10 @@  extern const FFCodec ff_v210_decoder;
 extern const FFCodec ff_v210x_decoder;
 extern const FFCodec ff_v308_encoder;
 extern const FFCodec ff_v308_decoder;
+#if FF_API_V408_CODECID
 extern const FFCodec ff_v408_encoder;
 extern const FFCodec ff_v408_decoder;
+#endif
 extern const FFCodec ff_v410_encoder;
 extern const FFCodec ff_v410_decoder;
 extern const FFCodec ff_vb_decoder;
diff --git a/libavcodec/codec_desc.c b/libavcodec/codec_desc.c
index 03dea5751a..6018052215 100644
--- a/libavcodec/codec_desc.c
+++ b/libavcodec/codec_desc.c
@@ -1484,6 +1484,7 @@  static const AVCodecDescriptor codec_descriptors[] = {
         .long_name = NULL_IF_CONFIG_SMALL("Uncompressed packed 4:4:4"),
         .props     = AV_CODEC_PROP_INTRA_ONLY | AV_CODEC_PROP_LOSSLESS,
     },
+#if FF_API_V408_CODECID
     {
         .id        = AV_CODEC_ID_V408,
         .type      = AVMEDIA_TYPE_VIDEO,
@@ -1491,6 +1492,7 @@  static const AVCodecDescriptor codec_descriptors[] = {
         .long_name = NULL_IF_CONFIG_SMALL("Uncompressed packed QT 4:4:4:4"),
         .props     = AV_CODEC_PROP_INTRA_ONLY | AV_CODEC_PROP_LOSSLESS,
     },
+#endif
     {
         .id        = AV_CODEC_ID_YUV4,
         .type      = AVMEDIA_TYPE_VIDEO,
diff --git a/libavcodec/codec_id.h b/libavcodec/codec_id.h
index 0a8d3bed1e..0ab0f6761f 100644
--- a/libavcodec/codec_id.h
+++ b/libavcodec/codec_id.h
@@ -255,7 +255,9 @@  enum AVCodecID {
     AV_CODEC_ID_AVUI,
     AV_CODEC_ID_TARGA_Y216,
     AV_CODEC_ID_V308,
+#if FF_API_V408_CODECID
     AV_CODEC_ID_V408,
+#endif
     AV_CODEC_ID_YUV4,
     AV_CODEC_ID_AVRN,
     AV_CODEC_ID_CPIA,
diff --git a/libavcodec/v408dec.c b/libavcodec/v408dec.c
index 2433c6de14..4bce5c7b67 100644
--- a/libavcodec/v408dec.c
+++ b/libavcodec/v408dec.c
@@ -27,6 +27,8 @@  static av_cold int v408_decode_init(AVCodecContext *avctx)
 {
     avctx->pix_fmt = AV_PIX_FMT_YUVA444P;
 
+    av_log(avctx, AV_LOG_WARNING, "This decoder is deprecated and will be removed.\n");
+
     return 0;
 }
 
diff --git a/libavcodec/v408enc.c b/libavcodec/v408enc.c
index c173f650ef..bf264de463 100644
--- a/libavcodec/v408enc.c
+++ b/libavcodec/v408enc.c
@@ -30,6 +30,8 @@  static av_cold int v408_encode_init(AVCodecContext *avctx)
     avctx->bits_per_coded_sample = 32;
     avctx->bit_rate = ff_guess_coded_bitrate(avctx);
 
+    av_log(avctx, AV_LOG_WARNING, "This encoder is deprecated and will be removed.\n");
+
     return 0;
 }
 
diff --git a/libavcodec/version_major.h b/libavcodec/version_major.h
index 63df40e9dd..37f243f868 100644
--- a/libavcodec/version_major.h
+++ b/libavcodec/version_major.h
@@ -48,5 +48,6 @@ 
 #define FF_API_BUFFER_MIN_SIZE     (LIBAVCODEC_VERSION_MAJOR < 62)
 #define FF_API_VDPAU_ALLOC_GET_SET (LIBAVCODEC_VERSION_MAJOR < 62)
 #define FF_API_QUALITY_FACTOR      (LIBAVCODEC_VERSION_MAJOR < 62)
+#define FF_API_V408_CODECID        (LIBAVCODEC_VERSION_MAJOR < 62)
 
 #endif /* AVCODEC_VERSION_MAJOR_H */
diff --git a/libavformat/isom_tags.c b/libavformat/isom_tags.c
index 1605a669d3..d2f8f74e01 100644
--- a/libavformat/isom_tags.c
+++ b/libavformat/isom_tags.c
@@ -63,7 +63,9 @@  const AVCodecTag ff_codec_movvideo_tags[] = {
     { AV_CODEC_ID_V210,   MKTAG('v', '2', '1', '0') }, /* uncompressed 10-bit 4:2:2 */
     { AV_CODEC_ID_V210,   MKTAG('b', 'x', 'y', '2') }, /* BOXX 10-bit 4:2:2 */
     { AV_CODEC_ID_V308,   MKTAG('v', '3', '0', '8') }, /* uncompressed  8-bit 4:4:4 */
+#if FF_API_V408_CODECID
     { AV_CODEC_ID_V408,   MKTAG('v', '4', '0', '8') }, /* uncompressed  8-bit 4:4:4:4 */
+#endif
     { AV_CODEC_ID_V410,   MKTAG('v', '4', '1', '0') }, /* uncompressed 10-bit 4:4:4 */
     { AV_CODEC_ID_Y41P,   MKTAG('Y', '4', '1', 'P') }, /* uncompressed 12-bit 4:1:1 */
     { AV_CODEC_ID_YUV4,   MKTAG('y', 'u', 'v', '4') }, /* libquicktime packed yuv420p */
diff --git a/libavformat/movenc.c b/libavformat/movenc.c
index b1f6b29f8b..f1312b3022 100644
--- a/libavformat/movenc.c
+++ b/libavformat/movenc.c
@@ -2615,7 +2615,9 @@  static int mov_write_video_tag(AVFormatContext *s, AVIOContext *pb, MOVMuxContex
                            || (track->par->codec_id == AV_CODEC_ID_RAWVIDEO && track->par->format == AV_PIX_FMT_VYU444)
                            || (track->par->codec_id == AV_CODEC_ID_RAWVIDEO && track->par->format == AV_PIX_FMT_UYVA)
                            ||  track->par->codec_id == AV_CODEC_ID_V308
+#if FF_API_V408_CODECID
                            ||  track->par->codec_id == AV_CODEC_ID_V408
+#endif
                            ||  track->par->codec_id == AV_CODEC_ID_V410
                            ||  track->par->codec_id == AV_CODEC_ID_V210);