summaryrefslogtreecommitdiff
path: root/libavutil/hwcontext_vulkan.c
diff options
context:
space:
mode:
authorLynne <dev@lynne.ee>2020-05-25 20:56:00 +0100
committerLynne <dev@lynne.ee>2020-05-26 10:52:10 +0100
commitb6d4bedbb1bfd7a04b0b84fa59769ec3e5ca149b (patch)
tree3a040904542021f3fa629f1ca018e63e27c5ab6c /libavutil/hwcontext_vulkan.c
parent6bb718aabd648d9e2cb166364f9efae2ac245ecd (diff)
hwcontext_vulkan: initialize the frames context when deriving
Otherwise, the frames context is considered to be ready to handle mapping, and it doesn't get initialized the normal way through .frames_init.
Diffstat (limited to 'libavutil/hwcontext_vulkan.c')
-rw-r--r--libavutil/hwcontext_vulkan.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/libavutil/hwcontext_vulkan.c b/libavutil/hwcontext_vulkan.c
index 5976e33f03..7383af2083 100644
--- a/libavutil/hwcontext_vulkan.c
+++ b/libavutil/hwcontext_vulkan.c
@@ -3251,6 +3251,12 @@ static int vulkan_transfer_data_from(AVHWFramesContext *hwfc, AVFrame *dst,
}
}
+static int vulkan_frames_derive_to(AVHWFramesContext *dst_fc,
+ AVHWFramesContext *src_fc, int flags)
+{
+ return vulkan_frames_init(dst_fc);
+}
+
AVVkFrame *av_vk_frame_alloc(void)
{
return av_mallocz(sizeof(AVVkFrame));
@@ -3280,6 +3286,7 @@ const HWContextType ff_hwcontext_type_vulkan = {
.map_to = vulkan_map_to,
.map_from = vulkan_map_from,
+ .frames_derive_to = &vulkan_frames_derive_to,
.pix_fmts = (const enum AVPixelFormat []) {
AV_PIX_FMT_VULKAN,