meson: Add build files for osxaudio, osxvideo, waveform

osxaudio is for macOS and iOS
osxvideo is for macOS
waveform is for Windows
This commit is contained in:
Nirbheek Chauhan 2018-08-17 18:56:54 +05:30
parent 7ed17a3d10
commit b7e78d84b4
6 changed files with 106 additions and 14 deletions

View file

@ -60,6 +60,8 @@ option('lame', type : 'feature', value : 'auto', description : 'LAME mp3 audio e
option('mpg123', type : 'feature', value : 'auto', description : 'mpg123 mp3 audio decoder plugin') option('mpg123', type : 'feature', value : 'auto', description : 'mpg123 mp3 audio decoder plugin')
option('oss', type : 'feature', value : 'auto', description : 'OSS audio source/sink plugin') option('oss', type : 'feature', value : 'auto', description : 'OSS audio source/sink plugin')
option('oss4', type : 'feature', value : 'auto', description : 'OSSv4 audio source/sink plugin') option('oss4', type : 'feature', value : 'auto', description : 'OSSv4 audio source/sink plugin')
option('osxaudio', type : 'feature', value : 'auto', description : 'macOS/iOS CoreAudio source/sink plugin')
option('osxvideo', type : 'feature', value : 'auto', description : 'macOS Cocoa video sink plugin')
option('png', type : 'feature', value : 'auto', description : 'PNG image codec plugin') option('png', type : 'feature', value : 'auto', description : 'PNG image codec plugin')
option('pulse', type : 'feature', value : 'auto', description : 'Pulseaudio audio source/sink plugin') option('pulse', type : 'feature', value : 'auto', description : 'Pulseaudio audio source/sink plugin')
option('qt5', type : 'feature', value : 'auto', description : 'Qt5 QML video sink plugin') option('qt5', type : 'feature', value : 'auto', description : 'Qt5 QML video sink plugin')
@ -69,6 +71,7 @@ option('speex', type : 'feature', value : 'auto', description : 'Speex audio cod
option('taglib', type : 'feature', value : 'auto', description : 'Tag-writing plugin based on taglib') option('taglib', type : 'feature', value : 'auto', description : 'Tag-writing plugin based on taglib')
option('twolame', type : 'feature', value : 'auto', description : 'twolame mp2 audio encoder plugin') option('twolame', type : 'feature', value : 'auto', description : 'twolame mp2 audio encoder plugin')
option('vpx', type : 'feature', value : 'auto', description : 'VP8 and VP9 video codec plugin') option('vpx', type : 'feature', value : 'auto', description : 'VP8 and VP9 video codec plugin')
option('waveform', type : 'feature', value : 'auto', description : 'Windows waveform audio sink plugin')
option('wavpack', type : 'feature', value : 'auto', description : 'Wavpack audio codec plugin') option('wavpack', type : 'feature', value : 'auto', description : 'Wavpack audio codec plugin')
option('x11', type : 'feature', value : 'auto', description : 'X11 ximagesrc plugin') option('x11', type : 'feature', value : 'auto', description : 'X11 ximagesrc plugin')

View file

@ -12,13 +12,15 @@ directsoundsink_device_flags = [
] ]
have_dsound = false have_dsound = false
# TODO: https://github.com/mesonbuild/meson/issues/3940
dsound_option = get_option('directsound') dsound_option = get_option('directsound')
if not dsound_option.disabled() if host_system != 'windows' or dsound_option.disabled()
have_dsound = cc.has_header('dsound.h') subdir_done()
if not have_dsound and dsound_option.enabled() endif
error('directsound plugin was enabled but dsound.h was not found')
endif # TODO: https://github.com/mesonbuild/meson/issues/3940
have_dsound = cc.has_header('dsound.h')
if not have_dsound and dsound_option.enabled()
error('directsound plugin was enabled but dsound.h was not found')
endif endif
if have_dsound if have_dsound

View file

@ -1,12 +1,8 @@
if host_system == 'windows' subdir('directsound')
subdir('directsound')
endif
subdir('oss') subdir('oss')
subdir('oss4') subdir('oss4')
subdir('osxaudio')
subdir('osxvideo')
subdir('v4l2') subdir('v4l2')
subdir('waveform')
subdir('ximage') subdir('ximage')
# FIXME: Implement these
#subdir('osxaudio')
#subdir('osxvideo')
#subdir('waveform')

43
sys/osxaudio/meson.build Normal file
View file

@ -0,0 +1,43 @@
osxaudio_sources = [
'gstosxaudioringbuffer.c',
'gstosxaudioelement.c',
'gstosxaudiosink.c',
'gstosxaudiosrc.c',
'gstosxcoreaudiocommon.c',
'gstosxcoreaudio.c',
'gstosxaudio.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')
osxaudio_sources += ['gstosxaudiodeviceprovider.c']
elif host_system == 'ios'
have_osxaudio = cc.has_header('CoreAudio/CoreAudioTypes.h')
endif
if not have_osxaudio and osxaudio_option.enabled()
error('osxaudio plugin was enabled but CoreAudio headers not found')
endif
if have_osxaudio
osxaudio_dep = [dependency('CoreAudio'), dependency('AudioToolbox')]
if host_system == 'darwin'
osxaudio_dep += [dependency('AudioUnit'), dependency('CoreServices')]
endif
gstosxaudio = library('gstosxaudio',
osxaudio_sources,
c_args : gst_plugins_good_args,
include_directories : [configinc, libsinc],
dependencies : [gstaudio_dep] + osxaudio_dep,
install : true,
install_dir : plugins_install_dir)
pkgconfig.generate(gstosxaudio, install_dir : plugins_pkgconfig_install_dir)
endif

21
sys/osxvideo/meson.build Normal file
View file

@ -0,0 +1,21 @@
osxvideo_sources = ['osxvideosink.m', 'cocoawindow.m']
have_osxvideo = false
if host_system != 'darwin'
subdir_done()
endif
osxvideo_opengl_dep = dependency('OpenGL', required : get_option('osxvideo'))
osxvideo_cocoa_dep = dependency('Cocoa', required : get_option('osxvideo'))
have_objc = add_languages('objc', required : get_option('osxvideo'))
if have_objc and osxvideo_opengl_dep.found() and osxvideo_cocoa_dep.found()
gstosxvideo = library('gstosxvideo',
osxvideo_sources,
c_args : gst_plugins_good_args,
include_directories : [configinc],
dependencies : [gstvideo_dep, osxvideo_opengl_dep, osxvideo_cocoa_dep],
install : true,
install_dir : plugins_install_dir)
pkgconfig.generate(gstosxvideo, install_dir : plugins_pkgconfig_install_dir)
endif

27
sys/waveform/meson.build Normal file
View file

@ -0,0 +1,27 @@
waveformsink_sources = [
'gstwaveformsink.c',
'gstwaveformplugin.c',
]
have_waveform = false
waveform_option = get_option('waveform')
if host_system != 'windows' or waveform_option.disabled()
subdir_done()
endif
# TODO: https://github.com/mesonbuild/meson/issues/3940
have_waveform = cc.has_header('mmsystem.h', prefix : '#include <windows.h>')
if not have_waveform and waveform_option.enabled()
error('waveform plugin was enabled but mmsystem.h was not found')
endif
if have_waveform
gstwaveformsink = library('gstwaveform',
waveformsink_sources,
c_args : gst_plugins_good_args,
include_directories : [configinc],
dependencies : [gstaudio_dep, cc.find_library('winmm')],
install : true,
install_dir : plugins_install_dir)
pkgconfig.generate(gstwaveformsink, install_dir : plugins_pkgconfig_install_dir)
endif