From 6146c08f0c3dd8b9e5788063aa433f304a810602 Mon Sep 17 00:00:00 2001 From: Andy Hung Date: Tue, 18 Mar 2014 11:56:15 -0700 Subject: Add enabling variable for extended precision audio Set AudioFlinger::kEnableExtendedPrecision = true to enable extended precision. Enabling will be required for devices (such as USB) which report 24 bit or 32 bit sink formats. Change-Id: I0dc1d7a4f7607086d7b536ea0e43aef0e696f2ee --- services/audioflinger/AudioFlinger.h | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'services/audioflinger/AudioFlinger.h') diff --git a/services/audioflinger/AudioFlinger.h b/services/audioflinger/AudioFlinger.h index 6e73a14..ddc6afb 100644 --- a/services/audioflinger/AudioFlinger.h +++ b/services/audioflinger/AudioFlinger.h @@ -326,6 +326,24 @@ private: audio_devices_t devices); void purgeStaleEffects_l(); + // Set kEnableExtendedPrecision to true to use extended precision in MixerThread + static const bool kEnableExtendedPrecision = false; + + // Returns true if format is permitted for the PCM sink in the MixerThread + static inline bool isValidPcmSinkFormat(audio_format_t format) { + switch (format) { + case AUDIO_FORMAT_PCM_16_BIT: + return true; + case AUDIO_FORMAT_PCM_FLOAT: + case AUDIO_FORMAT_PCM_24_BIT_PACKED: + case AUDIO_FORMAT_PCM_32_BIT: + case AUDIO_FORMAT_PCM_8_24_BIT: + return kEnableExtendedPrecision; + default: + return false; + } + } + // standby delay for MIXER and DUPLICATING playback threads is read from property // ro.audio.flinger_standbytime_ms or defaults to kDefaultStandbyTimeInNsecs static nsecs_t mStandbyTimeInNsecs; -- cgit v1.1