videoparse: Only add a single closed caption meta
[platform/upstream/gst-plugins-bad.git] / sys / meson.build
1 subdir('androidmedia')
2 subdir('applemedia')
3 subdir('bluez')
4 subdir('d3dvideosink')
5 subdir('decklink')
6 subdir('directsound')
7 #subdir('dshowdecwrapper')
8 #subdir('dshowsrcwrapper')
9 #subdir('dshowvideosink')
10 subdir('dvb')
11 subdir('fbdev')
12 subdir('ipcpipeline')
13 subdir('kms')
14 subdir('msdk')
15 subdir('opensles')
16 subdir('shm')
17 subdir('tinyalsa')
18 subdir('uvch264')
19 subdir('vdpau')
20 subdir('wasapi')
21 subdir('winks')
22 subdir('winscreencap')
23
24 # CUDA dependency
25 cuda_dep = dependency('', required : false)
26 cudart_dep = dependency('', required : false)
27 cuda_libdir = ''
28 cuda_incdir = ''
29
30 cuda_versions = [
31     '10.1',
32     '10.0',
33     '9.2',
34     '9.1',
35     '9.0',
36     '8.0',
37     '7.5',
38     '7.0',
39     '6.5',
40   ]
41 cuda_ver = ''
42
43 # FIXME: use break syntax when we use meson >= '0.49'
44 foreach v : cuda_versions
45   if cuda_ver == ''
46     cuda_dep = dependency('cuda-' + v, required: false)
47     cudart_dep = dependency('cudart-' + v, required: false)
48     if cuda_dep.found() and cudart_dep.found()
49       cuda_ver = v
50     endif
51   endif
52 endforeach
53
54 if cuda_dep.found()
55   cuda_header_found = cc.has_header('cuda.h', dependencies: cuda_dep)
56   cuda_lib_found = cc.has_function('cuInit', dependencies: cuda_dep)
57   if not cuda_header_found or not cuda_lib_found
58     message ('Missing required header and/or function in cuda dependency')
59     cuda_dep = dependency('', required : false)
60   endif
61 endif
62
63 if cudart_dep.found()
64   cudart_header_found = cc.has_header('cuda_runtime_api.h', dependencies: cudart_dep)
65   cudart_lib_found = cc.has_function('cudaGetErrorString', dependencies: cudart_dep)
66   if not cudart_header_found or not cudart_lib_found
67     message ('Missing required header and/or function in cudart dependency')
68     cudart_dep = dependency('', required : false)
69   endif
70 endif
71
72 if not cuda_dep.found() or not cudart_dep.found()
73   cuda_root = run_command(python3, '-c', 'import os; print(os.environ.get("CUDA_PATH"))').stdout().strip()
74   if cuda_root != '' and cuda_root != 'None'
75     if host_machine.system() == 'windows'
76       arc = ''
77       if build_machine.cpu_family() == 'x86_64'
78         arc = 'x64'
79       else
80         arc = 'Win32'
81       endif
82       cuda_libdir = join_paths (cuda_root, 'lib', arc)
83     else
84       cuda_libdir = [join_paths (cuda_root, 'lib'), join_paths (cuda_root, 'lib', 'stubs'),
85                      join_paths (cuda_root, 'lib64'), join_paths (cuda_root, 'lib64', 'stubs')]
86     endif
87     cuda_incdir = join_paths (cuda_root, 'include')
88     cuda_lib = cc.find_library('cuda', dirs: cuda_libdir, required: false)
89     cudart_lib = cc.find_library('cudart', dirs: cuda_libdir, required: false)
90
91     if cuda_lib.found()
92       cuda_header_found = cc.has_header('cuda.h', args: '-I' + cuda_incdir)
93       cuda_lib_found = cc.has_function('cuInit', dependencies: cuda_lib)
94       if cuda_header_found and cuda_lib_found
95         cuda_dep = declare_dependency(include_directories: include_directories(cuda_incdir),
96                                       dependencies: cuda_lib)
97       endif
98     endif
99
100     if cudart_lib.found()
101       cudart_header_found = cc.has_header('cuda_runtime_api.h', args: '-I' + cuda_incdir)
102       cudart_lib_found = cc.has_function('cudaGetErrorString', dependencies: cudart_lib)
103       if cudart_header_found and cudart_lib_found
104         cudart_dep = declare_dependency(dependencies: cudart_lib)
105       endif
106     endif
107
108   endif
109 endif
110
111 if cuda_dep.found() and cudart_dep.found()
112   subdir('nvdec')
113   subdir('nvenc')
114 elif get_option('nvdec').enabled()
115   error('The nvdec plugin was enabled explicitly, but required CUDA dependencies were not found.')
116 elif get_option('nvenc').enabled()
117   error('The nvenc plugin was enabled explicitly, but required CUDA dependencies were not found.')
118 endif