From 63377744f3dfff04fe02c832b24f8537b78ee8d3 Mon Sep 17 00:00:00 2001 From: wm4 Date: Wed, 3 Dec 2014 21:13:59 +0100 Subject: vdpau/GLX: don't access VO backend Same as with the previous commits. In theory, vdpau/x11 GL interop doesn't assume GLX. It could use EGL as well. But since it's always GLX in practice, so we're fine with this. Remove the gl_hwdec.mpgl field - it's unused now. --- video/out/gl_common.h | 1 - video/out/gl_hwdec_vdpau.c | 17 ++++++++++------- video/out/vo_opengl.c | 1 - video/out/vo_vdpau.c | 2 +- 4 files changed, 11 insertions(+), 10 deletions(-) (limited to 'video/out') diff --git a/video/out/gl_common.h b/video/out/gl_common.h index d7ba888a93..fa1566b0fb 100644 --- a/video/out/gl_common.h +++ b/video/out/gl_common.h @@ -172,7 +172,6 @@ struct gl_hwdec { const struct gl_hwdec_driver *driver; struct mp_log *log; GL *gl; - struct MPGLContext *mpgl; struct mp_hwdec_info *info; // For free use by hwdec driver void *priv; diff --git a/video/out/gl_hwdec_vdpau.c b/video/out/gl_hwdec_vdpau.c index db67679e4e..2fa262348f 100644 --- a/video/out/gl_hwdec_vdpau.c +++ b/video/out/gl_hwdec_vdpau.c @@ -18,6 +18,8 @@ #include #include +#include + #include "gl_common.h" #include "video/vdpau.h" #include "video/hwdec.h" @@ -51,7 +53,7 @@ static void mark_vdpau_objects_uninitialized(struct gl_hwdec *hw) static void destroy_objects(struct gl_hwdec *hw) { struct priv *p = hw->priv; - GL *gl = hw->mpgl->gl; + GL *gl = hw->gl; struct vdp_functions *vdp = &p->ctx->vdp; VdpStatus vdp_st; @@ -90,17 +92,18 @@ static void destroy(struct gl_hwdec *hw) static int create(struct gl_hwdec *hw) { - GL *gl = hw->mpgl->gl; + GL *gl = hw->gl; if (hw->info->vdpau_ctx) return -1; - if (!hw->mpgl->vo->x11) + Display *x11disp = glXGetCurrentDisplay(); + if (!x11disp) return -1; if (!(gl->mpgl_caps & MPGL_CAP_VDPAU)) return -1; struct priv *p = talloc_zero(hw, struct priv); hw->priv = p; p->log = hw->log; - p->ctx = mp_vdpau_create_device_x11(hw->log, hw->mpgl->vo->x11); + p->ctx = mp_vdpau_create_device_x11(hw->log, x11disp); if (!p->ctx) return -1; if (mp_vdpau_handle_preemption(p->ctx, &p->preemption_counter) < 1) @@ -115,7 +118,7 @@ static int create(struct gl_hwdec *hw) static int reinit(struct gl_hwdec *hw, const struct mp_image_params *params) { struct priv *p = hw->priv; - GL *gl = hw->mpgl->gl; + GL *gl = hw->gl; struct vdp_functions *vdp = &p->ctx->vdp; VdpStatus vdp_st; @@ -158,7 +161,7 @@ static int map_image(struct gl_hwdec *hw, struct mp_image *hw_image, GLuint *out_textures) { struct priv *p = hw->priv; - GL *gl = hw->mpgl->gl; + GL *gl = hw->gl; assert(hw_image && hw_image->imgfmt == IMGFMT_VDPAU); @@ -184,7 +187,7 @@ static int map_image(struct gl_hwdec *hw, struct mp_image *hw_image, static void unmap_image(struct gl_hwdec *hw) { struct priv *p = hw->priv; - GL *gl = hw->mpgl->gl; + GL *gl = hw->gl; gl->VDPAUUnmapSurfacesNV(1, &p->vdpgl_surface); } diff --git a/video/out/vo_opengl.c b/video/out/vo_opengl.c index 482eed1b79..2499106355 100644 --- a/video/out/vo_opengl.c +++ b/video/out/vo_opengl.c @@ -227,7 +227,6 @@ static void load_hwdec_driver(struct gl_priv *p, *hwdec = (struct gl_hwdec) { .driver = drv, .log = mp_log_new(hwdec, p->vo->log, drv->api_name), - .mpgl = p->glctx, .gl = p->glctx->gl, .info = &p->hwdec_info, .gl_texture_target = GL_TEXTURE_2D, diff --git a/video/out/vo_vdpau.c b/video/out/vo_vdpau.c index 46190fd032..aa2cd910a0 100644 --- a/video/out/vo_vdpau.c +++ b/video/out/vo_vdpau.c @@ -985,7 +985,7 @@ static int preinit(struct vo *vo) if (!vo_x11_init(vo)) return -1; - vc->mpvdp = mp_vdpau_create_device_x11(vo->log, vo->x11); + vc->mpvdp = mp_vdpau_create_device_x11(vo->log, vo->x11->display); if (!vc->mpvdp) { vo_x11_uninit(vo); return -1; -- cgit v1.2.3