diff options
Diffstat (limited to 'audio/aidl/default/EffectImpl.cpp')
-rw-r--r-- | audio/aidl/default/EffectImpl.cpp | 28 |
1 files changed, 15 insertions, 13 deletions
diff --git a/audio/aidl/default/EffectImpl.cpp b/audio/aidl/default/EffectImpl.cpp index e90fe35054..da1ad111db 100644 --- a/audio/aidl/default/EffectImpl.cpp +++ b/audio/aidl/default/EffectImpl.cpp @@ -40,7 +40,7 @@ namespace aidl::android::hardware::audio::effect { ndk::ScopedAStatus EffectImpl::open(const Parameter::Common& common, const std::optional<Parameter::Specific>& specific, OpenEffectReturn* ret) { - LOG(DEBUG) << __func__; + LOG(DEBUG) << getEffectName() << __func__; // effect only support 32bits float RETURN_IF(common.input.base.format.pcm != common.output.base.format.pcm || common.input.base.format.pcm != PcmType::FLOAT_32_BIT, @@ -71,12 +71,12 @@ ndk::ScopedAStatus EffectImpl::close() { RETURN_IF(releaseContext() != RetCode::SUCCESS, EX_UNSUPPORTED_OPERATION, "FailedToCreateWorker"); - LOG(DEBUG) << __func__; + LOG(DEBUG) << getEffectName() << __func__; return ndk::ScopedAStatus::ok(); } ndk::ScopedAStatus EffectImpl::setParameter(const Parameter& param) { - LOG(DEBUG) << __func__ << " with: " << param.toString(); + LOG(DEBUG) << getEffectName() << __func__ << " with: " << param.toString(); const auto tag = param.getTag(); switch (tag) { @@ -91,7 +91,8 @@ ndk::ScopedAStatus EffectImpl::setParameter(const Parameter& param) { return setParameterSpecific(param.get<Parameter::specific>()); } default: { - LOG(ERROR) << __func__ << " unsupportedParameterTag " << toString(tag); + LOG(ERROR) << getEffectName() << __func__ << " unsupportedParameterTag " + << toString(tag); return ndk::ScopedAStatus::fromExceptionCodeWithMessage(EX_ILLEGAL_ARGUMENT, "ParameterNotSupported"); } @@ -99,7 +100,7 @@ ndk::ScopedAStatus EffectImpl::setParameter(const Parameter& param) { } ndk::ScopedAStatus EffectImpl::getParameter(const Parameter::Id& id, Parameter* param) { - LOG(DEBUG) << __func__ << id.toString(); + LOG(DEBUG) << getEffectName() << __func__ << id.toString(); auto tag = id.getTag(); switch (tag) { case Parameter::Id::commonTag: { @@ -116,7 +117,7 @@ ndk::ScopedAStatus EffectImpl::getParameter(const Parameter::Id& id, Parameter* break; } } - LOG(DEBUG) << __func__ << param->toString(); + LOG(DEBUG) << getEffectName() << __func__ << param->toString(); return ndk::ScopedAStatus::ok(); } @@ -149,7 +150,8 @@ ndk::ScopedAStatus EffectImpl::setParameterCommon(const Parameter& param) { EX_ILLEGAL_ARGUMENT, "setVolumeStereoFailed"); break; default: { - LOG(ERROR) << __func__ << " unsupportedParameterTag " << toString(tag); + LOG(ERROR) << getEffectName() << __func__ << " unsupportedParameterTag " + << toString(tag); return ndk::ScopedAStatus::fromExceptionCodeWithMessage(EX_ILLEGAL_ARGUMENT, "commonParamNotSupported"); } @@ -183,7 +185,7 @@ ndk::ScopedAStatus EffectImpl::getParameterCommon(const Parameter::Tag& tag, Par break; } default: { - LOG(DEBUG) << __func__ << " unsupported tag " << toString(tag); + LOG(DEBUG) << getEffectName() << __func__ << " unsupported tag " << toString(tag); return ndk::ScopedAStatus::fromExceptionCodeWithMessage(EX_ILLEGAL_ARGUMENT, "tagNotSupported"); } @@ -198,8 +200,8 @@ ndk::ScopedAStatus EffectImpl::getState(State* state) { ndk::ScopedAStatus EffectImpl::command(CommandId command) { RETURN_IF(mState == State::INIT, EX_ILLEGAL_STATE, "CommandStateError"); - LOG(DEBUG) << __func__ << ": receive command: " << toString(command) << " at state " - << toString(mState); + LOG(DEBUG) << getEffectName() << __func__ << ": receive command: " << toString(command) + << " at state " << toString(mState); switch (command) { case CommandId::START: @@ -217,11 +219,11 @@ ndk::ScopedAStatus EffectImpl::command(CommandId command) { mState = State::IDLE; break; default: - LOG(ERROR) << __func__ << " instance still processing"; + LOG(ERROR) << getEffectName() << __func__ << " instance still processing"; return ndk::ScopedAStatus::fromExceptionCodeWithMessage(EX_ILLEGAL_ARGUMENT, "CommandIdNotSupported"); } - LOG(DEBUG) << __func__ << " transfer to state: " << toString(mState); + LOG(DEBUG) << getEffectName() << __func__ << " transfer to state: " << toString(mState); return ndk::ScopedAStatus::ok(); } @@ -252,7 +254,7 @@ IEffect::Status EffectImpl::effectProcessImpl(float* in, float* out, int samples for (int i = 0; i < samples; i++) { *out++ = *in++; } - LOG(DEBUG) << __func__ << " done processing " << samples << " samples"; + LOG(DEBUG) << getEffectName() << __func__ << " done processing " << samples << " samples"; return {STATUS_OK, samples, samples}; } |