Commit b55dfb53 authored by Nirbheek Chauhan's avatar Nirbheek Chauhan

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
parent 7ef303fa
aom_dep = dependency('aom', required: false)
aom_dep = dependency('aom', required: get_option('aom'))
if aom_dep.found()
gstaom = library('gstaom',
['gstaom.c', 'gstav1enc.c', 'gstav1dec.c'],
......
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()
gstassrender = library('gstassrender',
'gstassrender.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()
gstbs2b = library('gstbs2b',
......
......@@ -4,7 +4,7 @@ bz2_sources = [
'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')
gstbz2 = library('gstbz2',
......
chromaprint_dep = dependency('libchromaprint', required : false)
chromaprint_dep = dependency('libchromaprint', required : get_option('chromaprint'))
if chromaprint_dep.found()
gstchromaprint = library('gstchromaprint',
......
pangocairo_dep = dependency('pangocairo', version : '>= 1.22.0', required : false)
pangocairo_dep = dependency('pangocairo', version : '>= 1.22.0',
required : get_option('closedcaption'))
zvbi_sources = [
'bit_slicer.c',
......
......@@ -4,7 +4,7 @@ dash_sources = [
'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()
gstsouphttpsrc = library('gstdashdemux',
dash_sources,
......
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()
gstdirectfb = library('gstdirectfb',
......
......@@ -11,7 +11,8 @@ dtls_sources = [
'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()
gstdtls = library('gstdtls',
......
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')
dca_dep = cc.find_library('dca', required : false)
# 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)
endif
if not dca_dep.found() and get_option('dts').enabled()
error('DTS plugin enabled, but libdca not found')
endif
endif
# autotools didn't use the libdca pkg-config cflags, and they
......
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.c',
c_args : gst_plugins_bad_args,
......
......@@ -2,11 +2,11 @@ faad_args = [ ]
have_faad = cc.has_header_symbol('neaacdec.h', 'NeAACDecOpen')
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)')
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
gstfaad = library('gstfaad',
......
fdkaac_dep = dependency('fdk-aac', required : false)
fdkaac_dep = dependency('fdk-aac', required : get_option('fdkaac'))
if fdkaac_dep.found()
fdkaac_defines = []
......
......@@ -10,15 +10,23 @@ flite_libs = [
'flite_cmulex'
]
if get_option('flite').disabled()
subdir_done()
endif
flite_deps = [ ]
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()
flite_deps += [flite_lib_dep]
endif
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',
flite_sources,
c_args : gst_plugins_bad_args,
......
fluidsynth_dep = dependency('fluidsynth', version : '>= 1.0', required : false)
fluidsynth_dep = dependency('fluidsynth', version : '>= 1.0', required : get_option('fluidsynth'))
if fluidsynth_dep.found()
gstfluidsynth = library('gstfluidsynthmidi',
......
......@@ -8,7 +8,7 @@ opengl_sources = [
'gstglutils.c',
]
if build_gstgl and gstgl_dep.found()
if gstgl_dep.found()
optional_deps = []
opengl_defines = ['-DGST_USE_UNSTABLE_API'] # for videoaggregator
......
gsm_dep = cc.find_library('gsm', required : false)
if get_option('gsm').disabled()
subdir_done()
endif
gsm_dep = cc.find_library('gsm', required : get_option('gsm'))
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 (cc.has_header_symbol('gsm.h', 'gsm_create') or
cc.has_header_symbol('gsm/smg.h', 'gsm_create'))
if gsm_dep.found() and have_gsm_create
gstgsm = library('gstgsm',
['gstgsm.c', 'gstgsmenc.c', 'gstgsmdec.c'],
c_args : gst_plugins_bad_args,
......
......@@ -10,23 +10,45 @@ hls_sources = [
hls_cargs = ['-DGST_USE_UNSTABLE_API']
# FIXME: Add an option for selecting the library, and fail if it's not found
hls_crypto_dep = dependency('nettle', required : false)
if hls_crypto_dep.found()
hls_cargs += ['-DHAVE_NETTLE']
else
hls_crypto_dep = cc.find_library('gcrypt', required : false)
if hls_crypto_dep.found()
hls_cargs += ['-DHAVE_LIBGCRYPT']
else
hls_crypto_dep = openssl_dep
hls_crypto = get_option('hls-crypto')
hls_option = get_option('hls')
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']
endif
endif
if not hls_crypto_dep.found() and ['auto', 'libgcrypt'].contains(hls_crypto)
hls_crypto_dep = cc.find_library('gcrypt', required : false)
if hls_crypto_dep.found()
have_hls_crypto = true
hls_cargs += ['-DHAVE_LIBGCRYPT']
endif
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()
have_hls_crypto = true
hls_cargs += ['-DHAVE_OPENSSL']
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
if hls_crypto_dep.found()
if have_hls_crypto
gsthls = library('gsthls',
hls_sources,
c_args : gst_plugins_bad_args + hls_cargs,
......
dssim_dep = dependency('dssim', required : false,
dssim_dep = dependency('dssim', required : get_option('iqa'),
fallback: ['dssim', 'dssim_dep'])
if dssim_dep.found()
......
......@@ -8,9 +8,9 @@ kate_sources = [
'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
#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()
gstkate = library('gstkate',
......
......@@ -8,18 +8,28 @@ ladspa_sources = [
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()
ladspa_cargs = ['-DHAVE_LRDF']
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',
ladspa_sources,
c_args : gst_plugins_bad_args + ladspa_cargs,
link_args : noseh_link_args,
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_dir : plugins_install_dir,
)
......
......@@ -3,7 +3,7 @@ de265_sources = [
'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()
gstde265 = library('gstde265',
......
mms_dep = dependency('libmms', version : '>= 0.4', required : false)
mms_dep = dependency('libmms', version : '>= 0.4', required : get_option('libmms'))
if mms_dep.found()
gstmms = library('gstmms',
......
......@@ -5,14 +5,14 @@ lv2_sources = [
'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()
gstrsvg = library('gstlv2',
lv2_sources,
c_args : gst_plugins_bad_args,
link_args : noseh_link_args,
include_directories : [configinc],
dependencies : [gstaudio_dep, gstbase_dep, lv2_dep, mathlib],
dependencies : [gstaudio_dep, gstbase_dep, lv2_dep, libm],
install : true,
install_dir : plugins_install_dir,
)
......
......@@ -64,8 +64,8 @@ subdir('voaacenc')
#subdir('voamrwbenc')
subdir('vulkan')
subdir('wayland')
subdir('webrtcdsp')
subdir('webrtc')
subdir('webrtcdsp')
subdir('webp')
subdir('x265')
subdir('zbar')
if mjpegtools_dep.found()
mpeg2enc_dep = cxx.find_library('mpeg2encpp', required : false)
if mpeg2enc_dep.found()
gstmpeg2enc = library('gstmpeg2enc',
'gstmpeg2enc.cc',
'gstmpeg2encoptions.cc',
'gstmpeg2encoder.cc',
'gstmpeg2encstreamwriter.cc',
'gstmpeg2encpicturereader.cc',
cpp_args : gst_plugins_bad_args + ['-DGST_MJPEGTOOLS_API=' + mjpegtools_api],
link_args : noseh_link_args,
include_directories : [configinc, libsinc],
dependencies : [gstvideo_dep, mjpegtools_dep, mpeg2enc_dep],
install : true,
install_dir : plugins_install_dir,
)
pkgconfig.generate(gstmpeg2enc, install_dir : plugins_pkgconfig_install_dir)
endif
# 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 : 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.cc',
'gstmpeg2encoptions.cc',
'gstmpeg2encoder.cc',
'gstmpeg2encstreamwriter.cc',
'gstmpeg2encpicturereader.cc',
cpp_args : gst_plugins_bad_args + ['-DGST_MJPEGTOOLS_API=2000'],
link_args : noseh_link_args,
include_directories : [configinc, libsinc],
dependencies : [gstvideo_dep, mjpegtools_dep, mpeg2enc_dep],
install : true,
install_dir : plugins_install_dir,
)
pkgconfig.generate(gstmpeg2enc, install_dir : plugins_pkgconfig_install_dir)
endif
if mjpegtools_dep.found()
mplex2_dep = cxx.find_library('mplex2', required : false)
# See: ext/mpeg2enc for note about mjpegtools dep
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()
gstmplex2 = library('gstmplex',
'gstmplex.cc',
'gstmplexibitstream.cc',
'gstmplexjob.cc',
'gstmplexoutputstream.cc',
cpp_args : gst_plugins_bad_args + ['-DGST_MJPEGTOOLS_API=' + mjpegtools_api],
link_args : noseh_link_args,
include_directories : [configinc, libsinc],
dependencies : [gstaudio_dep, mjpegtools_dep, mplex2_dep],
install : true,
install_dir : plugins_install_dir,
)
pkgconfig.generate(gstmplex2, install_dir : plugins_pkgconfig_install_dir)
endif
if mjpegtools_dep.found() and mplex2_dep.found()
gstmplex2 = library('gstmplex',
'gstmplex.cc',
'gstmplexibitstream.cc',
'gstmplexjob.cc',
'gstmplexoutputstream.cc',
cpp_args : gst_plugins_bad_args + ['-DGST_MJPEGTOOLS_API=2000'],
link_args : noseh_link_args,
include_directories : [configinc, libsinc],
dependencies : [gstaudio_dep, mjpegtools_dep, mplex2_dep],
install : true,
install_dir : plugins_install_dir,
)
pkgconfig.generate(gstmplex2, install_dir : plugins_pkgconfig_install_dir)
endif
......@@ -4,10 +4,10 @@ openh264_sources = [
'gstopenh264plugin.c',
]
openh264_dep = dependency('openh264', version : '>= 1.3.0', required : false,
fallback: ['openh264', 'openh264_dep'])
openh264_dep = dependency('openh264', version : '>= 1.3.0',
required : get_option('openh264'),
fallback: ['openh264', 'openh264_dep'])
# FIXME: check if C++ compiler is available via new add_languages() semantics in meson git (~v30)
if openh264_dep.found()
gstopenh264 = library('gstopenh264',
openh264_sources,
......
......@@ -6,12 +6,19 @@ openjpeg_sources = [
openjpeg_cargs = []
if get_option('openjpeg').disabled()
subdir_done()
endif
openjpeg_dep = dependency('libopenjp2', version : '>=2.1', required : false)
if not openjpeg_dep.found()
# Fallback to v1.5
openjpeg_dep = dependency('libopenjpeg1', required : false)
openjpeg_cargs += ['-DHAVE_OPENJPEG_1']
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()
gstopenjpeg = library('gstopenjpeg',
......
......@@ -4,7 +4,7 @@ opus_sources = [
'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()
gstopus = library('gstopusparse',
......
......@@ -10,8 +10,8 @@ resindvd_sources = [
'rsnparsetter.c',
]
dvdnav_dep = dependency('dvdnav', version : '>= 4.1.2', required : false)
dvdread_dep = dependency('dvdread', 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 : get_option('resindvd'))
if dvdnav_dep.found() and dvdread_dep.found()
gstresindvd = library('gstresindvd',
......
......@@ -4,7 +4,7 @@ rsvg_sources = [
'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()
gstrsvg = library('gstrsvg',
rsvg_sources,
......
......@@ -4,7 +4,7 @@ rtmp_sources = [
'gstrtmpsrc.c',
]
rtmp_dep = dependency('librtmp', required : false)
rtmp_dep = dependency('librtmp', required : get_option('rtmp'))
if rtmp_dep.found()
gstrtmp = library('gstrtmp',
......
......@@ -4,7 +4,7 @@ sbc_sources = [
'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()
gstsbc = library('gstsbc',
......
......@@ -5,7 +5,7 @@ smoothstreaming_sources = [
'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()
gstmss = library('gstsmoothstreaming',
......
......@@ -5,6 +5,9 @@ soundtouch_sources = [
]
soundtouch_cargs = ['-DHAVE_SOUNDTOUCH']
if get_option('soundtouch').disabled()
subdir_done()
endif
soundtouch_dep = dependency('soundtouch', required : false)
if soundtouch_dep.found()
......@@ -19,6 +22,9 @@ else
# Add them back once we know which distros use them.
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()
gstsoundtouch = library('gstsoundtouch',
......
......@@ -8,7 +8,7 @@ spandsp_sources = [
'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()
gstspandsp = library('gstspandsp',
......
......@@ -7,12 +7,18 @@ srt_sources = [
'gstsrtclientsink.c',
'gstsrtserversink.c',
]
srt_option = get_option('srt')
if srt_option.disabled()
subdir_done()
endif
srt_dep = dependency('srt', required : false)
if not srt_dep.found() and cc.has_header_symbol('srt/srt.h', 'srt_startup')
srt_dep = cc.find_library('srt', required : false)
endif
if not srt_dep.found() and srt_option.enabled()
error('srt plugin enabled, but srt library not found')
endif
if srt_dep.found()
gstsrt = library('gstsrt',
......
......@@ -5,6 +5,9 @@ srtp_sources = [
]
srtp_cargs = []
if get_option('srtp').disabled()
subdir_done()
endif
srtp_dep = dependency('libsrtp2', version : '>= 2.1.0', required : false)
if srtp_dep.found()
......@@ -15,6 +18,9 @@ else
srtp_dep = cc.find_library('srtp', required : false)
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()
gstsrtp_enums = gnome.mkenums_simple('gstsrtp-enumtypes',
......
libxml_dep = dependency('libxml-2.0', version : '>= 2.9.2', required : false)
pango_dep = dependency('pango', required : false)
cairo_dep = dependency('cairo', required : false)
pangocairo_dep = dependency('pangocairo', required : false)
cc = meson.get_compiler('c')
m_dep = cc.find_library('m', required : false)
libxml_dep = dependency('libxml-2.0', version : '>= 2.9.2', required : get_option('ttml'))
pango_dep = dependency('pango', required : get_option('ttml'))
cairo_dep = dependency('cairo', required : get_option('ttml'))
pangocairo_dep = dependency('pangocairo', required : get_option('ttml'))
if libxml_dep.found() and pango_dep.found() and cairo_dep.found() and pangocairo_dep.found()
gstttmlsubs = library('gstttmlsubs',
......@@ -15,7 +13,7 @@ if libxml_dep.found() and pango_dep.found() and cairo_dep.found() and pangocairo
'gstttmlplugin.c'],
c_args : gst_plugins_bad_args,
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_dir : plugins_install_dir,
)
......
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()
gstbz2 = library('gstvoaacenc',
......
......@@ -20,15 +20,22 @@ vulkan_sources = [
vulkan_defines = []
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')
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
have_vulkan_windowing = false
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()
vulkan_sources += [
'xcb/vkdisplay_xcb.c',
......@@ -41,7 +48,7 @@ if vulkan_dep.found() and has_vulkan_header
vkconf.set10('GST_VULKAN_HAVE_WINDOW_XCB', 1)
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()
vulkan_sources += [
'wayland/vkdisplay_wayland.c',
......
......@@ -4,7 +4,7 @@ webp_sources = [
'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()
gstwebp = library('gstwebp',
......
......@@ -13,7 +13,7 @@ webrtc_sources = [
'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'],
default_options: ['tests=false'])
......
......@@ -3,7 +3,8 @@ webrtc_sources = [
'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()
gstwebrtcdsp = library('gstwebrtcdsp',
......
x265_dep = dependency('x265', required: false)
x265_dep = dependency('x265', required: get_option('x265'))
if x265_dep.found()
gstx265 = library('gstx265',
'gstx265enc.c',
......
zbar_dep = dependency('zbar', version : '>= 0.9', required : false)
zbar_dep = dependency('zbar', version : '>= 0.9', required : get_option('zbar'))
if zbar_dep.found()
gstzbar = library('gstzbar',
'gstzbar.c',
......
......@@ -8,9 +8,8 @@ opencv_headers = [
'gstopencvutils.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()
gstopencv = library('gstopencv-' + api_version,
opencv_sources,
......@@ -25,4 +24,6 @@ if opencv_dep.found()
gstopencv_dep = declare_dependency(link_with: gstopencv,
include_directories : [libsinc],
dependencies : [gstvideo_dep, opencv_dep])
install_headers(opencv_headers, subdir : 'gstreamer-1.0/gst/opencv')
endif
wl_req = '>= 1.4'
wl_client_dep = dependency('wayland-client', version: wl_req, required: false)
libdrm_dep = dependency('libdrm', version: '>= 2.4.55', required: false)
wl_protocol_dep = dependency('wayland-protocols', version: wl_req,
required: false)
wl_scanner = find_program('wayland-scanner', required: false)
wl_client_dep = dependency('wayland-client', version: wl_req, required: get_option('wayland'))
libdrm_dep = dependency('libdrm', version: '>= 2.4.55', required: get_option('wayland'))
wl_protocol_dep = dependency('wayland-protocols', version: wl_req, required: get_option('wayland'))
wl_scanner = find_program('wayland-scanner', required: get_option('wayland'))
# Also used in ext/wayland
use_wayland = wl_protocol_dep.found() and wl_client_dep.found() and wl_scanner.found() and libdrm_dep.found()
if use_wayland
......
......@@ -12,7 +12,7 @@ gstmpegtsdemux = library('gstmpegtsdemux',
c_args : gst_plugins_bad_args + ['-DGST_USE_UNSTABLE_API'],
include_directories : [configinc, libsinc],
dependencies : [gstcodecparsers_dep, gstmpegts_dep, gsttag_dep,
gstpbutils_dep, gstaudio_dep, gstbase_dep, mathlib],
gstpbutils_dep, gstaudio_dep, gstbase_dep, libm],
install : true,
install_dir : plugins_install_dir,
)
......
......@@ -387,11 +387,9 @@ endif
# GStreamer OpenGL
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 build_gstgl
if gstgl_dep.found()
if gstgl_dep.type_name() == 'pkgconfig'
gst_gl_apis = gstgl_dep.get_pkgconfig_variable('gl_apis').split()
gst_gl_winsys = gstgl_dep.get_pkgconfig_variable('gl_winsys').split()
......@@ -421,34 +419,17 @@ if build_gstgl
endif