diff options
author | wm4 <wm4@nowhere> | 2017-11-30 21:54:13 +0100 |
---|---|---|
committer | wm4 <wm4@nowhere> | 2017-11-30 21:54:13 +0100 |
commit | c7596d3c8bbb61f122e0a18261bb535578823071 (patch) | |
tree | 3e0f2a7edd0d0e8078ec68e7004a1d65764ab602 | |
parent | ce3af51e58db85aab60abb0be2208554f2bdf328 (diff) | |
download | mpv-c7596d3c8bbb61f122e0a18261bb535578823071.tar.bz2 mpv-c7596d3c8bbb61f122e0a18261bb535578823071.tar.xz |
vd_lavc: prefer nvdec over vdpau with --hwdec=auto
nvdec aka cuvid aka cuda should work much better than vdpau, and support
newer codecs (such as vp9), and more advanced surface formats (like 10
bit).
This requires moving the d3d hwaccels in the autoprobe order, since on
Windows, d3d decoding should be preferred over nvidia proprietary stuff.
Users of older drivers will need to force --hwdec=vdpau, since it could
happen that the vo_gpu cuda hwdec interop loads (so the vdpau interop is
not loaded), but the hwdec itself doesn't work.
I expect this does not break AMD (which still needs vdpau for vo_gpu
interop, until libva is fixed so it can fully support AMD).
-rw-r--r-- | video/decode/vd_lavc.c | 24 | ||||
-rw-r--r-- | video/out/gpu/hwdec.c | 6 |
2 files changed, 16 insertions, 14 deletions
diff --git a/video/decode/vd_lavc.c b/video/decode/vd_lavc.c index 2e144ac409..2362e9aa73 100644 --- a/video/decode/vd_lavc.c +++ b/video/decode/vd_lavc.c @@ -244,10 +244,23 @@ static const struct vd_lavc_hwdec mp_vd_lavc_videotoolbox_copy = { #endif static const struct vd_lavc_hwdec *const hwdec_list[] = { +#if HAVE_D3D_HWACCEL + &mp_vd_lavc_d3d11va, + + #if HAVE_D3D9_HWACCEL + &mp_vd_lavc_dxva2, + &mp_vd_lavc_dxva2_copy, + #endif + &mp_vd_lavc_d3d11va_copy, +#endif #if HAVE_RPI &mp_vd_lavc_rpi, &mp_vd_lavc_rpi_copy, #endif +#if HAVE_CUDA_HWACCEL + &mp_vd_lavc_nvdec, + &mp_vd_lavc_nvdec_copy, +#endif #if HAVE_VDPAU &mp_vd_lavc_vdpau, &mp_vd_lavc_vdpau_copy, @@ -260,22 +273,11 @@ static const struct vd_lavc_hwdec *const hwdec_list[] = { &mp_vd_lavc_vaapi, &mp_vd_lavc_vaapi_copy, #endif -#if HAVE_D3D_HWACCEL - &mp_vd_lavc_d3d11va, - - #if HAVE_D3D9_HWACCEL - &mp_vd_lavc_dxva2, - &mp_vd_lavc_dxva2_copy, - #endif - &mp_vd_lavc_d3d11va_copy, -#endif #if HAVE_ANDROID &mp_vd_lavc_mediacodec, &mp_vd_lavc_mediacodec_copy, #endif #if HAVE_CUDA_HWACCEL - &mp_vd_lavc_nvdec, - &mp_vd_lavc_nvdec_copy, &mp_vd_lavc_cuda, &mp_vd_lavc_cuda_copy, #endif diff --git a/video/out/gpu/hwdec.c b/video/out/gpu/hwdec.c index 5284f8e6f3..12f4dd7f64 100644 --- a/video/out/gpu/hwdec.c +++ b/video/out/gpu/hwdec.c @@ -44,9 +44,6 @@ static const struct ra_hwdec_driver *const mpgl_hwdec_drivers[] = { #if HAVE_VAAPI_EGL &ra_hwdec_vaegl, #endif -#if HAVE_VDPAU_GL_X11 - &ra_hwdec_vdpau, -#endif #if HAVE_VIDEOTOOLBOX_GL || HAVE_IOS_GL &ra_hwdec_videotoolbox, #endif @@ -66,6 +63,9 @@ static const struct ra_hwdec_driver *const mpgl_hwdec_drivers[] = { #if HAVE_CUDA_HWACCEL &ra_hwdec_cuda, #endif +#if HAVE_VDPAU_GL_X11 + &ra_hwdec_vdpau, +#endif #if HAVE_RPI &ra_hwdec_rpi_overlay, #endif |