hwdec/vaapi: rename interops to reflect more general use

This is the first in a series of changes that will introduce a drmprime
hwdec. As our vaapi hwdec is based around exporting surfaces as
drmprime dmabufs, we've actually got a lot of useful code already in
place in the GL/PL interops. I'm going to reorganise and adjust this
code to make the interops usable with the new hwdec as well.

The first step is to rename the files and functions. There are no
functional or other changes here. They will come next.
This commit is contained in:
Philip Langdale 2022-07-31 11:50:57 -07:00 committed by Philip Langdale
parent 490e263529
commit 06900eef63
6 changed files with 15 additions and 15 deletions

View File

@ -1474,7 +1474,7 @@ vaapi_egl = {
if vaapi_egl['use']
dependencies += [vaapi_wayland['deps'], vaapi_drm['deps']]
features += vaapi_egl['name']
sources += files('video/out/hwdec/hwdec_vaapi_gl.c')
sources += files('video/out/hwdec/dmabuf_interop_gl.c')
endif
vaapi_libplacebo = {
@ -1483,7 +1483,7 @@ vaapi_libplacebo = {
}
if vaapi_libplacebo['use']
features += vaapi_libplacebo['name']
sources += files('video/out/hwdec/hwdec_vaapi_pl.c')
sources += files('video/out/hwdec/dmabuf_interop_pl.c')
endif
if vaapi_egl['use'] or vaapi_libplacebo['use']

View File

@ -49,7 +49,7 @@ struct priv {
void *interop_mapper_priv;
};
typedef bool (*vaapi_interop_init)(const struct ra_hwdec *hw);
typedef bool (*dmabuf_interop_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 dmabuf_interop_gl_init(const struct ra_hwdec *hw);
bool dmabuf_interop_pl_init(const struct ra_hwdec *hw);

View File

@ -16,7 +16,7 @@
*/
#include "config.h"
#include "hwdec_vaapi.h"
#include "dmabuf_interop.h"
#include <EGL/egl.h>
#include "video/out/opengl/ra_gl.h"
@ -218,7 +218,7 @@ static void vaapi_gl_unmap(struct ra_hwdec_mapper *mapper)
}
}
bool vaapi_gl_init(const struct ra_hwdec *hw)
bool dmabuf_interop_gl_init(const struct ra_hwdec *hw)
{
struct priv_owner *p = hw->priv;
if (!ra_is_gl(hw->ra)) {

View File

@ -19,7 +19,7 @@
#include <unistd.h>
#include "config.h"
#include "hwdec_vaapi.h"
#include "dmabuf_interop.h"
#include "video/out/placebo/ra_pl.h"
#include "video/out/placebo/utils.h"
@ -113,7 +113,7 @@ static void vaapi_pl_unmap(struct ra_hwdec_mapper *mapper)
ra_tex_free(mapper->ra, &mapper->tex[n]);
}
bool vaapi_pl_init(const struct ra_hwdec *hw)
bool dmabuf_interop_pl_init(const struct ra_hwdec *hw)
{
struct priv_owner *p = hw->priv;
pl_gpu gpu = ra_pl_get(hw->ra);

View File

@ -26,7 +26,7 @@
#include "config.h"
#include "video/out/gpu/hwdec.h"
#include "video/out/hwdec/hwdec_vaapi.h"
#include "video/out/hwdec/dmabuf_interop.h"
#include "video/fmt-conversion.h"
#include "video/mp_image_pool.h"
#include "video/vaapi.h"
@ -107,12 +107,12 @@ static void uninit(struct ra_hwdec *hw)
va_destroy(p->ctx);
}
const static vaapi_interop_init interop_inits[] = {
const static dmabuf_interop_init interop_inits[] = {
#if HAVE_VAAPI_EGL
vaapi_gl_init,
dmabuf_interop_gl_init,
#endif
#if HAVE_VAAPI_LIBPLACEBO
vaapi_pl_init,
dmabuf_interop_pl_init,
#endif
NULL
};

View File

@ -471,8 +471,8 @@ def build(ctx):
( "video/out/hwdec/hwdec_cuda_gl.c", "cuda-interop && gl" ),
( "video/out/hwdec/hwdec_cuda_vk.c", "cuda-interop && 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_pl.c", "vaapi-libplacebo" ),
( "video/out/hwdec/dmabuf_interop_gl.c", "vaapi-egl" ),
( "video/out/hwdec/dmabuf_interop_pl.c", "vaapi-libplacebo" ),
( "video/out/libmpv_sw.c" ),
( "video/out/placebo/ra_pl.c", "libplacebo" ),
( "video/out/placebo/utils.c", "libplacebo" ),