mirror of
https://git.ffmpeg.org/ffmpeg.git
synced 2026-06-11 08:13:06 +00:00
hwcontext_vulkan: deprecate AVVulkanDeviceContext.lock/unlock_queue
Without replacement, as VK_KHR_internally_synchronized_queues will be required.
This commit is contained in:
@@ -2,6 +2,10 @@ The last version increases of all libraries were on 2025-03-28
|
||||
|
||||
API changes, most recent first:
|
||||
|
||||
2026-03-14 - xxxxxxxxxx - lavu 60.29.100 - hwcontext_vulkan.h
|
||||
Deprecate AVVulkanDeviceContext.lock_queue and
|
||||
AVVulkanDeviceContext.unlock_queue without replacement.
|
||||
|
||||
2026-03-12 - xxxxxxxxxx - lsws 9.7.100 - swscale.h
|
||||
Add enum SwsScaler, and SwsContext.scaler/scaler_sub.
|
||||
|
||||
|
||||
@@ -43,6 +43,7 @@
|
||||
|
||||
#include "libavutil/bprint.h"
|
||||
#include "libavutil/mem.h"
|
||||
#include "libavutil/internal.h"
|
||||
|
||||
#endif
|
||||
|
||||
@@ -115,14 +116,22 @@ static void hwctx_lock_queue(void *priv, uint32_t qf, uint32_t qidx)
|
||||
{
|
||||
AVHWDeviceContext *avhwctx = priv;
|
||||
const AVVulkanDeviceContext *hwctx = avhwctx->hwctx;
|
||||
#if FF_API_VULKAN_SYNC_QUEUES
|
||||
FF_DISABLE_DEPRECATION_WARNINGS
|
||||
hwctx->lock_queue(avhwctx, qf, qidx);
|
||||
FF_ENABLE_DEPRECATION_WARNINGS
|
||||
#endif
|
||||
}
|
||||
|
||||
static void hwctx_unlock_queue(void *priv, uint32_t qf, uint32_t qidx)
|
||||
{
|
||||
AVHWDeviceContext *avhwctx = priv;
|
||||
const AVVulkanDeviceContext *hwctx = avhwctx->hwctx;
|
||||
#if FF_API_VULKAN_SYNC_QUEUES
|
||||
FF_DISABLE_DEPRECATION_WARNINGS
|
||||
hwctx->unlock_queue(avhwctx, qf, qidx);
|
||||
FF_ENABLE_DEPRECATION_WARNINGS
|
||||
#endif
|
||||
}
|
||||
|
||||
static int add_instance_extension(const char **ext, unsigned num_ext,
|
||||
@@ -283,7 +292,11 @@ static void placebo_lock_queue(struct AVHWDeviceContext *dev_ctx,
|
||||
{
|
||||
RendererContext *ctx = dev_ctx->user_opaque;
|
||||
pl_vulkan vk = ctx->placebo_vulkan;
|
||||
#if FF_API_VULKAN_SYNC_QUEUES
|
||||
FF_DISABLE_DEPRECATION_WARNINGS
|
||||
vk->lock_queue(vk, queue_family, index);
|
||||
FF_ENABLE_DEPRECATION_WARNINGS
|
||||
#endif
|
||||
}
|
||||
|
||||
static void placebo_unlock_queue(struct AVHWDeviceContext *dev_ctx,
|
||||
@@ -292,7 +305,11 @@ static void placebo_unlock_queue(struct AVHWDeviceContext *dev_ctx,
|
||||
{
|
||||
RendererContext *ctx = dev_ctx->user_opaque;
|
||||
pl_vulkan vk = ctx->placebo_vulkan;
|
||||
#if FF_API_VULKAN_SYNC_QUEUES
|
||||
FF_DISABLE_DEPRECATION_WARNINGS
|
||||
vk->unlock_queue(vk, queue_family, index);
|
||||
FF_ENABLE_DEPRECATION_WARNINGS
|
||||
#endif
|
||||
}
|
||||
|
||||
static int get_decode_queue(VkRenderer *renderer, int *index, int *count)
|
||||
@@ -386,8 +403,12 @@ static int create_vk_by_placebo(VkRenderer *renderer,
|
||||
device_ctx->user_opaque = ctx;
|
||||
|
||||
vk_dev_ctx = device_ctx->hwctx;
|
||||
#if FF_API_VULKAN_SYNC_QUEUES
|
||||
FF_DISABLE_DEPRECATION_WARNINGS
|
||||
vk_dev_ctx->lock_queue = placebo_lock_queue;
|
||||
vk_dev_ctx->unlock_queue = placebo_unlock_queue;
|
||||
FF_ENABLE_DEPRECATION_WARNINGS
|
||||
#endif
|
||||
|
||||
vk_dev_ctx->get_proc_addr = ctx->placebo_instance->get_proc_addr;
|
||||
|
||||
|
||||
@@ -667,14 +667,22 @@ static void lock_queue(void *priv, uint32_t qf, uint32_t qidx)
|
||||
{
|
||||
AVHWDeviceContext *avhwctx = priv;
|
||||
const AVVulkanDeviceContext *hwctx = avhwctx->hwctx;
|
||||
#if FF_API_VULKAN_SYNC_QUEUES
|
||||
FF_DISABLE_DEPRECATION_WARNINGS
|
||||
hwctx->lock_queue(avhwctx, qf, qidx);
|
||||
FF_ENABLE_DEPRECATION_WARNINGS
|
||||
#endif
|
||||
}
|
||||
|
||||
static void unlock_queue(void *priv, uint32_t qf, uint32_t qidx)
|
||||
{
|
||||
AVHWDeviceContext *avhwctx = priv;
|
||||
const AVVulkanDeviceContext *hwctx = avhwctx->hwctx;
|
||||
#if FF_API_VULKAN_SYNC_QUEUES
|
||||
FF_DISABLE_DEPRECATION_WARNINGS
|
||||
hwctx->unlock_queue(avhwctx, qf, qidx);
|
||||
FF_ENABLE_DEPRECATION_WARNINGS
|
||||
#endif
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
@@ -2119,10 +2119,14 @@ FF_ENABLE_DEPRECATION_WARNINGS
|
||||
p->img_qfs[p->nb_img_qfs++] = hwctx->qf[i].idx;
|
||||
}
|
||||
|
||||
#if FF_API_VULKAN_SYNC_QUEUES
|
||||
FF_DISABLE_DEPRECATION_WARNINGS
|
||||
if (!hwctx->lock_queue)
|
||||
hwctx->lock_queue = lock_queue;
|
||||
if (!hwctx->unlock_queue)
|
||||
hwctx->unlock_queue = unlock_queue;
|
||||
FF_ENABLE_DEPRECATION_WARNINGS
|
||||
#endif
|
||||
|
||||
/* Re-query device capabilities, in case the device was created externally */
|
||||
vk->GetPhysicalDeviceMemoryProperties(hwctx->phys_dev, &p->mprops);
|
||||
|
||||
@@ -168,18 +168,26 @@ typedef struct AVVulkanDeviceContext {
|
||||
int nb_decode_queues;
|
||||
#endif
|
||||
|
||||
#if FF_API_VULKAN_SYNC_QUEUES
|
||||
/**
|
||||
* Locks a queue, preventing other threads from submitting any command
|
||||
* buffers to this queue.
|
||||
* If set to NULL, will be set to lavu-internal functions that utilize a
|
||||
* mutex.
|
||||
*
|
||||
* Deprecated: use VK_KHR_internally_synchronized_queues.
|
||||
*/
|
||||
attribute_deprecated
|
||||
void (*lock_queue)(struct AVHWDeviceContext *ctx, uint32_t queue_family, uint32_t index);
|
||||
|
||||
/**
|
||||
* Similar to lock_queue(), unlocks a queue. Must only be called after locking.
|
||||
*
|
||||
* Deprecated: use VK_KHR_internally_synchronized_queues.
|
||||
*/
|
||||
attribute_deprecated
|
||||
void (*unlock_queue)(struct AVHWDeviceContext *ctx, uint32_t queue_family, uint32_t index);
|
||||
#endif
|
||||
|
||||
/**
|
||||
* Queue families used. Must be preferentially ordered. List may contain
|
||||
|
||||
+2
-1
@@ -79,7 +79,7 @@
|
||||
*/
|
||||
|
||||
#define LIBAVUTIL_VERSION_MAJOR 60
|
||||
#define LIBAVUTIL_VERSION_MINOR 28
|
||||
#define LIBAVUTIL_VERSION_MINOR 29
|
||||
#define LIBAVUTIL_VERSION_MICRO 100
|
||||
|
||||
#define LIBAVUTIL_VERSION_INT AV_VERSION_INT(LIBAVUTIL_VERSION_MAJOR, \
|
||||
@@ -113,6 +113,7 @@
|
||||
#define FF_API_CPU_FLAG_FORCE (LIBAVUTIL_VERSION_MAJOR < 61)
|
||||
#define FF_API_DOVI_L11_INVALID_PROPS (LIBAVUTIL_VERSION_MAJOR < 61)
|
||||
#define FF_API_ASSERT_FPU (LIBAVUTIL_VERSION_MAJOR < 61)
|
||||
#define FF_API_VULKAN_SYNC_QUEUES (LIBAVUTIL_VERSION_MAJOR < 62)
|
||||
|
||||
/**
|
||||
* @}
|
||||
|
||||
@@ -928,9 +928,17 @@ int ff_vk_exec_submit(FFVulkanContext *s, FFVkExecContext *e)
|
||||
return AVERROR_EXTERNAL;
|
||||
}
|
||||
|
||||
#if FF_API_VULKAN_SYNC_QUEUES
|
||||
FF_DISABLE_DEPRECATION_WARNINGS
|
||||
s->hwctx->lock_queue(s->device, e->qf, e->qi);
|
||||
FF_ENABLE_DEPRECATION_WARNINGS
|
||||
#endif
|
||||
ret = vk->QueueSubmit2(e->queue, 1, &submit_info, e->fence);
|
||||
#if FF_API_VULKAN_SYNC_QUEUES
|
||||
FF_DISABLE_DEPRECATION_WARNINGS
|
||||
s->hwctx->unlock_queue(s->device, e->qf, e->qi);
|
||||
FF_ENABLE_DEPRECATION_WARNINGS
|
||||
#endif
|
||||
|
||||
if (ret != VK_SUCCESS) {
|
||||
av_log(s, AV_LOG_ERROR, "Unable to submit command buffer: %s\n",
|
||||
|
||||
Reference in New Issue
Block a user