For thread safety.
Showing the changes to libavfilter (1 of 1 file). Show all
Unified · Split
| @@ -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 | ||
| 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 | static int init_vulkan(AVFilterContext *avctx, const AVVulkanDeviceContext *hwctx) | 571 | static 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, |