diff --git a/audio/aidl/default/EffectImpl.cpp b/audio/aidl/default/EffectImpl.cpp index b24ca630d3..403a4b9e88 100644 --- a/audio/aidl/default/EffectImpl.cpp +++ b/audio/aidl/default/EffectImpl.cpp @@ -49,7 +49,6 @@ ndk::ScopedAStatus EffectImpl::open(const Parameter::Common& common, auto context = createContext(common); RETURN_IF(!context, EX_NULL_POINTER, "createContextFailed"); - RETURN_IF_ASTATUS_NOT_OK(setParameterCommon(common), "setCommParamErr"); if (specific.has_value()) { RETURN_IF_ASTATUS_NOT_OK(setParameterSpecific(specific.value()), "setSpecParamErr"); } diff --git a/audio/aidl/default/include/effect-impl/EffectContext.h b/audio/aidl/default/include/effect-impl/EffectContext.h index 7bbf19eedf..2ab0ade4dd 100644 --- a/audio/aidl/default/include/effect-impl/EffectContext.h +++ b/audio/aidl/default/include/effect-impl/EffectContext.h @@ -37,7 +37,6 @@ class EffectContext { DataMQ; EffectContext(size_t statusDepth, const Parameter::Common& common) { - mSessionId = common.session; auto& input = common.input; auto& output = common.output; @@ -63,6 +62,7 @@ class EffectContext { LOG(ERROR) << __func__ << " created invalid FMQ"; } mWorkBuffer.reserve(std::max(inBufferSizeInFloat, outBufferSizeInFloat)); + mCommon = common; } virtual ~EffectContext() {} @@ -88,7 +88,8 @@ class EffectContext { } size_t getInputFrameSize() { return mInputFrameSize; } size_t getOutputFrameSize() { return mOutputFrameSize; } - int getSessionId() { return mSessionId; } + int getSessionId() { return mCommon.session; } + int getIoHandle() { return mCommon.ioHandle; } virtual RetCode setOutputDevice( const std::vector& @@ -96,6 +97,7 @@ class EffectContext { mOutputDevice = device; return RetCode::SUCCESS; } + virtual std::vector getOutputDevice() { return mOutputDevice; @@ -131,7 +133,6 @@ class EffectContext { protected: // common parameters - int mSessionId = INVALID_AUDIO_SESSION_ID; size_t mInputFrameSize; size_t mOutputFrameSize; Parameter::Common mCommon;