meson: Add an option for the 'Tremor' Vorbis implementation
authorNirbheek Chauhan <nirbheek@centricular.com>
Mon, 10 Sep 2018 16:52:16 +0000 (22:22 +0530)
committerNirbheek Chauhan <nirbheek@centricular.com>
Mon, 10 Sep 2018 16:52:16 +0000 (22:22 +0530)
It makes sense to control it explicitly to allow us to enable it on
platforms that don't have hardware floating-point, and to allow people
to enable the 'vorbis' plugin without having to also provide the
Tremor dependency which is useless on most devices.

ext/vorbis/gstivorbisdec.c
ext/vorbis/meson.build
meson_options.txt

index ef500dd..a47a094 100644 (file)
@@ -29,7 +29,6 @@ static gboolean
 plugin_init (GstPlugin * plugin)
 {
 
-  /* if tremor is around, there is probably good reason for it, so preferred */
   if (!gst_element_register (plugin, "ivorbisdec", GST_RANK_SECONDARY,
           gst_vorbis_dec_get_type ()))
     return FALSE;
index 8f11243..3da041b 100644 (file)
@@ -17,7 +17,7 @@ vorbisidec_sources = [
 
 vorbis_dep = dependency('vorbis', version : '>=1.0', required : get_option('vorbis'))
 vorbisenc_dep = dependency('vorbisenc', version : '>=1.0', required : get_option('vorbis'))
-vorbisidec_dep = dependency('vorbisidec', required : get_option('vorbis'))
+vorbisidec_dep = dependency('vorbisidec', required : get_option('tremor'))
 
 if vorbis_dep.found() or vorbisidec_dep.found()
   if cc.has_header_symbol('vorbis/codec.h', 'vorbis_synthesis_restart')
@@ -43,6 +43,8 @@ if vorbis_dep.found()
 endif
 
 if vorbisidec_dep.found()
+  # NOTE: This plugin is only useful if your device does not support hardware
+  # floating point and needs integer ops for performance reasons.
   gstivorbisdec = library('gstivorbisdec',
     vorbisidec_sources,
     c_args : gst_plugins_base_args + ['-DTREMOR'],
index ea3728c..0c2128e 100644 (file)
@@ -57,6 +57,7 @@ option('ogg', type : 'feature', value : 'auto', description : 'ogg parser, muxer
 option('opus', type : 'feature', value : 'auto', description : 'OPUS audio codec plugin')
 option('pango', type : 'feature', value : 'auto', description : 'Pango text rendering and overlay plugin')
 option('theora', type : 'feature', value : 'auto', description : 'Theora video parser and codec plugin')
+option('tremor', type : 'feature', value : 'auto', description : 'Integer Vorbis decoder plugin for devices without floating point')
 option('vorbis', type : 'feature', value : 'auto', description : 'Vorbis audio parser, tagger, and codec plugin')
 option('x11', type : 'feature', value : 'auto', description : 'X11 ximagesink plugin, and X11 support in libraries, plugins, examples')
 option('xshm', type : 'feature', value : 'auto', description : 'X11 shared memory support for X11 plugins')