diff options
author | Andy Hung <hunga@google.com> | 2014-03-18 11:56:15 -0700 |
---|---|---|
committer | Andy Hung <hunga@google.com> | 2014-06-25 13:02:15 -0700 |
commit | 6146c08f0c3dd8b9e5788063aa433f304a810602 (patch) | |
tree | 26c9854fb01a0f9a7f3daf31cbbed99105cc88c3 /services/audioflinger/AudioFlinger.h | |
parent | 3a227969f604d7c6a24a795661a13f70a5f37e1f (diff) | |
download | frameworks_av-6146c08f0c3dd8b9e5788063aa433f304a810602.zip frameworks_av-6146c08f0c3dd8b9e5788063aa433f304a810602.tar.gz frameworks_av-6146c08f0c3dd8b9e5788063aa433f304a810602.tar.bz2 |
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
Diffstat (limited to 'services/audioflinger/AudioFlinger.h')
-rw-r--r-- | services/audioflinger/AudioFlinger.h | 18 |
1 files changed, 18 insertions, 0 deletions
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; |