gstreamer/subprojects/gst-plugins-bad/tests/check/meson.build

262 lines
11 KiB
Meson
Raw Normal View History

have_registry = true # FIXME get_option('registry')
libparser = static_library('parser',
'elements/parser.c',
install : false,
dependencies : [gst_dep, gstcheck_dep],
)
libparser_dep = declare_dependency(link_with: libparser,
sources: ['elements/parser.h'])
# FIXME: automagic
exif_dep = dependency('libexif', version : '>= 0.6.16', required : false)
# Since nalutils API is internal, need to build it again
nalutils_dep = gstcodecparsers_dep.partial_dependency (compile_args: true, includes: true)
enable_gst_play_tests = get_option('gst_play_tests')
libsoup_dep = dependency('libsoup-2.4', version : '>=2.48', required : enable_gst_play_tests,
fallback : ['libsoup', 'libsoup_dep'])
# name, condition when to skip the test and extra dependencies
base_tests = [
[['elements/aesenc.c'], not aes_dep.found(), [aes_dep]],
[['elements/aesdec.c'], not aes_dep.found(), [aes_dep]],
[['elements/aiffparse.c']],
2018-12-30 13:31:39 +00:00
[['elements/asfmux.c']],
[['elements/autoconvert.c']],
[['elements/autovideoconvert.c']],
[['elements/avwait.c']],
2018-12-30 13:31:39 +00:00
[['elements/camerabin.c']],
[['elements/ccconverter.c'], not closedcaption_dep.found(), [gstvideo_dep]],
[['elements/cccombiner.c'], not closedcaption_dep.found(), ],
[['elements/ccextractor.c'], not closedcaption_dep.found(), ],
[['elements/cudaconvert.c'], false, [gstgl_dep, gmodule_dep]],
[['elements/cudafilter.c'], false, [gstgl_dep, gmodule_dep]],
[['elements/d3d11colorconvert.c'], host_machine.system() != 'windows', ],
2018-12-30 13:31:39 +00:00
[['elements/gdpdepay.c']],
[['elements/gdppay.c']],
[['elements/h263parse.c'], false, [libparser_dep, gstcodecparsers_dep]],
[['elements/h264parse.c'], false, [libparser_dep, gstcodecparsers_dep]],
2019-12-18 09:05:05 +00:00
[['elements/h265parse.c'], false, [libparser_dep, gstcodecparsers_dep]],
[['elements/hlsdemux_m3u8.c'], not hls_dep.found(), [hls_dep]],
[['elements/id3mux.c']],
[['elements/interlace.c']],
2019-08-09 13:29:22 +00:00
[['elements/jpeg2000parse.c'], false, [libparser_dep, gstcodecparsers_dep]],
[['elements/line21.c'], not closedcaption_dep.found(), ],
[['elements/mfvideosrc.c'], host_machine.system() != 'windows', ],
[['elements/mpegtsdemux.c'], false, [gstmpegts_dep]],
[['elements/mpegtsmux.c'], false, [gstmpegts_dep]],
[['elements/mpeg4videoparse.c'], false, [libparser_dep, gstcodecparsers_dep]],
[['elements/mpegvideoparse.c'], false, [libparser_dep, gstcodecparsers_dep]],
2018-12-30 13:31:39 +00:00
[['elements/msdkh264enc.c'], not have_msdk, [msdk_dep]],
[['elements/mxfdemux.c']],
[['elements/mxfmux.c']],
[['elements/nvenc.c'], false, [gstgl_dep, gmodule_dep]],
[['elements/nvdec.c'], not gstgl_dep.found(), [gstgl_dep, gmodule_dep]],
[['elements/svthevcenc.c'], not svthevcenc_dep.found(), [svthevcenc_dep]],
[['elements/openjpeg.c'], not openjpeg_dep.found(), [openjpeg_dep]],
[['elements/pcapparse.c'], false, [libparser_dep]],
[['elements/pnm.c']],
[['elements/ristrtpext.c']],
[['elements/rtponvifparse.c']],
[['elements/rtponviftimestamp.c']],
rtpmanagerbad: add RTP streaming elements This is a re-implementation of the RTP elements that are submitted in 2013 to handle RTP streams. The elements handle a correct connection for the bi-directional use of the RTCP sockets. https://bugzilla.gnome.org/show_bug.cgi?id=703111 The rtpsink and rtpsrc elements add an URI interface so that streams can be decoded with decodebin using the rtp:// interface. The code can be used as follows ``` gst-launch-1.0 videotestsrc ! x264enc ! rtph264pay config-interval=3 ! rtpsink uri=rtp://239.1.1.1:1234 gst-launch-1.0 videotestsrc ! x264enc ! rtph264pay config-interval=1 ! rtpsink uri=rtp://239.1.2.3:5000 gst-launch-1.0 rtpsrc uri=rtp://239.1.2.3:5000?encoding-name=H264 ! rtph264depay ! avdec_h264 ! videoconvert ! xvimagesink gst-launch-1.0 videotestsrc ! avenc_mpeg4 ! rtpmp4vpay config-interval=1 ! rtpsink uri=rtp://239.1.2.3:5000 gst-launch-1.0 rtpsrc uri=rtp://239.1.2.3:5000?encoding-name=MP4V-ES ! rtpmp4vdepay ! avdec_mpeg4 ! videoconvert ! xvimagesink ``` rtpmanagerbad: add pkg-config rtpmanagerbad: Rtp should be uppercase rtpmanagerbad: add G_OS_WIN32 for shielding unix headers rtpmanagerbad: remove Since from documentation rtpmanagerbad: rename lib name from nrtp to rtpmanagerbad rtpmanagerbad: sync meson.build with other modules rtpmanagerbad: add Makefile.am rtpmanagerbad: use GstElement to count pads rtpmanagerbad: use gst_bin_set_suppressed_flags rtpmanagerbad: check element creation rtpmanagerbad: post message when trying to access missing rtpbin rtpmanagerbad: return FALSE with g_return tests rtpmanagerbad: use gsocket multicast check rtpmanagerbad: use gst_caps_new_empty_simple iso gst_caps_from_string rtpmanagerbad: sync with gstrtppayloads.h rtpmanagerbad: correct media type X-GST rtpmanagerbad: test if a compatible pad was found rtpmanagerbad: remove evil copy of GstRTPPayloadInfo rtpmanagerbad: add gio_dep to meson rtpmanagerbad: revert to old glib boilerplate GStreamer 1.16 does not yet support the newer GLib templates, so revert. rtpmanagerbad: return GST_STATE_CHANGE_NO_PREROLL for live sources for live sources, NO_PREROLL should be returned for PLAYING->PAUSED and READY->PAUSED transitions. rtpmanagerbad: use GstElement pad counting rtpmanagerbad: just use template name to request pad rtpmanagerbad: remove commented code rtpmanagerbad: use funnel to send multiple streams on one socket rtpmanagerbad: avoid beaches beaches should only be used during the summer, so rewrite the code to return explicitly and avoid beaches during the winter. rtpmanagerbad: add copyright to test code rtpmanagerbad: g_free is NULL safe rtpmanagerbad: do not trace rtpbin rtpmanagerbad: return NULL explitly rtpmanagerbad: warn when data port is not even According to RFC 3550, RTP data should be sent on even ports, while RTCP is sent on the following odd port. rtpmanagerbad: document port allocation in rtpsink/src rtpmanagerbad: improve uri description rtpmanagerbad: add comment re-use socket rtpmanagerbad: rename gst_object_set_properties_from_uri_query rtpmanagerbad: loan prop/val setter from rist rtpmanagerbad: rtpsrc: fix unitialised pointer rtpmanagerbad: fix silly typo rtpmanagerbad: test for empty key/value rtpmanagerbad: rtpsrc: deprecate ssrc collision to INFO rtpmanagerbad: sync debug with rist rtpmanagerbad: small strings allocated on stack rtpmanagerbad: correct rename rtpmanagerbad: add locking on prop setters/getters Locking is added because the URI allows to access the properties too. rtpmanagerbad: allow for RTCP through NAT rtpmanagerbad: move gio to header file rtpmanagerbad: free small strings too rtpmanagerbad: ttl_mc for ttl on dynudpsink rtpmanagerbad: add comments on the URI registered rtpmanagerbad: correct macro after file rename rtpmanagerbad: code style rtpmanagerbad: handle wrong URIs in setter rtpmanagerbad: nit URI notation correction In an URI, the first key/value pair should not have an ampersand, the parser did not die though.
2019-06-03 20:08:23 +00:00
[['elements/rtpsrc.c']],
[['elements/rtpsink.c']],
[['elements/srtp.c'], not srtp_dep.found(), [srtp_dep]],
[['elements/switchbin.c']],
[['elements/videoframe-audiolevel.c']],
[['elements/viewfinderbin.c']],
[['elements/vp9parse.c'], false, [gstcodecparsers_dep]],
[['elements/av1parse.c'], false, [gstcodecparsers_dep]],
[['elements/wasapi.c'], host_machine.system() != 'windows', ],
[['elements/wasapi2.c'], host_machine.system() != 'windows', ],
[['libs/h264parser.c'], false, [gstcodecparsers_dep]],
[['libs/h265parser.c'], false, [gstcodecparsers_dep]],
[['libs/insertbin.c'], false, [gstinsertbin_dep]],
[['libs/isoff.c'], false, [gstisoff_dep]],
[['libs/nalutils.c', '../../gst-libs/gst/codecparsers/nalutils.c'], false, [nalutils_dep]],
2018-12-30 13:31:39 +00:00
[['libs/mpegts.c'], false, [gstmpegts_dep]],
[['libs/mpegvideoparser.c'], false, [gstcodecparsers_dep]],
[['libs/planaraudioadapter.c'], false, [gstbadaudio_dep]],
[['libs/play.c'], not enable_gst_play_tests, [gstplay_dep, libsoup_dep]],
[['libs/vc1parser.c'], false, [gstcodecparsers_dep]],
[['libs/vp8parser.c'], false, [gstcodecparsers_dep]],
[['libs/vp9parser.c'], false, [gstcodecparsers_dep]],
[['libs/av1parser.c'], false, [gstcodecparsers_dep]],
[['libs/h264bitwriter.c'], false, [gstcodecparsers_dep]],
[['libs/h265bitwriter.c'], false, [gstcodecparsers_dep]],
2019-05-20 03:54:56 +00:00
[['libs/vkmemory.c'], not gstvulkan_dep.found(), [gstvulkan_dep]],
[['elements/vkcolorconvert.c'], not gstvulkan_dep.found(), [gstvulkan_dep]],
[['libs/vkwindow.c'], not gstvulkan_dep.found(), [gstvulkan_dep]],
[['libs/vkdevice.c'], not gstvulkan_dep.found(), [gstvulkan_dep]],
[['elements/vkdeviceprovider.c'], not gstvulkan_dep.found(), [gstvulkan_dep]],
[['libs/vkcommandpool.c'], not gstvulkan_dep.found(), [gstvulkan_dep]],
[['libs/vkimage.c'], not gstvulkan_dep.found(), [gstvulkan_dep]],
[['libs/vkinstance.c'], not gstvulkan_dep.found(), [gstvulkan_dep]],
[['libs/d3d11device.cpp'], not gstd3d11_dep.found(), [gstd3d11_dep]],
]
# FIXME: unistd dependency, unstable or not tested yet on windows
if host_machine.system() != 'windows'
base_tests += [
[['elements/assrender.c'], not ass_dep.found(), [ass_dep]],
[['elements/avtpaafpay.c'], not avtp_dep.found(), [avtp_dep]],
[['elements/avtpaafdepay.c'], not avtp_dep.found(), [avtp_dep]],
[['elements/avtpcrfbase.c'], not avtp_dep.found(), [avtp_dep]],
[['elements/avtpcrfcheck.c'], not avtp_dep.found(), [avtp_dep], ['../../ext/avtp/gstavtpcrfutil.c']],
[['elements/avtpcrfsync.c'], not avtp_dep.found(), [avtp_dep], ['../../ext/avtp/gstavtpcrfutil.c', '../../ext/avtp/gstavtpcrfbase.c']],
[['elements/avtpcrfutil.c'], not avtp_dep.found(), [avtp_dep], ['../../ext/avtp/gstavtpcrfutil.c', '../../ext/avtp/gstavtpcrfbase.c']],
[['elements/avtpcvfpay.c'], not avtp_dep.found(), [avtp_dep]],
[['elements/avtpcvfdepay.c'], not avtp_dep.found(), [avtp_dep]],
[['elements/avtpsink.c'], not avtp_dep.found(), [avtp_dep]],
[['elements/avtpsrc.c'], not avtp_dep.found(), [avtp_dep]],
[['elements/clockselect.c']],
[['elements/curlhttpsink.c'], not curl_dep.found(), [curl_dep]],
[['elements/curlhttpsrc.c'], not curl_dep.found(), [curl_dep, gio_dep]],
[['elements/curlfilesink.c'],
not curl_dep.found() or not cdata.has('HAVE_UNISTD_H'), [curl_dep]],
[['elements/curlftpsink.c'], not curl_dep.found(), [curl_dep]],
[['elements/curlsmtpsink.c'], not curl_dep.found(), [curl_dep]],
[['elements/dash_mpd.c'], not xml2_dep.found(), [xml2_dep]],
[['elements/dtls.c'], not libcrypto_dep.found(), [libcrypto_dep]],
[['elements/faac.c'],
not faac_dep.found() or not cc.has_header_symbol('faac.h', 'faacEncOpen') or not cdata.has('HAVE_UNISTD_H'),
[faac_dep]],
[['elements/faad.c'],
not faad_dep.found() or not have_faad_2_7 or not cdata.has('HAVE_UNISTD_H'),
[faad_dep]],
[['elements/jifmux.c'],
not exif_dep.found() or not cdata.has('HAVE_UNISTD_H'), [exif_dep]],
[['elements/jpegparse.c'], not cdata.has('HAVE_UNISTD_H')],
[['elements/kate.c'],
not kate_dep.found() or not cdata.has('HAVE_UNISTD_H'), [kate_dep]],
[['elements/netsim.c']],
[['elements/shm.c'], not shm_enabled, shm_deps],
[['elements/voaacenc.c'],
not voaac_dep.found() or not cdata.has('HAVE_UNISTD_H'), [voaac_dep]],
[['elements/webrtcbin.c'], not libnice_dep.found(), [gstwebrtc_dep]],
[['elements/x265enc.c'], not x265_dep.found(), [x265_dep]],
[['elements/zbar.c'], not zbar_dep.found(), [zbar_dep]],
[['elements/zxing.c'], not zxing_dep.found(), [zxing_dep]],
]
endif
# linux only tests
if host_machine.system() == 'linux'
base_tests += [
[['elements/vapostproc.c'], not gstva_dep.found(), [gstva_dep]],
]
endif
test_defines = [
'-UG_DISABLE_ASSERT',
'-UG_DISABLE_CAST_CHECKS',
'-DGST_CHECK_TEST_ENVIRONMENT_BEACON="GST_STATE_IGNORE_ELEMENTS"',
'-DGST_TEST_FILES_PATH="' + meson.current_source_dir() + '/../files"',
'-DTEST_PATH="' + meson.current_build_dir() + '/media"',
'-DDASH_MPD_DATADIR=' + meson.current_source_dir() + '/elements/dash_mpd_data',
'-DGST_USE_UNSTABLE_API',
]
test_deps = [gst_dep, gstapp_dep, gstbase_dep,
gstbasecamerabin_dep, gstphotography_dep,
gstpbutils_dep, gstcontroller_dep, gstaudio_dep,
gstvideo_dep, gstrtp_dep, gsturidownloader_dep,
gstcheck_dep, gio_dep, gsttag_dep]
pluginsdirs = [ ]
if gst_dep.type_name() == 'pkgconfig'
pbase = dependency('gstreamer-plugins-base-' + api_version)
pluginsdirs = [gst_dep.get_variable('pluginsdir'),
pbase.get_variable('pluginsdir')]
gst_plugin_scanner_dir = gst_dep.get_variable('pluginscannerdir')
tests: fix meson test env setup to make sure we use the right gst-plugin-scanner If core is built as a subproject (e.g. as in gst-build), make sure to use the gst-plugin-scanner from the built subproject. Without this, gstreamer might accidentally use the gst-plugin-scanner from the install prefix if that exists, which in turn might drag in gst library versions we didn't mean to drag in. Those gst library versions might then be older than what our current build needs, and might cause our newly-built plugins to get blacklisted in the test registry because they rely on a symbol that the wrongly-pulled in gst lib doesn't have. This should fix running of unit tests in gst-build when invoking meson test or ninja test from outside the devenv for the case where there is an older or different-version gst-plugin-scanner installed in the install prefix. In case no gst-plugin-scanner is installed in the install prefix, this will fix "GStreamer-WARNING: External plugin loader failed. This most likely means that the plugin loader helper binary was not found or could not be run. You might need to set the GST_PLUGIN_SCANNER environment variable if your setup is unusual." warnings when running the unit tests. In the case where we find GStreamer core via pkg-config we use a newly-added pkg-config var "pluginscannerdir" to get the right directory. This has the benefit of working transparently for both installed and uninstalled pkg-config files/setups. Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1302>
2020-05-27 14:17:12 +00:00
else
gst_plugin_scanner_dir = subproject('gstreamer').get_variable('gst_scanner_dir')
endif
tests: fix meson test env setup to make sure we use the right gst-plugin-scanner If core is built as a subproject (e.g. as in gst-build), make sure to use the gst-plugin-scanner from the built subproject. Without this, gstreamer might accidentally use the gst-plugin-scanner from the install prefix if that exists, which in turn might drag in gst library versions we didn't mean to drag in. Those gst library versions might then be older than what our current build needs, and might cause our newly-built plugins to get blacklisted in the test registry because they rely on a symbol that the wrongly-pulled in gst lib doesn't have. This should fix running of unit tests in gst-build when invoking meson test or ninja test from outside the devenv for the case where there is an older or different-version gst-plugin-scanner installed in the install prefix. In case no gst-plugin-scanner is installed in the install prefix, this will fix "GStreamer-WARNING: External plugin loader failed. This most likely means that the plugin loader helper binary was not found or could not be run. You might need to set the GST_PLUGIN_SCANNER environment variable if your setup is unusual." warnings when running the unit tests. In the case where we find GStreamer core via pkg-config we use a newly-added pkg-config var "pluginscannerdir" to get the right directory. This has the benefit of working transparently for both installed and uninstalled pkg-config files/setups. Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1302>
2020-05-27 14:17:12 +00:00
gst_plugin_scanner_path = join_paths(gst_plugin_scanner_dir, 'gst-plugin-scanner')
extra_args = []
# XXX: our MinGW 32bits toolchain complians when ComPtr is in use
if host_system == 'windows' and cc.get_id() != 'msvc'
mingw_args = cc.get_supported_arguments([
'-Wno-redundant-decls',
])
extra_args += mingw_args
endif
foreach t : base_tests
fnames = t.get(0)
test_name = fnames[0].split('.').get(0).underscorify()
skip_test = false
extra_deps = [ ]
if t.length() >= 3
extra_deps = t.get(2)
endif
if t.length() >= 2
skip_test = t.get(1)
endif
extra_sources = t.get(3, [ ])
if not skip_test
exe = executable(test_name, fnames, extra_sources,
include_directories : [configinc],
c_args : gst_plugins_bad_args + test_defines + extra_args,
cpp_args : gst_plugins_bad_args + test_defines + extra_args,
dependencies : [libm] + test_deps + extra_deps,
)
env = environment()
env.set('GST_PLUGIN_SYSTEM_PATH_1_0', '')
env.set('CK_DEFAULT_TIMEOUT', '20')
env.set('GST_STATE_IGNORE_ELEMENTS', '')
env.set('GST_PLUGIN_PATH_1_0', [meson.global_build_root()] + pluginsdirs)
env.set('GST_REGISTRY', join_paths(meson.current_build_dir(), '@0@.registry'.format(test_name)))
env.set('GST_PLUGIN_LOADING_WHITELIST', 'gstreamer', 'gst-plugins-base',
'gst-plugins-good', 'gst-plugins-ugly','gst-libav', 'libnice',
'gst-plugins-bad@' + meson.project_build_root())
tests: fix meson test env setup to make sure we use the right gst-plugin-scanner If core is built as a subproject (e.g. as in gst-build), make sure to use the gst-plugin-scanner from the built subproject. Without this, gstreamer might accidentally use the gst-plugin-scanner from the install prefix if that exists, which in turn might drag in gst library versions we didn't mean to drag in. Those gst library versions might then be older than what our current build needs, and might cause our newly-built plugins to get blacklisted in the test registry because they rely on a symbol that the wrongly-pulled in gst lib doesn't have. This should fix running of unit tests in gst-build when invoking meson test or ninja test from outside the devenv for the case where there is an older or different-version gst-plugin-scanner installed in the install prefix. In case no gst-plugin-scanner is installed in the install prefix, this will fix "GStreamer-WARNING: External plugin loader failed. This most likely means that the plugin loader helper binary was not found or could not be run. You might need to set the GST_PLUGIN_SCANNER environment variable if your setup is unusual." warnings when running the unit tests. In the case where we find GStreamer core via pkg-config we use a newly-added pkg-config var "pluginscannerdir" to get the right directory. This has the benefit of working transparently for both installed and uninstalled pkg-config files/setups. Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1302>
2020-05-27 14:17:12 +00:00
env.set('GST_PLUGIN_SCANNER_1_0', gst_plugin_scanner_path)
test(test_name, exe, env: env, timeout: 3 * 60)
endif
endforeach
2019-01-16 01:03:40 +00:00
# orc tests
orc_tests = [
['orc_bayer', files('../../gst/bayer/gstbayerorc.orc')],
]
orc_test_dep = dependency('', required : false)
2019-01-16 01:03:40 +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'
orc_test_dep = cc.find_library('orc-test-0.4', required : false)
else
orc_test_dep = dependency('', fallback: ['orc', 'orc_test_dep'], required: false)
2019-01-16 01:03:40 +00:00
endif
endif
if have_orcc and orc_test_dep.found()
2019-01-16 01:03:40 +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
if enable_gst_play_tests
subdir ('media')
endif