Loading media/libeffects/lvm/wrapper/Aidl/BundleContext.cpp +20 −2 Original line number Diff line number Diff line Loading @@ -93,7 +93,18 @@ void BundleContext::deInit() { RetCode BundleContext::setCommon(const Parameter::Common& common) { RetCode ret = EffectContext::setCommon(common); RETURN_VALUE_IF(ret != RetCode::SUCCESS, ret, " setCommonFailed"); return init(); if (mInstance) { LVM_ControlParams_t params; RETURN_VALUE_IF(LVM_SUCCESS != LVM_GetControlParameters(mInstance, ¶ms), RetCode::ERROR_EFFECT_LIB_ERROR, "failGetControlParams"); RETURN_VALUE_IF(RetCode::SUCCESS != applyCommonParameter(params), RetCode::ERROR_EFFECT_LIB_ERROR, " applyCommonParameterFailed"); RETURN_VALUE_IF(LVM_SUCCESS != LVM_SetControlParameters(mInstance, ¶ms), RetCode::ERROR_EFFECT_LIB_ERROR, "failSetControlParams"); } else { RETURN_VALUE_IF(RetCode::SUCCESS != init(), RetCode::ERROR_EFFECT_LIB_ERROR, " initFailed"); } return RetCode::SUCCESS; } RetCode BundleContext::enable() { Loading Loading @@ -605,7 +616,7 @@ RetCode BundleContext::setForcedDevice( return ret; } RetCode BundleContext::initControlParameter(LVM_ControlParams_t& params) const { RetCode BundleContext::applyCommonParameter(LVM_ControlParams_t& params) const { int outputChannelCount = ::aidl::android::hardware::audio::common::getChannelCount( mCommon.output.base.channelMask); auto outputChannelMaskConv = aidl2legacy_AudioChannelLayout_audio_channel_mask_t( Loading @@ -627,6 +638,13 @@ RetCode BundleContext::initControlParameter(LVM_ControlParams_t& params) const { params.SourceFormat = LVM_MULTICHANNEL; } return RetCode::SUCCESS; } RetCode BundleContext::initControlParameter(LVM_ControlParams_t& params) const { RETURN_VALUE_IF(RetCode::SUCCESS != applyCommonParameter(params), RetCode::ERROR_EFFECT_LIB_ERROR, " applyCommonParameterFailed"); /* General parameters */ params.OperatingMode = LVM_MODE_ON; params.SpeakerType = LVM_HEADPHONES; Loading media/libeffects/lvm/wrapper/Aidl/BundleContext.h +1 −0 Original line number Diff line number Diff line Loading @@ -135,6 +135,7 @@ class BundleContext final : public EffectContext { bool isBandLevelIndexInRange(const std::vector<Equalizer::BandLevel>& bandLevels) const; static LVM_EQNB_BandDef_t* getDefaultEqualizerBandDefs(); static LVM_HeadroomBandDef_t* getDefaultEqualizerHeadroomBanDefs(); RetCode applyCommonParameter(LVM_ControlParams_t& params) const; }; } // namespace aidl::android::hardware::audio::effect Loading Loading
media/libeffects/lvm/wrapper/Aidl/BundleContext.cpp +20 −2 Original line number Diff line number Diff line Loading @@ -93,7 +93,18 @@ void BundleContext::deInit() { RetCode BundleContext::setCommon(const Parameter::Common& common) { RetCode ret = EffectContext::setCommon(common); RETURN_VALUE_IF(ret != RetCode::SUCCESS, ret, " setCommonFailed"); return init(); if (mInstance) { LVM_ControlParams_t params; RETURN_VALUE_IF(LVM_SUCCESS != LVM_GetControlParameters(mInstance, ¶ms), RetCode::ERROR_EFFECT_LIB_ERROR, "failGetControlParams"); RETURN_VALUE_IF(RetCode::SUCCESS != applyCommonParameter(params), RetCode::ERROR_EFFECT_LIB_ERROR, " applyCommonParameterFailed"); RETURN_VALUE_IF(LVM_SUCCESS != LVM_SetControlParameters(mInstance, ¶ms), RetCode::ERROR_EFFECT_LIB_ERROR, "failSetControlParams"); } else { RETURN_VALUE_IF(RetCode::SUCCESS != init(), RetCode::ERROR_EFFECT_LIB_ERROR, " initFailed"); } return RetCode::SUCCESS; } RetCode BundleContext::enable() { Loading Loading @@ -605,7 +616,7 @@ RetCode BundleContext::setForcedDevice( return ret; } RetCode BundleContext::initControlParameter(LVM_ControlParams_t& params) const { RetCode BundleContext::applyCommonParameter(LVM_ControlParams_t& params) const { int outputChannelCount = ::aidl::android::hardware::audio::common::getChannelCount( mCommon.output.base.channelMask); auto outputChannelMaskConv = aidl2legacy_AudioChannelLayout_audio_channel_mask_t( Loading @@ -627,6 +638,13 @@ RetCode BundleContext::initControlParameter(LVM_ControlParams_t& params) const { params.SourceFormat = LVM_MULTICHANNEL; } return RetCode::SUCCESS; } RetCode BundleContext::initControlParameter(LVM_ControlParams_t& params) const { RETURN_VALUE_IF(RetCode::SUCCESS != applyCommonParameter(params), RetCode::ERROR_EFFECT_LIB_ERROR, " applyCommonParameterFailed"); /* General parameters */ params.OperatingMode = LVM_MODE_ON; params.SpeakerType = LVM_HEADPHONES; Loading
media/libeffects/lvm/wrapper/Aidl/BundleContext.h +1 −0 Original line number Diff line number Diff line Loading @@ -135,6 +135,7 @@ class BundleContext final : public EffectContext { bool isBandLevelIndexInRange(const std::vector<Equalizer::BandLevel>& bandLevels) const; static LVM_EQNB_BandDef_t* getDefaultEqualizerBandDefs(); static LVM_HeadroomBandDef_t* getDefaultEqualizerHeadroomBanDefs(); RetCode applyCommonParameter(LVM_ControlParams_t& params) const; }; } // namespace aidl::android::hardware::audio::effect Loading