[FFmpeg-devel] [PATCH 2/2] fftools/ffplay: pass SDL vulkan get_proc_addr to hwcontext
Zhao Zhili
quinkblack at foxmail.com
Wed Nov 1 18:56:47 EET 2023
From: Zhao Zhili <zhilizhao at tencent.com>
---
Maybe this patch should be squashed into the patch which add
ffplay_renderer.
fftools/ffplay_renderer.c | 14 +++++++++++++-
1 file changed, 13 insertions(+), 1 deletion(-)
diff --git a/fftools/ffplay_renderer.c b/fftools/ffplay_renderer.c
index f25796133e..143c327287 100644
--- a/fftools/ffplay_renderer.c
+++ b/fftools/ffplay_renderer.c
@@ -211,11 +211,23 @@ static int create_vk_by_hwcontext(VkRenderer *renderer,
AVHWDeviceContext *dev;
AVVulkanDeviceContext *hwctx;
AVDictionary *dict = NULL;
+ void *get_proc_addr = SDL_Vulkan_GetVkGetInstanceProcAddr();
+ char *addr_buf = av_asprintf("0x%" PRIXPTR, (uintptr_t)get_proc_addr);
int ret;
- ret = add_instance_extension(ext, num_ext, opt, &dict);
+ if (!addr_buf)
+ return AVERROR(ENOMEM);
+
+ ret = av_dict_set(&dict, "get_proc_addr", addr_buf, AV_DICT_DONT_STRDUP_VAL);
if (ret < 0)
return ret;
+
+ ret = add_instance_extension(ext, num_ext, opt, &dict);
+ if (ret < 0) {
+ av_dict_free(&dict);
+ return ret;
+ }
+
ret = add_device_extension(opt, &dict);
if (ret) {
av_dict_free(&dict);
--
2.34.1
More information about the ffmpeg-devel
mailing list