aboutsummaryrefslogtreecommitdiffstats
path: root/libavcodec/vulkan_decode.c
diff options
context:
space:
mode:
authorLynne <dev@lynne.ee>2024-12-03 15:31:49 +0900
committerLynne <dev@lynne.ee>2024-12-23 04:25:09 +0900
commit2e06b84e2747ef4ea4d9f5c20c936aa866f7647d (patch)
treeba037209826667bf2eb78796b180b673e40b36dc /libavcodec/vulkan_decode.c
parent157cd820adbbfcfd1870a6ce12d072dc0f623e9b (diff)
downloadffmpeg-2e06b84e2747ef4ea4d9f5c20c936aa866f7647d.tar.gz
vulkan: do not reinvent a queue context struct
We recently introduced a public field which was a superset of the queue context we used to have. Switch to using it entirely. This also allows us to get rid of the NIH function which was valid only for video queues.
Diffstat (limited to 'libavcodec/vulkan_decode.c')
-rw-r--r--libavcodec/vulkan_decode.c16
1 files changed, 7 insertions, 9 deletions
diff --git a/libavcodec/vulkan_decode.c b/libavcodec/vulkan_decode.c
index 1a5e70b2d6..8fd97a6dea 100644
--- a/libavcodec/vulkan_decode.c
+++ b/libavcodec/vulkan_decode.c
@@ -1116,21 +1116,19 @@ int ff_vk_decode_init(AVCodecContext *avctx)
/* Create queue context */
vk_desc = get_codecdesc(avctx->codec_id);
- err = ff_vk_video_qf_init(s, &ctx->qf,
- VK_QUEUE_VIDEO_DECODE_BIT_KHR,
- vk_desc->decode_op);
- if (err < 0) {
+ ctx->qf = ff_vk_qf_find(s, VK_QUEUE_VIDEO_DECODE_BIT_KHR, vk_desc->decode_op);
+ if (!ctx->qf) {
av_log(avctx, AV_LOG_ERROR, "Decoding of %s is not supported by this device\n",
avcodec_get_name(avctx->codec_id));
return err;
}
- /* Enable queries if supported */
- if (s->query_props[ctx->qf.queue_family].queryResultStatusSupport)
+ /* Enable queries if supported and usable */
+ if (s->query_props[ctx->qf->idx].queryResultStatusSupport)
nb_q = 1;
session_create.flags = 0x0;
- session_create.queueFamilyIndex = ctx->qf.queue_family;
+ session_create.queueFamilyIndex = ctx->qf->idx;
session_create.maxCodedExtent = ctx->caps.maxCodedExtent;
session_create.maxDpbSlots = ctx->caps.maxDpbSlots;
session_create.maxActiveReferencePictures = ctx->caps.maxActiveReferencePictures;
@@ -1142,8 +1140,8 @@ int ff_vk_decode_init(AVCodecContext *avctx)
/* Create decode exec context for this specific main thread.
* 2 async contexts per thread was experimentally determined to be optimal
* for a majority of streams. */
- err = ff_vk_exec_pool_init(s, &ctx->qf, &ctx->exec_pool,
- FFMAX(2*ctx->qf.nb_queues, avctx->thread_count),
+ err = ff_vk_exec_pool_init(s, ctx->qf, &ctx->exec_pool,
+ FFMAX(2*ctx->qf->num, avctx->thread_count),
nb_q, VK_QUERY_TYPE_RESULT_STATUS_ONLY_KHR, 0,
profile);
if (err < 0)