PR #21140 opened by Kacper Michajłow (kasper93)
URL: https://code.ffmpeg.org/FFmpeg/FFmpeg/pulls/21140
Patch URL: https://code.ffmpeg.org/FFmpeg/FFmpeg/pulls/21140.patch


From 08e01ed9bffe1c272a3119c300240f374adbf39b Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Kacper=20Michaj=C5=82ow?= <[email protected]>
Date: Tue, 9 Dec 2025 07:50:48 +0100
Subject: [PATCH 1/2] avcodec/libaomenc: remove UENUM1BYTE check
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

AOM had a short-lived API breakage introduced in commit [1], which was
workedaround in commit [2]. The original change, however, was reverted
shortly afterward in commit [3]. Since we require at least v2.0.0, there
is no need to keep this workaround.

[1] 
https://aomedia.googlesource.com/aom/+/4667aa1a373566e9c124afcd58c71731ab0d7377
[2] aaf9171574791cfa6bc5dd2115a840968d7ca5dc
[3] 
https://aomedia.googlesource.com/aom/+/9b1252eab0616d2c1f6d7990c6256441c0b6483f

Signed-off-by: Kacper Michajłow <[email protected]>
---
 libavcodec/libaomenc.c | 12 ------------
 1 file changed, 12 deletions(-)

diff --git a/libavcodec/libaomenc.c b/libavcodec/libaomenc.c
index be319d0f3c..34253af7b8 100644
--- a/libavcodec/libaomenc.c
+++ b/libavcodec/libaomenc.c
@@ -303,11 +303,7 @@ static av_cold void free_frame_list(struct FrameListData 
*list)
 }
 
 static av_cold int codecctl_int(AVCodecContext *avctx,
-#ifdef UENUM1BYTE
-                                aome_enc_control_id id,
-#else
                                 enum aome_enc_control_id id,
-#endif
                                 int val)
 {
     AOMContext *ctx = avctx->priv_data;
@@ -380,11 +376,7 @@ static int add_hdr_plus(AVCodecContext *avctx, struct 
aom_image *img, const AVFr
     defined(AOM_CTRL_AV1E_GET_SEQ_LEVEL_IDX) && \
     defined(AOM_CTRL_AV1E_GET_TARGET_SEQ_LEVEL_IDX)
 static av_cold int codecctl_intp(AVCodecContext *avctx,
-#ifdef UENUM1BYTE
-                                 aome_enc_control_id id,
-#else
                                  enum aome_enc_control_id id,
-#endif
                                  int* ptr)
 {
     AOMContext *ctx = avctx->priv_data;
@@ -408,11 +400,7 @@ static av_cold int codecctl_intp(AVCodecContext *avctx,
 #endif
 
 static av_cold int codecctl_imgp(AVCodecContext *avctx,
-#ifdef UENUM1BYTE
-                                 aome_enc_control_id id,
-#else
                                  enum aome_enc_control_id id,
-#endif
                                  struct aom_image *img)
 {
     AOMContext *ctx = avctx->priv_data;
-- 
2.49.1


From 3f604aa8895c95e78feab712ee4467de8a43d8b1 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Kacper=20Michaj=C5=82ow?= <[email protected]>
Date: Tue, 9 Dec 2025 08:09:25 +0100
Subject: [PATCH 2/2] avcodec/libaomenc: remove enum type from codecctl_*
 functions
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

aom_codec_control() takes control id as int. It could be AV1E_ or common
AV1_ enum in encoder, and AV1D_ for decoder.

While upstream provides AOM_CODEC_CONTROL_TYPECHECKED() macro to check
the provided enum value, we wrap those calls in codecctl_ functions,
which makes it not feasible to use.

To avoid complicating this needlessly, just use int.

Fixes: warning: implicit conversion from enumeration type 'enum 
aom_com_control_id' to different enumeration type 'enum aome_enc_control_id'
Signed-off-by: Kacper Michajłow <[email protected]>
---
 libavcodec/libaomenc.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/libavcodec/libaomenc.c b/libavcodec/libaomenc.c
index 34253af7b8..20e97e5d43 100644
--- a/libavcodec/libaomenc.c
+++ b/libavcodec/libaomenc.c
@@ -303,7 +303,7 @@ static av_cold void free_frame_list(struct FrameListData 
*list)
 }
 
 static av_cold int codecctl_int(AVCodecContext *avctx,
-                                enum aome_enc_control_id id,
+                                int id,
                                 int val)
 {
     AOMContext *ctx = avctx->priv_data;
@@ -376,7 +376,7 @@ static int add_hdr_plus(AVCodecContext *avctx, struct 
aom_image *img, const AVFr
     defined(AOM_CTRL_AV1E_GET_SEQ_LEVEL_IDX) && \
     defined(AOM_CTRL_AV1E_GET_TARGET_SEQ_LEVEL_IDX)
 static av_cold int codecctl_intp(AVCodecContext *avctx,
-                                 enum aome_enc_control_id id,
+                                 int id,
                                  int* ptr)
 {
     AOMContext *ctx = avctx->priv_data;
@@ -400,7 +400,7 @@ static av_cold int codecctl_intp(AVCodecContext *avctx,
 #endif
 
 static av_cold int codecctl_imgp(AVCodecContext *avctx,
-                                 enum aome_enc_control_id id,
+                                 int id,
                                  struct aom_image *img)
 {
     AOMContext *ctx = avctx->priv_data;
-- 
2.49.1

_______________________________________________
ffmpeg-devel mailing list -- [email protected]
To unsubscribe send an email to [email protected]

Reply via email to