[FFmpeg-devel] [PATCH 19/21] avcodec: deprecate v408 de/encoder
James Almer
jamrial at gmail.com
Wed Oct 9 01:50:24 EEST 2024
The uyva pixel format was recently added, so this lavc workaround is no longer
needed.
Signed-off-by: James Almer <jamrial at 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 ++
libavformat/riff.c | 2 ++
9 files changed, 17 insertions(+)
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 5b3b859d37..d1b6b52db4 100644
--- a/libavformat/isom_tags.c
+++ b/libavformat/isom_tags.c
@@ -64,7 +64,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 24b2385d94..ea5221c87b 100644
--- a/libavformat/movenc.c
+++ b/libavformat/movenc.c
@@ -2616,7 +2616,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_UYVA)
|| (track->par->codec_id == AV_CODEC_ID_RAWVIDEO && track->par->format == AV_PIX_FMT_V30X)
|| 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);
diff --git a/libavformat/riff.c b/libavformat/riff.c
index 7f3291a392..c1e48810b6 100644
--- a/libavformat/riff.c
+++ b/libavformat/riff.c
@@ -306,7 +306,9 @@ const AVCodecTag ff_codec_bmp_tags[] = {
{ AV_CODEC_ID_V210, MKTAG('v', '2', '1', '0') },
{ AV_CODEC_ID_V210, MKTAG('C', '2', '1', '0') },
{ AV_CODEC_ID_V308, MKTAG('v', '3', '0', '8') },
+#if FF_API_V408_CODECID
{ AV_CODEC_ID_V408, MKTAG('v', '4', '0', '8') },
+#endif
{ AV_CODEC_ID_V410, MKTAG('v', '4', '1', '0') },
{ AV_CODEC_ID_YUV4, MKTAG('y', 'u', 'v', '4') },
{ AV_CODEC_ID_INDEO3, MKTAG('I', 'V', '3', '1') },
--
2.46.2
More information about the ffmpeg-devel
mailing list