* [FFmpeg-devel] [PATCH] avcodec/libaomenc: remove enum type from codecctl_* functions (PR #21140)
@ 2025-12-09 7:17 Kacper Michajłow via ffmpeg-devel
0 siblings, 0 replies; only message in thread
From: Kacper Michajłow via ffmpeg-devel @ 2025-12-09 7:17 UTC (permalink / raw)
To: ffmpeg-devel; +Cc: Kacper Michajłow
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?= <kasper93@gmail.com>
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 <kasper93@gmail.com>
---
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?= <kasper93@gmail.com>
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 <kasper93@gmail.com>
---
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 -- ffmpeg-devel@ffmpeg.org
To unsubscribe send an email to ffmpeg-devel-leave@ffmpeg.org
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2025-12-09 7:18 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2025-12-09 7:17 [FFmpeg-devel] [PATCH] avcodec/libaomenc: remove enum type from codecctl_* functions (PR #21140) Kacper Michajłow via ffmpeg-devel
Git Inbox Mirror of the ffmpeg-devel mailing list - see https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
This inbox may be cloned and mirrored by anyone:
git clone --mirror https://master.gitmailbox.com/ffmpegdev/0 ffmpegdev/git/0.git
# If you have public-inbox 1.1+ installed, you may
# initialize and index your mirror using the following commands:
public-inbox-init -V2 ffmpegdev ffmpegdev/ https://master.gitmailbox.com/ffmpegdev \
ffmpegdev@gitmailbox.com
public-inbox-index ffmpegdev
Example config snippet for mirrors.
AGPL code for this site: git clone https://public-inbox.org/public-inbox.git