mirror of https://git.ffmpeg.org/ffmpeg.git
hwcontext_vulkan: remove duplicate code, port to use generic vulkan utils
The temporary AVFrame on staack enables us to use the common dependency/dispatch code in prepare_frame(). The prepare_frame() function is used for both frame initialization and frame import/export queue family transfer operations. In the former case, no AVFrame exists yet, so, as this is purely libavutil code, we create a temporary frame on stack. Otherwise, we'd need to allocate multiple frames somewhere, one for each possible command buffer dispatch.
This commit is contained in:
parent
94e17a63a4
commit
33fc919bb7
|
@ -195,7 +195,7 @@ OBJS-$(CONFIG_QSV) += hwcontext_qsv.o
|
||||||
OBJS-$(CONFIG_VAAPI) += hwcontext_vaapi.o
|
OBJS-$(CONFIG_VAAPI) += hwcontext_vaapi.o
|
||||||
OBJS-$(CONFIG_VIDEOTOOLBOX) += hwcontext_videotoolbox.o
|
OBJS-$(CONFIG_VIDEOTOOLBOX) += hwcontext_videotoolbox.o
|
||||||
OBJS-$(CONFIG_VDPAU) += hwcontext_vdpau.o
|
OBJS-$(CONFIG_VDPAU) += hwcontext_vdpau.o
|
||||||
OBJS-$(CONFIG_VULKAN) += hwcontext_vulkan.o
|
OBJS-$(CONFIG_VULKAN) += hwcontext_vulkan.o vulkan.o
|
||||||
|
|
||||||
OBJS-$(!CONFIG_VULKAN) += hwcontext_stub.o
|
OBJS-$(!CONFIG_VULKAN) += hwcontext_stub.o
|
||||||
|
|
||||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -267,6 +267,19 @@ static inline int ff_vk_count_images(AVVkFrame *f)
|
||||||
return cnt;
|
return cnt;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static inline const void *ff_vk_find_struct(const void *chain, VkStructureType stype)
|
||||||
|
{
|
||||||
|
const VkBaseInStructure *in = chain;
|
||||||
|
while (in) {
|
||||||
|
if (in->sType == stype)
|
||||||
|
return in;
|
||||||
|
|
||||||
|
in = in->pNext;
|
||||||
|
}
|
||||||
|
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
|
||||||
/* Identity mapping - r = r, b = b, g = g, a = a */
|
/* Identity mapping - r = r, b = b, g = g, a = a */
|
||||||
extern const VkComponentMapping ff_comp_identity_map;
|
extern const VkComponentMapping ff_comp_identity_map;
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue