meson: Add a top-level option to enable webrtc

There are a bunch of plugins that you need for webrtc support, and
it's not obvious at all to users which those are.

With this commit, srtp, sctp and dtls options will be auto-enabled if
the webrtc option is enabled.

Requires meson 1.1

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5505>
This commit is contained in:
Nirbheek Chauhan 2023-10-18 14:19:44 +05:30 committed by GStreamer Marge Bot
parent 62e33e04ea
commit fd4828bafe
7 changed files with 14 additions and 10 deletions

View file

@ -1,6 +1,6 @@
project('gstreamer-full', 'c', project('gstreamer-full', 'c',
version : '1.23.0.1', version : '1.23.0.1',
meson_version : '>= 0.63.0', meson_version : '>= 1.1',
default_options : ['buildtype=debugoptimized', default_options : ['buildtype=debugoptimized',
# Needed due to https://github.com/mesonbuild/meson/issues/1889, # Needed due to https://github.com/mesonbuild/meson/issues/1889,
# but this can cause problems in the future. Remove it # but this can cause problems in the future. Remove it

View file

@ -57,6 +57,7 @@ option('doc', type : 'feature', value : 'disabled', description : 'Generate API
option('gtk_doc', type : 'feature', value : 'disabled', description : 'Generate API documentation with gtk-doc') option('gtk_doc', type : 'feature', value : 'disabled', description : 'Generate API documentation with gtk-doc')
option('qt5', type : 'feature', value : 'auto', description : 'Qt5 toolkit support') option('qt5', type : 'feature', value : 'auto', description : 'Qt5 toolkit support')
option('qt6', type : 'feature', value : 'auto', description : 'Qt6 toolkit support') option('qt6', type : 'feature', value : 'auto', description : 'Qt6 toolkit support')
option('webrtc', type : 'feature', value : 'auto', description : 'WebRTC support')
option('package-origin', type : 'string', value : 'Unknown package origin', yield : true, option('package-origin', type : 'string', value : 'Unknown package origin', yield : true,
description : 'package origin URL to use in plugins') description : 'package origin URL to use in plugins')

View file

@ -12,8 +12,9 @@ dtls_sources = [
'gstdtlselement.c', 'gstdtlselement.c',
] ]
openssl_dep = dependency('openssl', version : '>= 1.0.1', required : get_option('dtls')) dtls_option = get_option('dtls').enable_if(get_option('webrtc').enabled(), error_message: 'webrtc option is enabled')
libcrypto_dep = dependency('libcrypto', required : get_option('dtls')) openssl_dep = dependency('openssl', version: '>= 1.0.1', required: dtls_option)
libcrypto_dep = dependency('libcrypto', required: dtls_option)
if openssl_dep.found() and libcrypto_dep.found() if openssl_dep.found() and libcrypto_dep.found()
gstdtls = library('gstdtls', gstdtls = library('gstdtls',

View file

@ -5,7 +5,8 @@ sctp_sources = [
'sctpassociation.c' 'sctpassociation.c'
] ]
if get_option('sctp').disabled() sctp_option = get_option('sctp').enable_if(get_option('webrtc').enabled(), error_message: 'webrtc option is enabled')
if sctp_option.disabled()
subdir_done() subdir_done()
endif endif
@ -23,7 +24,7 @@ if not get_option('sctp-internal-usrsctp').enabled()
found_system_usrsctp = sctp_dep.found() and sctp_header found_system_usrsctp = sctp_dep.found() and sctp_header
if get_option('sctp-internal-usrsctp').disabled() and not found_system_usrsctp if get_option('sctp-internal-usrsctp').disabled() and not found_system_usrsctp
if get_option('sctp').enabled() if sctp_option.enabled()
error('sctp plugin enabled but could not find libusrsctp or usrsctp.h, and internal libusrsctp disabled') error('sctp plugin enabled but could not find libusrsctp or usrsctp.h, and internal libusrsctp disabled')
else else
message('Could not find libusrsctp or usrsctp.h, and internal libusrsctp disabled - not building sctp plugin') message('Could not find libusrsctp or usrsctp.h, and internal libusrsctp disabled - not building sctp plugin')
@ -37,7 +38,7 @@ if not found_system_usrsctp
subdir('usrsctp') subdir('usrsctp')
sctp_dep = usrsctp_dep sctp_dep = usrsctp_dep
sctp_header = true sctp_header = true
if get_option('sctp').enabled() and not sctp_dep.found() if sctp_option.enabled() and not sctp_dep.found()
error('sctp plugin enabled but could not find system libusrsctp or configure internal libusrsctp') error('sctp plugin enabled but could not find system libusrsctp or configure internal libusrsctp')
endif endif
endif endif

View file

@ -7,7 +7,8 @@ srtp_sources = [
] ]
srtp_cargs = [] srtp_cargs = []
if get_option('srtp').disabled() srtp_option = get_option('srtp').enable_if(get_option('webrtc').enabled(), error_message: 'webrtc option is enabled')
if srtp_option.disabled()
srtp_dep = dependency('', required : false) srtp_dep = dependency('', required : false)
subdir_done() subdir_done()
endif endif
@ -21,7 +22,7 @@ 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() if not srtp_dep.found() and srtp_option.enabled()
error('srtp plugin enabled but libsrtp not found') error('srtp plugin enabled but libsrtp not found')
endif endif

View file

@ -1,6 +1,6 @@
project('gst-plugins-bad', 'c', 'cpp', project('gst-plugins-bad', 'c', 'cpp',
version : '1.23.0.1', version : '1.23.0.1',
meson_version : '>= 0.62', meson_version : '>= 1.1',
default_options : [ 'warning_level=1', default_options : [ 'warning_level=1',
'buildtype=debugoptimized' ]) 'buildtype=debugoptimized' ])

View file

@ -180,7 +180,7 @@ option('vulkan', type : 'feature', value : 'auto', description : 'Vulkan video s
option('wasapi', type : 'feature', value : 'auto', description : 'Windows Audio Session API source/sink plugin') option('wasapi', type : 'feature', value : 'auto', description : 'Windows Audio Session API source/sink plugin')
option('wasapi2', type : 'feature', value : 'auto', description : 'Windows Audio Session API source/sink plugin with WinRT API') option('wasapi2', type : 'feature', value : 'auto', description : 'Windows Audio Session API source/sink plugin with WinRT API')
option('webp', type : 'feature', value : 'auto', description : 'WebP image codec 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('webrtc', type : 'feature', value : 'auto', yield: true, 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('webrtcdsp', type : 'feature', value : 'auto', description : 'Plugin with various audio filters provided by the WebRTC audio processing library')
option('wildmidi', type : 'feature', value : 'auto', description : 'WildMidi midi soft synth plugin') option('wildmidi', type : 'feature', value : 'auto', description : 'WildMidi midi soft synth plugin')
option('wic', type : 'feature', value : 'auto', description : 'Windows Imaging Component plugin') option('wic', type : 'feature', value : 'auto', description : 'Windows Imaging Component plugin')