2018-10-28 14:07:54 +00:00
|
|
|
valgrind_dep = dependency('valgrind', required: false).partial_dependency(compile_args : true)
|
|
|
|
if valgrind_dep.found()
|
2016-09-26 13:30:00 +00:00
|
|
|
cdata.set('HAVE_VALGRIND', 1)
|
|
|
|
endif
|
|
|
|
|
|
|
|
# internal helper lib for unit testing audio parsers
|
|
|
|
libparser = static_library('libparser', 'elements/parser.c',
|
2016-08-12 15:42:30 +00:00
|
|
|
c_args : gst_plugins_good_args + ['-DGST_USE_UNSTABLE_API'],
|
|
|
|
include_directories : [configinc],
|
|
|
|
dependencies : [gstcheck_dep],
|
2016-09-26 13:30:00 +00:00
|
|
|
install : false)
|
2016-08-12 15:42:30 +00:00
|
|
|
|
2016-09-26 13:30:00 +00:00
|
|
|
libparser_dep = declare_dependency(link_with : libparser,
|
|
|
|
dependencies : gstcheck_dep)
|
2016-08-12 15:42:30 +00:00
|
|
|
|
2016-09-26 13:30:00 +00:00
|
|
|
# name, condition when to skip the test and extra dependencies
|
|
|
|
good_tests = [
|
2018-12-30 12:55:28 +00:00
|
|
|
[ 'elements/audioamplify', false, [gstfft_dep] ],
|
2018-12-07 12:46:12 +00:00
|
|
|
[ 'elements/audiochebband', false, [gstfft_dep] ],
|
|
|
|
[ 'elements/audiocheblimit', false, [gstfft_dep] ],
|
2018-12-30 12:55:28 +00:00
|
|
|
[ 'elements/audiodynamic', false, [gstfft_dep] ],
|
2018-12-07 12:46:12 +00:00
|
|
|
[ 'elements/audioecho', false, [gstfft_dep] ],
|
|
|
|
[ 'elements/audiofirfilter', false, [gstfft_dep] ],
|
|
|
|
[ 'elements/audioiirfilter', false, [gstfft_dep] ],
|
2018-12-30 12:55:28 +00:00
|
|
|
[ 'elements/audioinvert', false, [gstfft_dep] ],
|
|
|
|
[ 'elements/audiopanorama', false, [gstfft_dep] ],
|
2018-12-07 12:46:12 +00:00
|
|
|
[ 'elements/audiowsincband', false, [gstfft_dep] ],
|
|
|
|
[ 'elements/audiowsinclimit', false, [gstfft_dep] ],
|
2016-09-26 13:30:00 +00:00
|
|
|
[ 'elements/alphacolor' ],
|
|
|
|
[ 'elements/alpha' ],
|
2018-12-30 12:55:28 +00:00
|
|
|
[ 'elements/avimux', false, [gstriff_dep] ],
|
|
|
|
[ 'elements/avisubtitle', false, [gstriff_dep] ],
|
|
|
|
[ 'elements/capssetter' ],
|
2016-09-26 13:30:00 +00:00
|
|
|
[ 'elements/aacparse', false, [libparser_dep] ],
|
|
|
|
[ 'elements/ac3parse', false, [libparser_dep] ],
|
|
|
|
[ 'elements/amrparse', false, [libparser_dep] ],
|
|
|
|
[ 'elements/flacparse', false, [libparser_dep] ],
|
|
|
|
[ 'elements/mpegaudioparse', false, [libparser_dep] ],
|
|
|
|
[ 'elements/autodetect' ],
|
|
|
|
[ 'elements/deinterlace' ],
|
|
|
|
[ 'elements/dtmf' ],
|
|
|
|
[ 'elements/flvdemux' ],
|
|
|
|
[ 'elements/flvmux' ],
|
|
|
|
[ 'elements/mulawdec' ],
|
|
|
|
[ 'elements/mulawenc' ],
|
|
|
|
[ 'elements/icydemux' ],
|
|
|
|
[ 'elements/id3demux' ],
|
|
|
|
[ 'elements/imagefreeze' ],
|
|
|
|
[ 'elements/deinterleave' ],
|
|
|
|
[ 'elements/interleave' ],
|
2018-12-30 12:55:28 +00:00
|
|
|
[ 'elements/level' ],
|
2018-12-07 12:46:12 +00:00
|
|
|
[ 'elements/matroskademux', false, [gstriff_dep] ],
|
2018-12-30 12:55:28 +00:00
|
|
|
[ 'elements/matroskamux', false, [gstriff_dep] ],
|
2018-12-07 12:46:12 +00:00
|
|
|
[ 'elements/matroskaparse', false, [gstriff_dep] ],
|
2018-12-30 12:55:28 +00:00
|
|
|
[ 'elements/multifile' ],
|
2020-04-03 07:49:25 +00:00
|
|
|
[ 'elements/splitmuxsink', ],
|
2020-04-20 10:43:57 +00:00
|
|
|
[ 'elements/splitmuxsinktimecode', ],
|
2020-04-03 07:49:25 +00:00
|
|
|
[ 'elements/splitmuxsrc', ],
|
2018-12-30 12:55:28 +00:00
|
|
|
[ 'elements/qtmux', false, [gstriff_dep, zlib_dep] ],
|
|
|
|
[ 'elements/qtdemux', false, [gstriff_dep, zlib_dep] ],
|
2016-09-26 13:30:00 +00:00
|
|
|
[ 'elements/rganalysis' ],
|
|
|
|
[ 'elements/rglimiter' ],
|
|
|
|
[ 'elements/rgvolume' ],
|
2021-01-08 16:34:02 +00:00
|
|
|
[ 'elements/rtphdrext-colorspace' ],
|
2016-09-26 13:30:00 +00:00
|
|
|
[ 'elements/rtph261' ],
|
|
|
|
[ 'elements/rtph263' ],
|
2018-12-04 21:06:15 +00:00
|
|
|
[ 'elements/rtph264' ],
|
2018-12-18 17:43:30 +00:00
|
|
|
[ 'elements/rtph265' ],
|
2020-04-03 08:29:18 +00:00
|
|
|
[ 'elements/rtpopus' ],
|
2017-09-08 19:02:13 +00:00
|
|
|
[ 'elements/rtpvp8' ],
|
2016-09-26 13:30:00 +00:00
|
|
|
[ 'elements/rtpvp9' ],
|
|
|
|
[ 'elements/rtpbin' ],
|
|
|
|
[ 'elements/rtpbin_buffer_list' ],
|
|
|
|
[ 'elements/rtpcollision' ],
|
2017-10-18 09:14:36 +00:00
|
|
|
[ 'elements/rtpfunnel' ],
|
2021-09-15 18:19:06 +00:00
|
|
|
[ 'elements/rtphdrextclientaudiolevel', false, [gstsdp_dep, gstaudio_dep] ],
|
2021-08-25 06:59:40 +00:00
|
|
|
[ 'elements/rtphdrextsdes', false, [gstrtp_dep, gstsdp_dep] ],
|
2019-10-18 15:43:36 +00:00
|
|
|
[ 'elements/rtpjitterbuffer' ],
|
2020-04-01 11:19:46 +00:00
|
|
|
[ 'elements/rtpjpeg' ],
|
2019-10-18 15:43:36 +00:00
|
|
|
|
|
|
|
[ 'elements/rtptimerqueue', false, [gstrtp_dep],
|
|
|
|
['../../gst/rtpmanager/rtptimerqueue.c']],
|
|
|
|
|
2016-09-26 13:30:00 +00:00
|
|
|
[ 'elements/rtpmux' ],
|
2017-07-13 11:49:07 +00:00
|
|
|
[ 'elements/rtpptdemux' ],
|
2016-09-26 13:30:00 +00:00
|
|
|
[ 'elements/rtprtx' ],
|
|
|
|
[ 'elements/rtpsession' ],
|
2019-03-21 21:12:53 +00:00
|
|
|
[ 'elements/rtpstorage', false, [], ['../../gst/rtp/gstrtpstorage.c',
|
2021-02-12 12:16:28 +00:00
|
|
|
'../../gst/rtp/gstrtpelement.c',
|
|
|
|
'../../gst/rtp/gstrtputils.c',
|
2019-03-21 21:12:53 +00:00
|
|
|
'../../gst/rtp/rtpstorage.c',
|
|
|
|
'../../gst/rtp/rtpstoragestream.c']],
|
2017-11-17 02:52:03 +00:00
|
|
|
[ 'elements/rtpred' ],
|
|
|
|
[ 'elements/rtpulpfec' ],
|
2018-11-27 22:10:57 +00:00
|
|
|
[ 'elements/rtpssrcdemux' ],
|
2018-12-30 12:55:28 +00:00
|
|
|
[ 'elements/rtp-payloading' ],
|
2020-10-06 01:13:30 +00:00
|
|
|
[ 'elements/rtpst2022-1-fecdec' ],
|
2020-10-06 01:03:13 +00:00
|
|
|
[ 'elements/rtpst2022-1-fecenc' ],
|
2018-12-30 12:55:28 +00:00
|
|
|
[ 'elements/spectrum', false, [gstfft_dep] ],
|
|
|
|
[ 'elements/shapewipe' ],
|
2016-09-26 13:30:00 +00:00
|
|
|
[ 'elements/udpsink' ],
|
2018-12-30 12:55:28 +00:00
|
|
|
[ 'elements/udpsrc' ],
|
|
|
|
[ 'elements/videobox' ],
|
|
|
|
[ 'elements/videocrop' ],
|
|
|
|
[ 'elements/videofilter' ],
|
2020-12-09 08:49:47 +00:00
|
|
|
[ 'elements/videoflip' ],
|
2018-12-30 12:55:28 +00:00
|
|
|
[ 'elements/videomixer' ],
|
2016-09-26 13:30:00 +00:00
|
|
|
[ 'elements/aspectratiocrop' ],
|
|
|
|
[ 'pipelines/wavenc' ],
|
2018-12-07 12:46:12 +00:00
|
|
|
[ 'elements/wavparse', false, [gstriff_dep] ],
|
2018-12-30 12:55:28 +00:00
|
|
|
[ 'elements/wavpackparse', ],
|
|
|
|
[ 'elements/y4menc' ],
|
2016-09-26 13:30:00 +00:00
|
|
|
[ 'pipelines/effectv' ],
|
|
|
|
[ 'elements/equalizer' ],
|
|
|
|
[ 'pipelines/simple-launch-lines' ],
|
|
|
|
[ 'pipelines/tagschecking' ],
|
2018-12-30 12:55:28 +00:00
|
|
|
[ 'generic/states' ],
|
2016-09-26 13:30:00 +00:00
|
|
|
]
|
|
|
|
|
|
|
|
# FIXME: valgrind elements/rtp-payloading - needs fixing
|
|
|
|
# elements/videocrop should be disabled since it takes way too long in valgrind
|
|
|
|
|
2021-10-04 08:31:02 +00:00
|
|
|
libsoup2_dep = dependency('libsoup-2.4', version : '>=2.48',
|
|
|
|
required : false, fallback : ['libsoup', 'libsoup_dep'],
|
|
|
|
default_options: ['sysprof=disabled'])
|
|
|
|
libsoup3_dep = dependency('libsoup-3.0', required : false,
|
|
|
|
fallback : ['libsoup3', 'libsoup_dep'])
|
|
|
|
|
2018-12-07 12:46:12 +00:00
|
|
|
# FIXME: unistd dependency or not tested yet on windows
|
|
|
|
if host_machine.system() != 'windows'
|
|
|
|
good_tests += [
|
|
|
|
[ 'pipelines/flacdec', not flac_dep.found() ],
|
|
|
|
[ 'elements/gdkpixbufsink', not gdkpixbuf_dep.found(), [gdkpixbuf_dep] ],
|
|
|
|
[ 'elements/gdkpixbufoverlay', not gdkpixbuf_dep.found() ],
|
|
|
|
[ 'elements/jpegdec', not jpeglib.found() ],
|
|
|
|
[ 'elements/jpegenc', not jpeglib.found() ],
|
2021-10-04 08:31:02 +00:00
|
|
|
[ 'elements/mpg123audiodec', not mpg123_dep.found(), [gstfft_dep]],
|
|
|
|
[ 'elements/souphttpsrc', not libsoup2_dep.found(), [libsoup2_dep], [], 'elements/souphttpsrc2'],
|
|
|
|
[ 'elements/souphttpsrc', not libsoup3_dep.found(), [libsoup3_dep], [], 'elements/souphttpsrc3'],
|
2018-12-07 12:46:12 +00:00
|
|
|
[ 'elements/id3v2mux', not taglib_dep.found() ],
|
|
|
|
[ 'elements/apev2mux', not taglib_dep.found() ],
|
|
|
|
[ 'elements/vp8enc', not vpx_dep.found() or not have_vp8_encoder ],
|
|
|
|
[ 'elements/vp8dec', not vpx_dep.found() or not have_vp8_decoder ],
|
|
|
|
[ 'elements/vp9enc', not vpx_dep.found() or not have_vp9_encoder ],
|
|
|
|
[ 'pipelines/lame', not lame_dep.found() ],
|
|
|
|
[ 'elements/wavpackdec', not wavpack_dep.found() ],
|
|
|
|
[ 'elements/wavpackenc', not wavpack_dep.found() ],
|
|
|
|
[ 'pipelines/wavpack', not wavpack_dep.found() ],
|
|
|
|
]
|
|
|
|
endif
|
|
|
|
|
2016-09-26 13:30:00 +00:00
|
|
|
foo='''
|
|
|
|
if HAVE_ORC
|
|
|
|
check_orc = orc/deinterlace orc/videomixer orc/videobox
|
|
|
|
else
|
|
|
|
check_orc =
|
|
|
|
endif
|
|
|
|
'''
|
|
|
|
|
|
|
|
test_defines = [
|
|
|
|
'-UG_DISABLE_ASSERT',
|
|
|
|
'-UG_DISABLE_CAST_CHECKS',
|
|
|
|
'-DGST_CHECK_TEST_ENVIRONMENT_BEACON="GST_PLUGIN_LOADING_WHITELIST"',
|
2016-10-04 21:04:11 +00:00
|
|
|
'-DGST_TEST_FILES_PATH="' + meson.current_source_dir() + '/../files"',
|
2016-09-26 13:30:00 +00:00
|
|
|
'-DGST_USE_UNSTABLE_API',
|
|
|
|
]
|
|
|
|
|
2017-03-28 17:23:16 +00:00
|
|
|
pluginsdirs = []
|
|
|
|
if gst_dep.type_name() == 'pkgconfig'
|
2020-05-27 11:42:38 +00:00
|
|
|
pbase = dependency('gstreamer-plugins-base-' + api_version, required: true)
|
2021-10-17 23:40:14 +00:00
|
|
|
pluginsdirs = [gst_dep.get_variable('pluginsdir'),
|
|
|
|
pbase.get_variable('pluginsdir')]
|
|
|
|
gst_plugin_scanner_dir = gst_dep.get_variable('pluginscannerdir')
|
2020-05-27 11:42:38 +00:00
|
|
|
else
|
|
|
|
gst_plugin_scanner_dir = subproject('gstreamer').get_variable('gst_scanner_dir')
|
2016-09-26 13:30:00 +00:00
|
|
|
endif
|
2020-05-27 11:42:38 +00:00
|
|
|
gst_plugin_scanner_path = join_paths(gst_plugin_scanner_dir, 'gst-plugin-scanner')
|
2016-09-26 13:30:00 +00:00
|
|
|
|
|
|
|
# fake device drivers: we could run hardware element tests against dummy drivers
|
|
|
|
# v4l2: vivo (part of normal kernel)
|
|
|
|
# modprobe vivo;
|
|
|
|
# gst-launch v4l2src device="/dev/video1" ! xvimagesink;
|
|
|
|
# rmmod vivo
|
|
|
|
#
|
|
|
|
# alsa: snd-dummy (part of normal alsa, not removable)
|
|
|
|
# modprobe snd-dummy;
|
|
|
|
# gst-launch alsasrc device="hw:2" ! fakesink
|
|
|
|
# gst-launch fakesrc ! alsasink device="hw:2"
|
|
|
|
#
|
|
|
|
# need a way to figure out value for the device property
|
|
|
|
state_ignore_elements = '''aasink autoaudiosrc autoaudiosink autovideosrc
|
2019-03-06 17:26:23 +00:00
|
|
|
autovideosink cacasink cairotextoverlay gtkglsink gtksink jackaudiosrc
|
|
|
|
jackaudiosink osssrc osssink osxaudiosink osxaudiosrc osxvideosrc osxvideosink
|
2016-09-26 13:30:00 +00:00
|
|
|
pulsesink pulsesrc pulsemixer v4l2src'''
|
|
|
|
|
|
|
|
# FIXME: check, also + PTHREAD_CFLAGS
|
|
|
|
test_deps = [gst_dep, gstbase_dep, gstnet_dep, gstcheck_dep, gstaudio_dep,
|
|
|
|
gstvideo_dep, gstpbutils_dep, gstrtp_dep, gstrtsp_dep, gsttag_dep,
|
2022-03-25 19:00:20 +00:00
|
|
|
gstapp_dep, gio_dep, valgrind_dep]
|
2016-09-26 13:30:00 +00:00
|
|
|
|
|
|
|
# FIXME: add valgrind suppression common/gst.supp gst-plugins-good.supp
|
|
|
|
foreach t : good_tests
|
2017-06-07 16:47:59 +00:00
|
|
|
fname = '@0@.c'.format(t.get(0))
|
2021-10-04 08:31:02 +00:00
|
|
|
test_name = t.get(4, t.get(0)).underscorify()
|
2019-03-21 21:12:53 +00:00
|
|
|
extra_sources = t.get(3, [ ])
|
|
|
|
extra_deps = t.get(2, [ ])
|
|
|
|
skip_test = t.get(1, false)
|
2016-09-26 13:30:00 +00:00
|
|
|
if not skip_test
|
2016-10-04 21:04:11 +00:00
|
|
|
env = environment()
|
|
|
|
env.set('GST_PLUGIN_SYSTEM_PATH_1_0', '')
|
|
|
|
env.set('GST_STATE_IGNORE_ELEMENTS', state_ignore_elements)
|
|
|
|
env.set('CK_DEFAULT_TIMEOUT', '20')
|
|
|
|
env.set('GST_PLUGIN_LOADING_WHITELIST', 'gstreamer', 'gst-plugins-base',
|
2021-10-18 14:47:00 +00:00
|
|
|
'timecode', 'gst-plugins-good@' + meson.project_build_root())
|
|
|
|
env.set('GST_PLUGIN_PATH_1_0', [meson.global_build_root()] + pluginsdirs)
|
2016-10-04 21:04:11 +00:00
|
|
|
env.set('GSETTINGS_BACKEND', 'memory')
|
|
|
|
|
2018-12-18 11:39:40 +00:00
|
|
|
env.set('GST_REGISTRY', join_paths(meson.current_build_dir(), '@0@.registry'.format(test_name)))
|
2020-05-27 11:42:38 +00:00
|
|
|
env.set('GST_PLUGIN_SCANNER_1_0', gst_plugin_scanner_path)
|
2019-03-21 21:12:53 +00:00
|
|
|
exe = executable(test_name, fname, extra_sources,
|
2019-06-12 13:59:31 +00:00
|
|
|
include_directories : [configinc, libsinc],
|
2016-09-26 13:30:00 +00:00
|
|
|
c_args : ['-DHAVE_CONFIG_H=1' ] + test_defines,
|
|
|
|
dependencies : [libm] + test_deps + extra_deps,
|
|
|
|
)
|
2016-10-04 21:04:11 +00:00
|
|
|
test(test_name, exe, env: env, timeout: 3 * 60)
|
2016-09-26 13:30:00 +00:00
|
|
|
endif
|
|
|
|
endforeach
|
|
|
|
|
2019-01-16 00:57:46 +00:00
|
|
|
# orc tests
|
|
|
|
orc_tests = [
|
|
|
|
['orc_deinterlace', files('../../gst/deinterlace/tvtime.orc')],
|
|
|
|
['orc_videomixer', files('../../gst/videomixer/videomixerorc.orc')],
|
|
|
|
['orc_videobox', files('../../gst/videobox/gstvideoboxorc.orc')],
|
|
|
|
]
|
2016-09-26 13:30:00 +00:00
|
|
|
|
2019-01-30 10:44:01 +00:00
|
|
|
orc_test_dep = dependency('', required : false)
|
2019-01-16 00:57:46 +00:00
|
|
|
if have_orcc
|
|
|
|
# FIXME: there should really just be a separate orc-test-0.4.pc file for this
|
|
|
|
if orc_dep.type_name() == 'pkgconfig'
|
2019-01-30 10:44:01 +00:00
|
|
|
orc_test_dep = cc.find_library('orc-test-0.4', required : false)
|
2019-01-31 09:53:43 +00:00
|
|
|
else
|
|
|
|
orc_test_dep = dependency('', fallback: ['orc', 'orc_test_dep'], required: false)
|
2019-01-16 00:57:46 +00:00
|
|
|
endif
|
2019-01-30 10:44:01 +00:00
|
|
|
endif
|
|
|
|
|
|
|
|
if have_orcc and orc_test_dep.found()
|
2019-01-16 00:57:46 +00:00
|
|
|
foreach t : orc_tests
|
|
|
|
tname = t[0]
|
|
|
|
torcfile = t[1]
|
|
|
|
tcfilename = '@0@.c'.format(tname)
|
|
|
|
test_c = custom_target(tcfilename,
|
|
|
|
output: tcfilename,
|
|
|
|
input: torcfile,
|
|
|
|
command: [orcc, '--include', 'stdint.h', '--test', '-o', '@OUTPUT@', '@INPUT@'])
|
|
|
|
test_exe = executable(tname, test_c, dependencies: [orc_dep, orc_test_dep])
|
|
|
|
test(tname, test_exe)
|
|
|
|
endforeach
|
|
|
|
endif
|