From 9c05be8999a77deea056c8c4952ab37756d05ce2 Mon Sep 17 00:00:00 2001 From: Philip Langdale Date: Sat, 28 Dec 2019 12:58:39 -0800 Subject: video: cuda: add explicit context creation for copy hwaccels In the distant past, the cuviddec backed copy hwaccel could be configured directly using lavc options. However, since that time, we gained support for automatic hw ctx creation which ended up bypassing the lavc options. Rather than trying to find a way to pass those options again, a better idea is to make the 'cuda-decode-device' option, used by the interop hwaccels, work for the copy hwaccels too. And that's pretty simple: we have to add a create function that checks the option and passes it on to ffmpeg. Note that this does require a slight re-jig to the configuration flags, as we now have a scenario where we want to build with support for the cuda copy hwaccels but not the interop ones. So we need a distinct configuration flag for that combination. Fixes #7295. --- video/hwdec.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'video/hwdec.c') diff --git a/video/hwdec.c b/video/hwdec.c index b3c2131791..97b984db18 100644 --- a/video/hwdec.c +++ b/video/hwdec.c @@ -119,6 +119,9 @@ char *hwdec_devices_get_names(struct mp_hwdec_devices *devs) } static const struct hwcontext_fns *const hwcontext_fns[] = { +#if HAVE_CUDA_HWACCEL + &hwcontext_fns_cuda, +#endif #if HAVE_D3D_HWACCEL &hwcontext_fns_d3d11, #endif -- cgit v1.2.3