From: Niklas Haas <ffmpeg@haasn.xyz> To: ffmpeg-devel@ffmpeg.org Cc: Niklas Haas <git@haasn.dev> Subject: [FFmpeg-devel] [PATCH] lavfi/vf_libplacebo: require v5.278 for importing Date: Mon, 29 May 2023 12:59:52 +0200 Message-ID: <20230529105952.24077-1-ffmpeg@haasn.xyz> (raw) From: Niklas Haas <git@haasn.dev> Importing Vulkan device on older versions no longer works due to the lavu vulkan API changes (specifically, the switch to planar textures by default). Additionally, importing on versions that don't suppirt lock/unlock_queue is unsafe with the advent of the threaded vulkan hwaccel. As a plus, saves us some annoying #ifdef boilerplate. I will raise the minimum vf_libplacebo version globally on the next stable release of libplacebo, and remove all of these checks. --- libavfilter/vf_libplacebo.c | 20 +++++++++----------- 1 file changed, 9 insertions(+), 11 deletions(-) diff --git a/libavfilter/vf_libplacebo.c b/libavfilter/vf_libplacebo.c index 2b8dac09b06..0a849f86762 100644 --- a/libavfilter/vf_libplacebo.c +++ b/libavfilter/vf_libplacebo.c @@ -544,23 +544,15 @@ fail: return err; } -#if PL_API_VER >= 201 -# if PL_API_VER >= 278 +#if PL_API_VER >= 278 static void lock_queue(void *priv, uint32_t qf, uint32_t qidx) -# else -static void lock_queue(void *priv, int qf, int qidx) -# endif { AVHWDeviceContext *avhwctx = priv; const AVVulkanDeviceContext *hwctx = avhwctx->hwctx; hwctx->lock_queue(avhwctx, qf, qidx); } -# if PL_API_VER >= 278 static void unlock_queue(void *priv, uint32_t qf, uint32_t qidx) -# else -static void unlock_queue(void *priv, int qf, int qidx) -# endif { AVHWDeviceContext *avhwctx = priv; const AVVulkanDeviceContext *hwctx = avhwctx->hwctx; @@ -576,6 +568,7 @@ static int init_vulkan(AVFilterContext *avctx, const AVVulkanDeviceContext *hwct size_t buf_len; if (hwctx) { +#if PL_API_VER >= 278 /* Import libavfilter vulkan context into libplacebo */ s->vulkan = pl_vulkan_import(s->log, pl_vulkan_import_params( .instance = hwctx->inst, @@ -585,11 +578,9 @@ static int init_vulkan(AVFilterContext *avctx, const AVVulkanDeviceContext *hwct .extensions = hwctx->enabled_dev_extensions, .num_extensions = hwctx->nb_enabled_dev_extensions, .features = &hwctx->device_features, -#if PL_API_VER >= 201 .lock_queue = lock_queue, .unlock_queue = unlock_queue, .queue_ctx = avctx->hw_device_ctx->data, -#endif .queue_graphics = { .index = hwctx->queue_family_index, .count = hwctx->nb_graphics_queues, @@ -605,6 +596,13 @@ static int init_vulkan(AVFilterContext *avctx, const AVVulkanDeviceContext *hwct /* This is the highest version created by hwcontext_vulkan.c */ .max_api_version = VK_API_VERSION_1_3, )); +#else + av_log(s, AV_LOG_ERROR, "libplacebo version %s too old to import " + "Vulkan device, remove it or upgrade libplacebo to >= 5.278\n", + PL_VERSION); + err = AVERROR_EXTERNAL; + goto fail; +#endif } else { s->vulkan = pl_vulkan_create(s->log, pl_vulkan_params( .queue_count = 0, /* enable all queues for parallelization */ -- 2.40.1 _______________________________________________ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".
reply other threads:[~2023-05-29 11:00 UTC|newest] Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=20230529105952.24077-1-ffmpeg@haasn.xyz \ --to=ffmpeg@haasn.xyz \ --cc=ffmpeg-devel@ffmpeg.org \ --cc=git@haasn.dev \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: link
Git Inbox Mirror of the ffmpeg-devel mailing list - see https://ffmpeg.org/mailman/listinfo/ffmpeg-devel This inbox may be cloned and mirrored by anyone: git clone --mirror https://master.gitmailbox.com/ffmpegdev/0 ffmpegdev/git/0.git # If you have public-inbox 1.1+ installed, you may # initialize and index your mirror using the following commands: public-inbox-init -V2 ffmpegdev ffmpegdev/ https://master.gitmailbox.com/ffmpegdev \ ffmpegdev@gitmailbox.com public-inbox-index ffmpegdev Example config snippet for mirrors. AGPL code for this site: git clone https://public-inbox.org/public-inbox.git