From: "Kacper Michajłow via ffmpeg-devel" <ffmpeg-devel@ffmpeg.org>
To: ffmpeg-devel@ffmpeg.org
Cc: "Kacper Michajłow" <code@ffmpeg.org>
Subject: [FFmpeg-devel] [PATCH] avutil/hwcontext_vulkan: use correct bitmask types (PR #20845)
Date: Wed, 05 Nov 2025 18:05:11 -0000
Message-ID: <176236591222.25.4408400031120998197@2cb04c0e5124> (raw)
PR #20845 opened by Kacper Michajłow (kasper93)
URL: https://code.ffmpeg.org/FFmpeg/FFmpeg/pulls/20845
Patch URL: https://code.ffmpeg.org/FFmpeg/FFmpeg/pulls/20845.patch
From 08d327e92c967f75e024d8a3b0dc8399ab2c0156 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Kacper=20Michaj=C5=82ow?= <kasper93@gmail.com>
Date: Wed, 5 Nov 2025 18:50:29 +0100
Subject: [PATCH 1/4] fftools/ffmpeg: suppress unused variable warning, but
using it
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Signed-off-by: Kacper Michajłow <kasper93@gmail.com>
---
fftools/ffmpeg.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/fftools/ffmpeg.c b/fftools/ffmpeg.c
index 32289112a8..444d027c15 100644
--- a/fftools/ffmpeg.c
+++ b/fftools/ffmpeg.c
@@ -250,7 +250,7 @@ void term_init(void)
/* read a key without blocking */
static int read_key(void)
{
- unsigned char ch;
+ unsigned char ch = -1;
#if HAVE_TERMIOS_H
int n = 1;
struct timeval tv;
@@ -297,7 +297,7 @@ static int read_key(void)
if(kbhit())
return(getch());
#endif
- return -1;
+ return ch;
}
static int decode_interrupt_cb(void *ctx)
--
2.49.1
From c3ff7d23f5cf1c295cb79ac25569555e12efa6cf Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Kacper=20Michaj=C5=82ow?= <kasper93@gmail.com>
Date: Wed, 5 Nov 2025 18:51:12 +0100
Subject: [PATCH 2/4] avcodec/dxva2: move variable declaration to for loop to
avoid warning
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Signed-off-by: Kacper Michajłow <kasper93@gmail.com>
---
libavcodec/dxva2.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/libavcodec/dxva2.c b/libavcodec/dxva2.c
index 22ecd5acaf..a282e6c0c7 100644
--- a/libavcodec/dxva2.c
+++ b/libavcodec/dxva2.c
@@ -773,7 +773,6 @@ unsigned ff_dxva2_get_surface_index(const AVCodecContext *avctx,
int curr)
{
void *surface = get_surface(avctx, frame);
- unsigned i;
#if CONFIG_D3D12VA
if (avctx->pix_fmt == AV_PIX_FMT_D3D12) {
@@ -790,7 +789,7 @@ unsigned ff_dxva2_get_surface_index(const AVCodecContext *avctx,
}
#endif
#if CONFIG_DXVA2
- for (i = 0; i < DXVA_CONTEXT_COUNT(avctx, ctx); i++) {
+ for (unsigned i = 0; i < DXVA_CONTEXT_COUNT(avctx, ctx); i++) {
if (avctx->pix_fmt == AV_PIX_FMT_DXVA2_VLD && ctx->dxva2.surface[i] == surface)
return i;
}
--
2.49.1
From f47896422674504d053712a59f42f130c3836e46 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Kacper=20Michaj=C5=82ow?= <kasper93@gmail.com>
Date: Wed, 5 Nov 2025 18:51:38 +0100
Subject: [PATCH 3/4] avcodec/vulkan_encode_av1: fix unit_elems check
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Wrong enum value was used to check unit_elems. While
AV_FRAME_DATA_MASTERING_DISPLAY_METADATA (11) would trigger when
UNIT_MASTERING_DISPLAY (2) was set, it also would match
UNIT_CONTENT_LIGHT_LEVEL (1) which is not expected.
Signed-off-by: Kacper Michajłow <kasper93@gmail.com>
---
libavcodec/vulkan_encode_av1.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/libavcodec/vulkan_encode_av1.c b/libavcodec/vulkan_encode_av1.c
index bb47ddd7f1..1f26b37316 100644
--- a/libavcodec/vulkan_encode_av1.c
+++ b/libavcodec/vulkan_encode_av1.c
@@ -1081,7 +1081,7 @@ static int write_extra_headers(AVCodecContext *avctx,
VulkanEncodeAV1Picture *ap = base_pic->codec_priv;
CodedBitstreamFragment *obu = &enc->current_access_unit;
- if (ap->units_needed & AV_FRAME_DATA_MASTERING_DISPLAY_METADATA) {
+ if (ap->units_needed & UNIT_MASTERING_DISPLAY) {
err = vulkan_encode_av1_add_obu(avctx, obu,
AV1_OBU_METADATA,
&enc->meta_mastering_obu);
--
2.49.1
From 3eb0cb3b0b0c4ad3ca14818adb26e0f2b6fa1c6c Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Kacper=20Michaj=C5=82ow?= <kasper93@gmail.com>
Date: Wed, 5 Nov 2025 18:58:42 +0100
Subject: [PATCH 4/4] avutil/hwcontext_vulkan: use correct bitmask types
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Vulkan headers define *FlagBits enum with individual bit values, and
coresponding *Flags typedef to be used to store the bitmask of
coresponding bits.
In practice those two types map to the same type, but for consistency
*Flags should be used.
Fixes MSVC warnings about type mismatch.
Signed-off-by: Kacper Michajłow <kasper93@gmail.com>
---
libavutil/hwcontext_vulkan.c | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)
diff --git a/libavutil/hwcontext_vulkan.c b/libavutil/hwcontext_vulkan.c
index f7b487913b..85bae53e5a 100644
--- a/libavutil/hwcontext_vulkan.c
+++ b/libavutil/hwcontext_vulkan.c
@@ -1439,14 +1439,14 @@ static inline int pick_queue_family(VkQueueFamilyProperties2 *qf, uint32_t num_q
static inline int pick_video_queue_family(VkQueueFamilyProperties2 *qf,
VkQueueFamilyVideoPropertiesKHR *qf_vid, uint32_t num_qf,
- VkVideoCodecOperationFlagBitsKHR flags)
+ VkVideoCodecOperationFlagsKHR flags)
{
int index = -1;
uint32_t min_score = UINT32_MAX;
for (int i = 0; i < num_qf; i++) {
- const VkQueueFlagBits qflags = qf[i].queueFamilyProperties.queueFlags;
- const VkQueueFlagBits vflags = qf_vid[i].videoCodecOperations;
+ const VkQueueFlags qflags = qf[i].queueFamilyProperties.queueFlags;
+ const VkVideoCodecOperationFlagsKHR vflags = qf_vid[i].videoCodecOperations;
if (!(qflags & (VK_QUEUE_VIDEO_ENCODE_BIT_KHR | VK_QUEUE_VIDEO_DECODE_BIT_KHR)))
continue;
@@ -2675,7 +2675,7 @@ fail:
/* Checks if an export flag is enabled, and if it is ORs it with *iexp */
static void try_export_flags(AVHWFramesContext *hwfc,
VkExternalMemoryHandleTypeFlags *comp_handle_types,
- VkExternalMemoryHandleTypeFlagBits *iexp,
+ VkExternalMemoryHandleTypeFlags *iexp,
VkExternalMemoryHandleTypeFlagBits exp)
{
VkResult ret;
@@ -2846,7 +2846,7 @@ static int vulkan_frames_init(AVHWFramesContext *hwfc)
AVVulkanFramesContext *hwctx = &fp->p;
VulkanDevicePriv *p = hwfc->device_ctx->hwctx;
AVVulkanDeviceContext *dev_hwctx = &p->p;
- VkImageUsageFlagBits supported_usage;
+ VkImageUsageFlags supported_usage;
FFVulkanFunctions *vk = &p->vkctx.vkfn;
const struct FFVkFormatEntry *fmt;
int disable_multiplane = p->disable_multiplane ||
--
2.49.1
_______________________________________________
ffmpeg-devel mailing list -- ffmpeg-devel@ffmpeg.org
To unsubscribe send an email to ffmpeg-devel-leave@ffmpeg.org
reply other threads:[~2025-11-05 18:05 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=176236591222.25.4408400031120998197@2cb04c0e5124 \
--to=ffmpeg-devel@ffmpeg.org \
--cc=code@ffmpeg.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
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