Loading media/libaudiohal/impl/EffectConversionHelperAidl.cpp +0 −12 Original line number Diff line number Diff line Loading @@ -180,18 +180,6 @@ status_t EffectConversionHelperAidl::handleSetConfig(uint32_t cmdSize, const voi State state; RETURN_STATUS_IF_ERROR(statusTFromBinderStatus(mEffect->getState(&state))); // in case of buffer/ioHandle re-configure for an opened effect, close it and re-open if (state != State::INIT && mCommon != common) { ALOGI("%s at state %s, common parameter change from %s to %s, closing effect", __func__, android::internal::ToString(state).c_str(), mCommon.toString().c_str(), common.toString().c_str()); RETURN_STATUS_IF_ERROR(statusTFromBinderStatus(mEffect->close())); RETURN_STATUS_IF_ERROR(statusTFromBinderStatus(mEffect->getState(&state))); mStatusQ.reset(); mInputQ.reset(); mOutputQ.reset(); } if (state == State::INIT) { ALOGI("%s at state %s, opening effect with input %s output %s", __func__, android::internal::ToString(state).c_str(), common.input.toString().c_str(), Loading media/libaudiohal/impl/EffectProxy.cpp +27 −2 Original line number Diff line number Diff line Loading @@ -106,8 +106,8 @@ ndk::ScopedAStatus EffectProxy::setOffloadParam(const effect_offload_param_t* of ndk::ScopedAStatus EffectProxy::open(const Parameter::Common& common, const std::optional<Parameter::Specific>& specific, IEffect::OpenEffectReturn* ret __unused) { ndk::ScopedAStatus status = ndk::ScopedAStatus::fromExceptionCodeWithMessage( EX_ILLEGAL_ARGUMENT, "nullEffectHandle"); ndk::ScopedAStatus status = ndk::ScopedAStatus::fromExceptionCodeWithMessage(EX_ILLEGAL_STATE, "nullEffectHandle"); for (auto& sub : mSubEffects) { IEffect::OpenEffectReturn openReturn; if (!sub.handle || !(status = sub.handle->open(common, specific, &openReturn)).isOk()) { Loading @@ -130,6 +130,31 @@ ndk::ScopedAStatus EffectProxy::open(const Parameter::Common& common, return status; } ndk::ScopedAStatus EffectProxy::reopen(OpenEffectReturn* ret __unused) { ndk::ScopedAStatus status = ndk::ScopedAStatus::fromExceptionCodeWithMessage(EX_ILLEGAL_STATE, "nullEffectHandle"); for (auto& sub : mSubEffects) { IEffect::OpenEffectReturn openReturn; if (!sub.handle || !(status = sub.handle->reopen(&openReturn)).isOk()) { ALOGE("%s: failed to open %p UUID %s", __func__, sub.handle.get(), ::android::audio::utils::toString(sub.descriptor.common.id.uuid).c_str()); break; } sub.effectMq.statusQ = std::make_shared<StatusMQ>(openReturn.statusMQ); sub.effectMq.inputQ = std::make_shared<DataMQ>(openReturn.inputDataMQ); sub.effectMq.outputQ = std::make_shared<DataMQ>(openReturn.outputDataMQ); } // close all opened effects if failure if (!status.isOk()) { ALOGE("%s: closing all sub-effects with error %s", __func__, status.getDescription().c_str()); close(); } return status; } ndk::ScopedAStatus EffectProxy::close() { command(CommandId::STOP); return runWithAllSubEffects([&](std::shared_ptr<IEffect>& effect) { Loading media/libaudiohal/impl/EffectProxy.h +2 −0 Original line number Diff line number Diff line Loading @@ -62,6 +62,8 @@ class EffectProxy final : public ::aidl::android::hardware::audio::effect::BnEff specific, ::aidl::android::hardware::audio::effect::IEffect::OpenEffectReturn* ret) override; ndk::ScopedAStatus close() override; ndk::ScopedAStatus reopen( ::aidl::android::hardware::audio::effect::IEffect::OpenEffectReturn* ret) override; ndk::ScopedAStatus getDescriptor( ::aidl::android::hardware::audio::effect::Descriptor* desc) override; ndk::ScopedAStatus command(::aidl::android::hardware::audio::effect::CommandId id) override; Loading Loading
media/libaudiohal/impl/EffectConversionHelperAidl.cpp +0 −12 Original line number Diff line number Diff line Loading @@ -180,18 +180,6 @@ status_t EffectConversionHelperAidl::handleSetConfig(uint32_t cmdSize, const voi State state; RETURN_STATUS_IF_ERROR(statusTFromBinderStatus(mEffect->getState(&state))); // in case of buffer/ioHandle re-configure for an opened effect, close it and re-open if (state != State::INIT && mCommon != common) { ALOGI("%s at state %s, common parameter change from %s to %s, closing effect", __func__, android::internal::ToString(state).c_str(), mCommon.toString().c_str(), common.toString().c_str()); RETURN_STATUS_IF_ERROR(statusTFromBinderStatus(mEffect->close())); RETURN_STATUS_IF_ERROR(statusTFromBinderStatus(mEffect->getState(&state))); mStatusQ.reset(); mInputQ.reset(); mOutputQ.reset(); } if (state == State::INIT) { ALOGI("%s at state %s, opening effect with input %s output %s", __func__, android::internal::ToString(state).c_str(), common.input.toString().c_str(), Loading
media/libaudiohal/impl/EffectProxy.cpp +27 −2 Original line number Diff line number Diff line Loading @@ -106,8 +106,8 @@ ndk::ScopedAStatus EffectProxy::setOffloadParam(const effect_offload_param_t* of ndk::ScopedAStatus EffectProxy::open(const Parameter::Common& common, const std::optional<Parameter::Specific>& specific, IEffect::OpenEffectReturn* ret __unused) { ndk::ScopedAStatus status = ndk::ScopedAStatus::fromExceptionCodeWithMessage( EX_ILLEGAL_ARGUMENT, "nullEffectHandle"); ndk::ScopedAStatus status = ndk::ScopedAStatus::fromExceptionCodeWithMessage(EX_ILLEGAL_STATE, "nullEffectHandle"); for (auto& sub : mSubEffects) { IEffect::OpenEffectReturn openReturn; if (!sub.handle || !(status = sub.handle->open(common, specific, &openReturn)).isOk()) { Loading @@ -130,6 +130,31 @@ ndk::ScopedAStatus EffectProxy::open(const Parameter::Common& common, return status; } ndk::ScopedAStatus EffectProxy::reopen(OpenEffectReturn* ret __unused) { ndk::ScopedAStatus status = ndk::ScopedAStatus::fromExceptionCodeWithMessage(EX_ILLEGAL_STATE, "nullEffectHandle"); for (auto& sub : mSubEffects) { IEffect::OpenEffectReturn openReturn; if (!sub.handle || !(status = sub.handle->reopen(&openReturn)).isOk()) { ALOGE("%s: failed to open %p UUID %s", __func__, sub.handle.get(), ::android::audio::utils::toString(sub.descriptor.common.id.uuid).c_str()); break; } sub.effectMq.statusQ = std::make_shared<StatusMQ>(openReturn.statusMQ); sub.effectMq.inputQ = std::make_shared<DataMQ>(openReturn.inputDataMQ); sub.effectMq.outputQ = std::make_shared<DataMQ>(openReturn.outputDataMQ); } // close all opened effects if failure if (!status.isOk()) { ALOGE("%s: closing all sub-effects with error %s", __func__, status.getDescription().c_str()); close(); } return status; } ndk::ScopedAStatus EffectProxy::close() { command(CommandId::STOP); return runWithAllSubEffects([&](std::shared_ptr<IEffect>& effect) { Loading
media/libaudiohal/impl/EffectProxy.h +2 −0 Original line number Diff line number Diff line Loading @@ -62,6 +62,8 @@ class EffectProxy final : public ::aidl::android::hardware::audio::effect::BnEff specific, ::aidl::android::hardware::audio::effect::IEffect::OpenEffectReturn* ret) override; ndk::ScopedAStatus close() override; ndk::ScopedAStatus reopen( ::aidl::android::hardware::audio::effect::IEffect::OpenEffectReturn* ret) override; ndk::ScopedAStatus getDescriptor( ::aidl::android::hardware::audio::effect::Descriptor* desc) override; ndk::ScopedAStatus command(::aidl::android::hardware::audio::effect::CommandId id) override; Loading