1
0
mirror of https://github.com/mpv-player/mpv synced 2025-02-26 18:32:08 +00:00

wscript: Fix cuda test to actually work when cuda SDK is not present

The test ended up failing if cuda.h wasn't present, even if cuda.h
isn't used during the actual build.

This test is attempting to establish if the ffmpeg being built
against has dynlink_cuda support. While it might theoretically be
possible to build against the older normally-linked-cuda version
of ffmpeg, it seems more trouble than it's worth.
This commit is contained in:
Philip Langdale 2016-11-23 10:14:32 -08:00 committed by wm4
parent 755e9fad29
commit 3abb6f1fef
3 changed files with 15 additions and 4 deletions

View File

@ -19,7 +19,7 @@
* License along with mpv. If not, see <http://www.gnu.org/licenses/>.
*/
#if !defined(MPV_CUDA_DYNAMIC_H) && !defined(CUDA_VERSION)
#ifndef MPV_CUDA_DYNAMIC_H
#define MPV_CUDA_DYNAMIC_H
#include <stdbool.h>

12
waftools/fragments/cuda.c Normal file
View File

@ -0,0 +1,12 @@
#define CUDA_VERSION 7050
typedef void * CUcontext;
#include <libavutil/hwcontext.h>
#include <libavutil/hwcontext_cuda.h>
int main(int argc, char *argv[]) {
enum AVHWDeviceType type = AV_HWDEVICE_TYPE_CUDA;
AVCUDADeviceContextInternal *foo;
return 0;
}

View File

@ -922,9 +922,8 @@ hwaccel_features = [
}, {
'name': '--cuda-hwaccel',
'desc': 'CUDA hwaccel',
'func': check_statement('libavutil/hwcontext_cuda.h',
'AVCUDADeviceContextInternal* foo',
use='libav'),
'func': check_cc(fragment=load_fragment('cuda.c'),
use='libav'),
}, {
'name': 'sse4-intrinsics',
'desc': 'GCC SSE4 intrinsics for GPU memcpy',