summaryrefslogtreecommitdiffstats
path: root/video/out/vo_vdpau.c
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2012-11-04 17:17:11 +0100
committerwm4 <wm4@nowhere>2013-01-13 17:39:31 +0100
commitcfa1f9e082f3da83adb5161be140e477b38bc5c7 (patch)
tree3734904c1328ccc4967f34f20b3cbd405c54030c /video/out/vo_vdpau.c
parent58d3469fd6e983887a64afc51e0611504b749b3e (diff)
downloadmpv-cfa1f9e082f3da83adb5161be140e477b38bc5c7.tar.bz2
mpv-cfa1f9e082f3da83adb5161be140e477b38bc5c7.tar.xz
video: make vdpau hardware decoding not use slices code path
For some reason, libavcodec abuses the slices rendering code path for hardware decoding: in that case, the only purpose of the draw callback is to pass a vdpau video surface object to video output. (It is unclear to me why this had to use the slices code, instead of just returning an AVFrame with the required vdpau state.) Make this code separate within mpv, so that the internal slices code path is not used for hardware decoding. Pass the vdpau state with VOCTRL_HWDEC_DECODER_RENDER instead. Remove the mencoder specific VOCTRLs.
Diffstat (limited to 'video/out/vo_vdpau.c')
-rw-r--r--video/out/vo_vdpau.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/video/out/vo_vdpau.c b/video/out/vo_vdpau.c
index d6849564d1..3d0305b799 100644
--- a/video/out/vo_vdpau.c
+++ b/video/out/vo_vdpau.c
@@ -1252,17 +1252,16 @@ static void flip_page_timed(struct vo *vo, unsigned int pts_us, int duration)
vc->surface_num = WRAP_ADD(vc->surface_num, 1, vc->num_output_surfaces);
}
-static int draw_slice(struct vo *vo, uint8_t *image[], int stride[], int w,
- int h, int x, int y)
+static int decoder_render(struct vo *vo, void *state_ptr)
{
struct vdpctx *vc = vo->priv;
struct vdp_functions *vdp = vc->vdp;
VdpStatus vdp_st;
+ struct vdpau_render_state *rndr = (struct vdpau_render_state *)state_ptr;
if (handle_preemption(vo) < 0)
return VO_TRUE;
- struct vdpau_render_state *rndr = (struct vdpau_render_state *)image[0];
int max_refs = vc->image_format == IMGFMT_VDPAU_H264 ?
rndr->info.h264.num_ref_frames : 2;
if (!IMGFMT_IS_VDPAU(vc->image_format))
@@ -1606,6 +1605,8 @@ static int control(struct vo *vo, uint32_t request, void *data)
return true;
case VOCTRL_GET_IMAGE:
return get_image(vo, data);
+ case VOCTRL_HWDEC_DECODER_RENDER:
+ return decoder_render(vo, data);
case VOCTRL_BORDER:
vo_x11_border(vo);
checked_resize(vo);
@@ -1689,7 +1690,6 @@ const struct vo_driver video_out_vdpau = {
.control = control,
.draw_image_pts = draw_image,
.get_buffered_frame = set_next_frame_info,
- .draw_slice = draw_slice,
.draw_osd = draw_osd,
.flip_page_timed = flip_page_timed,
.check_events = check_events,