diff options
Diffstat (limited to 'video/out/opengl/hwdec_vaglx.c')
-rw-r--r-- | video/out/opengl/hwdec_vaglx.c | 22 |
1 files changed, 15 insertions, 7 deletions
diff --git a/video/out/opengl/hwdec_vaglx.c b/video/out/opengl/hwdec_vaglx.c index a9c5d03af4..2e3017c193 100644 --- a/video/out/opengl/hwdec_vaglx.c +++ b/video/out/opengl/hwdec_vaglx.c @@ -128,7 +128,6 @@ static int create(struct gl_hwdec *hw) p->ctx->hwctx.driver_name = hw->driver->name; hwdec_devices_add(hw->devs, &p->ctx->hwctx); - hw->converted_imgfmt = IMGFMT_RGB0; return 0; } @@ -139,8 +138,6 @@ static int reinit(struct gl_hwdec *hw, struct mp_image_params *params) destroy_texture(hw); - assert(params->imgfmt == hw->driver->imgfmt); - gl->GenTextures(1, &p->gl_texture); gl->BindTexture(GL_TEXTURE_2D, p->gl_texture); gl->TexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR); @@ -169,11 +166,13 @@ static int reinit(struct gl_hwdec *hw, struct mp_image_params *params) p->glXBindTexImage(p->xdisplay, p->glxpixmap, GLX_FRONT_EXT, NULL); gl->BindTexture(GL_TEXTURE_2D, 0); + params->imgfmt = IMGFMT_RGB0; + return 0; } -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; VAStatus status; @@ -190,7 +189,16 @@ static int map_image(struct gl_hwdec *hw, struct mp_image *hw_image, CHECK_VA_STATUS(p, "vaPutSurface()"); va_unlock(p->ctx); - 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; } @@ -200,6 +208,6 @@ const struct gl_hwdec_driver gl_hwdec_vaglx = { .imgfmt = IMGFMT_VAAPI, .create = create, .reinit = reinit, - .map_image = map_image, + .map_frame = map_frame, .destroy = destroy, }; |