summaryrefslogtreecommitdiffstats
path: root/video/out/hwdec/hwdec_vaapi_gl.c
diff options
context:
space:
mode:
authorPhilip Langdale <philipl@overt.org>2019-12-11 17:40:19 -0800
committerPhilip Langdale <github.philipl@overt.org>2019-12-28 14:31:34 -0800
commit49cbc5017cf78b2813560e631cf568f52ca4fc4c (patch)
tree3c31589db90301a34fed9f45e7d18b11638da6a1 /video/out/hwdec/hwdec_vaapi_gl.c
parenteb852dc50c42ccc68a4a56d03baefc34dc20ebd8 (diff)
downloadmpv-49cbc5017cf78b2813560e631cf568f52ca4fc4c.tar.bz2
mpv-49cbc5017cf78b2813560e631cf568f52ca4fc4c.tar.xz
vo_gpu: hwdec_vaegl: remove support for old-style interop
In vaapi 1.1.0 (which confusingly is libva release 2.1.0), they introduced a new surface export API that is more efficient, and we've been supporting that and the old API ever since (Feb 2018). If we drop support for the old API, we can do some fairly nice cleanup of the code. Note that the pkgconfig entries are explicitly versioned by the API version and not the library version. I confirmed the upstream pkgconfig files.
Diffstat (limited to 'video/out/hwdec/hwdec_vaapi_gl.c')
-rw-r--r--video/out/hwdec/hwdec_vaapi_gl.c50
1 files changed, 1 insertions, 49 deletions
diff --git a/video/out/hwdec/hwdec_vaapi_gl.c b/video/out/hwdec/hwdec_vaapi_gl.c
index 3e3edbed0a..1617167464 100644
--- a/video/out/hwdec/hwdec_vaapi_gl.c
+++ b/video/out/hwdec/hwdec_vaapi_gl.c
@@ -139,7 +139,6 @@ static void vaapi_gl_mapper_uninit(const struct ra_hwdec_mapper *mapper)
static bool vaapi_gl_map(struct ra_hwdec_mapper *mapper)
{
-#if VA_CHECK_VERSION(1, 1, 0)
struct priv *p_mapper = mapper->priv;
struct vaapi_gl_mapper_priv *p = p_mapper->interop_mapper_priv;
@@ -172,52 +171,6 @@ static bool vaapi_gl_map(struct ra_hwdec_mapper *mapper)
mapper->tex[n] = p_mapper->tex[n];
}
gl->BindTexture(GL_TEXTURE_2D, 0);
-#endif
- return true;
-}
-
-static bool vaapi_gl_map_legacy(struct ra_hwdec_mapper *mapper,
- const VABufferInfo *buffer_info,
- const int *drm_fmts) {
- struct priv *p_mapper = mapper->priv;
- struct vaapi_gl_mapper_priv *p = p_mapper->interop_mapper_priv;
-
- GL *gl = ra_gl_get(mapper->ra);
-
- VAImage *va_image = &p_mapper->current_image;
-
- for (int n = 0; n < p_mapper->num_planes; n++) {
- int attribs[20] = {EGL_NONE};
- int num_attribs = 0;
-
- const struct ra_format *fmt = p_mapper->tex[n]->params.format;
- int n_comp = fmt->num_components;
- int comp_s = fmt->component_size[n] / 8;
- if (n_comp < 1 || n_comp > 3 || comp_s < 1 || comp_s > 2)
- return false;
- int drm_fmt = drm_fmts[n_comp - 1 + (comp_s - 1) * 4];
- if (!drm_fmt)
- return false;
-
- ADD_ATTRIB(EGL_LINUX_DRM_FOURCC_EXT, drm_fmt);
- ADD_ATTRIB(EGL_WIDTH, p_mapper->tex[n]->params.w);
- ADD_ATTRIB(EGL_HEIGHT, p_mapper->tex[n]->params.h);
- ADD_ATTRIB(EGL_DMA_BUF_PLANE0_FD_EXT, buffer_info->handle);
- ADD_ATTRIB(EGL_DMA_BUF_PLANE0_OFFSET_EXT, va_image->offsets[n]);
- ADD_ATTRIB(EGL_DMA_BUF_PLANE0_PITCH_EXT, va_image->pitches[n]);
-
- p->images[n] = p->CreateImageKHR(eglGetCurrentDisplay(),
- EGL_NO_CONTEXT, EGL_LINUX_DMA_BUF_EXT, NULL, attribs);
- if (!p->images[n])
- return false;
-
- gl->BindTexture(GL_TEXTURE_2D, p->gl_textures[n]);
- p->EGLImageTargetTexture2DOES(GL_TEXTURE_2D, p->images[n]);
-
- mapper->tex[n] = p_mapper->tex[n];
- }
- gl->BindTexture(GL_TEXTURE_2D, 0);
-
return true;
}
@@ -262,8 +215,7 @@ bool vaapi_gl_init(const struct ra_hwdec *hw)
p->interop_init = vaapi_gl_mapper_init;
p->interop_uninit = vaapi_gl_mapper_uninit;
p->interop_map = vaapi_gl_map;
- p->interop_map_legacy = vaapi_gl_map_legacy;
p->interop_unmap = vaapi_gl_unmap;
return true;
-} \ No newline at end of file
+}