decklinkaudiosink: Add support for 8 and 16 channels
[platform/upstream/gstreamer.git] / meson.build
1 project('gst-plugins-bad', 'c', 'cpp',
2   version : '1.9.1.1',
3   meson_version : '>= 0.33.0',
4   default_options : [ 'warning_level=1',
5                       'c_std=gnu99',
6                       'buildtype=debugoptimized' ])
7
8 gst_version = meson.project_version()
9 version_arr = gst_version.split('.')
10 gst_version_major = version_arr[0]
11 gst_version_minor = version_arr[1]
12 gst_version_micro = version_arr[2]
13 if version_arr.length() == 4
14   gst_version_nano = version_arr[3]
15 else
16   gst_version_nano = 0
17 endif
18
19 glib_req = '>= 2.40.0'
20 gst_req = '>= @0@.@1@.0'.format(gst_version_major, gst_version_minor)
21
22 api_version = '1.0'
23 soversion = 0
24 # maintaining compatibility with the previous libtool versioning
25 # current = minor * 100 + micro
26 libversion = '@0@.@1@.0'.format(soversion, gst_version_minor.to_int() * 100 + gst_version_micro.to_int())
27
28 plugins_install_dir = '@0@/gstreamer-1.0'.format(get_option('libdir'))
29
30 cc = meson.get_compiler('c')
31
32 if cc.get_id() == 'msvc'
33   # Ignore several spurious warnings for things gstreamer does very commonly
34   # If a warning is completely useless and spammy, use '/wdXXXX' to suppress it
35   # If a warning is harmless but hard to fix, use '/woXXXX' so it's shown once
36   # NOTE: Only add warnings here if you are sure they're spurious
37   add_global_arguments('/wd4018', '/wd4244', '/wd4996', language : 'c')
38   # Disable SAFESEH with MSVC for plugins and libs that use external deps that
39   # are built with MinGW
40   noseh_link_args = ['/SAFESEH:NO']
41 else
42   noseh_link_args = []
43 endif
44
45 cdata = configuration_data()
46 check_headers = [
47   ['HAVE_DLFCN_H', 'dlfcn.h'],
48   ['HAVE_FCNTL_H', 'fcntl.h'],
49   ['HAVE_HIGHGUI_H', 'highgui.h'],
50   ['HAVE_INTTYPES_H', 'inttypes.h'],
51   ['HAVE_MEMORY_H', 'memory.h'],
52   ['HAVE_MSACM_H', 'msacm.h'],
53   ['HAVE_NETINET_IN_H', 'netinet/in.h'],
54   ['HAVE_NETINET_IP_H', 'netinet/ip.h'],
55   ['HAVE_NETINET_TCP_H', 'netinet/tcp.h'],
56   ['HAVE_OPENCV2_HIGHGUI_HIGHGUI_C_H', 'opencv2/highgui/highgui_c.h'],
57   ['HAVE_PTHREAD_H', 'pthread.h'],
58   ['HAVE_STDINT_H', 'stdint.h'],
59   ['HAVE_STDLIB_H', 'stdlib.h'],
60   ['HAVE_STRINGS_H', 'strings.h'],
61   ['HAVE_STRING_H', 'string.h'],
62   ['HAVE_SYS_PARAM_H', 'sys/param.h'],
63   ['HAVE_SYS_SOCKET_H', 'sys/socket.h'],
64   ['HAVE_SYS_STAT_H', 'sys/stat.h'],
65   ['HAVE_SYS_TIME_H', 'sys/time.h'],
66   ['HAVE_SYS_TYPES_H', 'sys/types.h'],
67   ['HAVE_SYS_UTSNAME_H', 'sys/utsname.h'],
68   ['HAVE_UNISTD_H', 'unistd.h'],
69   ['HAVE_WINDOWS_H', 'windows.h'],
70   ['HAVE_WININET_H', 'wininet.h'],
71   ['HAVE_WINSOCK2_H', 'winsock2.h'],
72   ['HAVE_WS2TCPIP_H', 'ws2tcpip.h'],
73 ]
74
75 foreach h : check_headers
76   if cc.has_header(h.get(1))
77     cdata.set(h.get(0), 1)
78   endif
79 endforeach
80
81 check_functions = [
82 # check token HAVE_ACM
83 # check token HAVE_ANDROID_MEDIA
84 # check token HAVE_APEXSINK
85 # check token HAVE_APPLE_MEDIA
86 # check token HAVE_ASSRENDER
87 # check token HAVE_AVC
88 # check token HAVE_AVFOUNDATION
89 # check token HAVE_BLUEZ
90 # check token HAVE_BZ2
91 # check token HAVE_CFLOCALECOPYCURRENT
92 # check token HAVE_CFPREFERENCESCOPYAPPVALUE
93 # check token HAVE_CHROMAPRINT
94 # check token HAVE_CPU_ALPHA
95 # check token HAVE_CPU_ARM
96 # check token HAVE_CPU_CRIS
97 # check token HAVE_CPU_CRISV32
98 # check token HAVE_CPU_HPPA
99 # check token HAVE_CPU_I386
100 # check token HAVE_CPU_IA64
101 # check token HAVE_CPU_M68K
102 # check token HAVE_CPU_MIPS
103 # check token HAVE_CPU_PPC
104 # check token HAVE_CPU_PPC64
105 # check token HAVE_CPU_S390
106 # check token HAVE_CPU_SPARC
107 # check token HAVE_CPU_X86_64
108 # check token HAVE_CURL
109 # check token HAVE_DAALA
110 # check token HAVE_DASH
111 # check token HAVE_DC1394
112   ['HAVE_DCGETTEXT', 'dcgettext'],
113 # check token HAVE_DECKLINK
114 # check token HAVE_DIRECT3D
115 # check token HAVE_DIRECTDRAW
116 # check token HAVE_DIRECTFB
117 # check token HAVE_DIRECTSOUND
118 # check token HAVE_DOWHILE_MACROS
119 # check token HAVE_DTS
120 # check token HAVE_DVB
121 # check token HAVE_EXPERIMENTAL
122 # check token HAVE_EXTERNAL
123 # check token HAVE_FAAC
124 # check token HAVE_FAAD
125 # check token HAVE_FBDEV
126 # check token HAVE_FIONREAD_IN_SYS_FILIO
127 # check token HAVE_FIONREAD_IN_SYS_IOCTL
128 # check token HAVE_FLITE
129 # check token HAVE_FLUIDSYNTH
130   ['HAVE_GETPAGESIZE', 'getpagesize'],
131 # check token HAVE_GETTEXT
132 # check token HAVE_GL
133 # check token HAVE_GLCHAR
134 # check token HAVE_GLEGLIMAGEOES
135 # check token HAVE_GLINTPTR
136 # check token HAVE_GLSIZEIPTR
137 # check token HAVE_GME
138   ['HAVE_GMTIME_R', 'gmtime_r'],
139 # check token HAVE_GRAPHENE
140 # check token HAVE_GSETTINGS
141 # check token HAVE_GSM
142 # check token HAVE_GUDEV
143 # check token HAVE_HLS
144 # check token HAVE_ICONV
145 # check token HAVE_IOS
146 # check token HAVE_JPEG
147 # check token HAVE_KATE
148 # check token HAVE_LADSPA
149 # check token HAVE_LIBGCRYPT
150 # check token HAVE_LIBGME_ACCURACY
151 # check token HAVE_LIBMMS
152 # check token HAVE_LIBNSL
153 # check token HAVE_LIBSOCKET
154 # check token HAVE_LIBUSB
155 # check token HAVE_LIBVISUAL
156 # check token HAVE_LINSYS
157 # check token HAVE_LRDF
158 # check token HAVE_LV2
159 # check token HAVE_MIMIC
160   ['HAVE_MMAP', 'mmap'],
161 # check token HAVE_MODPLUG
162 # check token HAVE_MPEG2ENC
163 # check token HAVE_MPG123
164 # check token HAVE_MPLEX
165 # check token HAVE_MUSEPACK
166 # check token HAVE_MYTHTV
167 # check token HAVE_NAS
168 # check token HAVE_NEON
169 # check token HAVE_NETTLE
170 # check token HAVE_OFA
171 # check token HAVE_OPENAL
172 # check token HAVE_OPENCV
173 # check token HAVE_OPENEXR
174 # check token HAVE_OPENJPEG
175 # check token HAVE_OPENJPEG_1
176 # check token HAVE_OPENNI2
177 # check token HAVE_OPENSLES
178 # check token HAVE_OPUS
179 # check token HAVE_ORC
180 # check token HAVE_OSX
181 # check token HAVE_OSX_VIDEO
182 # check token HAVE_PNG
183 # check token HAVE_PVR
184 # check token HAVE_QUICKTIME
185 # check token HAVE_RDTSC
186 # check token HAVE_RESINDVD
187 # check token HAVE_RSVG
188 # check token HAVE_RSVG_2_36_2
189 # check token HAVE_RTMP
190 # check token HAVE_SBC
191 # check token HAVE_SCHRO
192 # check token HAVE_SDL
193 # check token HAVE_SHM
194 # check token HAVE_SMOOTHSTREAMING
195 # check token HAVE_SNDFILE
196 # check token HAVE_SNDIO
197 # check token HAVE_SOUNDTOUCH
198 # check token HAVE_SOUNDTOUCH_1_4
199 # check token HAVE_SPANDSP
200 # check token HAVE_SPC
201 # check token HAVE_SRTP
202 # check token HAVE_SSH2
203 # check token HAVE_TELETEXTDEC
204 # check token HAVE_TIGER
205 # check token HAVE_TIMIDITY
206 # check token HAVE_UVCH264
207 # check token HAVE_VALGRIND
208 # check token HAVE_VCD
209 # check token HAVE_VDPAU
210 # check token HAVE_VIDEOTOOLBOX
211 # check token HAVE_VIDEOTOOLBOX_10_9_6
212 # check token HAVE_VOAACENC
213 # check token HAVE_VOAMRWBENC
214 # check token HAVE_WASAPI
215 # check token HAVE_WAYLAND
216 # check token HAVE_WEBP
217 # check token HAVE_WILDMIDI
218 # check token HAVE_WILDMIDI_0_2_2
219 # check token HAVE_WIN32
220 # check token HAVE_WININET
221 # check token HAVE_WINKS
222 # check token HAVE_WINSCREENCAP
223 # check token HAVE_XVID
224 # check token HAVE_ZBAR
225 ]
226
227 foreach f : check_functions
228   if cc.has_function(f.get(1))
229     cdata.set(f.get(0), 1)
230   endif
231 endforeach
232
233 cdata.set('SIZEOF_CHAR', cc.sizeof('char'))
234 cdata.set('SIZEOF_INT', cc.sizeof('int'))
235 cdata.set('SIZEOF_LONG', cc.sizeof('long'))
236 cdata.set('SIZEOF_SHORT', cc.sizeof('short'))
237 cdata.set('SIZEOF_VOIDP', cc.sizeof('void*'))
238
239 cdata.set('VERSION', '"@0@"'.format(gst_version))
240 cdata.set('PACKAGE', '"gst-plugins-bad"')
241 cdata.set('PACKAGE_VERSION', '"@0@"'.format(gst_version))
242 cdata.set('PACKAGE_BUGREPORT', '"http://bugzilla.gnome.org/enter_bug.cgi?product=GStreamer"')
243 cdata.set('PACKAGE_NAME', '"GStreamer Bad Plug-ins"')
244 cdata.set('GETTEXT_PACKAGE', '"gst-plugins-bad-1.0"')
245 cdata.set('GST_API_VERSION', '"@0@"'.format(api_version))
246 cdata.set('GST_PACKAGE_NAME', '"GStreamer Bad Plug-ins"')
247 cdata.set('GST_PACKAGE_ORIGIN', '"Unknown package origin"')
248 cdata.set('GST_LICENSE', '"LGPL"')
249 cdata.set('LIBDIR', '"@0@"'.format(get_option('libdir')))
250
251 # FIXME: This should be exposed as a configuration option
252 host_system = host_machine.system()
253 if host_system == 'linux'
254   cdata.set('DEFAULT_VIDEOSRC', '"v4l2src"')
255 elif host_system == 'osx'
256   cdata.set('DEFAULT_VIDEOSRC', '"avfvideosrc"')
257 else
258   cdata.set('DEFAULT_VIDEOSRC', '"videotestsrc"')
259 endif
260
261 # Mandatory GST deps
262 gst_dep = dependency('gstreamer-1.0', version : gst_req,
263   fallback : ['gstreamer', 'gst_dep'])
264 gstbase_dep = dependency('gstreamer-base-1.0', version : gst_req,
265   fallback : ['gstreamer', 'gst_base_dep'])
266 gstnet_dep = dependency('gstreamer-net-1.0', version : gst_req,
267   fallback : ['gstreamer', 'gst_net_dep'])
268 gstcheck_dep = dependency('gstreamer-check-1.0', version : gst_req,
269   fallback : ['gstreamer', 'gst_check_dep'])
270 gstcontroller_dep = dependency('gstreamer-controller-1.0', version : gst_req,
271   fallback : ['gstreamer', 'gst_controller_dep'])
272
273 gstpbutils_dep = dependency('gstreamer-pbutils-1.0', version : gst_req,
274     fallback : ['gst-plugins-base', 'pbutils_dep'])
275 gstallocators_dep = dependency('gstreamer-allocators-1.0', version : gst_req,
276     fallback : ['gst-plugins-base', 'allocators_dep'])
277 gstapp_dep = dependency('gstreamer-app-1.0', version : gst_req,
278     fallback : ['gst-plugins-base', 'app_dep'])
279 gstaudio_dep = dependency('gstreamer-audio-1.0', version : gst_req,
280     fallback : ['gst-plugins-base', 'audio_dep'])
281 gstfft_dep = dependency('gstreamer-fft-1.0', version : gst_req,
282     fallback : ['gst-plugins-base', 'fft_dep'])
283 gstriff_dep = dependency('gstreamer-riff-1.0', version : gst_req,
284     fallback : ['gst-plugins-base', 'riff_dep'])
285 gstrtp_dep = dependency('gstreamer-rtp-1.0', version : gst_req,
286     fallback : ['gst-plugins-base', 'rtp_dep'])
287 gstrtsp_dep = dependency('gstreamer-rtsp-1.0', version : gst_req,
288     fallback : ['gst-plugins-base', 'rtsp_dep'])
289 gstsdp_dep = dependency('gstreamer-sdp-1.0', version : gst_req,
290     fallback : ['gst-plugins-base', 'sdp_dep'])
291 gsttag_dep = dependency('gstreamer-tag-1.0', version : gst_req,
292     fallback : ['gst-plugins-base', 'tag_dep'])
293 gstvideo_dep = dependency('gstreamer-video-1.0', version : gst_req,
294     fallback : ['gst-plugins-base', 'video_dep'])
295
296 libm = cc.find_library('m', required : false)
297 glib_dep = dependency('glib-2.0', version : glib_req)
298 gio_dep = dependency('gio-2.0', version : glib_req)
299 gmodule_dep = dependency('gmodule-2.0', version : glib_req)
300 x11_dep = dependency('x11', required : false)
301 # Used by dtls and hls
302 openssl_dep = dependency('openssl', version : '>= 1.0.1', required : false)
303
304 if x11_dep.found()
305   cdata.set('HAVE_X11', 1)
306 endif
307
308 mathlib = cc.find_library('m', required : false)
309
310 if host_machine.system() == 'windows'
311   winsock2 = [cc.find_library('ws2_32')]
312 else
313   winsock2 = []
314 endif
315
316 have_orcc = false
317 orcc_args = []
318 if get_option('use_orc') != 'no'
319   need_orc = get_option('use_orc') == 'yes'
320   # Used by various libraries/elements that use Orc code
321   orc_dep = dependency('orc-0.4', required : need_orc)
322   orcc = find_program('orcc', required : need_orc)
323   if orc_dep.found() and orcc.found()
324     have_orcc = true
325     orcc_args = [orcc, '--include', 'glib.h']
326     cdata.set('HAVE_ORC', 1)
327   else
328     message('Orc Compiler not found, will use backup C code')
329     cdata.set('DISABLE_ORC', 1)
330   endif
331 else
332   cdata.set('DISABLE_ORC', 1)
333 endif
334
335 configure_file(input : 'config.h.meson',
336   output : 'config.h',
337   configuration : cdata)
338
339 gst_plugins_bad_args = ['-DHAVE_CONFIG_H']
340 configinc = include_directories('.')
341 libsinc = include_directories('gst-libs')
342
343 vs_module_defs_dir = meson.source_root() + '/win32/common/'
344
345 # Used by the *_mkenum.py helper scripts
346 glib_mkenums = find_program('glib-mkenums')
347
348 subdir('gst-libs')
349 subdir('gst')
350 subdir('sys')
351 subdir('ext')
352 subdir('pkgconfig')