d3d11videosink: add gstcheck test for win32 window
[platform/upstream/gstreamer.git] / subprojects / gst-plugins-bad / tests / check / meson.build
1 have_registry = true # FIXME get_option('registry')
2
3 libparser = static_library('parser',
4   'elements/parser.c',
5   install : false,
6   dependencies : [gst_dep, gstcheck_dep],
7 )
8
9 libparser_dep = declare_dependency(link_with: libparser,
10   sources: ['elements/parser.h'])
11
12 # FIXME: automagic
13 exif_dep = dependency('libexif', version : '>= 0.6.16', required : false)
14
15 # Since nalutils API is internal, need to build it again
16 nalutils_dep = gstcodecparsers_dep.partial_dependency (compile_args: true, includes: true)
17
18 enable_gst_play_tests = get_option('gst_play_tests')
19 libsoup_dep = dependency('libsoup-2.4', version : '>=2.48', required : enable_gst_play_tests,
20   fallback : ['libsoup', 'libsoup_dep'])
21
22 # name, condition when to skip the test and extra dependencies
23 base_tests = [
24   [['elements/aesenc.c'], not aes_dep.found(), [aes_dep]],
25   [['elements/aesdec.c'], not aes_dep.found(), [aes_dep]],
26   [['elements/aiffparse.c'], get_option('aiff').disabled()],
27   [['elements/asfmux.c'], get_option('asfmux').disabled()],
28   [['elements/autoconvert.c'], get_option('autoconvert').disabled()],
29   [['elements/autovideoconvert.c'], get_option('autoconvert').disabled()],
30   [['elements/avwait.c'], get_option('timecode').disabled()],
31   [['elements/camerabin.c'], get_option('camerabin2').disabled()],
32   [['elements/ccconverter.c'], not closedcaption_dep.found(), [gstvideo_dep]],
33   [['elements/cccombiner.c'], not closedcaption_dep.found(), ],
34   [['elements/ccextractor.c'], not closedcaption_dep.found(), ],
35   [['elements/cudaconvert.c'], false, [gstgl_dep, gmodule_dep]],
36   [['elements/cudafilter.c'], false, [gstgl_dep, gmodule_dep]],
37   [['elements/d3d11colorconvert.c'], host_machine.system() != 'windows', ],
38   [['elements/d3d11videosink.c'], host_machine.system() != 'windows', ],
39   [['elements/fdkaac.c'], not fdkaac_dep.found(), ],
40   [['elements/gdpdepay.c'], get_option('gdp').disabled()],
41   [['elements/gdppay.c'], get_option('gdp').disabled()],
42   [['elements/h263parse.c'], false, [libparser_dep, gstcodecparsers_dep]],
43   [['elements/h264parse.c'], false, [libparser_dep, gstcodecparsers_dep]],
44   [['elements/h264timestamper.c'], false, [libparser_dep, gstcodecparsers_dep]],
45   [['elements/h265parse.c'], false, [libparser_dep, gstcodecparsers_dep]],
46   [['elements/hlsdemux_m3u8.c'], not hls_dep.found(), [hls_dep]],
47   [['elements/id3mux.c'], get_option('id3tag').disabled()],
48   [['elements/interlace.c'], get_option('interlace').disabled()],
49   [['elements/jpeg2000parse.c'], false, [libparser_dep, gstcodecparsers_dep]],
50   [['elements/line21.c'], not closedcaption_dep.found(), ],
51   [['elements/mfvideosrc.c'], host_machine.system() != 'windows', ],
52   [['elements/mpegtsdemux.c'], get_option('mpegtsdemux').disabled(), [gstmpegts_dep]],
53   [['elements/mpegtsmux.c'], get_option('mpegtsmux').disabled(), [gstmpegts_dep]],
54   [['elements/mpeg4videoparse.c'], false, [libparser_dep, gstcodecparsers_dep]],
55   [['elements/mpegvideoparse.c'], false, [libparser_dep, gstcodecparsers_dep]],
56   [['elements/msdkh264enc.c'], not have_msdk, [msdk_dep]],
57   [['elements/mxfdemux.c'], get_option('mxf').disabled()],
58   [['elements/mxfmux.c'], get_option('mxf').disabled()],
59   [['elements/nvenc.c'], false, [gstgl_dep, gmodule_dep]],
60   [['elements/nvdec.c'], not gstgl_dep.found(), [gstgl_dep, gmodule_dep]],
61   [['elements/svthevcenc.c'], not svthevcenc_dep.found(), [svthevcenc_dep]],
62    [['elements/openjpeg.c'], not openjpeg_dep.found(), [openjpeg_dep]],
63   [['elements/pcapparse.c'], false, [libparser_dep]],
64   [['elements/pnm.c'], get_option('pnm').disabled()],
65   [['elements/proxysink.c'], get_option('proxy').disabled()],
66   [['elements/ristrtpext.c']],
67   [['elements/rtponvifparse.c'], get_option('onvif').disabled()],
68   [['elements/rtponviftimestamp.c'], get_option('onvif').disabled()],
69   [['elements/rtpsrc.c'], get_option('rtp').disabled()],
70   [['elements/rtpsink.c'], get_option('rtp').disabled()],
71   [['elements/srtp.c'], not srtp_dep.found(), [srtp_dep]],
72   [['elements/switchbin.c'], get_option('switchbin').disabled()],
73   [['elements/videoframe-audiolevel.c'], get_option('videoframe_audiolevel').disabled()],
74   [['elements/viewfinderbin.c']],
75   [['elements/voamrwbenc.c'], not voamrwbenc_dep.found(), [voamrwbenc_dep]],
76   [['elements/vp9parse.c'], false, [gstcodecparsers_dep]],
77   [['elements/av1parse.c'], false, [gstcodecparsers_dep]],
78   [['elements/wasapi.c'], host_machine.system() != 'windows', ],
79   [['elements/wasapi2.c'], host_machine.system() != 'windows', ],
80   [['libs/h264parser.c'], false, [gstcodecparsers_dep]],
81   [['libs/h265parser.c'], false, [gstcodecparsers_dep]],
82   [['libs/insertbin.c'], false, [gstinsertbin_dep]],
83   [['libs/isoff.c'], false, [gstisoff_dep]],
84   [['libs/nalutils.c', '../../gst-libs/gst/codecparsers/nalutils.c'], false, [nalutils_dep]],
85   [['libs/mpegts.c'], false, [gstmpegts_dep]],
86   [['libs/mpegvideoparser.c'], false, [gstcodecparsers_dep]],
87   [['libs/planaraudioadapter.c'], false, [gstbadaudio_dep]],
88   [['libs/play.c'], not enable_gst_play_tests, [gstplay_dep, libsoup_dep]],
89   [['libs/vc1parser.c'], false, [gstcodecparsers_dep]],
90   [['libs/vp8parser.c'], false, [gstcodecparsers_dep]],
91   [['libs/vp9parser.c'], false, [gstcodecparsers_dep]],
92   [['libs/av1parser.c'], false, [gstcodecparsers_dep]],
93   [['libs/h264bitwriter.c'], false, [gstcodecparsers_dep]],
94   [['libs/h265bitwriter.c'], false, [gstcodecparsers_dep]],
95   [['libs/vkmemory.c'], not gstvulkan_dep.found(), [gstvulkan_dep]],
96   [['elements/vkcolorconvert.c'], not gstvulkan_dep.found(), [gstvulkan_dep]],
97   [['libs/vkwindow.c'], not gstvulkan_dep.found(), [gstvulkan_dep]],
98   [['libs/vkdevice.c'], not gstvulkan_dep.found(), [gstvulkan_dep]],
99   [['elements/vkdeviceprovider.c'], not gstvulkan_dep.found(), [gstvulkan_dep]],
100   [['libs/vkcommandpool.c'], not gstvulkan_dep.found(), [gstvulkan_dep]],
101   [['libs/vkimage.c'], not gstvulkan_dep.found(), [gstvulkan_dep]],
102   [['libs/vkinstance.c'], not gstvulkan_dep.found(), [gstvulkan_dep]],
103   [['libs/d3d11device.cpp'], not gstd3d11_dep.found(), [gstd3d11_dep]],
104 ]
105
106 # FIXME: unistd dependency, unstable or not tested yet on windows
107 if host_machine.system() != 'windows'
108   base_tests += [
109     [['elements/assrender.c'], not ass_dep.found(), [ass_dep]],
110     [['elements/avtpaafpay.c'], not avtp_dep.found(), [avtp_dep]],
111     [['elements/avtpaafdepay.c'], not avtp_dep.found(), [avtp_dep]],
112     [['elements/avtpcrfbase.c'], not avtp_dep.found(), [avtp_dep]],
113     [['elements/avtpcrfcheck.c'], not avtp_dep.found(), [avtp_dep], ['../../ext/avtp/gstavtpcrfutil.c']],
114     [['elements/avtpcrfsync.c'], not avtp_dep.found(), [avtp_dep], ['../../ext/avtp/gstavtpcrfutil.c', '../../ext/avtp/gstavtpcrfbase.c']],
115     [['elements/avtpcrfutil.c'], not avtp_dep.found(), [avtp_dep], ['../../ext/avtp/gstavtpcrfutil.c', '../../ext/avtp/gstavtpcrfbase.c']],
116     [['elements/avtpcvfpay.c'], not avtp_dep.found(), [avtp_dep]],
117     [['elements/avtpcvfdepay.c'], not avtp_dep.found(), [avtp_dep]],
118     [['elements/avtpsink.c'], not avtp_dep.found(), [avtp_dep]],
119     [['elements/avtpsrc.c'], not avtp_dep.found(), [avtp_dep]],
120     [['elements/clockselect.c'], get_option('debugutils').disabled()],
121     [['elements/curlhttpsink.c'], not curl_dep.found(), [curl_dep]],
122     [['elements/curlhttpsrc.c'], not curl_dep.found(), [curl_dep, gio_dep]],
123     [['elements/curlfilesink.c'],
124         not curl_dep.found() or not cdata.has('HAVE_UNISTD_H'), [curl_dep]],
125     [['elements/curlftpsink.c'], not curl_dep.found(), [curl_dep]],
126     [['elements/curlsmtpsink.c'], not curl_dep.found(), [curl_dep]],
127     [['elements/dash_mpd.c'], not xml2_dep.found(), [xml2_dep]],
128     [['elements/dtls.c'], not libcrypto_dep.found(), [libcrypto_dep]],
129     [['elements/faac.c'],
130         not faac_dep.found() or not cc.has_header_symbol('faac.h', 'faacEncOpen') or not cdata.has('HAVE_UNISTD_H'),
131         [faac_dep]],
132     [['elements/faad.c'],
133         not faad_dep.found() or not have_faad_2_7 or not cdata.has('HAVE_UNISTD_H'),
134         [faad_dep]],
135     [['elements/jifmux.c'],
136         not exif_dep.found() or not cdata.has('HAVE_UNISTD_H'), [exif_dep]],
137     [['elements/jpegparse.c'], not cdata.has('HAVE_UNISTD_H')],
138     [['elements/kate.c'],
139         not kate_dep.found() or not cdata.has('HAVE_UNISTD_H'), [kate_dep]],
140     [['elements/netsim.c']],
141     [['elements/shm.c'], not shm_enabled, shm_deps],
142     [['elements/voaacenc.c'],
143         not voaac_dep.found() or not cdata.has('HAVE_UNISTD_H'), [voaac_dep]],
144     [['elements/webrtcbin.c'], not libnice_dep.found(), [gstwebrtc_dep]],
145     [['elements/x265enc.c'], not x265_dep.found(), [x265_dep]],
146     [['elements/zbar.c'], not zbar_dep.found(), [zbar_dep]],
147     [['elements/zxing.c'], not zxing_dep.found(), [zxing_dep]],
148   ]
149 endif
150
151 # linux only tests
152 if host_machine.system() == 'linux'
153   base_tests += [
154     [['elements/vapostproc.c'], not gstva_dep.found(), [gstva_dep]],
155     [['elements/vacompositor.c'], not gstva_dep.found(), [gstva_dep]],
156   ]
157 endif
158
159 test_defines = [
160   '-UG_DISABLE_ASSERT',
161   '-UG_DISABLE_CAST_CHECKS',
162   '-DGST_CHECK_TEST_ENVIRONMENT_BEACON="GST_STATE_IGNORE_ELEMENTS"',
163   '-DGST_TEST_FILES_PATH="' + meson.current_source_dir() + '/../files"',
164   '-DTEST_PATH="' + meson.current_build_dir() + '/media"',
165   '-DDASH_MPD_DATADIR=' + meson.current_source_dir() + '/elements/dash_mpd_data',
166   '-DGST_USE_UNSTABLE_API',
167 ]
168
169 test_deps = [gst_dep, gstapp_dep, gstbase_dep,
170              gstbasecamerabin_dep, gstphotography_dep,
171              gstpbutils_dep, gstcontroller_dep, gstaudio_dep,
172              gstvideo_dep, gstrtp_dep, gsturidownloader_dep,
173              gstcheck_dep, gio_dep, gsttag_dep]
174
175 pluginsdirs = [  ]
176
177 if gst_dep.type_name() == 'pkgconfig'
178   pbase = dependency('gstreamer-plugins-base-' + api_version)
179
180   pluginsdirs = [gst_dep.get_variable('pluginsdir'),
181                  pbase.get_variable('pluginsdir')]
182   gst_plugin_scanner_dir = gst_dep.get_variable('pluginscannerdir')
183 else
184   gst_plugin_scanner_dir = subproject('gstreamer').get_variable('gst_scanner_dir')
185 endif
186 gst_plugin_scanner_path = join_paths(gst_plugin_scanner_dir, 'gst-plugin-scanner')
187
188 extra_args = []
189 # XXX: our MinGW 32bits toolchain complians when ComPtr is in use
190 if host_system == 'windows' and cc.get_id() != 'msvc'
191   mingw_args = cc.get_supported_arguments([
192     '-Wno-redundant-decls',
193   ])
194
195   extra_args += mingw_args
196 endif
197
198 foreach t : base_tests
199   fnames = t.get(0)
200   test_name = fnames[0].split('.').get(0).underscorify()
201   skip_test = false
202   extra_deps = [ ]
203
204   if t.length() >= 3
205     extra_deps = t.get(2)
206   endif
207
208   if t.length() >= 2
209     skip_test = t.get(1)
210   endif
211
212   extra_sources = t.get(3, [ ])
213
214   if not skip_test
215     exe = executable(test_name, fnames, extra_sources,
216       include_directories : [configinc],
217       c_args : gst_plugins_bad_args + test_defines + extra_args,
218       cpp_args : gst_plugins_bad_args + test_defines + extra_args,
219       dependencies : [libm] + test_deps + extra_deps,
220     )
221
222     env = environment()
223     env.set('GST_PLUGIN_SYSTEM_PATH_1_0', '')
224     env.set('CK_DEFAULT_TIMEOUT', '20')
225     env.set('GST_STATE_IGNORE_ELEMENTS', '')
226     env.set('GST_PLUGIN_PATH_1_0', [meson.global_build_root()] + pluginsdirs)
227     env.set('GST_REGISTRY', join_paths(meson.current_build_dir(), '@0@.registry'.format(test_name)))
228     env.set('GST_PLUGIN_LOADING_WHITELIST', 'gstreamer', 'gst-plugins-base',
229       'gst-plugins-good', 'gst-plugins-ugly','gst-libav', 'libnice',
230       'gst-plugins-bad@' + meson.project_build_root())
231     env.set('GST_PLUGIN_SCANNER_1_0', gst_plugin_scanner_path)
232     test(test_name, exe, env: env, timeout: 3 * 60)
233   endif
234 endforeach
235
236 # orc tests
237 orc_tests = [
238   ['orc_bayer', files('../../gst/bayer/gstbayerorc.orc')],
239   ['orc_fieldanalysis', files('../../gst/fieldanalysis/gstfieldanalysisorc.orc')],
240   ['orc_gaudieffects', files('../../gst/gaudieffects/gstgaudieffectsorc.orc')],
241   ['orc_scenechange', files('../../gst/videofilters/gstscenechangeorc.orc')],
242 ]
243
244 orc_test_dep = dependency('', required : false)
245 if have_orcc
246   # FIXME: there should really just be a separate orc-test-0.4.pc file for this
247   if orc_dep.type_name() == 'pkgconfig'
248     orc_test_dep = cc.find_library('orc-test-0.4', required : false)
249   else
250     orc_test_dep = dependency('', fallback: ['orc', 'orc_test_dep'], required: false)
251   endif
252 endif
253
254 if have_orcc and orc_test_dep.found()
255   foreach t : orc_tests
256     tname = t[0]
257     torcfile = t[1]
258     tcfilename = '@0@.c'.format(tname)
259     test_c = custom_target(tcfilename,
260       output: tcfilename,
261       input: torcfile,
262       command: [orcc, '--include', 'stdint.h', '--test', '-o', '@OUTPUT@', '@INPUT@'])
263     test_exe = executable(tname, test_c, dependencies: [orc_dep, orc_test_dep])
264     test(tname, test_exe)
265   endforeach
266 endif
267
268 if enable_gst_play_tests
269   subdir ('media')
270 endif