summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNirbheek Chauhan <nirbheek@centricular.com>2018-08-28 12:54:07 +0530
committerNirbheek Chauhan <nirbheek@centricular.com>2018-08-29 14:58:19 +0530
commit4af7637012413209ce728ec377b265acbbaadc08 (patch)
treea12b1e25fcd326f5d6c6f9e5fc4790cd8aee982f
parent4ca76e0c123b37175dd76057dbb45c96b47e7477 (diff)
meson: Add build files for androidmedia and opensles
Note that androidmedia requires Android gstgl
-rw-r--r--meson_options.txt2
-rw-r--r--sys/androidmedia/meson.build41
-rw-r--r--sys/meson.build4
-rw-r--r--sys/opensles/meson.build29
4 files changed, 74 insertions, 2 deletions
diff --git a/meson_options.txt b/meson_options.txt
index 589055781..2809b3cb2 100644
--- a/meson_options.txt
+++ b/meson_options.txt
@@ -74,6 +74,7 @@ option('x11', type : 'feature', value : 'auto', description : 'X11 support in Vu
# Feature options for plugins that need external deps
option('aom', type : 'feature', value : 'auto', description : 'AOM AV1 video codec plugin')
+option('androidmedia', type : 'feature', value : 'auto', description : 'Video capture and codec plugins for Android')
option('applemedia', type : 'feature', value : 'auto', description : 'Video capture and codec access plugins for macOS and iOS')
option('assrender', type : 'feature', value : 'auto', description : 'ASS/SSA subtitle renderer plugin')
option('bluez', type : 'feature', value : 'auto', description : 'Bluetooth audio A2DP/AVDTP sink, AVDTP source plugin')
@@ -112,6 +113,7 @@ option('musepack', type : 'feature', value : 'auto', description : 'libmpcdec Mu
option('neon', type : 'feature', value : 'auto', description : 'NEON HTTP source plugin')
option('openh264', type : 'feature', value : 'auto', description : 'H.264 video codec plugin')
option('openjpeg', type : 'feature', value : 'auto', description : 'JPEG2000 image codec plugin')
+option('opensles', type : 'feature', value : 'auto', description : 'OpenSL ES audio source/sink plugin')
option('opus', type : 'feature', value : 'auto', description : 'OPUS audio parser plugin')
option('resindvd', type : 'feature', value : 'auto', description : 'Resin DVD playback plugin')
option('rsvg', type : 'feature', value : 'auto', description : 'SVG overlayer and image decoder plugin')
diff --git a/sys/androidmedia/meson.build b/sys/androidmedia/meson.build
new file mode 100644
index 000000000..a52cc0eb8
--- /dev/null
+++ b/sys/androidmedia/meson.build
@@ -0,0 +1,41 @@
+androidmedia_sources = [
+ 'gstahcsrc.c',
+ 'gstahssrc.c',
+ 'gstamcaudiodec.c',
+ 'gstamc.c',
+ 'gstamcsurface.c',
+ 'gstamcsurfacetexture.c',
+ 'gstamcvideodec.c',
+ 'gstamcvideoenc.c',
+ 'gst-android-graphics-imageformat.c',
+ 'gst-android-hardware-camera.c',
+ 'gst-android-hardware-sensor.c',
+ 'gstjniutils.c'
+]
+
+if host_system != 'android' or get_option('androidmedia').disabled()
+ subdir_done()
+endif
+
+if not gstgl_dep.found()
+ if get_option('androidmedia').enabled()
+ error('androidmedia plugin enabled but GL support was not detected')
+ endif
+ subdir_done()
+endif
+
+have_jni_h = cc.has_header('jni.h', required : false)
+if not have_jni_h and get_option('androidmedia').enabled()
+ error('androidmedia plugin enabled but jni.h not found')
+endif
+
+if have_jni_h
+ gstandroidmedia = library('gstandroidmedia',
+ androidmedia_sources,
+ c_args : gst_plugins_bad_args,
+ include_directories : [configinc],
+ dependencies : [gstgl_dep, gstpbutils_dep, gstaudio_dep, gstvideo_dep, gstphotography_dep],
+ install : true,
+ install_dir : plugins_install_dir)
+ pkgconfig.generate(gstandroidmedia, install_dir : plugins_pkgconfig_install_dir)
+endif
diff --git a/sys/meson.build b/sys/meson.build
index 69956f0a2..c21494df8 100644
--- a/sys/meson.build
+++ b/sys/meson.build
@@ -1,7 +1,7 @@
#FIXME
#subdir('acmenc')
#subdir('acmmp3dec')
-#subdir('androidmedia')
+subdir('androidmedia')
subdir('applemedia')
subdir('bluez')
subdir('d3dvideosink')
@@ -16,7 +16,7 @@ subdir('ipcpipeline')
subdir('kms')
subdir('msdk')
#subdir('nvenc')
-#subdir('opensles')
+subdir('opensles')
subdir('shm')
subdir('uvch264')
#subdir('vcd')
diff --git a/sys/opensles/meson.build b/sys/opensles/meson.build
new file mode 100644
index 000000000..75bdb6c5d
--- /dev/null
+++ b/sys/opensles/meson.build
@@ -0,0 +1,29 @@
+opensles_sources = [
+ 'openslescommon.c',
+ 'openslesringbuffer.c',
+ 'openslessink.c',
+ 'openslessrc.c',
+ 'opensles.c',
+]
+
+opensles_option = get_option('opensles')
+if opensles_option.disabled()
+ subdir_done()
+endif
+
+have_opensles_h = cc.has_header('SLES/OpenSLES.h', required : false)
+if not have_opensles_h and opensles_option.enabled()
+ error('opensles plugin enabled but SLES/OpenSLES.h not found')
+endif
+opensles_dep = cc.find_library('OpenSLES', required : opensles_option)
+
+if have_opensles_h and opensles_dep.found()
+ gstopensles = library('gstopensles',
+ opensles_sources,
+ c_args : gst_plugins_bad_args,
+ include_directories : [configinc],
+ dependencies : [gstaudio_dep, opensles_dep],
+ install : true,
+ install_dir : plugins_install_dir)
+ pkgconfig.generate(gstopensles, install_dir : plugins_pkgconfig_install_dir)
+endif