From fa34b4920aa372e2fb07b970a9242b41bddccf15 Mon Sep 17 00:00:00 2001 From: wm4 Date: Tue, 29 Jul 2014 00:21:02 +0200 Subject: vdpau: don't upload video images in advance With software decoding, images were uploaded to vdpau surfaces as they were queued to the VO. This makes it slightly more complicated (especially later on), and has no advantages - so stop doing it. The only reason why this was done explicitly was due to attempts to keep the code equivalent (instead of risking performance regressions). The original code did this naturally for certain reasons, but now that we can measure that it has no advantages and just requires extra code, we can just drop it. --- video/out/vo_vdpau.c | 30 +++++++++++------------------- 1 file changed, 11 insertions(+), 19 deletions(-) (limited to 'video/out/vo_vdpau.c') diff --git a/video/out/vo_vdpau.c b/video/out/vo_vdpau.c index 56a52d613f..949d149a55 100644 --- a/video/out/vo_vdpau.c +++ b/video/out/vo_vdpau.c @@ -847,28 +847,21 @@ static void draw_image(struct vo *vo, struct mp_image *mpi) { struct vdpctx *vc = vo->priv; - talloc_free(vc->current_image); - vc->current_image = mpi; - - if (status_ok(vo)) - video_to_output_surface(vo); -} - -static struct mp_image *filter_image(struct vo *vo, struct mp_image *mpi) -{ - struct vdpctx *vc = vo->priv; - check_preemption(vo); - struct mp_image *reserved_mpi = mp_vdpau_upload_video_surface(vc->mpvdp, mpi); - if (!reserved_mpi) - goto end; + struct mp_image *vdp_mpi = mp_vdpau_upload_video_surface(vc->mpvdp, mpi); + if (vdp_mpi) { + mp_image_copy_attributes(vdp_mpi, mpi); + } else { + MP_ERR(vo, "Could not upload image.\n"); + } + talloc_free(mpi); - mp_image_copy_attributes(reserved_mpi, mpi); + talloc_free(vc->current_image); + vc->current_image = vdp_mpi; -end: - talloc_free(mpi); - return reserved_mpi; + if (status_ok(vo)) + video_to_output_surface(vo); } // warning: the size and pixel format of surface must match that of the @@ -1148,7 +1141,6 @@ const struct vo_driver video_out_vdpau = { .reconfig = reconfig, .control = control, .draw_image = draw_image, - .filter_image = filter_image, .flip_page_timed = flip_page_timed, .uninit = uninit, .priv_size = sizeof(struct vdpctx), -- cgit v1.2.3