diff mbox series

[FFmpeg-devel] lavc: deprecate the omx encoders

Message ID 20241026092705.10714-1-anton@khirnov.net
State New
Headers show
Series [FFmpeg-devel] lavc: deprecate the omx encoders | expand

Checks

Context Check Description
yinshiyou/make_loongarch64 success Make finished
yinshiyou/make_fate_loongarch64 success Make fate finished
andriy/make_x86 success Make finished
andriy/make_fate_x86 success Make fate finished

Commit Message

Anton Khirnov Oct. 26, 2024, 9:27 a.m. UTC
They have not been relevant for a long time, and support for this API is
also being dropped from other projects.
---
 Changelog                  | 1 +
 configure                  | 4 +++-
 libavcodec/omx.c           | 4 ++++
 libavcodec/version_major.h | 3 +++
 4 files changed, 11 insertions(+), 1 deletion(-)

Comments

James Almer Oct. 28, 2024, 11:46 p.m. UTC | #1
On 10/26/2024 6:27 AM, Anton Khirnov wrote:
> They have not been relevant for a long time, and support for this API is
> also being dropped from other projects.
> ---
>   Changelog                  | 1 +
>   configure                  | 4 +++-
>   libavcodec/omx.c           | 4 ++++
>   libavcodec/version_major.h | 3 +++
>   4 files changed, 11 insertions(+), 1 deletion(-)
> 
> diff --git a/Changelog b/Changelog
> index 7963e093dd..f702e1b67e 100644
> --- a/Changelog
> +++ b/Changelog
> @@ -3,6 +3,7 @@ releases are sorted from youngest to oldest.
>   
>   version <next>:
>   - yasm support dropped, users need to use nasm
> +- OpenMAX encoders deprecated
>   
>   version 7.1:
>   - Raw Captions with Time (RCWT) closed caption demuxer
> diff --git a/configure b/configure
> index 9f508a2527..92ab1344bf 100755
> --- a/configure
> +++ b/configure
> @@ -7107,7 +7107,9 @@ enabled omx_rpi           && { test_code cc OMX_Core.h OMX_IndexConfigBrcmVideoR
>                                    test_code cc OMX_Core.h OMX_IndexConfigBrcmVideoRequestIFrame; } ||
>                                  die "ERROR: OpenMAX IL headers from raspberrypi/firmware not found"; } &&
>                                enable omx
> -enabled omx               && require_headers OMX_Core.h
> +enabled omx               && require_headers OMX_Core.h && \
> +    warn "The OpenMAX encoders are deprecated and will be removed in future versions"
> +
>   enabled openssl           && { { check_pkg_config openssl "openssl >= 3.0.0" openssl/ssl.h OPENSSL_init_ssl &&
>                                    { enabled gplv3 || ! enabled gpl || enabled nonfree || die "ERROR: OpenSSL >=3.0.0 requires --enable-version3"; }; } ||
>                                  { enabled gpl && ! enabled nonfree && die "ERROR: OpenSSL <3.0.0 is incompatible with the gpl"; } ||
> diff --git a/libavcodec/omx.c b/libavcodec/omx.c
> index 2c3865506f..2855aff8f2 100644
> --- a/libavcodec/omx.c
> +++ b/libavcodec/omx.c
> @@ -648,6 +648,10 @@ static av_cold int omx_encode_init(AVCodecContext *avctx)
>       OMX_BUFFERHEADERTYPE *buffer;
>       OMX_ERRORTYPE err;
>   
> +    av_log(avctx, AV_LOG_WARNING,
> +           "The %s encoder is deprecated and will be removed in future versions\n",
> +           avctx->codec->name);
> +
>       /* cleanup relies on the mutexes/conditions being initialized first. */
>       ret = ff_pthread_init(s, omx_codec_context_offsets);
>       if (ret < 0)
> diff --git a/libavcodec/version_major.h b/libavcodec/version_major.h
> index 37f243f868..7ab2b67c2f 100644
> --- a/libavcodec/version_major.h
> +++ b/libavcodec/version_major.h
> @@ -50,4 +50,7 @@
>   #define FF_API_QUALITY_FACTOR      (LIBAVCODEC_VERSION_MAJOR < 62)
>   #define FF_API_V408_CODECID        (LIBAVCODEC_VERSION_MAJOR < 62)
>   
> +// reminder to remove the OMX encoder on next major bump
> +#define FF_CODEC_OMX               (LIBAVCODEC_VERSION_MAJOR < 62)
> +
>   #endif /* AVCODEC_VERSION_MAJOR_H */

Ok.
diff mbox series

Patch

diff --git a/Changelog b/Changelog
index 7963e093dd..f702e1b67e 100644
--- a/Changelog
+++ b/Changelog
@@ -3,6 +3,7 @@  releases are sorted from youngest to oldest.
 
 version <next>:
 - yasm support dropped, users need to use nasm
+- OpenMAX encoders deprecated
 
 version 7.1:
 - Raw Captions with Time (RCWT) closed caption demuxer
diff --git a/configure b/configure
index 9f508a2527..92ab1344bf 100755
--- a/configure
+++ b/configure
@@ -7107,7 +7107,9 @@  enabled omx_rpi           && { test_code cc OMX_Core.h OMX_IndexConfigBrcmVideoR
                                  test_code cc OMX_Core.h OMX_IndexConfigBrcmVideoRequestIFrame; } ||
                                die "ERROR: OpenMAX IL headers from raspberrypi/firmware not found"; } &&
                              enable omx
-enabled omx               && require_headers OMX_Core.h
+enabled omx               && require_headers OMX_Core.h && \
+    warn "The OpenMAX encoders are deprecated and will be removed in future versions"
+
 enabled openssl           && { { check_pkg_config openssl "openssl >= 3.0.0" openssl/ssl.h OPENSSL_init_ssl &&
                                  { enabled gplv3 || ! enabled gpl || enabled nonfree || die "ERROR: OpenSSL >=3.0.0 requires --enable-version3"; }; } ||
                                { enabled gpl && ! enabled nonfree && die "ERROR: OpenSSL <3.0.0 is incompatible with the gpl"; } ||
diff --git a/libavcodec/omx.c b/libavcodec/omx.c
index 2c3865506f..2855aff8f2 100644
--- a/libavcodec/omx.c
+++ b/libavcodec/omx.c
@@ -648,6 +648,10 @@  static av_cold int omx_encode_init(AVCodecContext *avctx)
     OMX_BUFFERHEADERTYPE *buffer;
     OMX_ERRORTYPE err;
 
+    av_log(avctx, AV_LOG_WARNING,
+           "The %s encoder is deprecated and will be removed in future versions\n",
+           avctx->codec->name);
+
     /* cleanup relies on the mutexes/conditions being initialized first. */
     ret = ff_pthread_init(s, omx_codec_context_offsets);
     if (ret < 0)
diff --git a/libavcodec/version_major.h b/libavcodec/version_major.h
index 37f243f868..7ab2b67c2f 100644
--- a/libavcodec/version_major.h
+++ b/libavcodec/version_major.h
@@ -50,4 +50,7 @@ 
 #define FF_API_QUALITY_FACTOR      (LIBAVCODEC_VERSION_MAJOR < 62)
 #define FF_API_V408_CODECID        (LIBAVCODEC_VERSION_MAJOR < 62)
 
+// reminder to remove the OMX encoder on next major bump
+#define FF_CODEC_OMX               (LIBAVCODEC_VERSION_MAJOR < 62)
+
 #endif /* AVCODEC_VERSION_MAJOR_H */