diff --git a/.gitignore b/.gitignore index e82b629d95..347d4e68e1 100644 --- a/.gitignore +++ b/.gitignore @@ -20,3 +20,4 @@ *.libs/* .#* tags +build* diff --git a/meson.build b/meson.build new file mode 100644 index 0000000000..251c4ede6e --- /dev/null +++ b/meson.build @@ -0,0 +1,53 @@ +project('gst-devtools', 'c', + version : '1.9.1.1', + meson_version : '>= 0.33.0', + default_options : [ 'warning_level=1', + 'c_std=gnu99', + 'buildtype=debugoptimized' ]) + +gst_version = meson.project_version() +version_arr = gst_version.split('.') +gst_version_major = version_arr[0] +gst_version_minor = version_arr[1] +gst_version_micro = version_arr[2] +if version_arr.length() == 4 + gst_version_nano = version_arr[3] + TESTUITE_VERSION = '@0@.@1@'.format(gst_version_major, gst_version_minor) +else + gst_version_nano = 0 + TESTUITE_VERSION = 'master' +endif + +apiversion = '1.0' +soversion = 0 +# maintaining compatibility with the previous libtool versioning +# current = minor * 100 + micro +libversion = '@0@.@1@.0'.format(soversion, gst_version_minor.to_int() * 100 + gst_version_micro.to_int()) + +prefix = get_option('prefix') + +glib_req = '>= 2.40.0' +gst_req = '>= @0@.@1@.0'.format(gst_version_major, gst_version_minor) + +cc = meson.get_compiler('c') +gst_dep = dependency('gstreamer-' + apiversion, version : gst_req, + fallback : ['gstreamer', 'gst_dep']) +gst_pbutils_dep = dependency('gstreamer-pbutils-' + apiversion, version : gst_req, + fallback : ['gst-plugins-base', 'pbutils_dep']) +gst_video_dep = dependency('gstreamer-video-' + apiversion, version : gst_req, + fallback : ['gst-plugins-base', 'video_dep']) +glib_dep = dependency('glib-2.0', version: glib_req) +gio_dep = dependency('gio-2.0', version: glib_req) +gmodule_dep = dependency('gmodule-2.0', version: glib_req) +gtk_dep = dependency('gtk+-3.0', required: false) +mathlib = cc.find_library('m', required : false) + +gst_c_args = ['-DHAVE_CONFIG_H', '-DGST_USE_UNSTABLE_API'] + +gir = find_program('g-ir-scanner', required : false) +build_gir = gir.found() and not meson.is_cross_build() and not get_option('disable-introspection') +gnome = import('gnome') + +gtkdoc = find_program('gtkdoc-scan', required : false) + +subdir('validate') diff --git a/meson_options.txt b/meson_options.txt new file mode 100644 index 0000000000..f1d4da711c --- /dev/null +++ b/meson_options.txt @@ -0,0 +1,3 @@ +option('disable-introspection', + type : 'boolean', value : false, + description : 'Whether to disable the introspection generation') diff --git a/validate/.gitignore b/validate/.gitignore index aef704cdc9..183897c328 100644 --- a/validate/.gitignore +++ b/validate/.gitignore @@ -43,6 +43,7 @@ stamp-h.in *.stamp *.log *.trs +build*/ .arcconfig /m4/*m4 diff --git a/validate/config.h.meson b/validate/config.h.meson new file mode 100644 index 0000000000..86366d9133 --- /dev/null +++ b/validate/config.h.meson @@ -0,0 +1,11 @@ +/* GStreamer API Version */ +#mesondefine GST_API_VERSION + +/* data dir */ +#mesondefine GST_DATADIR + +/* Define to the full name of this package. */ +#mesondefine PACKAGE_NAME + +/* directory where plugins are located */ +#mesondefine VALIDATEPLUGINDIR diff --git a/validate/data/meson.build b/validate/data/meson.build new file mode 100644 index 0000000000..d8c406c6a8 --- /dev/null +++ b/validate/data/meson.build @@ -0,0 +1 @@ +subdir('scenarios') diff --git a/validate/data/scenarios/meson.build b/validate/data/scenarios/meson.build new file mode 100644 index 0000000000..fa55736053 --- /dev/null +++ b/validate/data/scenarios/meson.build @@ -0,0 +1,30 @@ +_scenarios = ['simple_seeks.scenario', + 'seek_forward.scenario', + 'seek_backward.scenario', + 'seek_forward_backward.scenario', + 'reverse_playback.scenario', + 'fast_forward.scenario', + 'fast_backward.scenario', + 'alternate_fast_backward_forward.scenario', + 'pause_resume.scenario', + 'scrub_forward_seeking.scenario', + 'scrub_backward_seeking.scenario', + 'scrub_forward_seeking_full.scenario', + 'scrub_backward_seeking_full.scenario', + 'adaptive_video_size.scenario', + 'adaptive_video_framerate.scenario', + 'adaptive_video_framerate_size.scenario', + 'force_key_unit.scenario', + 'seek_with_stop.scenario', + 'switch_audio_track_while_paused.scenario', + 'switch_subtitle_track.scenario', + 'switch_subtitle_track_while_paused.scenario', + 'disable_subtitle_track_while_paused.scenario', + 'play_15s.scenario', + 'change_state_intensive.scenario', + 'switch_audio_track.scenario', + 'setup_sink_props_max_lateness.scenario'] + +install_data(sources: _scenarios, + install_dir: get_option('datadir') + '/gstreamer-' + + apiversion + '/validate/scenarios') diff --git a/validate/docs/meson.build b/validate/docs/meson.build new file mode 100644 index 0000000000..638cdf4ab4 --- /dev/null +++ b/validate/docs/meson.build @@ -0,0 +1,2 @@ +subdir('validate') +# subdir('launcher') diff --git a/validate/docs/validate/meson.build b/validate/docs/validate/meson.build new file mode 100644 index 0000000000..fec31c67b1 --- /dev/null +++ b/validate/docs/validate/meson.build @@ -0,0 +1,29 @@ +configure_file(input : 'gst-validate.types', + output : 'gst-validate.types', + configuration : configuration_data()) + +doc_deps_names = ['glib-2.0', + 'gstreamer-@0@'.format(apiversion), + 'gstreamer-plugins-base-@0@'.format(apiversion)] + +doc_deps = [] +foreach doc_dep : doc_deps_names + runcmd = run_command('pkg-config', '--variable=prefix', doc_dep) + if runcmd.returncode() == 0 + tmp = '--extra-dir=' + runcmd.stdout().strip() + '/share/gtk-doc/html/' + tmp.strip() + doc_deps = doc_deps + [tmp] + endif +endforeach + +if gtkdoc.found() + gnome.gtkdoc('gst-validate-@0@'.format(apiversion), + main_sgml : 'gst-validate-docs.sgml', + src_dir : '@0@/../../gst/validate'.format(meson.current_source_dir()), + scan_args : ['--deprecated-guards=GST_DISABLE_DEPRECATED', + '--ignore-decorators=GST_EXPORT', + '--ignore-headers= gettext.h gst-validate-internal.h gst-validate-monitor.h gst-validate-bin-monitor.h gst-validate-element-monitor.h gst-validate-pad-monitor.h gst-validate-override.h gst-validate-override-registry.h gst-validate-utils.h gst-validate-media-info.h gst-validate-report.h media-descriptor.h media-descriptor-parser.h media-descriptor-writer.h gst-validate-i18n-lib.h' + ], + fixxref_args: doc_deps + ['--html-dir=' + get_option('prefix') + '/share/gtk-doc/html/'], + install : true) +endif diff --git a/validate/gst/meson.build b/validate/gst/meson.build new file mode 100644 index 0000000000..1cd20c81e6 --- /dev/null +++ b/validate/gst/meson.build @@ -0,0 +1,5 @@ +subdir('validate') + +# if HAVE_LD_PRELOAD +#subdir('preload') +# endif diff --git a/validate/gst/validate/meson.build b/validate/gst/validate/meson.build new file mode 100644 index 0000000000..d729986c99 --- /dev/null +++ b/validate/gst/validate/meson.build @@ -0,0 +1,74 @@ +gstvalidate_sources = [ + 'gst-validate-runner.c', + 'gst-validate-reporter.c', + 'gst-validate-monitor.c', + 'gst-validate-element-monitor.c', + 'gst-validate-bin-monitor.c', + 'gst-validate-pipeline-monitor.c', + 'gst-validate-pad-monitor.c', + 'gst-validate-monitor-factory.c', + 'gst-validate-report.c', + 'gst-validate-scenario.c', + 'gst-validate-override.c', + 'gst-validate-utils.c', + 'gst-validate-override-registry.c', + 'media-descriptor.c', + 'media-descriptor-writer.c', + 'media-descriptor-parser.c', + 'gst-validate-media-info.c', + 'validate.c', + 'validate.h', + 'gst-validate-types.h', + 'gst-validate-bin-monitor.h', + 'gst-validate-pipeline-monitor.h', + 'gst-validate-element-monitor.h', + 'gst-validate-enums.h', + 'media-descriptor.h', + 'media-descriptor-writer.h', + 'media-descriptor-parser.h', + 'gst-validate-monitor-factory.h', + 'gst-validate-monitor.h', + 'gst-validate-override.h', + 'gst-validate-override-registry.h', + 'gst-validate-pad-monitor.h', + 'gst-validate-reporter.h', + 'gst-validate-report.h', + 'gst-validate-runner.h', + 'gst-validate-scenario.h', + 'gst-validate-utils.h', + 'gst-validate-media-info.h'] + +gstvalidate = shared_library('gstvalidate', + sources: gstvalidate_sources, + version : libversion, + soversion : soversion, + include_directories : [inc_dirs], + install: true, + c_args : [gst_c_args], + dependencies : [gst_dep, glib_dep, gio_dep, gmodule_dep, + gst_pbutils_dep, mathlib]) + +if build_gir + gnome.generate_gir(gstvalidate, + include_directories : include_directories('..'), + sources : gstvalidate_sources, + nsversion : '1.0', + namespace : 'GstValidate', + symbol_prefix : 'gst_', + identifier_prefix : 'Gst', + export_packages : 'gstvalidate-' + apiversion, + includes : ['GObject-2.0', + 'GLib-2.0', + 'Gio-2.0', + 'GModule-2.0', + 'GstVideo-' + apiversion, + 'Gst-' + apiversion, + 'GstPbutils-' + apiversion], + install : true + ) +endif + +validate_dep = declare_dependency(link_with : gstvalidate, + include_directories : [inc_dirs], + dependencies : [gst_dep, glib_dep, gio_dep, gmodule_dep, + gst_pbutils_dep, mathlib]) diff --git a/validate/launcher/apps/meson.build b/validate/launcher/apps/meson.build new file mode 100644 index 0000000000..a22b3b225f --- /dev/null +++ b/validate/launcher/apps/meson.build @@ -0,0 +1,2 @@ +install_data(sources: ['__init__.py', 'gstvalidate.py'], + install_dir: _launcherdir + '/apps') diff --git a/validate/launcher/meson.build b/validate/launcher/meson.build new file mode 100644 index 0000000000..86c5705621 --- /dev/null +++ b/validate/launcher/meson.build @@ -0,0 +1,23 @@ +_launcherdir = get_option('libdir') + '/gst-validate-launcher/python/launcher/' + +launcher_configure = configuration_data() +launcher_configure.set('GST_VALIDATE_TESTSUITE_VERSION', '"@0@"'.format(TESTUITE_VERSION)) +configure_file(input : 'config.py.in', + output : 'config.py', + configuration : launcher_configure) + +_sources = ['baseclasses.py', + '__init__.py', + 'loggable.py', + 'reporters.py', + 'main.py', + 'httpserver.py', + 'RangeHTTPServer.py', + 'utils.py', + 'vfb_server.py', + 'config.py'] + +install_data(sources: _sources, + install_dir: _launcherdir) + +subdir('apps') diff --git a/validate/meson.build b/validate/meson.build new file mode 100644 index 0000000000..3f5c30745d --- /dev/null +++ b/validate/meson.build @@ -0,0 +1,19 @@ +inc_dirs = include_directories('.') + +cdata = configuration_data() +cdata.set('GST_API_VERSION', '"@0@"'.format(apiversion)) +cdata.set('VALIDATEPLUGINDIR', '"@0@/@1@/gstreamer-1.0/validate"'.format(get_option('prefix'),get_option('libdir'))) +cdata.set('GST_DATADIR', '"@0@/@1@"'.format(prefix, get_option('datadir'))) +cdata.set('PACKAGE_NAME', '"GStreamer Validate"') +configure_file(input : 'config.h.meson', + output : 'config.h', + configuration : cdata) + +subdir('data') +subdir('gst') +subdir('launcher') +subdir('tools') +subdir('docs') +subdir('pkgconfig') +#subdir('tests') +#subdir('po') diff --git a/validate/pkgconfig/meson.build b/validate/pkgconfig/meson.build new file mode 100644 index 0000000000..5105417a3c --- /dev/null +++ b/validate/pkgconfig/meson.build @@ -0,0 +1,15 @@ +pkgconf = configuration_data() + +pkgconf.set('prefix', get_option('prefix')) +pkgconf.set('exec_prefix', '${prefix}') +pkgconf.set('libdir', '${prefix}/@0@'.format(get_option('libdir'))) +pkgconf.set('includedir', '${prefix}/@0@'.format(get_option('includedir'))) +pkgconf.set('GST_API_VERSION', apiversion) +pkgconf.set('VERSION', gst_version) + +pkg_install_dir = '@0@/pkgconfig'.format(get_option('libdir')) + +configure_file(input : 'gst-validate.pc.in', + output : 'gst-validate-1.0.pc', + configuration : pkgconf, + install_dir : pkg_install_dir) diff --git a/validate/plugins/fault_injection/meson.build b/validate/plugins/fault_injection/meson.build new file mode 100644 index 0000000000..87239d28e0 --- /dev/null +++ b/validate/plugins/fault_injection/meson.build @@ -0,0 +1,5 @@ +shared_library('gstvalidatefaultinjection', + 'socket_interposer.c', + include_directories : inc_dirs, + dependencies : [gst_dep, glib_dep] + ) diff --git a/validate/plugins/gapplication/meson.build b/validate/plugins/gapplication/meson.build new file mode 100644 index 0000000000..e6f888850e --- /dev/null +++ b/validate/plugins/gapplication/meson.build @@ -0,0 +1,8 @@ +shared_library('gstvalidategapplication', + 'gstvalidategapplication.c', + install: true, + install_dir: PLUGINDIR, + include_directories : inc_dirs, + dependencies : [gst_dep, glib_dep, gst_pbutils_dep], + link_with : [gstvalidate] + ) diff --git a/validate/plugins/gtk/meson.build b/validate/plugins/gtk/meson.build new file mode 100644 index 0000000000..068aabc082 --- /dev/null +++ b/validate/plugins/gtk/meson.build @@ -0,0 +1,6 @@ +shared_library('gstvalidategtk', 'gstvalidategtk.c', + install: true, + install_dir: PLUGINDIR, + include_directories : inc_dirs, + dependencies : [gst_dep, glib_dep, gst_pbutils_dep, gtk_dep], + link_with : [gstvalidate]) diff --git a/validate/plugins/meson.build b/validate/plugins/meson.build new file mode 100644 index 0000000000..d335898213 --- /dev/null +++ b/validate/plugins/meson.build @@ -0,0 +1,6 @@ +subdir('fault_injection') +subdir('gapplication') + +if gtk_dep.found() + subdir('gtk') +endif diff --git a/validate/tools/gst-validate-launcher.in b/validate/tools/gst-validate-launcher.in old mode 100644 new mode 100755 index e165f3ab10..28ad909bf2 --- a/validate/tools/gst-validate-launcher.in +++ b/validate/tools/gst-validate-launcher.in @@ -22,6 +22,8 @@ import subprocess import sys LIBDIR = '@LIBDIR@' +BUILDDIR = '@BUILDDIR@' +SRCDIR = '@SRCDIR@' GIT_FIRST_HASH = 'da962d096af9460502843e41b7d25fdece7ff1c2' @@ -45,12 +47,14 @@ def _in_devel(): def _add_gst_launcher_path(): - if not _in_devel(): - root = os.path.join(LIBDIR, 'gst-validate-launcher', 'python') - else: + if _in_devel(): print "Running with development path" dir_ = os.path.dirname(os.path.abspath(__file__)) root = os.path.split(dir_)[0] + elif __file__.startswith(BUILDDIR): + root = os.path.abspath(os.path.join(SRCDIR, "../")) + else: + root = os.path.join(LIBDIR, 'gst-validate-launcher', 'python') sys.path.insert(0, root) return os.path.join(root, "launcher") diff --git a/validate/tools/meson.build b/validate/tools/meson.build new file mode 100644 index 0000000000..162ee24ce5 --- /dev/null +++ b/validate/tools/meson.build @@ -0,0 +1,36 @@ +executable('gst-validate-' + apiversion, + 'gst-validate.c', + install: true, + include_directories : inc_dirs, + dependencies : [gst_dep, glib_dep, gst_pbutils_dep, gio_dep], + c_args : [gst_c_args], + link_with : [gstvalidate] + ) +executable('gst-validate-transcoding-' + apiversion, + 'gst-validate-transcoding.c', install: true, + include_directories : inc_dirs, + dependencies : [gst_dep, glib_dep, gst_pbutils_dep, gst_video_dep, gio_dep], + c_args : [gst_c_args], + link_with : [gstvalidate] + ) +executable('gst-validate-media-check-' + apiversion, + 'gst-validate-media-check.c', + install: true, + include_directories : inc_dirs, + dependencies : [gst_dep, glib_dep, gst_pbutils_dep, gio_dep], + c_args : [gst_c_args], + link_with : [gstvalidate] + ) + +tmpconf = configuration_data() +tmpconf.set('LIBDIR', get_option('prefix') + '/' + get_option('datadir') + + '/' + get_option('libdir')) +tmpconf.set('BUILDDIR', meson.current_build_dir()) +tmpconf.set('SRCDIR', meson.current_source_dir()) + +configure_file(input : 'gst-validate-launcher.in', + output : 'gst-validate-launcher', + configuration : tmpconf) + +install_data(sources: 'gst-validate-launcher', + install_dir: get_option('bindir'))