For thread safety.
Unified · Split
| @@ -544,6 +544,30 @@ fail: · 543 unmodified lines | ||
| 544 | 544 | return err; |
| 545 | 545 | } |
| 546 | 546 | |
| 547 | +#if PL_API_VER >= 201 | |
| 548 | +# if PL_API_VER >= 278 | |
| 549 | +static void lock_queue(void *priv, uint32_t qf, uint32_t qidx) | |
| 550 | +# else | |
| 551 | +static 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 | |
| 560 | +static void unlock_queue(void *priv, uint32_t qf, uint32_t qidx) | |
| 561 | +# else | |
| 562 | +static 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 | + | |
| 547 | 571 | static int init_vulkan(AVFilterContext *avctx, const AVVulkanDeviceContext *hwctx) |
| 548 | 572 | { |
| 549 | 573 | int err = 0; |
| @@ -561,6 +585,11 @@ static int init_vulkan(AVFilterContext *avctx, const AVVulkanDeviceContext *hwct · 11 unmodified lines | ||
| 561 | 585 | .extensions = hwctx->enabled_dev_extensions, |
| 562 | 586 | .num_extensions = hwctx->nb_enabled_dev_extensions, |
| 563 | 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 | 593 | .queue_graphics = { |
| 565 | 594 | .index = hwctx->queue_family_index, |
| 566 | 595 | .count = hwctx->nb_graphics_queues, |