diff options
Diffstat (limited to 'services/audiopolicy/engineconfigurable/src')
4 files changed, 13 insertions, 16 deletions
diff --git a/services/audiopolicy/engineconfigurable/src/Engine.cpp b/services/audiopolicy/engineconfigurable/src/Engine.cpp index c5cccfd..61fae71 100755 --- a/services/audiopolicy/engineconfigurable/src/Engine.cpp +++ b/services/audiopolicy/engineconfigurable/src/Engine.cpp @@ -146,7 +146,7 @@ status_t Engine::add(const std::string &name, const Key &key) template <> routing_strategy Engine::getPropertyForKey<routing_strategy, audio_usage_t>(audio_usage_t usage) const { - const AudioOutputCollection &outputs = mApmObserver->getOutputs(); + const SwAudioOutputCollection &outputs = mApmObserver->getOutputs(); if (usage == AUDIO_USAGE_ASSISTANCE_ACCESSIBILITY && (outputs.isStreamActive(AUDIO_STREAM_RING) || @@ -170,7 +170,7 @@ Property Engine::getPropertyForKey(Key key) const template <> audio_devices_t Engine::getPropertyForKey<audio_devices_t, routing_strategy>(routing_strategy strategy) const { - const AudioOutputCollection &outputs = mApmObserver->getOutputs(); + const SwAudioOutputCollection &outputs = mApmObserver->getOutputs(); /** This is the only case handled programmatically because the PFW is unable to know the * activity of streams. @@ -213,7 +213,7 @@ bool Engine::setPropertyForKey(const Property &property, const Key &key) return element->template set<Property>(property) == NO_ERROR; } -float Engine::volIndexToAmpl(Volume::device_category category, +float Engine::volIndexToDb(Volume::device_category category, audio_stream_type_t streamType, int indexInUi) { @@ -222,7 +222,7 @@ float Engine::volIndexToAmpl(Volume::device_category category, ALOGE("%s: Element indexed by key=%d not found", __FUNCTION__, streamType); return 1.0f; } - return stream->volIndexToAmpl(category, indexInUi); + return stream->volIndexToDb(category, indexInUi); } status_t Engine::initStreamVolume(audio_stream_type_t streamType, diff --git a/services/audiopolicy/engineconfigurable/src/Engine.h b/services/audiopolicy/engineconfigurable/src/Engine.h index 23ca7d0..6fa7a13 100755 --- a/services/audiopolicy/engineconfigurable/src/Engine.h +++ b/services/audiopolicy/engineconfigurable/src/Engine.h @@ -97,11 +97,11 @@ private: virtual void initializeVolumeCurves(bool /*isSpeakerDrcEnabled*/) {} - virtual float volIndexToAmpl(Volume::device_category deviceCategory, + virtual float volIndexToDb(Volume::device_category deviceCategory, audio_stream_type_t stream, int indexInUi) { - return mPolicyEngine->volIndexToAmpl(deviceCategory, stream, indexInUi); + return mPolicyEngine->volIndexToDb(deviceCategory, stream, indexInUi); } private: @@ -183,9 +183,9 @@ private: status_t setDeviceConnectionState(audio_devices_t devices, audio_policy_dev_state_t state, const char *deviceAddress); - float volIndexToAmpl(Volume::device_category category, - audio_stream_type_t stream, - int indexInUi); + float volIndexToDb(Volume::device_category category, + audio_stream_type_t stream, + int indexInUi); status_t initStreamVolume(audio_stream_type_t stream, int indexMin, int indexMax); StrategyCollection mStrategyCollection; /**< Strategies indexed by their enum id. */ diff --git a/services/audiopolicy/engineconfigurable/src/Stream.cpp b/services/audiopolicy/engineconfigurable/src/Stream.cpp index 7126c27..378d592 100755 --- a/services/audiopolicy/engineconfigurable/src/Stream.cpp +++ b/services/audiopolicy/engineconfigurable/src/Stream.cpp @@ -91,7 +91,7 @@ status_t Element<audio_stream_type_t>::initVolume(int indexMin, int indexMax) return NO_ERROR; } -float Element<audio_stream_type_t>::volIndexToAmpl(Volume::device_category deviceCategory, +float Element<audio_stream_type_t>::volIndexToDb(Volume::device_category deviceCategory, int indexInUi) { VolumeProfileConstIterator it = mVolumeProfiles.find(deviceCategory); @@ -140,17 +140,14 @@ float Element<audio_stream_type_t>::volIndexToAmpl(Volume::device_category devic ((float)(curve[segment+1].mIndex - curve[segment].mIndex)) ); - float amplification = exp(decibels * 0.115129f); /** exp( dB * ln(10) / 20 ) */ - ALOGV("VOLUME vol index=[%d %d %d], dB=[%.1f %.1f %.1f] ampl=%.5f", curve[segment].mIndex, volIdx, curve[segment+1].mIndex, curve[segment].mDBAttenuation, decibels, - curve[segment+1].mDBAttenuation, - amplification); + curve[segment+1].mDBAttenuation); - return amplification; + return decibels; } } // namespace audio_policy diff --git a/services/audiopolicy/engineconfigurable/src/Stream.h b/services/audiopolicy/engineconfigurable/src/Stream.h index 03a9b3e9..8c39dc6 100755 --- a/services/audiopolicy/engineconfigurable/src/Stream.h +++ b/services/audiopolicy/engineconfigurable/src/Stream.h @@ -81,7 +81,7 @@ public: status_t setVolumeProfile(Volume::device_category category, const VolumeCurvePoints &points); - float volIndexToAmpl(Volume::device_category deviceCategory, int indexInUi); + float volIndexToDb(Volume::device_category deviceCategory, int indexInUi); status_t initVolume(int indexMin, int indexMax); |