summaryrefslogtreecommitdiffstats
path: root/video/out
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2017-01-17 11:00:31 +0100
committerwm4 <wm4@nowhere>2017-01-17 15:48:56 +0100
commitff9f2c4b6eed6cd85488290200d2345015c5bf06 (patch)
tree567b004153c51928fb78c59f66bea8acb06ad903 /video/out
parentcda31b71debdd52cfe9a36e8eea318899acdd0d2 (diff)
downloadmpv-ff9f2c4b6eed6cd85488290200d2345015c5bf06.tar.bz2
mpv-ff9f2c4b6eed6cd85488290200d2345015c5bf06.tar.xz
vdpau: use libavutil for surface allocation during decoding
Use the libavutil vdpau frame allocation code instead of our own "old" code. This also uses its code for copying a video surface to normal memory (used by vdpau-copy). Since vdpau doesn't really have an internal pixel format, 4:2:0 can be accessed as both nv12 and yuv420p - and libavutil prefers to report yuv420p. The OpenGL interop has to be adjusted accordingly. Preemption is a potential problem, but it doesn't break it more than it already is. This requires a bug fix to FFmpeg's vdpau code, or vdpau-copy (as well as taking screenshots) will fail. Libav has fixed this bug ages ago.
Diffstat (limited to 'video/out')
-rw-r--r--video/out/opengl/hwdec_vdpau.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/video/out/opengl/hwdec_vdpau.c b/video/out/opengl/hwdec_vdpau.c
index 06dc71e5e9..712997ed7a 100644
--- a/video/out/opengl/hwdec_vdpau.c
+++ b/video/out/opengl/hwdec_vdpau.c
@@ -158,7 +158,8 @@ static int reinit(struct gl_hwdec *hw, struct mp_image_params *params)
p->vdpgl_initialized = true;
- p->direct_mode = params->hw_subfmt == IMGFMT_NV12;
+ p->direct_mode = params->hw_subfmt == IMGFMT_NV12 ||
+ params->hw_subfmt == IMGFMT_420P;
gl->GenTextures(4, p->gl_textures);
for (int n = 0; n < 4; n++) {