Add feature options for almost all plugins

The only plugins remaining are those that haven't been ported to Meson
yet, and msdk. Also, the tests are still automagic.

https://bugzilla.gnome.org/show_bug.cgi?id=795107
This commit is contained in:
Nirbheek Chauhan 2018-07-27 18:59:23 +05:30
parent 7ef303fa28
commit b55dfb5313
67 changed files with 445 additions and 208 deletions

View file

@ -1,4 +1,4 @@
aom_dep = dependency('aom', required: false) aom_dep = dependency('aom', required: get_option('aom'))
if aom_dep.found() if aom_dep.found()
gstaom = library('gstaom', gstaom = library('gstaom',
['gstaom.c', 'gstav1enc.c', 'gstav1dec.c'], ['gstaom.c', 'gstav1enc.c', 'gstav1dec.c'],

View file

@ -1,5 +1,4 @@
ass_dep = dependency('libass', version : '>= 0.10.2', required : false) ass_dep = dependency('libass', version : '>= 0.10.2', required : get_option('assrender'))
if ass_dep.found() if ass_dep.found()
gstassrender = library('gstassrender', gstassrender = library('gstassrender',
'gstassrender.c', 'gstassrender.c',

View file

@ -1,6 +1,6 @@
bs2b_sources = [ 'gstbs2b.c', ] bs2b_sources = [ 'gstbs2b.c', ]
bs2b_dep = dependency('libbs2b', version : '>=3.1.0', required : false) bs2b_dep = dependency('libbs2b', version : '>=3.1.0', required : get_option('bs2b'))
if bs2b_dep.found() if bs2b_dep.found()
gstbs2b = library('gstbs2b', gstbs2b = library('gstbs2b',

View file

@ -4,7 +4,7 @@ bz2_sources = [
'gstbz2enc.c', 'gstbz2enc.c',
] ]
bz2_dep = cc.find_library('bz2', required : false) bz2_dep = cc.find_library('bz2', required : get_option('bz2'))
if bz2_dep.found() and cc.has_header_symbol('bzlib.h', 'BZ2_bzlibVersion') if bz2_dep.found() and cc.has_header_symbol('bzlib.h', 'BZ2_bzlibVersion')
gstbz2 = library('gstbz2', gstbz2 = library('gstbz2',

View file

@ -1,4 +1,4 @@
chromaprint_dep = dependency('libchromaprint', required : false) chromaprint_dep = dependency('libchromaprint', required : get_option('chromaprint'))
if chromaprint_dep.found() if chromaprint_dep.found()
gstchromaprint = library('gstchromaprint', gstchromaprint = library('gstchromaprint',

View file

@ -1,4 +1,5 @@
pangocairo_dep = dependency('pangocairo', version : '>= 1.22.0', required : false) pangocairo_dep = dependency('pangocairo', version : '>= 1.22.0',
required : get_option('closedcaption'))
zvbi_sources = [ zvbi_sources = [
'bit_slicer.c', 'bit_slicer.c',

View file

@ -4,7 +4,7 @@ dash_sources = [
'gstplugin.c', 'gstplugin.c',
] ]
xml2_dep = dependency('libxml-2.0', version : '>= 2.8', required : false) xml2_dep = dependency('libxml-2.0', version : '>= 2.8', required : get_option('dash'))
if xml2_dep.found() if xml2_dep.found()
gstsouphttpsrc = library('gstdashdemux', gstsouphttpsrc = library('gstdashdemux',
dash_sources, dash_sources,

View file

@ -1,4 +1,4 @@
directfb_dep = dependency('directfb', version : '>= 0.9.24', required : false) directfb_dep = dependency('directfb', version : '>= 0.9.24', required : get_option('directfb'))
if directfb_dep.found() if directfb_dep.found()
gstdirectfb = library('gstdirectfb', gstdirectfb = library('gstdirectfb',

View file

@ -11,7 +11,8 @@ dtls_sources = [
'plugin.c', 'plugin.c',
] ]
libcrypto_dep = dependency('libcrypto', required : false) openssl_dep = dependency('openssl', version : '>= 1.0.1', required : get_option('dtls'))
libcrypto_dep = dependency('libcrypto', required : get_option('dtls'))
if openssl_dep.found() and libcrypto_dep.found() if openssl_dep.found() and libcrypto_dep.found()
gstdtls = library('gstdtls', gstdtls = library('gstdtls',

View file

@ -1,7 +1,17 @@
dca_dep = dependency('libdca', required : false) # Don't do any dependency checks if disabled
if get_option('dts').disabled()
subdir_done()
endif
if not dca_dep.found() and cc.has_header_symbol('dca.h', 'dca_init') # Detect libdca using a pkg-config file, or manually
dca_dep = dependency('libdca', required : false)
if not dca_dep.found()
if cc.has_header_symbol('dca.h', 'dca_init')
dca_dep = cc.find_library('dca', required : false) dca_dep = cc.find_library('dca', required : false)
endif
if not dca_dep.found() and get_option('dts').enabled()
error('DTS plugin enabled, but libdca not found')
endif
endif endif
# autotools didn't use the libdca pkg-config cflags, and they # autotools didn't use the libdca pkg-config cflags, and they

View file

@ -1,6 +1,10 @@
faac_dep = cc.find_library('faac', required : false) faac_dep = cc.find_library('faac', required : get_option('faac'))
have_faac_h = cc.has_header_symbol('faac.h', 'faacEncOpen')
if not have_faac_h and get_option('faac').enabled()
error('faac plugin enabled: found libfaac, but not faac.h')
endif
if faac_dep.found() and cc.has_header_symbol('faac.h', 'faacEncOpen') if faac_dep.found() and have_faac_h
gstfaac = library('gstfaac', gstfaac = library('gstfaac',
'gstfaac.c', 'gstfaac.c',
c_args : gst_plugins_bad_args, c_args : gst_plugins_bad_args,

View file

@ -2,11 +2,11 @@ faad_args = [ ]
have_faad = cc.has_header_symbol('neaacdec.h', 'NeAACDecOpen') have_faad = cc.has_header_symbol('neaacdec.h', 'NeAACDecOpen')
have_faad_2_7 = have_faad and cc.has_header_symbol('neaacdec.h', 'LATM') have_faad_2_7 = have_faad and cc.has_header_symbol('neaacdec.h', 'LATM')
if have_faad and not have_faad_2_7 if have_faad and not have_faad_2_7 and get_option('faad').enabled()
message('Found faad2, but too old (< v2.7.0)') message('Found faad2, but too old (< v2.7.0)')
endif endif
faad_dep = cc.find_library('faad', required : false) faad_dep = cc.find_library('faad', required : get_option('faad'))
if faad_dep.found() and have_faad_2_7 if faad_dep.found() and have_faad_2_7
gstfaad = library('gstfaad', gstfaad = library('gstfaad',

View file

@ -1,4 +1,4 @@
fdkaac_dep = dependency('fdk-aac', required : false) fdkaac_dep = dependency('fdk-aac', required : get_option('fdkaac'))
if fdkaac_dep.found() if fdkaac_dep.found()
fdkaac_defines = [] fdkaac_defines = []

View file

@ -10,15 +10,23 @@ flite_libs = [
'flite_cmulex' 'flite_cmulex'
] ]
if get_option('flite').disabled()
subdir_done()
endif
flite_deps = [ ] flite_deps = [ ]
foreach flite_lib : flite_libs foreach flite_lib : flite_libs
flite_lib_dep = cc.find_library(flite_lib, required : false) flite_lib_dep = cc.find_library(flite_lib, required : get_option('flite'))
if flite_lib_dep.found() if flite_lib_dep.found()
flite_deps += [flite_lib_dep] flite_deps += [flite_lib_dep]
endif endif
endforeach endforeach
have_flite_h = cc.has_header_symbol('flite/flite.h', 'flite_init')
if not have_flite_h and get_option('flite').enabled()
error('flite plugin enabled, but flite.h not found')
endif
if flite_deps.length() == flite_libs.length() and cc.has_header_symbol('flite/flite.h', 'flite_init') if flite_deps.length() == flite_libs.length() and have_flite_h
gstflite = library('gstflite', gstflite = library('gstflite',
flite_sources, flite_sources,
c_args : gst_plugins_bad_args, c_args : gst_plugins_bad_args,

View file

@ -1,4 +1,4 @@
fluidsynth_dep = dependency('fluidsynth', version : '>= 1.0', required : false) fluidsynth_dep = dependency('fluidsynth', version : '>= 1.0', required : get_option('fluidsynth'))
if fluidsynth_dep.found() if fluidsynth_dep.found()
gstfluidsynth = library('gstfluidsynthmidi', gstfluidsynth = library('gstfluidsynthmidi',

View file

@ -8,7 +8,7 @@ opengl_sources = [
'gstglutils.c', 'gstglutils.c',
] ]
if build_gstgl and gstgl_dep.found() if gstgl_dep.found()
optional_deps = [] optional_deps = []
opengl_defines = ['-DGST_USE_UNSTABLE_API'] # for videoaggregator opengl_defines = ['-DGST_USE_UNSTABLE_API'] # for videoaggregator

View file

@ -1,7 +1,17 @@
gsm_dep = cc.find_library('gsm', required : false) if get_option('gsm').disabled()
subdir_done()
endif
if gsm_dep.found() and (cc.has_header_symbol('gsm.h', 'gsm_create') or gsm_dep = cc.find_library('gsm', required : get_option('gsm'))
cc.has_header_symbol('gsm/smg.h', 'gsm_create')) have_gsm_create = cc.has_header_symbol('gsm.h', 'gsm_create')
if not have_gsm_create
have_gsm_create = cc.has_header_symbol('gsm/smg.h', 'gsm_create')
if not have_gsm_create and get_option('gsm').enabled()
error('GSM plugin is enabled: found libgsm but no headers')
endif
endif
if gsm_dep.found() and have_gsm_create
gstgsm = library('gstgsm', gstgsm = library('gstgsm',
['gstgsm.c', 'gstgsmenc.c', 'gstgsmdec.c'], ['gstgsm.c', 'gstgsmenc.c', 'gstgsmdec.c'],
c_args : gst_plugins_bad_args, c_args : gst_plugins_bad_args,

View file

@ -10,23 +10,45 @@ hls_sources = [
hls_cargs = ['-DGST_USE_UNSTABLE_API'] hls_cargs = ['-DGST_USE_UNSTABLE_API']
# FIXME: Add an option for selecting the library, and fail if it's not found hls_crypto = get_option('hls-crypto')
hls_crypto_dep = dependency('nettle', required : false) hls_option = get_option('hls')
if hls_crypto_dep.found()
have_hls_crypto = false
if not hls_option.disabled()
if ['auto', 'nettle'].contains(hls_crypto)
hls_crypto_dep = dependency('nettle', required : false)
if hls_crypto_dep.found()
have_hls_crypto = true
hls_cargs += ['-DHAVE_NETTLE'] hls_cargs += ['-DHAVE_NETTLE']
else endif
endif
if not hls_crypto_dep.found() and ['auto', 'libgcrypt'].contains(hls_crypto)
hls_crypto_dep = cc.find_library('gcrypt', required : false) hls_crypto_dep = cc.find_library('gcrypt', required : false)
if hls_crypto_dep.found() if hls_crypto_dep.found()
have_hls_crypto = true
hls_cargs += ['-DHAVE_LIBGCRYPT'] hls_cargs += ['-DHAVE_LIBGCRYPT']
else endif
hls_crypto_dep = openssl_dep endif
if not hls_crypto_dep.found() and ['auto', 'openssl'].contains(hls_crypto)
hls_crypto_dep = dependency('openssl', required : false)
if hls_crypto_dep.found() if hls_crypto_dep.found()
have_hls_crypto = true
hls_cargs += ['-DHAVE_OPENSSL'] hls_cargs += ['-DHAVE_OPENSSL']
endif endif
endif endif
if not have_hls_crypto and hls_option.enabled()
if hls_crypto == 'auto'
error('HLS plugin enabled, but found none of nettle, libgcrypt, or openssl')
else
error('HLS plugin enabled, but crypto library "@0@" not found'.format(hls_crypto))
endif
endif
endif endif
if hls_crypto_dep.found() if have_hls_crypto
gsthls = library('gsthls', gsthls = library('gsthls',
hls_sources, hls_sources,
c_args : gst_plugins_bad_args + hls_cargs, c_args : gst_plugins_bad_args + hls_cargs,

View file

@ -1,4 +1,4 @@
dssim_dep = dependency('dssim', required : false, dssim_dep = dependency('dssim', required : get_option('iqa'),
fallback: ['dssim', 'dssim_dep']) fallback: ['dssim', 'dssim_dep'])
if dssim_dep.found() if dssim_dep.found()

View file

@ -8,9 +8,9 @@ kate_sources = [
'gstkatespu.c', 'gstkatespu.c',
] ]
kate_dep = dependency('kate', version : '>=0.1.7', required : false) kate_dep = dependency('kate', version : '>=0.1.7', required : get_option('kate'))
# Not used # Not used
#tiger_dep = dependency('tiger', version : '>=0.3.2', required : false) #tiger_dep = dependency('tiger', version : '>=0.3.2', required : get_option('kate'))
if kate_dep.found() if kate_dep.found()
gstkate = library('gstkate', gstkate = library('gstkate',

View file

@ -8,18 +8,28 @@ ladspa_sources = [
ladspa_cargs = [] ladspa_cargs = []
lrdf_dep = dependency('lrdf', required : false) if get_option('ladspa').disabled()
subdir_done()
endif
# This is an optional dep, but we make it optional only in auto mode
lrdf_dep = dependency('lrdf', required : get_option('ladspa'))
if lrdf_dep.found() if lrdf_dep.found()
ladspa_cargs = ['-DHAVE_LRDF'] ladspa_cargs = ['-DHAVE_LRDF']
endif endif
if cc.has_header('ladspa.h') have_ladspa_h = cc.has_header('ladspa.h')
if not have_ladspa_h and get_option('ladspa').enabled()
error('ladspa plugin is enabled but ladspa.h not found')
endif
if have_ladspa_h
gstladspa = library('gstladspa', gstladspa = library('gstladspa',
ladspa_sources, ladspa_sources,
c_args : gst_plugins_bad_args + ladspa_cargs, c_args : gst_plugins_bad_args + ladspa_cargs,
link_args : noseh_link_args, link_args : noseh_link_args,
include_directories : [configinc, libsinc], include_directories : [configinc, libsinc],
dependencies : [gstaudio_dep, gstbase_dep, gmodule_dep, lrdf_dep, mathlib], dependencies : [gstaudio_dep, gstbase_dep, gmodule_dep, lrdf_dep, libm],
install : true, install : true,
install_dir : plugins_install_dir, install_dir : plugins_install_dir,
) )

View file

@ -3,7 +3,7 @@ de265_sources = [
'libde265-dec.c', 'libde265-dec.c',
] ]
de265_dep = dependency('libde265', version : '>= 0.9', required : false) de265_dep = dependency('libde265', version : '>= 0.9', required : get_option('libde265'))
if de265_dep.found() if de265_dep.found()
gstde265 = library('gstde265', gstde265 = library('gstde265',

View file

@ -1,4 +1,4 @@
mms_dep = dependency('libmms', version : '>= 0.4', required : false) mms_dep = dependency('libmms', version : '>= 0.4', required : get_option('libmms'))
if mms_dep.found() if mms_dep.found()
gstmms = library('gstmms', gstmms = library('gstmms',

View file

@ -5,14 +5,14 @@ lv2_sources = [
'gstlv2utils.c', 'gstlv2utils.c',
] ]
lv2_dep = dependency('lilv-0', version : '>= 0.22', required : false) lv2_dep = dependency('lilv-0', version : '>= 0.22', required : get_option('lv2'))
if lv2_dep.found() if lv2_dep.found()
gstrsvg = library('gstlv2', gstrsvg = library('gstlv2',
lv2_sources, lv2_sources,
c_args : gst_plugins_bad_args, c_args : gst_plugins_bad_args,
link_args : noseh_link_args, link_args : noseh_link_args,
include_directories : [configinc], include_directories : [configinc],
dependencies : [gstaudio_dep, gstbase_dep, lv2_dep, mathlib], dependencies : [gstaudio_dep, gstbase_dep, lv2_dep, libm],
install : true, install : true,
install_dir : plugins_install_dir, install_dir : plugins_install_dir,
) )

View file

@ -64,8 +64,8 @@ subdir('voaacenc')
#subdir('voamrwbenc') #subdir('voamrwbenc')
subdir('vulkan') subdir('vulkan')
subdir('wayland') subdir('wayland')
subdir('webrtcdsp')
subdir('webrtc') subdir('webrtc')
subdir('webrtcdsp')
subdir('webp') subdir('webp')
subdir('x265') subdir('x265')
subdir('zbar') subdir('zbar')

View file

@ -1,14 +1,17 @@
if mjpegtools_dep.found() # mjpegtools upstream breaks API constantly and doesn't export the version in
mpeg2enc_dep = cxx.find_library('mpeg2encpp', required : false) # a header anywhere. The configure file has a lot of logic to support old
# versions, but it all seems untested and broken. Require 2.0.0. Can be changed
if mpeg2enc_dep.found() # if someone complains.
mjpegtools_dep = dependency('mjpegtools', version : '>=2.0.0', required : get_option('mpeg2enc'))
mpeg2enc_dep = cxx.find_library('mpeg2encpp', required : get_option('mpeg2enc'))
if mjpegtools_dep.found() and mpeg2enc_dep.found()
gstmpeg2enc = library('gstmpeg2enc', gstmpeg2enc = library('gstmpeg2enc',
'gstmpeg2enc.cc', 'gstmpeg2enc.cc',
'gstmpeg2encoptions.cc', 'gstmpeg2encoptions.cc',
'gstmpeg2encoder.cc', 'gstmpeg2encoder.cc',
'gstmpeg2encstreamwriter.cc', 'gstmpeg2encstreamwriter.cc',
'gstmpeg2encpicturereader.cc', 'gstmpeg2encpicturereader.cc',
cpp_args : gst_plugins_bad_args + ['-DGST_MJPEGTOOLS_API=' + mjpegtools_api], cpp_args : gst_plugins_bad_args + ['-DGST_MJPEGTOOLS_API=2000'],
link_args : noseh_link_args, link_args : noseh_link_args,
include_directories : [configinc, libsinc], include_directories : [configinc, libsinc],
dependencies : [gstvideo_dep, mjpegtools_dep, mpeg2enc_dep], dependencies : [gstvideo_dep, mjpegtools_dep, mpeg2enc_dep],
@ -16,5 +19,4 @@ if mjpegtools_dep.found()
install_dir : plugins_install_dir, install_dir : plugins_install_dir,
) )
pkgconfig.generate(gstmpeg2enc, install_dir : plugins_pkgconfig_install_dir) pkgconfig.generate(gstmpeg2enc, install_dir : plugins_pkgconfig_install_dir)
endif
endif endif

View file

@ -1,13 +1,14 @@
if mjpegtools_dep.found() # See: ext/mpeg2enc for note about mjpegtools dep
mplex2_dep = cxx.find_library('mplex2', required : false) mjpegtools_dep = dependency('mjpegtools', version : '>=2.0.0', required : get_option('mplex'))
mplex2_dep = cxx.find_library('mplex2', required : get_option('mplex'))
if mplex2_dep.found() if mjpegtools_dep.found() and mplex2_dep.found()
gstmplex2 = library('gstmplex', gstmplex2 = library('gstmplex',
'gstmplex.cc', 'gstmplex.cc',
'gstmplexibitstream.cc', 'gstmplexibitstream.cc',
'gstmplexjob.cc', 'gstmplexjob.cc',
'gstmplexoutputstream.cc', 'gstmplexoutputstream.cc',
cpp_args : gst_plugins_bad_args + ['-DGST_MJPEGTOOLS_API=' + mjpegtools_api], cpp_args : gst_plugins_bad_args + ['-DGST_MJPEGTOOLS_API=2000'],
link_args : noseh_link_args, link_args : noseh_link_args,
include_directories : [configinc, libsinc], include_directories : [configinc, libsinc],
dependencies : [gstaudio_dep, mjpegtools_dep, mplex2_dep], dependencies : [gstaudio_dep, mjpegtools_dep, mplex2_dep],
@ -15,5 +16,4 @@ if mjpegtools_dep.found()
install_dir : plugins_install_dir, install_dir : plugins_install_dir,
) )
pkgconfig.generate(gstmplex2, install_dir : plugins_pkgconfig_install_dir) pkgconfig.generate(gstmplex2, install_dir : plugins_pkgconfig_install_dir)
endif
endif endif

View file

@ -4,10 +4,10 @@ openh264_sources = [
'gstopenh264plugin.c', 'gstopenh264plugin.c',
] ]
openh264_dep = dependency('openh264', version : '>= 1.3.0', required : false, openh264_dep = dependency('openh264', version : '>= 1.3.0',
required : get_option('openh264'),
fallback: ['openh264', 'openh264_dep']) fallback: ['openh264', 'openh264_dep'])
# FIXME: check if C++ compiler is available via new add_languages() semantics in meson git (~v30)
if openh264_dep.found() if openh264_dep.found()
gstopenh264 = library('gstopenh264', gstopenh264 = library('gstopenh264',
openh264_sources, openh264_sources,

View file

@ -6,12 +6,19 @@ openjpeg_sources = [
openjpeg_cargs = [] openjpeg_cargs = []
if get_option('openjpeg').disabled()
subdir_done()
endif
openjpeg_dep = dependency('libopenjp2', version : '>=2.1', required : false) openjpeg_dep = dependency('libopenjp2', version : '>=2.1', required : false)
if not openjpeg_dep.found() if not openjpeg_dep.found()
# Fallback to v1.5 # Fallback to v1.5
openjpeg_dep = dependency('libopenjpeg1', required : false) openjpeg_dep = dependency('libopenjpeg1', required : false)
openjpeg_cargs += ['-DHAVE_OPENJPEG_1'] openjpeg_cargs += ['-DHAVE_OPENJPEG_1']
endif endif
if not openjpeg_dep.found() and get_option('openjpeg').enabled()
error('openjpeg plugin enabled, but neither libopenjp2 nor libopenjpeg1 not found')
endif
if openjpeg_dep.found() if openjpeg_dep.found()
gstopenjpeg = library('gstopenjpeg', gstopenjpeg = library('gstopenjpeg',

View file

@ -4,7 +4,7 @@ opus_sources = [
'gstopusparse.c', 'gstopusparse.c',
] ]
opus_dep = dependency('opus', version : '>= 0.9.4', required : false) opus_dep = dependency('opus', version : '>= 0.9.4', required : get_option('opus'))
if opus_dep.found() if opus_dep.found()
gstopus = library('gstopusparse', gstopus = library('gstopusparse',

View file

@ -10,8 +10,8 @@ resindvd_sources = [
'rsnparsetter.c', 'rsnparsetter.c',
] ]
dvdnav_dep = dependency('dvdnav', version : '>= 4.1.2', required : false) dvdnav_dep = dependency('dvdnav', version : '>= 4.1.2', required : get_option('resindvd'))
dvdread_dep = dependency('dvdread', version : '>= 4.1.2', required : false) dvdread_dep = dependency('dvdread', version : '>= 4.1.2', required : get_option('resindvd'))
if dvdnav_dep.found() and dvdread_dep.found() if dvdnav_dep.found() and dvdread_dep.found()
gstresindvd = library('gstresindvd', gstresindvd = library('gstresindvd',

View file

@ -4,7 +4,7 @@ rsvg_sources = [
'gstrsvgoverlay.c', 'gstrsvgoverlay.c',
] ]
rsvg_dep = dependency('librsvg-2.0', version : '>= 2.36.2', required : false) rsvg_dep = dependency('librsvg-2.0', version : '>= 2.36.2', required : get_option('rsvg'))
if rsvg_dep.found() if rsvg_dep.found()
gstrsvg = library('gstrsvg', gstrsvg = library('gstrsvg',
rsvg_sources, rsvg_sources,

View file

@ -4,7 +4,7 @@ rtmp_sources = [
'gstrtmpsrc.c', 'gstrtmpsrc.c',
] ]
rtmp_dep = dependency('librtmp', required : false) rtmp_dep = dependency('librtmp', required : get_option('rtmp'))
if rtmp_dep.found() if rtmp_dep.found()
gstrtmp = library('gstrtmp', gstrtmp = library('gstrtmp',

View file

@ -4,7 +4,7 @@ sbc_sources = [
'gstsbcenc.c', 'gstsbcenc.c',
] ]
sbc_dep = dependency('sbc', version : '>= 1.0', required : false) sbc_dep = dependency('sbc', version : '>= 1.0', required : get_option('sbc'))
if sbc_dep.found() if sbc_dep.found()
gstsbc = library('gstsbc', gstsbc = library('gstsbc',

View file

@ -5,7 +5,7 @@ smoothstreaming_sources = [
'gstsmoothstreaming-plugin.c', 'gstsmoothstreaming-plugin.c',
] ]
xml28_dep = dependency('libxml-2.0', version : '>= 2.8', required : false) xml28_dep = dependency('libxml-2.0', version : '>= 2.8', required : get_option('smoothstreaming'))
if xml28_dep.found() if xml28_dep.found()
gstmss = library('gstsmoothstreaming', gstmss = library('gstsmoothstreaming',

View file

@ -5,6 +5,9 @@ soundtouch_sources = [
] ]
soundtouch_cargs = ['-DHAVE_SOUNDTOUCH'] soundtouch_cargs = ['-DHAVE_SOUNDTOUCH']
if get_option('soundtouch').disabled()
subdir_done()
endif
soundtouch_dep = dependency('soundtouch', required : false) soundtouch_dep = dependency('soundtouch', required : false)
if soundtouch_dep.found() if soundtouch_dep.found()
@ -19,6 +22,9 @@ else
# Add them back once we know which distros use them. # Add them back once we know which distros use them.
endif endif
endif endif
if not soundtouch_dep.found() and get_option('soundtouch').enabled()
error('soundtouch plugin enabled but soundtouch library not found')
endif
if soundtouch_dep.found() if soundtouch_dep.found()
gstsoundtouch = library('gstsoundtouch', gstsoundtouch = library('gstsoundtouch',

View file

@ -8,7 +8,7 @@ spandsp_sources = [
'gsttonegeneratesrc.h', 'gsttonegeneratesrc.h',
] ]
spandsp_dep = dependency('spandsp', version : '>= 0.0.6', required : false) spandsp_dep = dependency('spandsp', version : '>= 0.0.6', required : get_option('spandsp'))
if spandsp_dep.found() if spandsp_dep.found()
gstspandsp = library('gstspandsp', gstspandsp = library('gstspandsp',

View file

@ -7,12 +7,18 @@ srt_sources = [
'gstsrtclientsink.c', 'gstsrtclientsink.c',
'gstsrtserversink.c', 'gstsrtserversink.c',
] ]
srt_option = get_option('srt')
if srt_option.disabled()
subdir_done()
endif
srt_dep = dependency('srt', required : false) srt_dep = dependency('srt', required : false)
if not srt_dep.found() and cc.has_header_symbol('srt/srt.h', 'srt_startup') if not srt_dep.found() and cc.has_header_symbol('srt/srt.h', 'srt_startup')
srt_dep = cc.find_library('srt', required : false) srt_dep = cc.find_library('srt', required : false)
endif endif
if not srt_dep.found() and srt_option.enabled()
error('srt plugin enabled, but srt library not found')
endif
if srt_dep.found() if srt_dep.found()
gstsrt = library('gstsrt', gstsrt = library('gstsrt',

View file

@ -5,6 +5,9 @@ srtp_sources = [
] ]
srtp_cargs = [] srtp_cargs = []
if get_option('srtp').disabled()
subdir_done()
endif
srtp_dep = dependency('libsrtp2', version : '>= 2.1.0', required : false) srtp_dep = dependency('libsrtp2', version : '>= 2.1.0', required : false)
if srtp_dep.found() if srtp_dep.found()
@ -15,6 +18,9 @@ else
srtp_dep = cc.find_library('srtp', required : false) srtp_dep = cc.find_library('srtp', required : false)
endif endif
endif endif
if not srtp_dep.found() and get_option('srtp').enabled()
error('srtp plugin enabled but libsrtp not found')
endif
if srtp_dep.found() if srtp_dep.found()
gstsrtp_enums = gnome.mkenums_simple('gstsrtp-enumtypes', gstsrtp_enums = gnome.mkenums_simple('gstsrtp-enumtypes',

View file

@ -1,9 +1,7 @@
libxml_dep = dependency('libxml-2.0', version : '>= 2.9.2', required : false) libxml_dep = dependency('libxml-2.0', version : '>= 2.9.2', required : get_option('ttml'))
pango_dep = dependency('pango', required : false) pango_dep = dependency('pango', required : get_option('ttml'))
cairo_dep = dependency('cairo', required : false) cairo_dep = dependency('cairo', required : get_option('ttml'))
pangocairo_dep = dependency('pangocairo', required : false) pangocairo_dep = dependency('pangocairo', required : get_option('ttml'))
cc = meson.get_compiler('c')
m_dep = cc.find_library('m', required : false)
if libxml_dep.found() and pango_dep.found() and cairo_dep.found() and pangocairo_dep.found() if libxml_dep.found() and pango_dep.found() and cairo_dep.found() and pangocairo_dep.found()
gstttmlsubs = library('gstttmlsubs', gstttmlsubs = library('gstttmlsubs',
@ -15,7 +13,7 @@ if libxml_dep.found() and pango_dep.found() and cairo_dep.found() and pangocairo
'gstttmlplugin.c'], 'gstttmlplugin.c'],
c_args : gst_plugins_bad_args, c_args : gst_plugins_bad_args,
include_directories : [configinc], include_directories : [configinc],
dependencies : [gstvideo_dep, libxml_dep, pango_dep, cairo_dep, pangocairo_dep, m_dep], dependencies : [gstvideo_dep, libxml_dep, pango_dep, cairo_dep, pangocairo_dep, libm],
install : true, install : true,
install_dir : plugins_install_dir, install_dir : plugins_install_dir,
) )

View file

@ -1,6 +1,6 @@
voaac_sources = ['gstvoaac.c', 'gstvoaacenc.c'] voaac_sources = ['gstvoaac.c', 'gstvoaacenc.c']
voaac_dep = dependency('vo-aacenc', required : false) voaac_dep = dependency('vo-aacenc', required : get_option('voaacenc'))
if voaac_dep.found() if voaac_dep.found()
gstbz2 = library('gstvoaacenc', gstbz2 = library('gstvoaacenc',

View file

@ -20,15 +20,22 @@ vulkan_sources = [
vulkan_defines = [] vulkan_defines = []
optional_deps = [] optional_deps = []
if get_option('vulkan').disabled()
subdir_done()
endif
vulkan_dep = cc.find_library('vulkan', required : false) vulkan_dep = cc.find_library('vulkan', required : get_option('vulkan'))
has_vulkan_header = cc.has_header('vulkan/vulkan.h') has_vulkan_header = cc.has_header('vulkan/vulkan.h')
if not has_vulkan_header and get_option('vulkan').enabled()
error('vulkan plugin enabled, but vulkan.h not found')
endif
if vulkan_dep.found() and has_vulkan_header if vulkan_dep.found() and has_vulkan_header
have_vulkan_windowing = false have_vulkan_windowing = false
vkconf = configuration_data() vkconf = configuration_data()
xcb_dep = dependency('xcb', version : '>=1.10', required : false) xcb_dep = dependency('xcb', version : '>=1.10', required : get_option('x11'))
if xcb_dep.found() if xcb_dep.found()
vulkan_sources += [ vulkan_sources += [
'xcb/vkdisplay_xcb.c', 'xcb/vkdisplay_xcb.c',
@ -41,7 +48,7 @@ if vulkan_dep.found() and has_vulkan_header
vkconf.set10('GST_VULKAN_HAVE_WINDOW_XCB', 1) vkconf.set10('GST_VULKAN_HAVE_WINDOW_XCB', 1)
endif endif
wayland_client_dep = dependency('wayland-client', version : '>=1.4', required : false) wayland_client_dep = dependency('wayland-client', version : '>=1.4', required : get_option('wayland'))
if wayland_client_dep.found() if wayland_client_dep.found()
vulkan_sources += [ vulkan_sources += [
'wayland/vkdisplay_wayland.c', 'wayland/vkdisplay_wayland.c',

View file

@ -4,7 +4,7 @@ webp_sources = [
'gstwebpenc.c', 'gstwebpenc.c',
] ]
webp_dep = dependency('libwebp', version : '>= 0.2.1', required : false) webp_dep = dependency('libwebp', version : '>= 0.2.1', required : get_option('webp'))
if webp_dep.found() if webp_dep.found()
gstwebp = library('gstwebp', gstwebp = library('gstwebp',

View file

@ -13,7 +13,7 @@ webrtc_sources = [
'webrtctransceiver.c', 'webrtctransceiver.c',
] ]
libnice_dep = dependency('nice', version : '>=0.1.14', required : false, libnice_dep = dependency('nice', version : '>=0.1.14', required : get_option('webrtc'),
fallback : ['libnice', 'libnice_dep'], fallback : ['libnice', 'libnice_dep'],
default_options: ['tests=false']) default_options: ['tests=false'])

View file

@ -3,7 +3,8 @@ webrtc_sources = [
'gstwebrtcechoprobe.cpp' 'gstwebrtcechoprobe.cpp'
] ]
webrtc_dep = dependency('webrtc-audio-processing', version : ['>= 0.2', '< 0.4'], required : false) webrtc_dep = dependency('webrtc-audio-processing', version : ['>= 0.2', '< 0.4'],
required : get_option('webrtcdsp'))
if webrtc_dep.found() if webrtc_dep.found()
gstwebrtcdsp = library('gstwebrtcdsp', gstwebrtcdsp = library('gstwebrtcdsp',

View file

@ -1,4 +1,4 @@
x265_dep = dependency('x265', required: false) x265_dep = dependency('x265', required: get_option('x265'))
if x265_dep.found() if x265_dep.found()
gstx265 = library('gstx265', gstx265 = library('gstx265',
'gstx265enc.c', 'gstx265enc.c',

View file

@ -1,4 +1,4 @@
zbar_dep = dependency('zbar', version : '>= 0.9', required : false) zbar_dep = dependency('zbar', version : '>= 0.9', required : get_option('zbar'))
if zbar_dep.found() if zbar_dep.found()
gstzbar = library('gstzbar', gstzbar = library('gstzbar',
'gstzbar.c', 'gstzbar.c',

View file

@ -8,9 +8,8 @@ opencv_headers = [
'gstopencvutils.h', 'gstopencvutils.h',
'gstopencvvideofilter.h', 'gstopencvvideofilter.h',
] ]
install_headers(opencv_headers, subdir : 'gstreamer-1.0/gst/opencv')
opencv_dep = dependency('opencv', version : '>= 2.3.0', required : false) opencv_dep = dependency('opencv', version : '>= 2.3.0', required : get_option('opencv'))
if opencv_dep.found() if opencv_dep.found()
gstopencv = library('gstopencv-' + api_version, gstopencv = library('gstopencv-' + api_version,
opencv_sources, opencv_sources,
@ -25,4 +24,6 @@ if opencv_dep.found()
gstopencv_dep = declare_dependency(link_with: gstopencv, gstopencv_dep = declare_dependency(link_with: gstopencv,
include_directories : [libsinc], include_directories : [libsinc],
dependencies : [gstvideo_dep, opencv_dep]) dependencies : [gstvideo_dep, opencv_dep])
install_headers(opencv_headers, subdir : 'gstreamer-1.0/gst/opencv')
endif endif

View file

@ -1,9 +1,9 @@
wl_req = '>= 1.4' wl_req = '>= 1.4'
wl_client_dep = dependency('wayland-client', version: wl_req, required: false) wl_client_dep = dependency('wayland-client', version: wl_req, required: get_option('wayland'))
libdrm_dep = dependency('libdrm', version: '>= 2.4.55', required: false) libdrm_dep = dependency('libdrm', version: '>= 2.4.55', required: get_option('wayland'))
wl_protocol_dep = dependency('wayland-protocols', version: wl_req, wl_protocol_dep = dependency('wayland-protocols', version: wl_req, required: get_option('wayland'))
required: false) wl_scanner = find_program('wayland-scanner', required: get_option('wayland'))
wl_scanner = find_program('wayland-scanner', required: false) # Also used in ext/wayland
use_wayland = wl_protocol_dep.found() and wl_client_dep.found() and wl_scanner.found() and libdrm_dep.found() use_wayland = wl_protocol_dep.found() and wl_client_dep.found() and wl_scanner.found() and libdrm_dep.found()
if use_wayland if use_wayland

View file

@ -12,7 +12,7 @@ gstmpegtsdemux = library('gstmpegtsdemux',
c_args : gst_plugins_bad_args + ['-DGST_USE_UNSTABLE_API'], c_args : gst_plugins_bad_args + ['-DGST_USE_UNSTABLE_API'],
include_directories : [configinc, libsinc], include_directories : [configinc, libsinc],
dependencies : [gstcodecparsers_dep, gstmpegts_dep, gsttag_dep, dependencies : [gstcodecparsers_dep, gstmpegts_dep, gsttag_dep,
gstpbutils_dep, gstaudio_dep, gstbase_dep, mathlib], gstpbutils_dep, gstaudio_dep, gstbase_dep, libm],
install : true, install : true,
install_dir : plugins_install_dir, install_dir : plugins_install_dir,
) )

View file

@ -387,11 +387,9 @@ endif
# GStreamer OpenGL # GStreamer OpenGL
gstgl_dep = dependency('gstreamer-gl-1.0', version : gst_req, gstgl_dep = dependency('gstreamer-gl-1.0', version : gst_req,
fallback : ['gst-plugins-base', 'gstgl_dep'], required: false) fallback : ['gst-plugins-base', 'gstgl_dep'], required: get_option('gl'))
build_gstgl = gstgl_dep.found() # FIXME: add option? if gstgl_dep.found()
if build_gstgl
if gstgl_dep.type_name() == 'pkgconfig' if gstgl_dep.type_name() == 'pkgconfig'
gst_gl_apis = gstgl_dep.get_pkgconfig_variable('gl_apis').split() gst_gl_apis = gstgl_dep.get_pkgconfig_variable('gl_apis').split()
gst_gl_winsys = gstgl_dep.get_pkgconfig_variable('gl_winsys').split() gst_gl_winsys = gstgl_dep.get_pkgconfig_variable('gl_winsys').split()
@ -421,34 +419,17 @@ if build_gstgl
endif endif
libm = cc.find_library('m', required : false) libm = cc.find_library('m', required : false)
glib_dep = dependency('glib-2.0', version : glib_req, glib_dep = dependency('glib-2.0', version : glib_req, fallback: ['glib', 'libglib_dep'])
fallback: ['glib', 'libglib_dep']) gmodule_dep = dependency('gmodule-2.0', fallback: ['glib', 'libgmodule_dep'])
gmodule_dep = dependency('gmodule-2.0', gio_dep = dependency('gio-2.0', fallback: ['glib', 'libgio_dep'])
fallback: ['glib', 'libgmodule_dep']) # gio-unix-2.0 is used by sys/bluez
gio_dep = dependency('gio-2.0',
fallback: ['glib', 'libgio_dep'])
x11_dep = dependency('x11', required : false)
# Used by dtls and hls
openssl_dep = dependency('openssl', version : '>= 1.0.1', required : false)
# Used by mpeg2enc and mplex
# mjpegtools upstream breaks API constantly and doesn't export the version in
# a header anywhere. The configure file has a lot of logic to support old
# versions, but it all seems untested and broken. Require 2.0.0. Can be changed
# if someone complains.
mjpegtools_dep = dependency('mjpegtools', version : '>=2.0.0', required : false)
mjpegtools_api = '0'
if mjpegtools_dep.found()
mjpegtools_api = '20000'
endif
# Optional dep of ext/gl and gst/librfb
x11_dep = dependency('x11', required : get_option('x11'))
if x11_dep.found() if x11_dep.found()
cdata.set('HAVE_X11', 1) cdata.set('HAVE_X11', 1)
endif endif
mathlib = cc.find_library('m', required : false)
if host_machine.system() == 'windows' if host_machine.system() == 'windows'
winsock2 = [cc.find_library('ws2_32')] winsock2 = [cc.find_library('ws2_32')]
else else

View file

@ -65,6 +65,78 @@ option('vmnc', type : 'feature', value : 'auto')
option('y4m', type : 'feature', value : 'auto') option('y4m', type : 'feature', value : 'auto')
option('yadif', type : 'feature', value : 'auto') option('yadif', type : 'feature', value : 'auto')
# Feature options for libraries that need external deps
option('opencv', type : 'feature', value : 'auto', description : 'OpenCV computer vision library support')
# Feature options for optional deps in plugins
option('wayland', type : 'feature', value : 'auto', description : 'Wayland plugin/library, support in the Vulkan plugin')
option('x11', type : 'feature', value : 'auto', description : 'X11 support in Vulkan, GL and rfb plugins')
# Feature options for plugins that need external deps
option('aom', type : 'feature', value : 'auto', description : 'AOM AV1 video codec plugin')
option('assrender', type : 'feature', value : 'auto', description : 'ASS/SSA subtitle renderer plugin')
option('bluez', type : 'feature', value : 'auto', description : 'Bluetooth audio A2DP/AVDTP sink, AVDTP source plugin')
option('bs2b', type : 'feature', value : 'auto', description : 'Bauer stereophonic-to-binaural audio plugin')
option('bz2', type : 'feature', value : 'auto', description : 'bz2 stream encoder and decoder plugin')
option('chromaprint', type : 'feature', value : 'auto', description : 'Chromaprint fingerprint audio plugin')
option('closedcaption', type : 'feature', value : 'auto', description : 'Closed caption extractor, decoder, and overlay plugin')
option('curl', type : 'feature', value : 'auto', description : 'cURL network source and sink plugin')
option('d3dvideosink', type : 'feature', value : 'auto', description : 'Direct3D video sink plugin')
option('dash', type : 'feature', value : 'auto', description : 'DASH demuxer plugin')
option('decklink', type : 'feature', value : 'auto', description : 'DeckLink audio/video source/sink plugin')
option('directfb', type : 'feature', value : 'auto', description : 'DirectFB video sink plugin')
option('directsound', type : 'feature', value : 'auto', description : 'Directsound audio source plugin')
option('dtls', type : 'feature', value : 'auto', description : 'DTLS encoder and decoder plugin')
option('dts', type : 'feature', value : 'auto', description : 'DTS audio decoder plugin')
option('dvb', type : 'feature', value : 'auto', description : 'DVB video bin and source plugin')
option('faac', type : 'feature', value : 'auto', description : 'Free AAC audio encoder plugin')
option('faad', type : 'feature', value : 'auto', description : 'Free AAC audio decoder plugin')
option('fbdev', type : 'feature', value : 'auto', description : 'Framebuffer video sink plugin')
option('fdkaac', type : 'feature', value : 'auto', description : 'Fraunhofer AAC audio codec plugin')
option('flite', type : 'feature', value : 'auto', description : 'Flite speech synthesizer source plugin')
option('fluidsynth', type : 'feature', value : 'auto', description : 'Fluidsynth MIDI decoder plugin')
option('gl', type : 'feature', value : 'auto', description : 'GStreamer OpenGL mixer plugin')
option('gsm', type : 'feature', value : 'auto', description : 'GSM encoder/decoder plugin')
option('ipcpipeline', type : 'feature', value : 'auto', description : 'Inter-process communication plugin')
option('iqa', type : 'feature', value : 'auto', description : 'Image quality assessment plugin')
option('kate', type : 'feature', value : 'auto', description : 'Kate subtitle parser, tagger, and codec plugin')
option('kms', type : 'feature', value : 'auto', description : 'KMS video sink plugin')
option('ladspa', type : 'feature', value : 'auto', description : 'LADSPA plugin bridge')
option('libde265', type : 'feature', value : 'auto', description : 'HEVC/H.265 video decoder plugin')
option('libmms', type : 'feature', value : 'auto', description : 'Microsoft multimedia server network source plugin')
option('lv2', type : 'feature', value : 'auto', description : 'LV2 audio plugin bridge')
option('mpeg2enc', type : 'feature', value : 'auto', description : 'mpeg2enc video encoder plugin')
option('mplex', type : 'feature', value : 'auto', description : 'mplex audio/video multiplexer plugin')
option('openh264', type : 'feature', value : 'auto', description : 'H.264 video codec plugin')
option('openjpeg', type : 'feature', value : 'auto', description : 'JPEG2000 image codec plugin')
option('opus', type : 'feature', value : 'auto', description : 'OPUS audio parser plugin')
option('resindvd', type : 'feature', value : 'auto', description : 'Resin DVD playback plugin')
option('rsvg', type : 'feature', value : 'auto', description : 'SVG overlayer and image decoder plugin')
option('rtmp', type : 'feature', value : 'auto', description : 'RTMP video network source and sink plugin')
option('sbc', type : 'feature', value : 'auto', description : 'SBC bluetooth audio codec plugin')
option('shm', type : 'feature', value : 'auto', description : 'Shared memory source/sink plugin')
option('smoothstreaming', type : 'feature', value : 'auto', description : 'Microsoft Smooth Streaming demuxer plugin')
option('soundtouch', type : 'feature', value : 'auto', description : 'Audio pitch controller & BPM detection plugin')
option('spandsp', type : 'feature', value : 'auto', description : 'Packet loss concealment audio plugin')
option('srt', type : 'feature', value : 'auto', description : 'Secure, Reliable, Transport client/server network source/sink plugin')
option('srtp', type : 'feature', value : 'auto', description : 'Secure RTP codec plugin')
option('ttml', type : 'feature', value : 'auto', description : 'TTML subtitle parser and renderer plugin')
option('uvch264', type : 'feature', value : 'auto', description : 'UVC compliant H.264 camera source plugin')
option('voaacenc', type : 'feature', value : 'auto', description : 'AAC audio encoder plugin')
option('vulkan', type : 'feature', value : 'auto', description : 'Vulkan video sink plugin')
option('wasapi', type : 'feature', value : 'auto', description : 'Windows Audio Session API source/sink plugin')
option('webp', type : 'feature', value : 'auto', description : 'WebP image codec plugin')
option('webrtc', type : 'feature', value : 'auto', description : 'WebRTC audio/video network bin plugin')
option('webrtcdsp', type : 'feature', value : 'auto', description : 'Plugin with various audio filters provided by the WebRTC audio processing library')
option('winscreencap', type : 'feature', value : 'auto', description : 'Windows Screen Capture video source plugin')
option('x265', type : 'feature', value : 'auto', description : 'HEVC/H.265 video encoder plugin')
option('zbar', type : 'feature', value : 'auto', description : 'Barcode image scanner plugin')
# HLS plugin options
option('hls', type : 'feature', value : 'auto', description : 'HTTP Live Streaming plugin')
option('hls-crypto', type : 'combo', value : 'auto', choices : ['auto', 'nettle', 'libgcrypt', 'openssl'],
description: 'Crypto library to use for HLS plugin')
# Common feature options # Common feature options
option('examples', type : 'feature', value : 'auto', yield : true) option('examples', type : 'feature', value : 'auto', yield : true)
option('introspection', type : 'feature', value : 'auto', yield : true, description : 'Generate gobject-introspection bindings') option('introspection', type : 'feature', value : 'auto', yield : true, description : 'Generate gobject-introspection bindings')

View file

@ -7,21 +7,16 @@ bluez_sources = [
'gstavrcputil.c', 'gstavrcputil.c',
] ]
bluez_dep = dependency('bluez', version : '>= 5.0', required : false) bluez_dep = dependency('bluez', version : '>= 5.0', required : get_option('bluez'))
gio_unix_dep = dependency('gio-unix-2.0', version : glib_req, required : false) gio_unix_dep = dependency('gio-unix-2.0', version : glib_req,
fallback: ['glib', 'libgiounix_dep'],
required : get_option('bluez'))
if bluez_dep.found() and gio_unix_dep.found() if bluez_dep.found() and gio_unix_dep.found()
# FIXME: do we really need the meson.current_build_dir() here? Shouldn't bluez_ch = gnome.gdbus_codegen('bluez-interface',
# the custom command be executed with the current build directoy as working sources : 'org.bluez.xml',
# directory? Without this, bluez.[ch] are created in the top-level build dir! interface_prefix : 'org.bluez',
bluez_ch = custom_target('bluez_ch', namespace : 'Bluez')
output : [ 'bluez.h', 'bluez.c' ] ,
input : 'org.bluez.xml',
command : [ find_program('gdbus-codegen'),
'--c-namespace=Bluez',
'--generate-c-code=' + meson.current_build_dir() + '/bluez',
'--interface-prefix=org.bluez',
'@INPUT@' ])
gstbluez = library('gstbluez', gstbluez = library('gstbluez',
bluez_sources, bluez_ch, bluez_sources, bluez_ch,

View file

@ -3,14 +3,23 @@ d3dvideosink_sources = [
'd3dvideosink.c', 'd3dvideosink.c',
] ]
if host_system == 'windows' and cc.has_header('d3d9.h') if host_system != 'windows' or get_option('d3dvideosink').disabled()
d3dvideosink_dep = [cc.find_library('d3d9'), cc.find_library('gdi32')] subdir_done()
endif
d3d_dep = cc.find_library('d3d9', required : get_option('d3dvideosink'))
gdi_dep = cc.find_library('gdi32', required : get_option('d3dvideosink'))
have_d3d9_h = cc.has_header('d3d9.h')
if not have_d3d9_h and get_option('d3dvideosink').enabled()
error('d3dvideosink plugin enabled but d3d9.h not found')
endif
if d3d_dep.found() and gdi_dep.found() and have_d3d9_h
gstd3dvideosink = library('gstd3d', gstd3dvideosink = library('gstd3d',
d3dvideosink_sources, d3dvideosink_sources,
c_args : gst_plugins_bad_args, c_args : gst_plugins_bad_args,
include_directories : [configinc], include_directories : [configinc],
dependencies : [gstvideo_dep] + d3dvideosink_dep, dependencies : [gstvideo_dep, d3d_dep, gdi_dep],
install : true, install : true,
install_dir : plugins_install_dir) install_dir : plugins_install_dir)
pkgconfig.generate(gstd3dvideosink, install_dir : plugins_pkgconfig_install_dir) pkgconfig.generate(gstd3dvideosink, install_dir : plugins_pkgconfig_install_dir)

View file

@ -6,15 +6,19 @@ decklink_sources = [
'gstdecklinkvideosrc.cpp', 'gstdecklinkvideosrc.cpp',
] ]
if get_option('decklink').disabled()
subdir_done()
endif
build_decklink = false build_decklink = false
decklink_ldflags = [] decklink_ldflags = []
decklink_libs = [] decklink_libs = []
if host_machine.system() == 'windows' if host_system == 'windows'
decklink_sources += ['win/DeckLinkAPIDispatch.cpp', 'win/DeckLinkAPI_i.c'] decklink_sources += ['win/DeckLinkAPIDispatch.cpp', 'win/DeckLinkAPI_i.c']
if cxx.get_id() == 'msvc' if cxx.get_id() == 'msvc'
# FIXME: Use commsuppwd.lib for debug builds? # FIXME: Use commsuppwd.lib for debug builds?
comutil_dep = cxx.find_library('comsuppw') comutil_dep = cxx.find_library('comsuppw', required : get_option('decklink'))
if comutil_dep.found() if comutil_dep.found()
build_decklink = true build_decklink = true
decklink_libs = [comutil_dep] decklink_libs = [comutil_dep]
@ -23,7 +27,7 @@ if host_machine.system() == 'windows'
build_decklink = true build_decklink = true
endif endif
else else
libdl = cc.find_library('dl', required: false) libdl = cc.find_library('dl', required: get_option('decklink'))
have_pthread_h = cdata.has('HAVE_PTHREAD_H') have_pthread_h = cdata.has('HAVE_PTHREAD_H')
if libdl.found() and have_pthread_h if libdl.found() and have_pthread_h
decklink_libs = [libm, libdl, dependency('threads')] decklink_libs = [libm, libdl, dependency('threads')]

View file

@ -12,14 +12,24 @@ directsoundsrc_device_flags = [
'-DGST_DIRECTSOUND_SRC_DEVICE_PROVIDER=1' '-DGST_DIRECTSOUND_SRC_DEVICE_PROVIDER=1'
] ]
if host_system == 'windows' and cc.has_header('dsound.h') if host_system != 'windows' or get_option('directsound').disabled()
directsoundsrc_dep = [cc.find_library('dsound'), cc.find_library('winmm'), cc.find_library('ole32')] subdir_done()
endif
dsound_dep = cc.find_library('dsound', required : get_option('directsound'))
winmm_dep = cc.find_library('winmm', required : get_option('directsound'))
ole32_dep = cc.find_library('ole32', required : get_option('directsound'))
have_dsound_h = cc.has_header('dsound.h')
if not have_dsound_h and get_option('directsound').enabled()
error('directsound plugin enabled but dsound.h not found')
endif
if dsound_dep.found() and winmm_dep.found() and ole32_dep.found() and have_dsound_h
gstdirectsoundsrc = library('gstdirectsoundsrc', gstdirectsoundsrc = library('gstdirectsoundsrc',
directsoundsrc_sources, directsoundsrc_sources,
c_args : gst_plugins_bad_args + directsoundsrc_device_flags, c_args : gst_plugins_bad_args + directsoundsrc_device_flags,
include_directories : [configinc], include_directories : [configinc],
dependencies : [gstaudio_dep] + directsoundsrc_dep, dependencies : [gstaudio_dep, dsound_dep, winmm_dep, ole32_dep],
install : true, install : true,
install_dir : plugins_install_dir) install_dir : plugins_install_dir)
pkgconfig.generate(gstdirectsoundsrc, install_dir : plugins_pkgconfig_install_dir) pkgconfig.generate(gstdirectsoundsrc, install_dir : plugins_pkgconfig_install_dir)

View file

@ -15,18 +15,22 @@ dvb_sources = [
'parsechannels.c', 'parsechannels.c',
] ]
dvb_check_code_lines = [ if get_option('dvb').disabled()
'#include <linux/dvb/version.h>\n\n', subdir_done()
'#if DVB_API_VERSION < 5 || (DVB_API_VERSION == 5 && DVB_API_VERSION_MINOR <= 4)\n\n', endif
'#error "Incompatible dvb API"\n\n',
'#endif',
]
dvb_check_code=''
foreach l : dvb_check_code_lines
dvb_check_code = dvb_check_code + l
endforeach
if cc.compiles(dvb_check_code) dvb_check_code = '''
#include <linux/dvb/version.h>
#if DVB_API_VERSION < 5 || (DVB_API_VERSION == 5 && DVB_API_VERSION_MINOR <= 4)
#error "Incompatible dvb API"
#endif'
'''
have_dvb = cc.compiles(dvb_check_code)
if not have_dvb and get_option('dvb').enabled()
error('DVB plugin enabled but dvb headers not found')
endif
if have_dvb
gstdvb = library('gstdvb', gstdvb = library('gstdvb',
dvb_sources, dvb_sources,
c_args : gst_plugins_bad_args + [ '-DGST_USE_UNSTABLE_API' ], c_args : gst_plugins_bad_args + [ '-DGST_USE_UNSTABLE_API' ],

View file

@ -2,7 +2,16 @@ fbdevsink_sources = [
'gstfbdevsink.c', 'gstfbdevsink.c',
] ]
if cc.has_header('linux/fb.h') if get_option('fbdev').disabled()
subdir_done()
endif
have_fb_h = cc.has_header('linux/fb.h')
if not have_fb_h and get_option('fbdev').enabled()
error('fbdev plugin enabled but fb.h not found')
endif
if have_fb_h
gstfbdevsink = library('gstfbdevsink', gstfbdevsink = library('gstfbdevsink',
fbdevsink_sources, fbdevsink_sources,
c_args : gst_plugins_bad_args, c_args : gst_plugins_bad_args,

View file

@ -6,8 +6,25 @@ ipcpipeline_sources = [
'gstipcslavepipeline.c' 'gstipcslavepipeline.c'
] ]
if cc.has_header ('sys/socket.h') and cc.has_function ('pipe') and cc.has_function ('socketpair') if get_option('ipcpipeline').disabled()
subdir_done()
endif
have_socket_h = cc.has_header('sys/socket.h')
if not have_socket_h and get_option('ipcpipeline').enabled()
error('ipcpipeline plugin enabled but socket.h not found')
endif
have_pipe = cc.has_function('pipe')
if not have_pipe and get_option('ipcpipeline').enabled()
error('ipcpipeline plugin enabled but pipe() not found')
endif
have_socketpair = cc.has_function('socketpair')
if not have_socketpair and get_option('ipcpipeline').enabled()
error('ipcpipeline plugin enabled but socketpair() not found')
endif
if have_socket_h and have_pipe and have_socketpair
gstipcpipeline = library('gstipcpipeline', gstipcpipeline = library('gstipcpipeline',
ipcpipeline_sources, ipcpipeline_sources,
c_args : gst_plugins_bad_args, c_args : gst_plugins_bad_args,
@ -17,5 +34,4 @@ if cc.has_header ('sys/socket.h') and cc.has_function ('pipe') and cc.has_functi
install_dir : plugins_install_dir, install_dir : plugins_install_dir,
) )
pkgconfig.generate(gstipcpipeline, install_dir : plugins_pkgconfig_install_dir) pkgconfig.generate(gstipcpipeline, install_dir : plugins_pkgconfig_install_dir)
endif endif

View file

@ -5,8 +5,7 @@ kmssink_sources = [
'gstkmsutils.c', 'gstkmsutils.c',
] ]
libdrm_dep = dependency('libdrm', version : '>= 2.4.55', required : false) libdrm_dep = dependency('libdrm', version : '>= 2.4.55', required : get_option('kms'))
if libdrm_dep.found() if libdrm_dep.found()
gstkmssink = library('gstkms', gstkmssink = library('gstkms',
kmssink_sources, kmssink_sources,

View file

@ -30,6 +30,7 @@ else
msdk_sources += ['msdk_libva.c', 'gstmsdkallocator_libva.c'] msdk_sources += ['msdk_libva.c', 'gstmsdkallocator_libva.c']
endif endif
# FIXME: automagic
msdk_root = run_command(python3, '-c', 'import os; print(os.environ.get("INTELMEDIASDKROOT", os.environ.get("MFX_HOME", "")))').stdout().strip() msdk_root = run_command(python3, '-c', 'import os; print(os.environ.get("INTELMEDIASDKROOT", os.environ.get("MFX_HOME", "")))').stdout().strip()
have_msdk = false have_msdk = false

View file

@ -6,25 +6,35 @@ shm_sources = [
'gstshmsink.c', 'gstshmsink.c',
] ]
shm_enabled = false if get_option('shm').disabled()
subdir_done()
endif
shm_deps = [] shm_deps = []
rt_dep = cc.find_library ('rt', required: false) if ['osx', 'bsd'].contains(host_system)
rt_dep = []
if cc.has_header ('sys/socket.h') and (host_system == 'osx' or
host_system == 'bsd' or rt_dep.found())
shm_enabled = true shm_enabled = true
shm_deps = [gstbase_dep] else
rt_dep = cc.find_library ('rt', required: false)
shm_enabled = rt_dep.found()
endif
if rt_dep.found() if shm_enabled
shm_deps += [rt_dep] shm_enabled = cc.has_header('sys/socket.h')
endif elif get_option('shm').enabled()
error('shm plugin enabled but librt not found')
endif
if not shm_enabled and get_option('shm').enabled()
error('shm plugin enabled but socket.h not found')
endif
if shm_enabled
gstshm = library('gstshm', gstshm = library('gstshm',
shm_sources, shm_sources,
c_args : gst_plugins_bad_args + ['-DSHM_PIPE_USE_GLIB'], c_args : gst_plugins_bad_args + ['-DSHM_PIPE_USE_GLIB'],
include_directories : [configinc], include_directories : [configinc],
dependencies : shm_deps, dependencies : [gstbase_dep, rt_dep],
install : true, install : true,
install_dir : plugins_install_dir, install_dir : plugins_install_dir,
) )

View file

@ -5,9 +5,12 @@ uvch264_sources = [
'uvc_h264.c', 'uvc_h264.c',
] ]
libgudev_dep = dependency('gudev-1.0', required : false) libgudev_dep = dependency('gudev-1.0', required : get_option('uvch264'))
libusb_dep = dependency('libusb-1.0', required : false) libusb_dep = dependency('libusb-1.0', required : get_option('uvch264'))
has_uvcvideo_h = cc.has_header('linux/uvcvideo.h') has_uvcvideo_h = cc.has_header('linux/uvcvideo.h')
if not has_uvcvideo_h and get_option('uvch264').enabled()
error('uvch264 plugin enabled but uvcvideo.h not found')
endif
if libgudev_dep.found() and libusb_dep.found() and has_uvcvideo_h if libgudev_dep.found() and libusb_dep.found() and has_uvcvideo_h
gstuvch264 = library('gstuvch264', gstuvch264 = library('gstuvch264',

View file

@ -6,15 +6,27 @@ wasapi_sources = [
'gstwasapidevice.c', 'gstwasapidevice.c',
] ]
if host_system == 'windows' and cc.has_header('audioclient.h') if host_system != 'windows'
wasapi_dep = [cc.find_library('ole32'), cc.find_library('ksuser'), if get_option('wasapi').disabled()
cc.find_library('avrt', required : false)] subdir_done()
elif get_option('wasapi').enabled()
error('Cannot build wasapi plugin when not building for Windows')
endif
endif
ole32_dep = cc.find_library('ole32', required : get_option('wasapi'))
ksuser_dep = cc.find_library('ksuser', required : get_option('wasapi'))
have_audioclient_h = cc.has_header('audioclient.h')
if not have_audioclient_h and get_option('wasapi').enabled()
error('wasapi plugin enabled but audioclient.h not found')
endif
if ole32_dep.found() and ksuser_dep.found() and have_audioclient_h
gstwasapi = library('gstwasapi', gstwasapi = library('gstwasapi',
wasapi_sources, wasapi_sources,
c_args : gst_plugins_bad_args + ['-DCOBJMACROS'], c_args : gst_plugins_bad_args + ['-DCOBJMACROS'],
include_directories : [configinc], include_directories : [configinc],
dependencies : [gstaudio_dep] + wasapi_dep, dependencies : [gstaudio_dep, ole32_dep, ksuser_dep],
install : true, install : true,
install_dir : plugins_install_dir) install_dir : plugins_install_dir)
pkgconfig.generate(gstwasapi, install_dir : plugins_pkgconfig_install_dir) pkgconfig.generate(gstwasapi, install_dir : plugins_pkgconfig_install_dir)

View file

@ -8,9 +8,12 @@ winks_sources = [
] ]
if host_system == 'windows' if host_system == 'windows'
winks_dep = [cc.find_library('ksuser'), cc.find_library('uuid'), winks_dep = [cc.find_library('ksuser', required : get_option('winks')),
cc.find_library('strmiids'), cc.find_library('dxguid'), cc.find_library('uuid', required : get_option('winks')),
cc.find_library('setupapi'), cc.find_library('ole32')] cc.find_library('strmiids', required : get_option('winks')),
cc.find_library('dxguid', required : get_option('winks')),
cc.find_library('setupapi', required : get_option('winks')),
cc.find_library('ole32', required : get_option('winks'))]
gstwinks = library('gstwinks', gstwinks = library('gstwinks',
winks_sources, winks_sources,

View file

@ -4,14 +4,23 @@ winscreencap_sources = [
'gstwinscreencap.c', 'gstwinscreencap.c',
] ]
if host_system == 'windows' and cc.has_header('d3d9.h') if host_system != 'windows' or get_option('winscreencap').disabled()
winscreencap_dep = [cc.find_library('d3d9'), cc.find_library('gdi32')] subdir_done()
endif
d3d_dep = cc.find_library('d3d9', required : get_option('winscreencap'))
gdi_dep = cc.find_library('gdi32', required : get_option('winscreencap'))
have_d3d9_h = cc.has_header('d3d9.h')
if not have_d3d9_h and get_option('winscreencap').enabled()
error('winscreencap plugin enabled but d3d9.h not found')
endif
if d3d_dep.found() and gdi_dep.found() and have_d3d9_h
gstwinscreencap = library('gstwinscreencap', gstwinscreencap = library('gstwinscreencap',
winscreencap_sources, winscreencap_sources,
c_args : gst_plugins_bad_args, c_args : gst_plugins_bad_args,
include_directories : [configinc], include_directories : [configinc],
dependencies : [gstbase_dep, gstvideo_dep] + winscreencap_dep, dependencies : [gstbase_dep, gstvideo_dep, d3d_dep, gdi_dep],
install : true, install : true,
install_dir : plugins_install_dir, install_dir : plugins_install_dir,
) )

View file

@ -9,6 +9,7 @@ libparser = static_library('parser',
libparser_dep = declare_dependency(link_with: libparser, libparser_dep = declare_dependency(link_with: libparser,
sources: ['elements/parser.h']) sources: ['elements/parser.h'])
# FIXME: automagic
exif_dep = dependency('libexif', version : '>= 0.6.16', required : false) exif_dep = dependency('libexif', version : '>= 0.6.16', required : false)
enable_gst_player_tests = get_option('gst_player_tests') enable_gst_player_tests = get_option('gst_player_tests')