diff options
author | Eric Laurent <elaurent@google.com> | 2014-10-10 23:39:36 +0000 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2014-10-10 23:39:37 +0000 |
commit | ffd5cdbd3e3faa203539e26adc755f860c8cac80 (patch) | |
tree | 00c3d67fa2a460f969c516c897235086e0f722eb /services | |
parent | aec1dbfd10150da3f28b64471b4dc249a58a104e (diff) | |
parent | 95511add8ad4d440c67272503559f5042c4e6f1f (diff) | |
download | frameworks_av-ffd5cdbd3e3faa203539e26adc755f860c8cac80.zip frameworks_av-ffd5cdbd3e3faa203539e26adc755f860c8cac80.tar.gz frameworks_av-ffd5cdbd3e3faa203539e26adc755f860c8cac80.tar.bz2 |
Merge "audio policy: add support for ro.audio.media_deep_buffer" into lmp-dev
Diffstat (limited to 'services')
-rw-r--r-- | services/audiopolicy/AudioPolicyManager.cpp | 12 | ||||
-rw-r--r-- | services/audiopolicy/AudioPolicyManager.h | 2 |
2 files changed, 13 insertions, 1 deletions
diff --git a/services/audiopolicy/AudioPolicyManager.cpp b/services/audiopolicy/AudioPolicyManager.cpp index 536987a..e4d785c 100644 --- a/services/audiopolicy/AudioPolicyManager.cpp +++ b/services/audiopolicy/AudioPolicyManager.cpp @@ -926,6 +926,10 @@ audio_io_handle_t AudioPolicyManager::getOutputForDevice( if ((flags & AUDIO_OUTPUT_FLAG_HW_AV_SYNC) != 0) { flags = (audio_output_flags_t)(flags | AUDIO_OUTPUT_FLAG_DIRECT); } + if (mForceDeepBufferForMedia && (flags & AUDIO_OUTPUT_FLAG_DIRECT) == 0 && + stream == AUDIO_STREAM_MUSIC) { + flags = (audio_output_flags_t)(flags | AUDIO_OUTPUT_FLAG_DEEP_BUFFER); + } sp<IOProfile> profile; @@ -2653,8 +2657,14 @@ AudioPolicyManager::AudioPolicyManager(AudioPolicyClientInterface *clientInterfa mTotalEffectsCpuLoad(0), mTotalEffectsMemory(0), mA2dpSuspended(false), mSpeakerDrcEnabled(false), mNextUniqueId(1), - mAudioPortGeneration(1) + mAudioPortGeneration(1), + mForceDeepBufferForMedia(false) { + char propValue[PROPERTY_VALUE_MAX]; + if (property_get("ro.audio.media_deep_buffer", propValue, "0")) { + mForceDeepBufferForMedia = atoi(propValue); + } + mUidCached = getuid(); mpClientInterface = clientInterface; diff --git a/services/audiopolicy/AudioPolicyManager.h b/services/audiopolicy/AudioPolicyManager.h index 0ea7b97..b57a295 100644 --- a/services/audiopolicy/AudioPolicyManager.h +++ b/services/audiopolicy/AudioPolicyManager.h @@ -806,6 +806,8 @@ protected: sp<AudioPatch> mCallTxPatch; sp<AudioPatch> mCallRxPatch; + bool mForceDeepBufferForMedia; + #ifdef AUDIO_POLICY_TEST Mutex mLock; Condition mWaitWorkCV; |