2016-01-27 01:03:52 +00:00
|
|
|
project('gst-rtsp-server', 'c',
|
2023-12-18 13:52:12 +00:00
|
|
|
version : '1.22.8.1',
|
2022-09-21 13:49:45 +00:00
|
|
|
meson_version : '>= 0.62',
|
2016-01-27 01:03:52 +00:00
|
|
|
default_options : ['warning_level=1', 'buildtype=debugoptimized'])
|
|
|
|
|
|
|
|
gst_version = meson.project_version()
|
|
|
|
version_arr = gst_version.split('.')
|
2018-02-08 19:15:10 +00:00
|
|
|
gst_version_major = version_arr[0].to_int()
|
|
|
|
gst_version_minor = version_arr[1].to_int()
|
|
|
|
gst_version_micro = version_arr[2].to_int()
|
|
|
|
if version_arr.length() == 4
|
|
|
|
gst_version_nano = version_arr[3].to_int()
|
2016-01-27 01:03:52 +00:00
|
|
|
else
|
|
|
|
gst_version_nano = 0
|
|
|
|
endif
|
2021-10-25 10:37:45 +00:00
|
|
|
gst_version_is_stable = gst_version_minor.is_even()
|
|
|
|
gst_version_is_dev = gst_version_minor.is_odd() and gst_version_micro < 90
|
2016-01-27 01:03:52 +00:00
|
|
|
|
2022-04-06 11:56:30 +00:00
|
|
|
glib_req = '>= 2.62.0'
|
2021-10-25 10:37:45 +00:00
|
|
|
|
|
|
|
if gst_version_is_stable
|
|
|
|
gst_req = '>= @0@.@1@.0'.format(gst_version_major, gst_version_minor)
|
|
|
|
else
|
|
|
|
gst_req = '>= ' + gst_version
|
|
|
|
endif
|
2016-01-27 01:03:52 +00:00
|
|
|
|
|
|
|
api_version = '1.0'
|
|
|
|
soversion = 0
|
|
|
|
# maintaining compatibility with the previous libtool versioning
|
|
|
|
# current = minor * 100 + micro
|
2018-08-31 09:12:15 +00:00
|
|
|
curversion = gst_version_minor * 100 + gst_version_micro
|
|
|
|
libversion = '@0@.@1@.0'.format(soversion, curversion)
|
|
|
|
osxversion = curversion + 1
|
2016-01-27 01:03:52 +00:00
|
|
|
|
|
|
|
plugins_install_dir = '@0@/gstreamer-1.0'.format(get_option('libdir'))
|
|
|
|
|
2017-08-11 13:14:32 +00:00
|
|
|
cc = meson.get_compiler('c')
|
|
|
|
|
2018-09-24 08:36:21 +00:00
|
|
|
cdata = configuration_data()
|
|
|
|
|
2018-04-25 10:00:32 +00:00
|
|
|
if cc.has_link_argument('-Wl,-Bsymbolic-functions')
|
|
|
|
add_project_link_arguments('-Wl,-Bsymbolic-functions', language : 'c')
|
|
|
|
endif
|
|
|
|
|
2021-03-24 19:20:18 +00:00
|
|
|
# glib doesn't support unloading, which means that unloading and reloading
|
|
|
|
# any library that registers static types will fail
|
|
|
|
if cc.has_link_argument('-Wl,-z,nodelete')
|
|
|
|
add_project_link_arguments('-Wl,-z,nodelete', language: 'c')
|
|
|
|
endif
|
|
|
|
|
2017-08-11 13:14:32 +00:00
|
|
|
# Symbol visibility
|
2022-12-13 13:58:43 +00:00
|
|
|
if cc.has_argument('-fvisibility=hidden')
|
2017-08-11 13:14:32 +00:00
|
|
|
add_project_arguments('-fvisibility=hidden', language: 'c')
|
|
|
|
endif
|
|
|
|
|
2018-01-30 20:35:21 +00:00
|
|
|
# Disable strict aliasing
|
|
|
|
if cc.has_argument('-fno-strict-aliasing')
|
|
|
|
add_project_arguments('-fno-strict-aliasing', language: 'c')
|
|
|
|
endif
|
|
|
|
|
2018-09-19 11:21:30 +00:00
|
|
|
# Define G_DISABLE_DEPRECATED for development versions
|
|
|
|
if gst_version_is_dev
|
|
|
|
message('Disabling deprecated GLib API')
|
|
|
|
add_project_arguments('-DG_DISABLE_DEPRECATED', language: 'c')
|
|
|
|
endif
|
|
|
|
|
|
|
|
cast_checks = get_option('gobject-cast-checks')
|
|
|
|
if cast_checks.disabled() or (cast_checks.auto() and not gst_version_is_dev)
|
|
|
|
message('Disabling GLib cast checks')
|
|
|
|
add_project_arguments('-DG_DISABLE_CAST_CHECKS', language: 'c')
|
|
|
|
endif
|
|
|
|
|
|
|
|
glib_asserts = get_option('glib-asserts')
|
|
|
|
if glib_asserts.disabled() or (glib_asserts.auto() and not gst_version_is_dev)
|
|
|
|
message('Disabling GLib asserts')
|
|
|
|
add_project_arguments('-DG_DISABLE_ASSERT', language: 'c')
|
|
|
|
endif
|
|
|
|
|
|
|
|
glib_checks = get_option('glib-checks')
|
|
|
|
if glib_checks.disabled() or (glib_checks.auto() and not gst_version_is_dev)
|
|
|
|
message('Disabling GLib checks')
|
|
|
|
add_project_arguments('-DG_DISABLE_CHECKS', language: 'c')
|
|
|
|
endif
|
|
|
|
|
2017-06-09 20:27:09 +00:00
|
|
|
cdata.set_quoted('GETTEXT_PACKAGE', 'gst-rtsp-server-1.0')
|
|
|
|
cdata.set_quoted('PACKAGE', 'gst-rtsp-server')
|
|
|
|
cdata.set_quoted('VERSION', gst_version)
|
|
|
|
cdata.set_quoted('PACKAGE_VERSION', gst_version)
|
|
|
|
cdata.set_quoted('GST_API_VERSION', api_version)
|
|
|
|
cdata.set_quoted('GST_LICENSE', 'LGPL')
|
|
|
|
|
|
|
|
# FIXME: ENABLE_NLS (currently also missing from autotools build)
|
|
|
|
# cdata.set('ENABLE_NLS', true)
|
|
|
|
# cdata.set_quoted('LOCALEDIR', join_paths(get_option('prefix'), get_option('localedir')))
|
2016-01-27 01:03:52 +00:00
|
|
|
|
2017-05-20 14:07:31 +00:00
|
|
|
# GStreamer package name and origin url
|
2018-05-05 14:21:52 +00:00
|
|
|
gst_package_name = get_option('package-name')
|
2017-05-20 14:07:31 +00:00
|
|
|
if gst_package_name == ''
|
|
|
|
if gst_version_nano == 0
|
2017-06-26 08:55:49 +00:00
|
|
|
gst_package_name = 'GStreamer RTSP Server Library source release'
|
2017-05-20 14:07:31 +00:00
|
|
|
elif gst_version_nano == 1
|
2017-06-26 08:55:49 +00:00
|
|
|
gst_package_name = 'GStreamer RTSP Server Library git'
|
2017-05-20 14:07:31 +00:00
|
|
|
else
|
2017-06-26 08:55:49 +00:00
|
|
|
gst_package_name = 'GStreamer RTSP Server Library prerelease'
|
2017-05-20 14:07:31 +00:00
|
|
|
endif
|
|
|
|
endif
|
2017-06-26 08:55:49 +00:00
|
|
|
cdata.set_quoted('GST_PACKAGE_NAME', gst_package_name)
|
2018-05-05 14:21:52 +00:00
|
|
|
cdata.set_quoted('GST_PACKAGE_ORIGIN', get_option('package-origin'))
|
2017-05-20 14:07:31 +00:00
|
|
|
|
2016-01-27 01:03:52 +00:00
|
|
|
rtspserver_args = ['-DHAVE_CONFIG_H']
|
|
|
|
|
2018-03-01 18:28:16 +00:00
|
|
|
warning_flags = [
|
|
|
|
'-Wmissing-declarations',
|
|
|
|
'-Wmissing-prototypes',
|
|
|
|
'-Wredundant-decls',
|
|
|
|
'-Wundef',
|
|
|
|
'-Wwrite-strings',
|
|
|
|
'-Wformat',
|
|
|
|
'-Wformat-nonliteral',
|
|
|
|
'-Wformat-security',
|
|
|
|
'-Wold-style-definition',
|
|
|
|
'-Waggregate-return',
|
|
|
|
'-Winit-self',
|
|
|
|
'-Wmissing-include-dirs',
|
|
|
|
'-Waddress',
|
|
|
|
'-Wno-multichar',
|
|
|
|
'-Wvla',
|
|
|
|
'-Wpointer-arith',
|
|
|
|
]
|
|
|
|
|
|
|
|
foreach extra_arg : warning_flags
|
|
|
|
if cc.has_argument (extra_arg)
|
|
|
|
add_project_arguments([extra_arg], language: 'c')
|
|
|
|
endif
|
|
|
|
endforeach
|
|
|
|
|
2016-01-27 01:03:52 +00:00
|
|
|
rtspserver_incs = include_directories('gst/rtsp-server', '.')
|
|
|
|
|
2016-10-20 20:40:18 +00:00
|
|
|
gst_dep = dependency('gstreamer-1.0', version : gst_req,
|
|
|
|
fallback : ['gstreamer', 'gst_dep'])
|
|
|
|
gstrtsp_dep = dependency('gstreamer-rtsp-1.0', version : gst_req,
|
|
|
|
fallback : ['gst-plugins-base', 'rtsp_dep'])
|
|
|
|
gstrtp_dep = dependency('gstreamer-rtp-1.0', version : gst_req,
|
|
|
|
fallback : ['gst-plugins-base', 'rtp_dep'])
|
|
|
|
gstsdp_dep = dependency('gstreamer-sdp-1.0', version : gst_req,
|
|
|
|
fallback : ['gst-plugins-base', 'sdp_dep'])
|
|
|
|
gstapp_dep = dependency('gstreamer-app-1.0', version : gst_req,
|
|
|
|
fallback : ['gst-plugins-base', 'app_dep'])
|
|
|
|
gstnet_dep = dependency('gstreamer-net-1.0', version : gst_req,
|
|
|
|
fallback : ['gstreamer', 'gst_net_dep'])
|
2018-09-01 05:51:15 +00:00
|
|
|
if host_machine.system() != 'windows'
|
|
|
|
gstcheck_dep = dependency('gstreamer-check-1.0', version : gst_req,
|
|
|
|
required : get_option('tests'),
|
|
|
|
fallback : ['gstreamer', 'gst_check_dep'])
|
|
|
|
endif
|
2016-01-27 01:03:52 +00:00
|
|
|
|
2019-03-21 11:49:10 +00:00
|
|
|
# Disable compiler warnings for unused variables and args if gst debug system is disabled
|
|
|
|
if gst_dep.type_name() == 'internal'
|
|
|
|
gst_debug_disabled = not subproject('gstreamer').get_variable('gst_debug')
|
|
|
|
else
|
|
|
|
# We can't check that in the case of subprojects as we won't
|
|
|
|
# be able to build against an internal dependency (which is not built yet)
|
|
|
|
gst_debug_disabled = cc.has_header_symbol('gst/gstconfig.h', 'GST_DISABLE_GST_DEBUG', dependencies: gst_dep)
|
|
|
|
endif
|
|
|
|
|
|
|
|
if gst_debug_disabled
|
|
|
|
message('GStreamer debug system is disabled')
|
|
|
|
add_project_arguments(cc.get_supported_arguments(['-Wno-unused']), language: 'c')
|
|
|
|
else
|
|
|
|
message('GStreamer debug system is enabled')
|
|
|
|
endif
|
|
|
|
|
2018-07-25 11:52:20 +00:00
|
|
|
gir = find_program('g-ir-scanner', required : get_option('introspection'))
|
2017-04-13 16:52:26 +00:00
|
|
|
gnome = import('gnome')
|
2019-10-17 23:42:12 +00:00
|
|
|
build_gir = gir.found() and (not meson.is_cross_build() or get_option('introspection').enabled())
|
2017-04-13 16:52:26 +00:00
|
|
|
gir_init_section = [ '--add-init-section=extern void gst_init(gint*,gchar**);' + \
|
|
|
|
'g_setenv("GST_REGISTRY_1.0", "@0@", TRUE);'.format(meson.current_build_dir() + '/gir_empty_registry.reg') + \
|
|
|
|
'g_setenv("GST_PLUGIN_PATH_1_0", "", TRUE);' + \
|
|
|
|
'g_setenv("GST_PLUGIN_SYSTEM_PATH_1_0", "", TRUE);' + \
|
2019-03-23 19:16:17 +00:00
|
|
|
'gst_init(NULL,NULL);', '--quiet']
|
2017-04-13 16:52:26 +00:00
|
|
|
|
2018-08-31 07:20:47 +00:00
|
|
|
pkgconfig = import('pkgconfig')
|
|
|
|
plugins_pkgconfig_install_dir = join_paths(plugins_install_dir, 'pkgconfig')
|
|
|
|
if get_option('default_library') == 'shared'
|
|
|
|
# If we don't build static plugins there is no need to generate pc files
|
|
|
|
plugins_pkgconfig_install_dir = disabler()
|
|
|
|
endif
|
|
|
|
|
2018-10-22 09:29:24 +00:00
|
|
|
plugins = []
|
2018-10-29 13:19:33 +00:00
|
|
|
pkgconfig_subdirs = ['gstreamer-1.0']
|
2020-06-27 04:39:00 +00:00
|
|
|
static_build = get_option('default_library') == 'static'
|
2022-09-01 15:51:48 +00:00
|
|
|
gst_libraries = []
|
2018-10-29 13:19:33 +00:00
|
|
|
|
2016-01-27 01:03:52 +00:00
|
|
|
subdir('gst')
|
2018-09-01 05:51:15 +00:00
|
|
|
if not get_option('tests').disabled()
|
2017-12-06 20:42:39 +00:00
|
|
|
subdir('tests')
|
|
|
|
endif
|
2018-07-25 11:52:20 +00:00
|
|
|
if not get_option('examples').disabled()
|
2017-12-06 20:42:39 +00:00
|
|
|
subdir('examples')
|
|
|
|
endif
|
2018-10-22 09:29:24 +00:00
|
|
|
subdir('docs')
|
2020-07-08 16:28:57 +00:00
|
|
|
|
|
|
|
# Set release date
|
|
|
|
if gst_version_nano == 0
|
|
|
|
extract_release_date = find_program('scripts/extract-release-date-from-doap-file.py')
|
2022-01-04 20:37:59 +00:00
|
|
|
run_result = run_command(extract_release_date, gst_version, files('gst-rtsp-server.doap'), check: true)
|
|
|
|
release_date = run_result.stdout().strip()
|
|
|
|
cdata.set_quoted('GST_PACKAGE_RELEASE_DATETIME', release_date)
|
|
|
|
message('Package release date: ' + release_date)
|
2020-07-08 16:28:57 +00:00
|
|
|
endif
|
|
|
|
|
|
|
|
configure_file(output: 'config.h', configuration: cdata)
|
2022-08-31 22:44:14 +00:00
|
|
|
|
2022-11-07 00:10:39 +00:00
|
|
|
meson.add_dist_script('scripts/gen-changelog.py', meson.project_name(), '1.20.0', meson.project_version())
|
|
|
|
|
2022-08-31 22:44:14 +00:00
|
|
|
plugin_names = []
|
|
|
|
gst_plugins = []
|
|
|
|
foreach plugin: plugins
|
2022-09-01 19:11:31 +00:00
|
|
|
pkgconfig.generate(plugin, install_dir: plugins_pkgconfig_install_dir)
|
2022-08-31 22:44:14 +00:00
|
|
|
dep = declare_dependency(link_with: plugin, variables: {'full_path': plugin.full_path()})
|
|
|
|
meson.override_dependency(plugin.name(), dep)
|
|
|
|
gst_plugins += [dep]
|
|
|
|
if plugin.name().startswith('gst')
|
|
|
|
plugin_names += [plugin.name().substring(3)]
|
|
|
|
else
|
|
|
|
plugin_names += [plugin.name()]
|
|
|
|
endif
|
|
|
|
endforeach
|
|
|
|
|
|
|
|
summary({
|
|
|
|
'Plugins': plugin_names,
|
|
|
|
}, list_sep: ', ')
|