diff options
author | wm4 <wm4@nowhere> | 2013-11-29 14:19:44 +0100 |
---|---|---|
committer | wm4 <wm4@nowhere> | 2013-11-29 14:19:44 +0100 |
commit | 2a316c3506766a331f7c0ef717ae8bffe21da457 (patch) | |
tree | 28de54650219123a2697e6620082c8d2a210ad6f | |
parent | 60cd30055812d95aba453bdcb9b316e63fda5a31 (diff) | |
download | mpv-2a316c3506766a331f7c0ef717ae8bffe21da457.tar.bz2 mpv-2a316c3506766a331f7c0ef717ae8bffe21da457.tar.xz |
vdpau: always let decoder output IMGFMT_VDPAU
The old ffmpeg vdpau support code uses separate vdpau pixel formats for
each decoder (pretty much because mplayer's architecture sucked), which
just gets into the way. Force the old decoder's output to IMGFMT_VDPAU,
and remove IMGFMT_IS_VDPAU() where we can remove it.
This should completely remove the differences betwene the old and new
vdpau decoder outside of the decoder.
-rw-r--r-- | video/decode/vdpau_old.c | 1 | ||||
-rw-r--r-- | video/out/gl_hwdec_vdpau.c | 4 | ||||
-rw-r--r-- | video/out/vo_vdpau.c | 2 |
3 files changed, 4 insertions, 3 deletions
diff --git a/video/decode/vdpau_old.c b/video/decode/vdpau_old.c index 24486a6b23..8b7950c876 100644 --- a/video/decode/vdpau_old.c +++ b/video/decode/vdpau_old.c @@ -255,6 +255,7 @@ static struct mp_image *process_image(struct lavc_ctx *ctx, struct mp_image *img struct vdpau_render_state *rndr = (void *)img->planes[0]; img->planes[0] = (void *)"dummy"; // must be non-NULL, otherwise arbitrary img->planes[3] = (void *)(intptr_t)rndr->surface; + mp_image_setfmt(img, IMGFMT_VDPAU); return img; } diff --git a/video/out/gl_hwdec_vdpau.c b/video/out/gl_hwdec_vdpau.c index 58e1ab2d8d..b92f6a9b07 100644 --- a/video/out/gl_hwdec_vdpau.c +++ b/video/out/gl_hwdec_vdpau.c @@ -42,7 +42,7 @@ struct priv { static bool query_format(int imgfmt) { - return IMGFMT_IS_VDPAU(imgfmt); + return imgfmt == IMGFMT_VDPAU; } static void mark_vdpau_objects_uninitialized(struct gl_hwdec *hw) @@ -221,7 +221,7 @@ static int map_image(struct gl_hwdec *hw, struct mp_image *hw_image, struct vdp_functions *vdp = p->ctx->vdp; VdpStatus vdp_st; - assert(hw_image && IMGFMT_IS_VDPAU(hw_image->imgfmt)); + assert(hw_image && hw_image->imgfmt == IMGFMT_VDPAU); VdpVideoSurface video_surface = (intptr_t)hw_image->planes[3]; if (handle_preemption(hw) < 0) diff --git a/video/out/vo_vdpau.c b/video/out/vo_vdpau.c index 54b13cfd94..727fea532f 100644 --- a/video/out/vo_vdpau.c +++ b/video/out/vo_vdpau.c @@ -1169,7 +1169,7 @@ static void draw_image(struct vo *vo, mp_image_t *mpi) // Forget previous frames, as we can display a new one now. vc->prev_deint_queue_pos = -1001; - if (IMGFMT_IS_VDPAU(vc->image_format)) { + if (vc->image_format == IMGFMT_VDPAU) { surface = (VdpVideoSurface)(intptr_t)mpi->planes[3]; reserved_mpi = mp_image_new_ref(mpi); } else if (vc->rgb_mode) { |