Loading media/libaudiohal/impl/EffectConversionHelperAidl.cpp +15 −14 Original line number Diff line number Diff line Loading @@ -187,13 +187,7 @@ status_t EffectConversionHelperAidl::handleSetConfig(uint32_t cmdSize, const voi IEffect::OpenEffectReturn openReturn; RETURN_STATUS_IF_ERROR( statusTFromBinderStatus(mEffect->open(common, std::nullopt, &openReturn))); updateMqs(openReturn); if (status_t status = updateEventFlags(); status != OK) { ALOGV("%s closing at status %d", __func__, status); mEffect->close(); return status; } updateMqsAndEventFlags(openReturn); } else if (mCommon != common) { ALOGI("%s at state %s, setParameter", __func__, android::internal::ToString(state).c_str()); Parameter aidlParam = UNION_MAKE(Parameter, common, common); Loading @@ -204,13 +198,21 @@ status_t EffectConversionHelperAidl::handleSetConfig(uint32_t cmdSize, const voi return *static_cast<int32_t*>(pReplyData) = OK; } void EffectConversionHelperAidl::updateMqs(const IEffect::OpenEffectReturn& ret) { void EffectConversionHelperAidl::updateMqsAndEventFlags(const IEffect::OpenEffectReturn& ret) { if (mIsProxyEffect) { mStatusQ = std::static_pointer_cast<EffectProxy>(mEffect)->getStatusMQ(); } else { mStatusQ = std::make_shared<StatusMQ>(ret.statusMQ); } updateEventFlags(); updateDataMqs(ret); } void EffectConversionHelperAidl::updateDataMqs(const IEffect::OpenEffectReturn& ret) { if (mIsProxyEffect) { mInputQ = std::static_pointer_cast<EffectProxy>(mEffect)->getInputMQ(); mOutputQ = std::static_pointer_cast<EffectProxy>(mEffect)->getOutputMQ(); } else { mStatusQ = std::make_shared<StatusMQ>(ret.statusMQ); mInputQ = std::make_shared<DataMQ>(ret.inputDataMQ); mOutputQ = std::make_shared<DataMQ>(ret.outputDataMQ); } Loading Loading @@ -407,10 +409,8 @@ status_t EffectConversionHelperAidl::handleSetOffload(uint32_t cmdSize, const vo } // update FMQs if the effect instance already open if (State state; effectProxy->getState(&state).isOk() && state != State::INIT) { mStatusQ = effectProxy->getStatusMQ(); mInputQ = effectProxy->getInputMQ(); mOutputQ = effectProxy->getOutputMQ(); updateEventFlags(); IEffect::OpenEffectReturn openReturn; updateMqsAndEventFlags(openReturn); } } return *static_cast<int32_t*>(pReplyData) = OK; Loading Loading @@ -512,7 +512,8 @@ status_t EffectConversionHelperAidl::reopen() { IEffect::OpenEffectReturn openReturn; RETURN_STATUS_IF_ERROR(statusTFromBinderStatus(mEffect->reopen(&openReturn))); updateMqs(openReturn); // status MQ won't be changed after open updateDataMqs(openReturn); return OK; } Loading media/libaudiohal/impl/EffectConversionHelperAidl.h +4 −3 Original line number Diff line number Diff line Loading @@ -98,7 +98,6 @@ class EffectConversionHelperAidl { std::shared_ptr<StatusMQ> mStatusQ = nullptr; std::shared_ptr<DataMQ> mInputQ = nullptr, mOutputQ = nullptr; struct EventFlagDeleter { void operator()(::android::hardware::EventFlag* flag) const { if (flag) { Loading @@ -108,8 +107,10 @@ class EffectConversionHelperAidl { }; std::shared_ptr<android::hardware::EventFlag> mEfGroup = nullptr; status_t updateEventFlags(); void updateMqs(const ::aidl::android::hardware::audio::effect::IEffect::OpenEffectReturn& ret); void updateDataMqs( const ::aidl::android::hardware::audio::effect::IEffect::OpenEffectReturn& ret); void updateMqsAndEventFlags( const ::aidl::android::hardware::audio::effect::IEffect::OpenEffectReturn& ret); status_t handleInit(uint32_t cmdSize, const void* pCmdData, uint32_t* replySize, void* pReplyData); Loading Loading
media/libaudiohal/impl/EffectConversionHelperAidl.cpp +15 −14 Original line number Diff line number Diff line Loading @@ -187,13 +187,7 @@ status_t EffectConversionHelperAidl::handleSetConfig(uint32_t cmdSize, const voi IEffect::OpenEffectReturn openReturn; RETURN_STATUS_IF_ERROR( statusTFromBinderStatus(mEffect->open(common, std::nullopt, &openReturn))); updateMqs(openReturn); if (status_t status = updateEventFlags(); status != OK) { ALOGV("%s closing at status %d", __func__, status); mEffect->close(); return status; } updateMqsAndEventFlags(openReturn); } else if (mCommon != common) { ALOGI("%s at state %s, setParameter", __func__, android::internal::ToString(state).c_str()); Parameter aidlParam = UNION_MAKE(Parameter, common, common); Loading @@ -204,13 +198,21 @@ status_t EffectConversionHelperAidl::handleSetConfig(uint32_t cmdSize, const voi return *static_cast<int32_t*>(pReplyData) = OK; } void EffectConversionHelperAidl::updateMqs(const IEffect::OpenEffectReturn& ret) { void EffectConversionHelperAidl::updateMqsAndEventFlags(const IEffect::OpenEffectReturn& ret) { if (mIsProxyEffect) { mStatusQ = std::static_pointer_cast<EffectProxy>(mEffect)->getStatusMQ(); } else { mStatusQ = std::make_shared<StatusMQ>(ret.statusMQ); } updateEventFlags(); updateDataMqs(ret); } void EffectConversionHelperAidl::updateDataMqs(const IEffect::OpenEffectReturn& ret) { if (mIsProxyEffect) { mInputQ = std::static_pointer_cast<EffectProxy>(mEffect)->getInputMQ(); mOutputQ = std::static_pointer_cast<EffectProxy>(mEffect)->getOutputMQ(); } else { mStatusQ = std::make_shared<StatusMQ>(ret.statusMQ); mInputQ = std::make_shared<DataMQ>(ret.inputDataMQ); mOutputQ = std::make_shared<DataMQ>(ret.outputDataMQ); } Loading Loading @@ -407,10 +409,8 @@ status_t EffectConversionHelperAidl::handleSetOffload(uint32_t cmdSize, const vo } // update FMQs if the effect instance already open if (State state; effectProxy->getState(&state).isOk() && state != State::INIT) { mStatusQ = effectProxy->getStatusMQ(); mInputQ = effectProxy->getInputMQ(); mOutputQ = effectProxy->getOutputMQ(); updateEventFlags(); IEffect::OpenEffectReturn openReturn; updateMqsAndEventFlags(openReturn); } } return *static_cast<int32_t*>(pReplyData) = OK; Loading Loading @@ -512,7 +512,8 @@ status_t EffectConversionHelperAidl::reopen() { IEffect::OpenEffectReturn openReturn; RETURN_STATUS_IF_ERROR(statusTFromBinderStatus(mEffect->reopen(&openReturn))); updateMqs(openReturn); // status MQ won't be changed after open updateDataMqs(openReturn); return OK; } Loading
media/libaudiohal/impl/EffectConversionHelperAidl.h +4 −3 Original line number Diff line number Diff line Loading @@ -98,7 +98,6 @@ class EffectConversionHelperAidl { std::shared_ptr<StatusMQ> mStatusQ = nullptr; std::shared_ptr<DataMQ> mInputQ = nullptr, mOutputQ = nullptr; struct EventFlagDeleter { void operator()(::android::hardware::EventFlag* flag) const { if (flag) { Loading @@ -108,8 +107,10 @@ class EffectConversionHelperAidl { }; std::shared_ptr<android::hardware::EventFlag> mEfGroup = nullptr; status_t updateEventFlags(); void updateMqs(const ::aidl::android::hardware::audio::effect::IEffect::OpenEffectReturn& ret); void updateDataMqs( const ::aidl::android::hardware::audio::effect::IEffect::OpenEffectReturn& ret); void updateMqsAndEventFlags( const ::aidl::android::hardware::audio::effect::IEffect::OpenEffectReturn& ret); status_t handleInit(uint32_t cmdSize, const void* pCmdData, uint32_t* replySize, void* pReplyData); Loading