2020-06-27 04:39:00 +00:00
|
|
|
gst_sources = files(
|
2016-08-12 14:55:17 +00:00
|
|
|
'gst.c',
|
|
|
|
'gstobject.c',
|
|
|
|
'gstallocator.c',
|
|
|
|
'gstbin.c',
|
|
|
|
'gstbuffer.c',
|
|
|
|
'gstbufferlist.c',
|
|
|
|
'gstbufferpool.c',
|
|
|
|
'gstbus.c',
|
|
|
|
'gstcaps.c',
|
|
|
|
'gstcapsfeatures.c',
|
|
|
|
'gstchildproxy.c',
|
|
|
|
'gstclock.c',
|
|
|
|
'gstcontext.c',
|
|
|
|
'gstcontrolbinding.c',
|
|
|
|
'gstcontrolsource.c',
|
|
|
|
'gstdatetime.c',
|
|
|
|
'gstdebugutils.c',
|
|
|
|
'gstdevice.c',
|
|
|
|
'gstdeviceprovider.c',
|
|
|
|
'gstdeviceproviderfactory.c',
|
2016-11-02 08:12:58 +00:00
|
|
|
'gstdynamictypefactory.c',
|
2016-08-12 14:55:17 +00:00
|
|
|
'gstelement.c',
|
|
|
|
'gstelementfactory.c',
|
|
|
|
'gsterror.c',
|
|
|
|
'gstevent.c',
|
|
|
|
'gstformat.c',
|
|
|
|
'gstghostpad.c',
|
|
|
|
'gstdevicemonitor.c',
|
|
|
|
'gstinfo.c',
|
|
|
|
'gstiterator.c',
|
|
|
|
'gstatomicqueue.c',
|
|
|
|
'gstmessage.c',
|
|
|
|
'gstmeta.c',
|
|
|
|
'gstmemory.c',
|
|
|
|
'gstminiobject.c',
|
|
|
|
'gstpad.c',
|
|
|
|
'gstpadtemplate.c',
|
|
|
|
'gstparamspecs.c',
|
|
|
|
'gstpipeline.c',
|
|
|
|
'gstplugin.c',
|
|
|
|
'gstpluginfeature.c',
|
|
|
|
'gstpluginloader.c',
|
|
|
|
'gstpoll.c',
|
|
|
|
'gstpreset.c',
|
|
|
|
'gstprotection.c',
|
|
|
|
'gstquark.c',
|
|
|
|
'gstquery.c',
|
|
|
|
'gstregistry.c',
|
|
|
|
'gstregistrychunks.c',
|
2017-04-03 12:20:51 +00:00
|
|
|
'gstpromise.c',
|
2016-08-12 14:55:17 +00:00
|
|
|
'gstsample.c',
|
|
|
|
'gstsegment.c',
|
|
|
|
'gststreamcollection.c',
|
|
|
|
'gststreams.c',
|
|
|
|
'gststructure.c',
|
|
|
|
'gstsystemclock.c',
|
|
|
|
'gsttaglist.c',
|
|
|
|
'gsttagsetter.c',
|
|
|
|
'gsttask.c',
|
|
|
|
'gsttaskpool.c',
|
|
|
|
'gsttoc.c',
|
|
|
|
'gsttocsetter.c',
|
|
|
|
'gsttracer.c',
|
|
|
|
'gsttracerfactory.c',
|
|
|
|
'gsttracerrecord.c',
|
|
|
|
'gsttracerutils.c',
|
|
|
|
'gsttypefind.c',
|
|
|
|
'gsttypefindfactory.c',
|
|
|
|
'gsturi.c',
|
|
|
|
'gstutils.c',
|
|
|
|
'gstvalue.c',
|
|
|
|
'gstparse.c',
|
2020-06-27 04:39:00 +00:00
|
|
|
)
|
2016-08-12 14:55:17 +00:00
|
|
|
|
2020-06-27 04:39:00 +00:00
|
|
|
gst_headers = files(
|
2016-08-12 14:55:17 +00:00
|
|
|
'gst.h',
|
|
|
|
'glib-compat.h',
|
|
|
|
'gstobject.h',
|
|
|
|
'gstallocator.h',
|
|
|
|
'gstbin.h',
|
|
|
|
'gstbuffer.h',
|
|
|
|
'gstbufferlist.h',
|
|
|
|
'gstbufferpool.h',
|
|
|
|
'gstbus.h',
|
|
|
|
'gstcaps.h',
|
|
|
|
'gstcapsfeatures.h',
|
|
|
|
'gstchildproxy.h',
|
|
|
|
'gstclock.h',
|
|
|
|
'gstcompat.h',
|
|
|
|
'gstcontext.h',
|
|
|
|
'gstcontrolbinding.h',
|
|
|
|
'gstcontrolsource.h',
|
|
|
|
'gstdatetime.h',
|
|
|
|
'gstdebugutils.h',
|
|
|
|
'gstelement.h',
|
|
|
|
'gstelementmetadata.h',
|
|
|
|
'gstdevice.h',
|
|
|
|
'gstdeviceprovider.h',
|
|
|
|
'gstdeviceproviderfactory.h',
|
2016-11-02 08:04:01 +00:00
|
|
|
'gstdynamictypefactory.h',
|
2016-08-12 14:55:17 +00:00
|
|
|
'gstelementfactory.h',
|
|
|
|
'gsterror.h',
|
|
|
|
'gstevent.h',
|
|
|
|
'gstformat.h',
|
|
|
|
'gstghostpad.h',
|
|
|
|
'gstdevicemonitor.h',
|
|
|
|
'gstinfo.h',
|
|
|
|
'gstiterator.h',
|
|
|
|
'gstatomicqueue.h',
|
|
|
|
'gstmacros.h',
|
|
|
|
'gstmessage.h',
|
|
|
|
'gstmeta.h',
|
|
|
|
'gstmemory.h',
|
|
|
|
'gstminiobject.h',
|
|
|
|
'gstpad.h',
|
|
|
|
'gstpadtemplate.h',
|
|
|
|
'gstparamspecs.h',
|
|
|
|
'gstpipeline.h',
|
|
|
|
'gstplugin.h',
|
|
|
|
'gstpluginfeature.h',
|
|
|
|
'gstpoll.h',
|
|
|
|
'gstpreset.h',
|
|
|
|
'gstprotection.h',
|
|
|
|
'gstquery.h',
|
2017-04-03 12:20:51 +00:00
|
|
|
'gstpromise.h',
|
2016-08-12 14:55:17 +00:00
|
|
|
'gstsample.h',
|
|
|
|
'gstsegment.h',
|
|
|
|
'gststreamcollection.h',
|
|
|
|
'gststreams.h',
|
|
|
|
'gststructure.h',
|
|
|
|
'gstsystemclock.h',
|
|
|
|
'gsttaglist.h',
|
|
|
|
'gsttagsetter.h',
|
|
|
|
'gsttask.h',
|
|
|
|
'gsttaskpool.h',
|
|
|
|
'gsttoc.h',
|
|
|
|
'gsttocsetter.h',
|
|
|
|
'gsttracer.h',
|
|
|
|
'gsttracerfactory.h',
|
|
|
|
'gsttracerrecord.h',
|
|
|
|
'gsttypefind.h',
|
|
|
|
'gsttypefindfactory.h',
|
|
|
|
'gsturi.h',
|
|
|
|
'gstutils.h',
|
|
|
|
'gstvalue.h',
|
|
|
|
'gstregistry.h',
|
|
|
|
'gstparse.h',
|
|
|
|
'math-compat.h',
|
2020-06-27 04:39:00 +00:00
|
|
|
)
|
2016-08-12 14:55:17 +00:00
|
|
|
install_headers(gst_headers, subdir : 'gstreamer-1.0/gst')
|
|
|
|
|
2020-09-05 00:52:47 +00:00
|
|
|
extra_deps = []
|
|
|
|
if host_system == 'android'
|
|
|
|
gst_sources += 'gstandroid.c'
|
|
|
|
extra_deps += cc.find_library('log')
|
|
|
|
endif
|
|
|
|
|
2018-05-05 13:38:09 +00:00
|
|
|
gst_registry = get_option('registry')
|
|
|
|
if gst_registry
|
2020-06-27 04:39:00 +00:00
|
|
|
gst_registry_sources = files('gstregistrybinary.c')
|
2016-08-12 14:55:17 +00:00
|
|
|
else
|
2018-05-05 13:38:09 +00:00
|
|
|
gst_registry_sources = []
|
2016-08-12 14:55:17 +00:00
|
|
|
endif
|
|
|
|
|
2017-05-05 10:49:08 +00:00
|
|
|
# Make copy so configure_file consumes the copy and we can
|
|
|
|
# still add to the original cdata later.
|
|
|
|
gst_cdata = cdata
|
|
|
|
|
2018-05-05 13:38:09 +00:00
|
|
|
if gst_debug
|
2017-08-07 10:06:58 +00:00
|
|
|
gst_cdata.set('GST_DISABLE_GST_DEBUG_DEFINE', '#undef GST_DISABLE_GST_DEBUG')
|
2018-05-05 13:38:09 +00:00
|
|
|
else
|
|
|
|
gst_cdata.set('GST_DISABLE_GST_DEBUG_DEFINE', '#define GST_DISABLE_GST_DEBUG 1')
|
2017-08-07 10:06:58 +00:00
|
|
|
endif
|
|
|
|
|
2018-05-05 13:38:09 +00:00
|
|
|
if gst_registry
|
2017-08-07 10:06:58 +00:00
|
|
|
gst_cdata.set('GST_DISABLE_REGISTRY_DEFINE', '#undef GST_DISABLE_REGISTRY')
|
2018-05-05 13:38:09 +00:00
|
|
|
else
|
|
|
|
gst_cdata.set('GST_DISABLE_REGISTRY_DEFINE', '#define GST_DISABLE_REGISTRY 1')
|
2017-08-07 10:06:58 +00:00
|
|
|
endif
|
|
|
|
|
2018-08-09 23:08:43 +00:00
|
|
|
gst_parse = get_option('gst_parse')
|
|
|
|
if gst_parse
|
|
|
|
gst_cdata.set('GST_DISABLE_PARSE_DEFINE', '#undef GST_DISABLE_PARSE')
|
|
|
|
else
|
|
|
|
gst_cdata.set('GST_DISABLE_PARSE_DEFINE', '#define GST_DISABLE_PARSE 1')
|
|
|
|
endif
|
2017-08-07 10:06:58 +00:00
|
|
|
|
2018-11-06 09:20:17 +00:00
|
|
|
gst_cdata.set10('GST_DISABLE_CAST_CHECKS_DEFINE', cast_checks.disabled())
|
|
|
|
gst_cdata.set10('GST_DISABLE_GLIB_ASSERTS_DEFINE', glib_asserts.disabled())
|
|
|
|
gst_cdata.set10('GST_DISABLE_GLIB_CHECKS_DEFINE', glib_checks.disabled())
|
|
|
|
|
2017-08-07 10:06:58 +00:00
|
|
|
# FIXME: add --disable-plugin option?
|
|
|
|
gst_cdata.set('GST_DISABLE_PLUGIN_DEFINE', '#undef GST_DISABLE_PLUGIN')
|
|
|
|
|
2016-08-12 14:55:17 +00:00
|
|
|
configure_file(input : 'gstconfig.h.in',
|
|
|
|
output : 'gstconfig.h',
|
2018-04-01 14:06:26 +00:00
|
|
|
install_dir : join_paths(get_option('includedir'), 'gstreamer-1.0/gst'),
|
2017-05-05 10:49:08 +00:00
|
|
|
configuration : gst_cdata)
|
2017-05-21 13:26:01 +00:00
|
|
|
|
|
|
|
version_cdata = configuration_data()
|
|
|
|
version_cdata.set('GST_VERSION_MAJOR', gst_version_major)
|
|
|
|
version_cdata.set('GST_VERSION_MINOR', gst_version_minor)
|
|
|
|
version_cdata.set('GST_VERSION_MICRO', gst_version_micro)
|
|
|
|
version_cdata.set('GST_VERSION_NANO', gst_version_nano)
|
|
|
|
|
2017-04-10 14:28:57 +00:00
|
|
|
gst_version_h = configure_file(input : 'gstversion.h.in',
|
2016-08-12 14:55:17 +00:00
|
|
|
output : 'gstversion.h',
|
2018-04-01 14:06:26 +00:00
|
|
|
install_dir : join_paths(get_option('includedir'), 'gstreamer-1.0/gst'),
|
2017-05-21 13:26:01 +00:00
|
|
|
configuration : version_cdata)
|
2016-08-12 14:55:17 +00:00
|
|
|
|
2017-07-20 08:12:43 +00:00
|
|
|
gst_enums = gnome.mkenums_simple('gstenumtypes',
|
2016-12-17 14:35:19 +00:00
|
|
|
sources : gst_headers,
|
2017-07-20 08:12:43 +00:00
|
|
|
header_prefix : '#include <gst/gstconfig.h>',
|
|
|
|
body_prefix : '#include "gst/gst_private.h"\n#include <gst/gst.h>',
|
|
|
|
decorator : 'GST_API',
|
2016-12-17 14:35:19 +00:00
|
|
|
install_header : true,
|
|
|
|
install_dir : join_paths(get_option('includedir'), 'gstreamer-1.0/gst'))
|
2016-08-12 14:55:17 +00:00
|
|
|
|
2016-12-22 18:09:39 +00:00
|
|
|
gstenum_h = gst_enums[1]
|
|
|
|
gstenum_c = gst_enums[0]
|
2016-08-12 14:55:17 +00:00
|
|
|
|
2018-08-09 23:08:43 +00:00
|
|
|
gst_parse_sources = []
|
|
|
|
if gst_parse
|
|
|
|
subdir('parse')
|
|
|
|
endif
|
2016-08-12 14:55:17 +00:00
|
|
|
|
|
|
|
subdir('printf')
|
|
|
|
|
|
|
|
libgst_c_args = gst_c_args + [
|
|
|
|
'-D_GNU_SOURCE',
|
2021-10-01 14:29:36 +00:00
|
|
|
'-DG_LOG_DOMAIN="GStreamer"',
|
2016-08-12 14:55:17 +00:00
|
|
|
'-DGST_DISABLE_DEPRECATED',
|
|
|
|
]
|
|
|
|
|
2018-05-05 13:38:09 +00:00
|
|
|
tracer_hooks = get_option('tracer_hooks')
|
|
|
|
if not tracer_hooks
|
2017-07-05 12:20:19 +00:00
|
|
|
libgst_c_args += ['-DGST_DISABLE_GST_TRACER_HOOKS']
|
|
|
|
endif
|
|
|
|
|
2016-08-26 23:06:59 +00:00
|
|
|
# Make sure that subproject building gir files work
|
|
|
|
gst_incdirs = [configinc]
|
|
|
|
gst_gen_sources = [gstenum_h]
|
2018-03-23 16:48:37 +00:00
|
|
|
libgst = library('gstreamer-1.0', gst_sources,
|
2018-08-09 23:08:43 +00:00
|
|
|
gstenum_h, gstenum_c, gst_parse_sources, gst_registry_sources,
|
2018-03-23 16:48:37 +00:00
|
|
|
version : libversion,
|
|
|
|
soversion : soversion,
|
2018-08-28 20:33:28 +00:00
|
|
|
darwin_versions : osxversion,
|
2018-08-25 21:09:12 +00:00
|
|
|
c_args : libgst_c_args + ['-DBUILDING_GST'],
|
2018-03-23 16:48:37 +00:00
|
|
|
include_directories : [configinc,
|
|
|
|
# HACK, change include paths in .y and .l in final version.
|
|
|
|
include_directories('parse')],
|
2021-10-19 14:24:42 +00:00
|
|
|
link_with : printf_lib,
|
2018-03-23 16:48:37 +00:00
|
|
|
install : true,
|
2020-09-05 00:52:47 +00:00
|
|
|
dependencies : [gobject_dep, gmodule_dep, glib_dep, mathlib, dl_dep,
|
|
|
|
backtrace_deps, platform_deps, extra_deps],
|
2018-03-23 16:48:37 +00:00
|
|
|
)
|
2016-08-26 23:06:59 +00:00
|
|
|
|
2020-06-27 04:39:00 +00:00
|
|
|
pkg_name = 'gstreamer-1.0'
|
|
|
|
library_def = {'lib': libgst}
|
2018-10-27 17:01:02 +00:00
|
|
|
pkgconfig.generate(libgst,
|
meson: Add -Wl,-rpath,${libdir} on macOS
We made the gstreamer installation prefix relocatable by picking up
plugins relative to the location of libgstreamer-1.0.dylib, similar to
how it's done for Windows:
https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1627
This had a lot of side-effects:
https://gitlab.freedesktop.org/gstreamer/gstreamer/-/issues/1051
https://gitlab.freedesktop.org/gstreamer/cerbero/-/issues/363
https://gitlab.freedesktop.org/gstreamer/cerbero/-/issues/371
https://gitlab.freedesktop.org/gstreamer/cerbero/-/issues/362
A partial fix for the cerbero side of these was:
https://gitlab.freedesktop.org/gstreamer/cerbero/-/merge_requests/807
However, this relied on the consumers knowing that they need to add
`LC_RPATH` entries to the libdir of the prefix. This is done
automatically by build systems like Meson, but not by others, such as
Autotools, CMake, Cargo, XCode, etc. For those, we need to add the
RPATH entries to the gstreamer-1.0.pc file.
This also has the side-effect of fixing the loading of gstreamer rust
plugins on macOS:
Fixes https://gitlab.freedesktop.org/gstreamer/gstreamer/-/issues/1159
Fixes https://gitlab.freedesktop.org/gstreamer/gstreamer/-/issues/1149
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2218>
2022-04-18 10:14:47 +00:00
|
|
|
libraries : [glib_dep, gobject_dep] + pkgconfig_libs,
|
2018-10-27 17:01:02 +00:00
|
|
|
variables : pkgconfig_variables,
|
2021-02-26 09:01:56 +00:00
|
|
|
uninstalled_variables: pkgconfig_uninstalled_variables,
|
2018-10-27 17:01:02 +00:00
|
|
|
subdirs : pkgconfig_subdirs,
|
2020-06-27 04:39:00 +00:00
|
|
|
name : pkg_name,
|
2018-10-27 17:01:02 +00:00
|
|
|
description : 'Streaming media framework',
|
|
|
|
)
|
|
|
|
|
2018-03-23 16:48:37 +00:00
|
|
|
if build_gir
|
2020-07-24 12:30:39 +00:00
|
|
|
gst_gir_extra_args = gir_init_section + ['--c-include=gst/gst.h']
|
2018-03-23 16:48:37 +00:00
|
|
|
if meson.is_subproject()
|
|
|
|
# FIXME: There must be a better way to do this
|
|
|
|
# Need to pass the include path to find gst/gst.h and gst/gstenumtypes.h (built)
|
|
|
|
gst_gir_extra_args += ['--cflags-begin',
|
|
|
|
'-I' + meson.current_source_dir() + '/..',
|
|
|
|
'-I' + meson.current_build_dir() + '/..',
|
2021-01-08 11:23:23 +00:00
|
|
|
'-DGST_DISABLE_MINIOBJECT_INLINE_FUNCTIONS',
|
2018-03-23 16:48:37 +00:00
|
|
|
'--cflags-end']
|
2016-08-12 14:55:17 +00:00
|
|
|
endif
|
2018-03-23 16:48:37 +00:00
|
|
|
|
|
|
|
gst_incdirs += [configinc]
|
2020-06-27 04:39:00 +00:00
|
|
|
gir = {
|
|
|
|
'sources' : gst_sources + gst_headers + gst_enums + [gst_version_h],
|
|
|
|
'namespace' : 'Gst',
|
|
|
|
'nsversion' : apiversion,
|
|
|
|
'identifier_prefix' : 'Gst',
|
|
|
|
'symbol_prefix' : 'gst',
|
|
|
|
'export_packages' : pkg_name,
|
|
|
|
'includes' : ['GLib-2.0', 'GObject-2.0', 'GModule-2.0' ],
|
|
|
|
'install' : true,
|
|
|
|
'extra_args' : gst_gir_extra_args,
|
|
|
|
}
|
|
|
|
library_def += {'gir': [gir]}
|
|
|
|
# When building statically the information about the gir is going to be
|
|
|
|
# consumed by `gst-build` to generate gir files linked against
|
|
|
|
# `libgstreamer-full-1.0.so`. We do not build it here as it is currently
|
|
|
|
# broken. Once that is fixed we could build it here, even though we would keep
|
|
|
|
# creating another gir which links against gst-full.
|
|
|
|
if not static_build
|
|
|
|
gst_gir = gnome.generate_gir(libgst, kwargs: gir)
|
|
|
|
gst_gen_sources += gst_gir
|
|
|
|
endif
|
2016-08-12 14:55:17 +00:00
|
|
|
endif
|
2022-09-01 15:51:48 +00:00
|
|
|
gst_libraries += [[pkg_name, library_def]]
|
2016-08-12 14:55:17 +00:00
|
|
|
|
2019-05-13 09:12:28 +00:00
|
|
|
gst_compile_args = []
|
|
|
|
if get_option('default_library') == 'static'
|
|
|
|
gst_compile_args += ['-DGST_STATIC_COMPILATION']
|
|
|
|
endif
|
|
|
|
|
2016-08-12 14:55:17 +00:00
|
|
|
gst_dep = declare_dependency(link_with : libgst,
|
2019-05-13 09:12:28 +00:00
|
|
|
compile_args : gst_compile_args,
|
2016-08-26 23:06:59 +00:00
|
|
|
include_directories : gst_incdirs,
|
2016-08-12 14:55:17 +00:00
|
|
|
dependencies : [glib_dep, gobject_dep, gmodule_dep],
|
|
|
|
# Everything that uses libgst needs this built to compile
|
2016-09-22 22:49:47 +00:00
|
|
|
sources : gst_gen_sources,
|
2016-08-12 14:55:17 +00:00
|
|
|
)
|
2018-10-27 17:01:02 +00:00
|
|
|
|
2020-06-27 04:39:00 +00:00
|
|
|
meson.override_dependency(pkg_name, gst_dep)
|