mirror of
https://github.com/mpv-player/mpv
synced 2025-01-14 02:51:26 +00:00
hwdec_vaapi_vk: rename to vaapi_pl
There's really nothing vulkan-specific about this hwdec wrapper, and it actually works perfectly fine with an OpenGL-based ra_pl. This is not hugely important at the time, but I still think it makes sense in case we ever decide to make vo_gpu_next wrap OpenGL contexts to ra_pl instead of exposing the underlying ra_gl.
This commit is contained in:
parent
4387f3bcd0
commit
e2c02a4ce3
16
meson.build
16
meson.build
@ -1470,16 +1470,16 @@ if vaapi_egl['use']
|
|||||||
sources += files('video/out/hwdec/hwdec_vaapi_gl.c')
|
sources += files('video/out/hwdec/hwdec_vaapi_gl.c')
|
||||||
endif
|
endif
|
||||||
|
|
||||||
vaapi_vulkan = {
|
vaapi_libplacebo = {
|
||||||
'name': 'vaapi-vulkan',
|
'name': 'vaapi-libplacebo',
|
||||||
'use': vaapi['use'] and vulkan.found(),
|
'use': vaapi['use'] and libplacebo.found(),
|
||||||
}
|
}
|
||||||
if vaapi_vulkan['use']
|
if vaapi_libplacebo['use']
|
||||||
features += vaapi_vulkan['name']
|
features += vaapi_libplacebo['name']
|
||||||
sources += files('video/out/hwdec/hwdec_vaapi_vk.c')
|
sources += files('video/out/hwdec/hwdec_vaapi_pl.c')
|
||||||
endif
|
endif
|
||||||
|
|
||||||
if vaapi_egl['use'] or vaapi_vulkan['use']
|
if vaapi_egl['use'] or vaapi_libplacebo['use']
|
||||||
sources += files('video/out/hwdec/hwdec_vaapi.c')
|
sources += files('video/out/hwdec/hwdec_vaapi.c')
|
||||||
endif
|
endif
|
||||||
|
|
||||||
@ -1776,7 +1776,7 @@ conf_data.set10('HAVE_UWP', uwp.found())
|
|||||||
conf_data.set10('HAVE_VAAPI', vaapi['use'])
|
conf_data.set10('HAVE_VAAPI', vaapi['use'])
|
||||||
conf_data.set10('HAVE_VAAPI_DRM', vaapi_drm['use'])
|
conf_data.set10('HAVE_VAAPI_DRM', vaapi_drm['use'])
|
||||||
conf_data.set10('HAVE_VAAPI_EGL', vaapi_egl['use'])
|
conf_data.set10('HAVE_VAAPI_EGL', vaapi_egl['use'])
|
||||||
conf_data.set10('HAVE_VAAPI_VULKAN', vaapi_vulkan['use'])
|
conf_data.set10('HAVE_VAAPI_LIBPLACEBO', vaapi_libplacebo['use'])
|
||||||
conf_data.set10('HAVE_VAAPI_WAYLAND', vaapi_wayland['use'])
|
conf_data.set10('HAVE_VAAPI_WAYLAND', vaapi_wayland['use'])
|
||||||
conf_data.set10('HAVE_VAAPI_X11', vaapi_x11['use'])
|
conf_data.set10('HAVE_VAAPI_X11', vaapi_x11['use'])
|
||||||
conf_data.set10('HAVE_VAPOURSYNTH', vapoursynth.found() and vapoursynth_script.found())
|
conf_data.set10('HAVE_VAPOURSYNTH', vapoursynth.found() and vapoursynth_script.found())
|
||||||
|
@ -111,8 +111,8 @@ const static vaapi_interop_init interop_inits[] = {
|
|||||||
#if HAVE_VAAPI_EGL
|
#if HAVE_VAAPI_EGL
|
||||||
vaapi_gl_init,
|
vaapi_gl_init,
|
||||||
#endif
|
#endif
|
||||||
#if HAVE_VAAPI_VULKAN
|
#if HAVE_VAAPI_LIBPLACEBO
|
||||||
vaapi_vk_init,
|
vaapi_pl_init,
|
||||||
#endif
|
#endif
|
||||||
NULL
|
NULL
|
||||||
};
|
};
|
||||||
|
@ -52,5 +52,4 @@ struct priv {
|
|||||||
typedef bool (*vaapi_interop_init)(const struct ra_hwdec *hw);
|
typedef bool (*vaapi_interop_init)(const struct ra_hwdec *hw);
|
||||||
|
|
||||||
bool vaapi_gl_init(const struct ra_hwdec *hw);
|
bool vaapi_gl_init(const struct ra_hwdec *hw);
|
||||||
|
bool vaapi_pl_init(const struct ra_hwdec *hw);
|
||||||
bool vaapi_vk_init(const struct ra_hwdec *hw);
|
|
||||||
|
@ -23,7 +23,7 @@
|
|||||||
#include "video/out/placebo/ra_pl.h"
|
#include "video/out/placebo/ra_pl.h"
|
||||||
#include "video/out/placebo/utils.h"
|
#include "video/out/placebo/utils.h"
|
||||||
|
|
||||||
static bool vaapi_vk_map(struct ra_hwdec_mapper *mapper, bool probing)
|
static bool vaapi_pl_map(struct ra_hwdec_mapper *mapper, bool probing)
|
||||||
{
|
{
|
||||||
struct priv *p = mapper->priv;
|
struct priv *p = mapper->priv;
|
||||||
pl_gpu gpu = ra_pl_get(mapper->ra);
|
pl_gpu gpu = ra_pl_get(mapper->ra);
|
||||||
@ -102,31 +102,31 @@ static bool vaapi_vk_map(struct ra_hwdec_mapper *mapper, bool probing)
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void vaapi_vk_unmap(struct ra_hwdec_mapper *mapper)
|
static void vaapi_pl_unmap(struct ra_hwdec_mapper *mapper)
|
||||||
{
|
{
|
||||||
for (int n = 0; n < 4; n++)
|
for (int n = 0; n < 4; n++)
|
||||||
ra_tex_free(mapper->ra, &mapper->tex[n]);
|
ra_tex_free(mapper->ra, &mapper->tex[n]);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool vaapi_vk_init(const struct ra_hwdec *hw)
|
bool vaapi_pl_init(const struct ra_hwdec *hw)
|
||||||
{
|
{
|
||||||
struct priv_owner *p = hw->priv;
|
struct priv_owner *p = hw->priv;
|
||||||
pl_gpu gpu = ra_pl_get(hw->ra);
|
pl_gpu gpu = ra_pl_get(hw->ra);
|
||||||
if (!gpu) {
|
if (!gpu) {
|
||||||
// This is not a Vulkan RA;
|
// This is not a libplacebo RA;
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!(gpu->import_caps.tex & PL_HANDLE_DMA_BUF)) {
|
if (!(gpu->import_caps.tex & PL_HANDLE_DMA_BUF)) {
|
||||||
MP_VERBOSE(hw, "VAAPI Vulkan interop requires support for "
|
MP_VERBOSE(hw, "VAAPI libplacebo interop requires support for "
|
||||||
"dma_buf import in Vulkan.\n");
|
"PL_HANDLE_DMA_BUF import.\n");
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
MP_VERBOSE(hw, "using VAAPI Vulkan interop\n");
|
MP_VERBOSE(hw, "using VAAPI libplacebo interop\n");
|
||||||
|
|
||||||
p->interop_map = vaapi_vk_map;
|
p->interop_map = vaapi_pl_map;
|
||||||
p->interop_unmap = vaapi_vk_unmap;
|
p->interop_unmap = vaapi_pl_unmap;
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
6
wscript
6
wscript
@ -751,9 +751,9 @@ video_output_features = [
|
|||||||
'deps': 'libplacebo',
|
'deps': 'libplacebo',
|
||||||
'func': check_pkg_config('vulkan'),
|
'func': check_pkg_config('vulkan'),
|
||||||
}, {
|
}, {
|
||||||
'name': 'vaapi-vulkan',
|
'name': 'vaapi-libplacebo',
|
||||||
'desc': 'VAAPI Vulkan',
|
'desc': 'VAAPI libplacebo',
|
||||||
'deps': 'vaapi && vulkan',
|
'deps': 'vaapi && libplacebo',
|
||||||
'func': check_true,
|
'func': check_true,
|
||||||
}, {
|
}, {
|
||||||
'name': 'egl-helpers',
|
'name': 'egl-helpers',
|
||||||
|
@ -457,9 +457,9 @@ def build(ctx):
|
|||||||
( "video/out/hwdec/hwdec_cuda.c", "cuda-interop" ),
|
( "video/out/hwdec/hwdec_cuda.c", "cuda-interop" ),
|
||||||
( "video/out/hwdec/hwdec_cuda_gl.c", "cuda-interop && gl" ),
|
( "video/out/hwdec/hwdec_cuda_gl.c", "cuda-interop && gl" ),
|
||||||
( "video/out/hwdec/hwdec_cuda_vk.c", "cuda-interop && vulkan" ),
|
( "video/out/hwdec/hwdec_cuda_vk.c", "cuda-interop && vulkan" ),
|
||||||
( "video/out/hwdec/hwdec_vaapi.c", "vaapi-egl || vaapi-vulkan" ),
|
( "video/out/hwdec/hwdec_vaapi.c", "vaapi-egl || vaapi-libplacebo" ),
|
||||||
( "video/out/hwdec/hwdec_vaapi_gl.c", "vaapi-egl" ),
|
( "video/out/hwdec/hwdec_vaapi_gl.c", "vaapi-egl" ),
|
||||||
( "video/out/hwdec/hwdec_vaapi_vk.c", "vaapi-vulkan" ),
|
( "video/out/hwdec/hwdec_vaapi_pl.c", "vaapi-libplacebo" ),
|
||||||
( "video/out/libmpv_sw.c" ),
|
( "video/out/libmpv_sw.c" ),
|
||||||
( "video/out/placebo/ra_pl.c", "libplacebo" ),
|
( "video/out/placebo/ra_pl.c", "libplacebo" ),
|
||||||
( "video/out/placebo/utils.c", "libplacebo" ),
|
( "video/out/placebo/utils.c", "libplacebo" ),
|
||||||
|
Loading…
Reference in New Issue
Block a user