summaryrefslogtreecommitdiffstats
path: root/video/decode/vd_lavc.c
diff options
context:
space:
mode:
authorPhilip Langdale <philipl@overt.org>2016-09-10 20:12:27 -0700
committerwm4 <wm4@nowhere>2016-09-11 10:46:22 +0200
commit3f7e43c2e2658eb8a1a22cc4e7359392ec70dc3b (patch)
tree761336d58bb5928690232f5a918dc986a5bc22d1 /video/decode/vd_lavc.c
parent71681e04ee956a64f2d6e067f3540ea918a16b61 (diff)
downloadmpv-3f7e43c2e2658eb8a1a22cc4e7359392ec70dc3b.tar.bz2
mpv-3f7e43c2e2658eb8a1a22cc4e7359392ec70dc3b.tar.xz
hwdec_cuda: Add trivial cuda-copy wrapper
The cuvid decoder already knows how to copy back to system memory if NV12 frames are requested, and this will happen if the decoder is used without the hwdec. For convenience, let's add a wrapper hwdec so people don't have to explicitly pick the cuvid decoder if they want this behaviour.
Diffstat (limited to 'video/decode/vd_lavc.c')
-rw-r--r--video/decode/vd_lavc.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/video/decode/vd_lavc.c b/video/decode/vd_lavc.c
index 11978b3ded..e21f60972d 100644
--- a/video/decode/vd_lavc.c
+++ b/video/decode/vd_lavc.c
@@ -151,6 +151,14 @@ static const struct vd_lavc_hwdec mp_vd_lavc_mediacodec = {
};
#endif
+#if HAVE_CUDA_GL
+static const struct vd_lavc_hwdec mp_vd_lavc_cuda_copy = {
+ .type = HWDEC_CUDA_COPY,
+ .lavc_suffix = "_cuvid",
+ .copying = true,
+};
+#endif
+
static const struct vd_lavc_hwdec *const hwdec_list[] = {
#if HAVE_RPI
&mp_vd_lavc_rpi,
@@ -177,6 +185,7 @@ static const struct vd_lavc_hwdec *const hwdec_list[] = {
#endif
#if HAVE_CUDA_GL
&mp_vd_lavc_cuda,
+ &mp_vd_lavc_cuda_copy,
#endif
NULL
};