Commit b7e78d84 authored by Nirbheek Chauhan's avatar Nirbheek Chauhan

meson: Add build files for osxaudio, osxvideo, waveform

osxaudio is for macOS and iOS
osxvideo is for macOS
waveform is for Windows
parent 7ed17a3d
......@@ -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('oss', type : 'feature', value : 'auto', description : 'OSS 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('pulse', type : 'feature', value : 'auto', description : 'Pulseaudio audio source/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('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('waveform', type : 'feature', value : 'auto', description : 'Windows waveform audio sink plugin')
option('wavpack', type : 'feature', value : 'auto', description : 'Wavpack audio codec plugin')
option('x11', type : 'feature', value : 'auto', description : 'X11 ximagesrc plugin')
......
......@@ -12,13 +12,15 @@ directsoundsink_device_flags = [
]
have_dsound = false
# TODO: https://github.com/mesonbuild/meson/issues/3940
dsound_option = get_option('directsound')
if not dsound_option.disabled()
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
if host_system != 'windows' or dsound_option.disabled()
subdir_done()
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
if have_dsound
......
if host_system == 'windows'
subdir('directsound')
endif
subdir('directsound')
subdir('oss')
subdir('oss4')
subdir('osxaudio')
subdir('osxvideo')
subdir('v4l2')
subdir('waveform')
subdir('ximage')
# FIXME: Implement these
#subdir('osxaudio')
#subdir('osxvideo')
#subdir('waveform')
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
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
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
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment