From f221666ade9a60195a37d809973fbc18391306ed Mon Sep 17 00:00:00 2001 From: Philip Langdale Date: Sun, 3 Apr 2022 20:12:50 -0700 Subject: f_hwtransfer: mp_image_pool: support HW -> HW mapping Certain combinations of hardware formats require the use of hwmap to transfer frames between the formats, rather than hwupload, which will fail if attempted. To keep the usage of vf_format for HW -> HW transfers as intuitive as possible, we should detect these cases and do the map operation instead of uploading. For now, the relevant cases are moving between VAAPI and Vulkan, and VAAPI and DRM Prime, in both directions. I have introduced the IMGFMT entry for Vulkan here so that I can put in the complete mapping table. It's actually not useless, as you can map to Vulkan, use a Vulkan filter and then map back to VAAPI for display output. --- video/mp_image_pool.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'video/mp_image_pool.h') diff --git a/video/mp_image_pool.h b/video/mp_image_pool.h index 3c7e6221d1..ab9065e6e9 100644 --- a/video/mp_image_pool.h +++ b/video/mp_image_pool.h @@ -41,4 +41,6 @@ bool mp_update_av_hw_frames_pool(struct AVBufferRef **hw_frames_ctx, struct mp_image *mp_av_pool_image_hw_upload(struct AVBufferRef *hw_frames_ctx, struct mp_image *src); +struct mp_image *mp_av_pool_image_hw_map(struct AVBufferRef *hw_frames_ctx, + struct mp_image *src); #endif -- cgit v1.2.3