summaryrefslogtreecommitdiffstats
path: root/video/out/opengl/hwdec_dxva2egl.c
diff options
context:
space:
mode:
Diffstat (limited to 'video/out/opengl/hwdec_dxva2egl.c')
-rw-r--r--video/out/opengl/hwdec_dxva2egl.c22
1 files changed, 14 insertions, 8 deletions
diff --git a/video/out/opengl/hwdec_dxva2egl.c b/video/out/opengl/hwdec_dxva2egl.c
index 1384e2bb47..3a4ee6089f 100644
--- a/video/out/opengl/hwdec_dxva2egl.c
+++ b/video/out/opengl/hwdec_dxva2egl.c
@@ -205,8 +205,6 @@ static int create(struct gl_hwdec *hw)
goto fail;
}
- hw->converted_imgfmt = IMGFMT_RGB0;
-
p->hwctx = (struct mp_hwdec_ctx){
.type = HWDEC_DXVA2,
.driver_name = hw->driver->name,
@@ -228,8 +226,6 @@ static int reinit(struct gl_hwdec *hw, struct mp_image_params *params)
destroy_textures(hw);
- assert(params->imgfmt == hw->driver->imgfmt);
-
HANDLE share_handle = NULL;
hr = IDirect3DDevice9Ex_CreateTexture(p->device9ex,
params->w, params->h,
@@ -274,14 +270,15 @@ static int reinit(struct gl_hwdec *hw, struct mp_image_params *params)
gl->TexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);
gl->BindTexture(GL_TEXTURE_2D, 0);
+ params->imgfmt = IMGFMT_RGB0;
return 0;
fail:
destroy_textures(hw);
return -1;
}
-static int map_image(struct gl_hwdec *hw, struct mp_image *hw_image,
- GLuint *out_textures)
+static int map_frame(struct gl_hwdec *hw, struct mp_image *hw_image,
+ struct gl_hwdec_frame *out_frame)
{
struct priv *p = hw->priv;
GL *gl = hw->gl;
@@ -334,7 +331,16 @@ static int map_image(struct gl_hwdec *hw, struct mp_image *hw_image,
eglBindTexImage(p->egl_display, p->egl_surface, EGL_BACK_BUFFER);
gl->BindTexture(GL_TEXTURE_2D, 0);
- out_textures[0] = p->gl_texture;
+ *out_frame = (struct gl_hwdec_frame){
+ .planes = {
+ {
+ .gl_texture = p->gl_texture,
+ .gl_target = GL_TEXTURE_2D,
+ .tex_w = hw_image->w,
+ .tex_h = hw_image->h,
+ },
+ },
+ };
return 0;
}
@@ -344,6 +350,6 @@ const struct gl_hwdec_driver gl_hwdec_dxva2egl = {
.imgfmt = IMGFMT_DXVA2,
.create = create,
.reinit = reinit,
- .map_image = map_image,
+ .map_frame = map_frame,
.destroy = destroy,
};