History

avfilter/vf_libplacebo: forward queue locking primitives

For thread safety.

Niklas Haas committed 3 years ago

Commit 661db601 parent f70f8731 file · +29 −0Browse files

Unified · Split

libavfilter/vf_libplacebo.c+29−0
@@ -544,6 +544,30 @@ fail: · 543 unmodified lines
544 return err;544 return err;
545}545}
546 546
547#if PL_API_VER >= 201
548# if PL_API_VER >= 278
549static void lock_queue(void *priv, uint32_t qf, uint32_t qidx)
550# else
551static void lock_queue(void *priv, int qf, int qidx)
552# endif
553{
554 AVHWDeviceContext *avhwctx = priv;
555 const AVVulkanDeviceContext *hwctx = avhwctx->hwctx;
556 hwctx->lock_queue(avhwctx, qf, qidx);
557}
558
559# if PL_API_VER >= 278
560static void unlock_queue(void *priv, uint32_t qf, uint32_t qidx)
561# else
562static void unlock_queue(void *priv, int qf, int qidx)
563# endif
564{
565 AVHWDeviceContext *avhwctx = priv;
566 const AVVulkanDeviceContext *hwctx = avhwctx->hwctx;
567 hwctx->unlock_queue(avhwctx, qf, qidx);
568}
569#endif
570
547static int init_vulkan(AVFilterContext *avctx, const AVVulkanDeviceContext *hwctx)571static int init_vulkan(AVFilterContext *avctx, const AVVulkanDeviceContext *hwctx)
548{572{
549 int err = 0;573 int err = 0;
@@ -561,6 +585,11 @@ static int init_vulkan(AVFilterContext *avctx, const AVVulkanDeviceContext *hwct · 11 unmodified lines
561 .extensions = hwctx->enabled_dev_extensions,585 .extensions = hwctx->enabled_dev_extensions,
562 .num_extensions = hwctx->nb_enabled_dev_extensions,586 .num_extensions = hwctx->nb_enabled_dev_extensions,
563 .features = &hwctx->device_features,587 .features = &hwctx->device_features,
588#if PL_API_VER >= 201
589 .lock_queue = lock_queue,
590 .unlock_queue = unlock_queue,
591 .queue_ctx = avctx->hw_device_ctx->data,
592#endif
564 .queue_graphics = {593 .queue_graphics = {
565 .index = hwctx->queue_family_index,594 .index = hwctx->queue_family_index,
566 .count = hwctx->nb_graphics_queues,595 .count = hwctx->nb_graphics_queues,

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t