mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-02-24 15:06:38 +00:00
A correctly configured AVAudioSession is needed on iOS to: - allow the application to capture microphone audio (in some cases) - avoid playback being silenced in silent mode Without this, initializing AudioUnit for capture can fail on iOS >=17 (from my testing). Since AVAudioSession has a lot of settings, in most cases its setup should be handled by the user/app. However, just to have a basic default scenario covered, let's configure the bare minimum ourselves, and allow anyone to disable that behaviour by setting configure-session=false on src/sink. Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/7856>
46 lines
1.4 KiB
Meson
46 lines
1.4 KiB
Meson
osxaudio_sources = [
|
|
'gstosxaudioringbuffer.c',
|
|
'gstosxaudioelement.c',
|
|
'gstosxaudiosink.c',
|
|
'gstosxaudiosrc.c',
|
|
'gstosxcoreaudiocommon.c',
|
|
'gstosxcoreaudio.c',
|
|
'gstosxaudio.c',
|
|
'gstatdec.c',
|
|
'gstatenc.c',
|
|
]
|
|
|
|
have_osxaudio = false
|
|
osxaudio_option = get_option('osxaudio')
|
|
if osxaudio_option.disabled() or not ['darwin', 'ios'].contains(host_system)
|
|
subdir_done()
|
|
endif
|
|
|
|
if host_system == 'darwin'
|
|
# TODO: https://github.com/mesonbuild/meson/issues/3940
|
|
have_osxaudio = cc.has_header('CoreAudio/CoreAudio.h', required: osxaudio_option)
|
|
osxaudio_sources += ['gstosxaudiodeviceprovider.c']
|
|
elif host_system == 'ios'
|
|
have_osxaudio = cc.has_header('CoreAudio/CoreAudioTypes.h', required: osxaudio_option)
|
|
osxaudio_sources += ['gstiosaudiosession.m']
|
|
endif
|
|
|
|
if have_osxaudio
|
|
modules = ['CoreAudio', 'AudioToolbox']
|
|
if host_system == 'darwin'
|
|
modules += ['AudioUnit', 'CoreServices']
|
|
elif host_system == 'ios'
|
|
modules += ['AVFAudio', 'Foundation']
|
|
endif
|
|
osxaudio_dep = dependency('appleframeworks', modules : modules)
|
|
|
|
gstosxaudio = library('gstosxaudio',
|
|
osxaudio_sources,
|
|
c_args : gst_plugins_good_args,
|
|
objc_args : gst_plugins_good_args,
|
|
include_directories : [configinc, libsinc],
|
|
dependencies : [gstaudio_dep, gstpbutils_dep, osxaudio_dep],
|
|
install : true,
|
|
install_dir : plugins_install_dir)
|
|
plugins += [gstosxaudio]
|
|
endif
|