project('gst-libav', 'c', 'cpp',
- version : '1.9.2.1',
- meson_version : '>= 0.33.0',
+ version : '1.11.90',
+ meson_version : '>= 0.36.0',
default_options : [ 'warning_level=1',
'buildtype=debugoptimized' ])
#error libav provider should be FFmpeg
#endif'''
-if not cc.compiles(check_ffmpeg_src, name : 'libav is provided by FFmpeg')
+if not cc.compiles(check_ffmpeg_src, dependencies : libav_deps, name : 'libav is provided by FFmpeg')
error('Uncompatible libavcodec found')
endif
cdata.set('LIBAV_SOURCE', '"system install"')
cdata.set('PACKAGE_VERSION', '"@0@"'.format(gst_version))
cdata.set('PACKAGE', '"gst-libav"')
+check_headers = [['unistd.h', 'HAVE_UNISTD_H']]
+
+foreach h : check_headers
+ if cc.has_header(h.get(0))
+ cdata.set(h.get(1), 1)
+ endif
+endforeach
gst_req = '>= @0@.@1@.0'.format(gst_version_major, gst_version_minor)
gst_dep = dependency('gstreamer-1.0', version : gst_req,
fallback : ['gst-plugins-base', 'pbutils_dep'])
libm = cc.find_library('m', required : false)
-configure_file(input : 'config.h.meson',
- output : 'config.h',
- configuration : cdata)
+configure_file(output : 'config.h', configuration : cdata)
+
+gst_libav_args = ['-DHAVE_CONFIG_H']
+if cc.get_id() != 'msvc'
+ gst_libav_args += ['-Wno-deprecated-declarations']
+else
+ # Ignore several spurious warnings for things gstreamer does very commonly
+ # If a warning is completely useless and spammy, use '/wdXXXX' to suppress it
+ # If a warning is harmless but hard to fix, use '/woXXXX' so it's shown once
+ # NOTE: Only add warnings here if you are sure they're spurious
+ add_project_arguments(
+ '/wd4018', # implicit signed/unsigned conversion
+ '/wd4146', # unary minus on unsigned (beware INT_MIN)
+ '/wd4244', # lossy type conversion (e.g. double -> int)
+ '/wd4305', # truncating type conversion (e.g. double -> float)
+ language : 'c')
+endif
+
+if gst_dep.type_name() == 'internal'
+ gst_proj = subproject('gstreamer')
+
+ if gst_proj.get_variable('disable_gst_debug')
+ message('GStreamer debug system is disabled')
+ add_project_arguments('-Wno-unused', language: 'c')
+ else
+ message('GStreamer debug system is enabled')
+ endif
+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)
+ if not cc.compiles('''
+#include <gst/gstconfig.h>
+#ifdef GST_DISABLE_GST_DEBUG
+#error "debugging disabled, make compiler fail"
+#endif''' , dependencies: gst_dep)
+ message('GStreamer debug system is disabled')
+ add_project_arguments('-Wno-unused', language: 'c')
+ else
+ message('GStreamer debug system is enabled')
+ endif
+endif
-gst_libav_args = ['-DHAVE_CONFIG_H', '-Wno-deprecated-declarations']
configinc = include_directories('.')
plugins_install_dir = '@0@/gstreamer-1.0'.format(get_option('libdir'))
subdir('ext/libav/')