From 41b7a65b81bdb1f257f2a8552d42dc0047e463dc Mon Sep 17 00:00:00 2001 From: Nirbheek Chauhan Date: Mon, 10 Sep 2018 22:22:16 +0530 Subject: [PATCH] meson: Add an option for the 'Tremor' Vorbis implementation 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 | 1 - ext/vorbis/meson.build | 4 +++- meson_options.txt | 1 + 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/ext/vorbis/gstivorbisdec.c b/ext/vorbis/gstivorbisdec.c index ef500ddb9c..a47a094fc5 100644 --- a/ext/vorbis/gstivorbisdec.c +++ b/ext/vorbis/gstivorbisdec.c @@ -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; diff --git a/ext/vorbis/meson.build b/ext/vorbis/meson.build index 8f112431e0..3da041bfba 100644 --- a/ext/vorbis/meson.build +++ b/ext/vorbis/meson.build @@ -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'], diff --git a/meson_options.txt b/meson_options.txt index ea3728c7ef..0c2128e774 100644 --- a/meson_options.txt +++ b/meson_options.txt @@ -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')