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; assert(hw_image && hw_image->imgfmt == IMGFMT_VDPAU); if (handle_preemption(hw) < 0) return -1; if (!p->vdpgl_surface) return -1; mp_vdpau_mixer_render(p->mixer, NULL, p->vdp_surface, NULL, hw_image, NULL); gl->VDPAUMapSurfacesNV(1, &p->vdpgl_surface); out_textures[0] = p->gl_texture; return 0; }
// Check whether vdpau initialization and preemption status is ok and we can // proceed normally. bool mp_vdpau_status_ok(struct mp_vdpau_ctx *ctx) { return handle_preemption(ctx) >= 0; }