diff options
author | wm4 <wm4@nowhere> | 2014-12-03 21:13:59 +0100 |
---|---|---|
committer | wm4 <wm4@nowhere> | 2014-12-03 21:13:59 +0100 |
commit | 63377744f3dfff04fe02c832b24f8537b78ee8d3 (patch) | |
tree | 7f3f3f0f46d4d814679975f6fe035dc3f412fa42 /video/out/gl_hwdec_vdpau.c | |
parent | 031aef9be9052dce8ff7b7446b979b2e2d418b3d (diff) | |
download | mpv-63377744f3dfff04fe02c832b24f8537b78ee8d3.tar.bz2 mpv-63377744f3dfff04fe02c832b24f8537b78ee8d3.tar.xz |
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.
Diffstat (limited to 'video/out/gl_hwdec_vdpau.c')
-rw-r--r-- | video/out/gl_hwdec_vdpau.c | 17 |
1 files changed, 10 insertions, 7 deletions
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 <stddef.h> #include <assert.h> +#include <GL/glx.h> + #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); } |