summaryrefslogtreecommitdiffstats
path: root/video/out/vo_vdpau.c
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2012-11-06 15:27:44 +0100
committerwm4 <wm4@nowhere>2013-01-13 17:39:32 +0100
commit2d8fb838d7823137661b420b98e68188532bb36f (patch)
treee9d3742a0428a0dccc2cff894d89c6fad1d11a0c /video/out/vo_vdpau.c
parent0d1aca12896b6459d0a1c41fcac5b67bf5351817 (diff)
downloadmpv-2d8fb838d7823137661b420b98e68188532bb36f.tar.bz2
mpv-2d8fb838d7823137661b420b98e68188532bb36f.tar.xz
video: make vdpau hardware decoding not use DR code path
vdpau hardware decoding used the DR (direct rendering) path to let the decoder query a surface from the VO. Special-case the HW decoding path instead, to make it separate from DR.
Diffstat (limited to 'video/out/vo_vdpau.c')
-rw-r--r--video/out/vo_vdpau.c19
1 files changed, 5 insertions, 14 deletions
diff --git a/video/out/vo_vdpau.c b/video/out/vo_vdpau.c
index 13a352f790..67ac0593f8 100644
--- a/video/out/vo_vdpau.c
+++ b/video/out/vo_vdpau.c
@@ -1307,7 +1307,7 @@ static void draw_image(struct vo *vo, mp_image_t *mpi, double pts)
struct vdpau_render_state *rndr;
if (IMGFMT_IS_VDPAU(vc->image_format)) {
- rndr = mpi->priv;
+ rndr = (struct vdpau_render_state *)mpi->planes[0];
reserved_mpi = mpi;
} else {
rndr = get_surface(vo, vc->deint_counter);
@@ -1394,31 +1394,22 @@ static struct mp_image *get_window_screenshot(struct vo *vo)
return image;
}
-static uint32_t get_image(struct vo *vo, mp_image_t *mpi)
+static uint32_t get_decoder_surface(struct vo *vo, mp_image_t *mpi)
{
struct vdpctx *vc = vo->priv;
struct vdpau_render_state *rndr;
- // no dr for non-decoding for now
if (!IMGFMT_IS_VDPAU(vc->image_format))
return VO_FALSE;
- if (mpi->type != MP_IMGTYPE_NUMBERED)
- return VO_FALSE;
rndr = get_surface(vo, mpi->number);
if (!rndr) {
mp_msg(MSGT_VO, MSGL_ERR, "[vdpau] no surfaces available in "
- "get_image\n");
+ "get_decoder_surface\n");
// TODO: this probably breaks things forever, provide a dummy buffer?
return VO_FALSE;
}
- mpi->flags |= MP_IMGFLAG_DIRECT;
- mpi->stride[0] = mpi->stride[1] = mpi->stride[2] = 0;
- mpi->planes[0] = mpi->planes[1] = mpi->planes[2] = NULL;
- // hack to get around a check and to avoid a special-case in vd_ffmpeg.c
mpi->planes[0] = (void *)rndr;
- mpi->num_planes = 1;
- mpi->priv = rndr;
return VO_TRUE;
}
@@ -1598,8 +1589,8 @@ static int control(struct vo *vo, uint32_t request, void *data)
if (vc->dropped_frame)
vo->want_redraw = true;
return true;
- case VOCTRL_GET_IMAGE:
- return get_image(vo, data);
+ case VOCTRL_HWDEC_GET_SURFACE:
+ return get_decoder_surface(vo, data);
case VOCTRL_HWDEC_DECODER_RENDER:
return decoder_render(vo, data);
case VOCTRL_BORDER: