summaryrefslogtreecommitdiffstats
path: root/video/out/gl_hwdec_vaglx.c
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2013-11-05 19:08:44 +0100
committerwm4 <wm4@nowhere>2013-11-05 22:05:23 +0100
commitff5a90832814fe583b006d1943fced4dd0fa786d (patch)
tree3af94d05a7ce4f2c7bfc3cda96825ad0cc61331b /video/out/gl_hwdec_vaglx.c
parent91472b84c2bd5a4501d0c4ac801aefb24cd101ac (diff)
downloadmpv-ff5a90832814fe583b006d1943fced4dd0fa786d.tar.bz2
mpv-ff5a90832814fe583b006d1943fced4dd0fa786d.tar.xz
vo_opengl: redo aspects of initialization, change hwdec API
Instead of checking for resolution and image format changes, always fully reinit on any parameter change. Let init_video do all required initializations, which simplifies things a little bit. Change the gl_video/hardware decoding interop API slightly, so that hwdec initialization gets the full image parameters. Also make some cosmetic changes.
Diffstat (limited to 'video/out/gl_hwdec_vaglx.c')
-rw-r--r--video/out/gl_hwdec_vaglx.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/video/out/gl_hwdec_vaglx.c b/video/out/gl_hwdec_vaglx.c
index fae066442c..abfc656337 100644
--- a/video/out/gl_hwdec_vaglx.c
+++ b/video/out/gl_hwdec_vaglx.c
@@ -83,7 +83,7 @@ static int create(struct gl_hwdec *hw)
return 0;
}
-static int reinit(struct gl_hwdec *hw, int w, int h)
+static int reinit(struct gl_hwdec *hw, const struct mp_image_params *params)
{
struct priv *p = hw->priv;
GL *gl = hw->mpgl->gl;
@@ -97,7 +97,7 @@ static int reinit(struct gl_hwdec *hw, int w, int h)
gl->TexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
gl->TexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);
gl->TexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);
- gl->TexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, w, h, 0,
+ gl->TexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, params->w, params->h, 0,
GL_RGBA, GL_UNSIGNED_BYTE, NULL);
gl->BindTexture(GL_TEXTURE_2D, 0);
@@ -106,8 +106,8 @@ static int reinit(struct gl_hwdec *hw, int w, int h)
return check_va_status(status, "vaCreateSurfaceGLX()") ? 0 : -1;
}
-static int load_image(struct gl_hwdec *hw, struct mp_image *hw_image,
- GLuint *out_textures)
+static int map_image(struct gl_hwdec *hw, struct mp_image *hw_image,
+ GLuint *out_textures)
{
struct priv *p = hw->priv;
VAStatus status;
@@ -125,7 +125,7 @@ static int load_image(struct gl_hwdec *hw, struct mp_image *hw_image,
return 0;
}
-static void unload_image(struct gl_hwdec *hw)
+static void unmap_image(struct gl_hwdec *hw)
{
}
@@ -134,7 +134,7 @@ const struct gl_hwdec_driver gl_hwdec_vaglx = {
.query_format = query_format,
.create = create,
.reinit = reinit,
- .load_image = load_image,
- .unload_image = unload_image,
+ .map_image = map_image,
+ .unmap_image = unmap_image,
.destroy = destroy,
};