Git Inbox Mirror of the ffmpeg-devel mailing list - see https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
 help / color / mirror / Atom feed
From: Zhao Zhili <quinkblack-at-foxmail.com@ffmpeg.org>
To: ffmpeg-devel@ffmpeg.org
Cc: Zhao Zhili <zhilizhao@tencent.com>
Subject: [FFmpeg-devel] [PATCH 1/2] fftools/ffplay_renderer: Use new vulkan queue API
Date: Mon, 16 Jun 2025 22:36:57 +0800
Message-ID: <tencent_A92EAD4543D31BA84D53E43379D5C2A91F05@qq.com> (raw)

From: Zhao Zhili <zhilizhao@tencent.com>

Fixes deprecation warning.

Signed-off-by: Zhao Zhili <zhilizhao@tencent.com>
---
 fftools/ffplay_renderer.c | 73 +++++++++++++++++++++++++++++----------
 1 file changed, 54 insertions(+), 19 deletions(-)

diff --git a/fftools/ffplay_renderer.c b/fftools/ffplay_renderer.c
index b702c2883f..699cd6ecd0 100644
--- a/fftools/ffplay_renderer.c
+++ b/fftools/ffplay_renderer.c
@@ -259,8 +259,8 @@ static int create_vk_by_hwcontext(VkRenderer *renderer,
 
     ctx->get_proc_addr = hwctx->get_proc_addr;
     ctx->inst = hwctx->inst;
-    ctx->placebo_vulkan = pl_vulkan_import(ctx->vk_log,
-        pl_vulkan_import_params(
+
+    struct pl_vulkan_import_params import_params = {
             .instance = hwctx->inst,
             .get_proc_addr = hwctx->get_proc_addr,
             .phys_device = hwctx->phys_dev,
@@ -272,18 +272,36 @@ static int create_vk_by_hwcontext(VkRenderer *renderer,
             .unlock_queue   = hwctx_unlock_queue,
             .queue_ctx      = dev,
             .queue_graphics = {
-                .index = hwctx->queue_family_index,
-                .count = hwctx->nb_graphics_queues,
+                .index = VK_QUEUE_FAMILY_IGNORED,
+                .count = 0,
             },
             .queue_compute = {
-                .index = hwctx->queue_family_comp_index,
-                .count = hwctx->nb_comp_queues,
+                .index = VK_QUEUE_FAMILY_IGNORED,
+                .count = 0,
             },
             .queue_transfer = {
-                .index = hwctx->queue_family_tx_index,
-                .count = hwctx->nb_tx_queues,
+                .index = VK_QUEUE_FAMILY_IGNORED,
+                .count = 0,
             },
-        ));
+    };
+    for (int i = 0; i < hwctx->nb_qf; i++) {
+        const AVVulkanDeviceQueueFamily *qf = &hwctx->qf[i];
+
+        if (qf->flags & VK_QUEUE_GRAPHICS_BIT) {
+            import_params.queue_graphics.index = qf->idx;
+            import_params.queue_graphics.count = qf->num;
+        }
+        if (qf->flags & VK_QUEUE_COMPUTE_BIT) {
+            import_params.queue_compute.index = qf->idx;
+            import_params.queue_compute.count = qf->num;
+        }
+        if (qf->flags & VK_QUEUE_TRANSFER_BIT) {
+            import_params.queue_transfer.index = qf->idx;
+            import_params.queue_transfer.count = qf->num;
+        }
+    }
+
+    ctx->placebo_vulkan = pl_vulkan_import(ctx->vk_log, &import_params);
     if (!ctx->placebo_vulkan)
         return AVERROR_EXTERNAL;
 
@@ -408,21 +426,38 @@ static int create_vk_by_placebo(VkRenderer *renderer,
     vk_dev_ctx->enabled_dev_extensions = ctx->placebo_vulkan->extensions;
     vk_dev_ctx->nb_enabled_dev_extensions = ctx->placebo_vulkan->num_extensions;
 
-    vk_dev_ctx->queue_family_index = ctx->placebo_vulkan->queue_graphics.index;
-    vk_dev_ctx->nb_graphics_queues = ctx->placebo_vulkan->queue_graphics.count;
-
-    vk_dev_ctx->queue_family_tx_index = ctx->placebo_vulkan->queue_transfer.index;
-    vk_dev_ctx->nb_tx_queues = ctx->placebo_vulkan->queue_transfer.count;
-
-    vk_dev_ctx->queue_family_comp_index = ctx->placebo_vulkan->queue_compute.index;
-    vk_dev_ctx->nb_comp_queues = ctx->placebo_vulkan->queue_compute.count;
+    int nb_qf = 0;
+    vk_dev_ctx->qf[nb_qf] = (AVVulkanDeviceQueueFamily) {
+        .idx = ctx->placebo_vulkan->queue_graphics.index,
+        .num = ctx->placebo_vulkan->queue_graphics.count,
+        .flags = VK_QUEUE_GRAPHICS_BIT,
+    };
+    nb_qf++;
+    vk_dev_ctx->qf[nb_qf] = (AVVulkanDeviceQueueFamily) {
+        .idx = ctx->placebo_vulkan->queue_transfer.index,
+        .num = ctx->placebo_vulkan->queue_transfer.count,
+        .flags = VK_QUEUE_TRANSFER_BIT,
+    };
+    nb_qf++;
+    vk_dev_ctx->qf[nb_qf] = (AVVulkanDeviceQueueFamily) {
+        .idx = ctx->placebo_vulkan->queue_compute.index,
+        .num = ctx->placebo_vulkan->queue_compute.count,
+        .flags = VK_QUEUE_COMPUTE_BIT,
+    };
+    nb_qf++;
 
     ret = get_decode_queue(renderer, &decode_index, &decode_count);
     if (ret < 0)
         return ret;
 
-    vk_dev_ctx->queue_family_decode_index = decode_index;
-    vk_dev_ctx->nb_decode_queues = decode_count;
+    vk_dev_ctx->qf[nb_qf] = (AVVulkanDeviceQueueFamily) {
+        .idx = decode_index,
+        .num = decode_count,
+        .flags = VK_QUEUE_VIDEO_DECODE_BIT_KHR,
+    };
+    nb_qf++;
+
+    vk_dev_ctx->nb_qf = nb_qf;
 
     ret = av_hwdevice_ctx_init(ctx->hw_device_ref);
     if (ret < 0)
-- 
2.25.1

_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".

                 reply	other threads:[~2025-06-16 14:37 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=tencent_A92EAD4543D31BA84D53E43379D5C2A91F05@qq.com \
    --to=quinkblack-at-foxmail.com@ffmpeg.org \
    --cc=ffmpeg-devel@ffmpeg.org \
    --cc=zhilizhao@tencent.com \
    /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