summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNirbheek Chauhan <nirbheek@centricular.com>2018-08-17 18:56:54 +0530
committerNirbheek Chauhan <nirbheek@centricular.com>2018-08-17 20:05:25 +0530
commitb7e78d84b491fcaefbe936a33c07bebdc99c55eb (patch)
treec728a767db6763f9c623424b14f4e004e138d0d2
parent7ed17a3d10029f7fc3e4d09a94b29075ebd2b653 (diff)
downloadgstreamer-plugins-good-b7e78d84b491fcaefbe936a33c07bebdc99c55eb.tar.gz
meson: Add build files for osxaudio, osxvideo, waveform
osxaudio is for macOS and iOS osxvideo is for macOS waveform is for Windows
-rw-r--r--meson_options.txt3
-rw-r--r--sys/directsound/meson.build14
-rw-r--r--sys/meson.build12
-rw-r--r--sys/osxaudio/meson.build43
-rw-r--r--sys/osxvideo/meson.build21
-rw-r--r--sys/waveform/meson.build27
6 files changed, 106 insertions, 14 deletions
diff --git a/meson_options.txt b/meson_options.txt
index a3b5cd8ca..e41c244ce 100644
--- a/meson_options.txt
+++ b/meson_options.txt
@@ -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')
diff --git a/sys/directsound/meson.build b/sys/directsound/meson.build
index 7deaed569..d120cc000 100644
--- a/sys/directsound/meson.build
+++ b/sys/directsound/meson.build
@@ -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
diff --git a/sys/meson.build b/sys/meson.build
index c226db564..c5c8d640e 100644
--- a/sys/meson.build
+++ b/sys/meson.build
@@ -1,12 +1,8 @@
-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')
diff --git a/sys/osxaudio/meson.build b/sys/osxaudio/meson.build
new file mode 100644
index 000000000..995705f86
--- /dev/null
+++ b/sys/osxaudio/meson.build
@@ -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
diff --git a/sys/osxvideo/meson.build b/sys/osxvideo/meson.build
new file mode 100644
index 000000000..5c5667e3d
--- /dev/null
+++ b/sys/osxvideo/meson.build
@@ -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
diff --git a/sys/waveform/meson.build b/sys/waveform/meson.build
new file mode 100644
index 000000000..6c9bc9532
--- /dev/null
+++ b/sys/waveform/meson.build
@@ -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