Loading audio/aidl/default/EffectContext.cpp +13 −0 Original line number Diff line number Diff line Loading @@ -242,4 +242,17 @@ RetCode EffectContext::notifyDataMqUpdate() { LOG(VERBOSE) << __func__ << " : signal client for reopen"; return RetCode::SUCCESS; } RetCode EffectContext::enable() { return RetCode::SUCCESS; } RetCode EffectContext::disable() { return RetCode::SUCCESS; } RetCode EffectContext::reset() { return RetCode::SUCCESS; } } // namespace aidl::android::hardware::audio::effect audio/aidl/default/EffectImpl.cpp +23 −3 Original line number Diff line number Diff line Loading @@ -246,7 +246,6 @@ ndk::ScopedAStatus EffectImpl::command(CommandId command) { startThread(); break; case CommandId::STOP: case CommandId::RESET: RETURN_OK_IF(mState == State::IDLE); mState = State::IDLE; RETURN_IF(notifyEventFlag(mDataMqNotEmptyEf) != RetCode::SUCCESS, EX_ILLEGAL_STATE, Loading @@ -254,6 +253,13 @@ ndk::ScopedAStatus EffectImpl::command(CommandId command) { stopThread(); RETURN_IF_ASTATUS_NOT_OK(commandImpl(command), "commandImplFailed"); break; case CommandId::RESET: mState = State::IDLE; RETURN_IF(notifyEventFlag(mDataMqNotEmptyEf) != RetCode::SUCCESS, EX_ILLEGAL_STATE, "notifyEventFlagNotEmptyFailed"); stopThread(); RETURN_IF_ASTATUS_NOT_OK(commandImpl(command), "commandImplFailed"); break; default: LOG(ERROR) << getEffectNameWithVersion() << __func__ << " instance still processing"; return ndk::ScopedAStatus::fromExceptionCodeWithMessage(EX_ILLEGAL_ARGUMENT, Loading @@ -266,8 +272,22 @@ ndk::ScopedAStatus EffectImpl::command(CommandId command) { ndk::ScopedAStatus EffectImpl::commandImpl(CommandId command) { RETURN_IF(!mImplContext, EX_NULL_POINTER, "nullContext"); if (command == CommandId::RESET) { switch (command) { case CommandId::START: mImplContext->enable(); break; case CommandId::STOP: mImplContext->disable(); break; case CommandId::RESET: mImplContext->disable(); mImplContext->reset(); mImplContext->resetBuffer(); break; default: LOG(ERROR) << __func__ << " commandId " << toString(command) << " not supported"; return ndk::ScopedAStatus::fromExceptionCodeWithMessage(EX_ILLEGAL_ARGUMENT, "commandIdNotSupported"); } return ndk::ScopedAStatus::ok(); } Loading audio/aidl/default/include/effect-impl/EffectContext.h +4 −0 Original line number Diff line number Diff line Loading @@ -82,6 +82,10 @@ class EffectContext { virtual ::android::hardware::EventFlag* getStatusEventFlag(); virtual RetCode enable(); virtual RetCode disable(); virtual RetCode reset(); protected: int mVersion = 0; size_t mInputFrameSize = 0; Loading audio/aidl/vts/EffectHelper.h +1 −1 Original line number Diff line number Diff line Loading @@ -397,10 +397,10 @@ class EffectHelper { outputBuffer.size(), outputBuffer)); } // Disable the process ASSERT_NO_FATAL_FAILURE(command(effect, CommandId::STOP)); EXPECT_NO_FATAL_FAILURE(EffectHelper::readFromFmq(statusMQ, 0, outputMQ, 0, outputBuffer)); // Disable the process ASSERT_NO_FATAL_FAILURE(command(effect, CommandId::RESET)); } Loading Loading
audio/aidl/default/EffectContext.cpp +13 −0 Original line number Diff line number Diff line Loading @@ -242,4 +242,17 @@ RetCode EffectContext::notifyDataMqUpdate() { LOG(VERBOSE) << __func__ << " : signal client for reopen"; return RetCode::SUCCESS; } RetCode EffectContext::enable() { return RetCode::SUCCESS; } RetCode EffectContext::disable() { return RetCode::SUCCESS; } RetCode EffectContext::reset() { return RetCode::SUCCESS; } } // namespace aidl::android::hardware::audio::effect
audio/aidl/default/EffectImpl.cpp +23 −3 Original line number Diff line number Diff line Loading @@ -246,7 +246,6 @@ ndk::ScopedAStatus EffectImpl::command(CommandId command) { startThread(); break; case CommandId::STOP: case CommandId::RESET: RETURN_OK_IF(mState == State::IDLE); mState = State::IDLE; RETURN_IF(notifyEventFlag(mDataMqNotEmptyEf) != RetCode::SUCCESS, EX_ILLEGAL_STATE, Loading @@ -254,6 +253,13 @@ ndk::ScopedAStatus EffectImpl::command(CommandId command) { stopThread(); RETURN_IF_ASTATUS_NOT_OK(commandImpl(command), "commandImplFailed"); break; case CommandId::RESET: mState = State::IDLE; RETURN_IF(notifyEventFlag(mDataMqNotEmptyEf) != RetCode::SUCCESS, EX_ILLEGAL_STATE, "notifyEventFlagNotEmptyFailed"); stopThread(); RETURN_IF_ASTATUS_NOT_OK(commandImpl(command), "commandImplFailed"); break; default: LOG(ERROR) << getEffectNameWithVersion() << __func__ << " instance still processing"; return ndk::ScopedAStatus::fromExceptionCodeWithMessage(EX_ILLEGAL_ARGUMENT, Loading @@ -266,8 +272,22 @@ ndk::ScopedAStatus EffectImpl::command(CommandId command) { ndk::ScopedAStatus EffectImpl::commandImpl(CommandId command) { RETURN_IF(!mImplContext, EX_NULL_POINTER, "nullContext"); if (command == CommandId::RESET) { switch (command) { case CommandId::START: mImplContext->enable(); break; case CommandId::STOP: mImplContext->disable(); break; case CommandId::RESET: mImplContext->disable(); mImplContext->reset(); mImplContext->resetBuffer(); break; default: LOG(ERROR) << __func__ << " commandId " << toString(command) << " not supported"; return ndk::ScopedAStatus::fromExceptionCodeWithMessage(EX_ILLEGAL_ARGUMENT, "commandIdNotSupported"); } return ndk::ScopedAStatus::ok(); } Loading
audio/aidl/default/include/effect-impl/EffectContext.h +4 −0 Original line number Diff line number Diff line Loading @@ -82,6 +82,10 @@ class EffectContext { virtual ::android::hardware::EventFlag* getStatusEventFlag(); virtual RetCode enable(); virtual RetCode disable(); virtual RetCode reset(); protected: int mVersion = 0; size_t mInputFrameSize = 0; Loading
audio/aidl/vts/EffectHelper.h +1 −1 Original line number Diff line number Diff line Loading @@ -397,10 +397,10 @@ class EffectHelper { outputBuffer.size(), outputBuffer)); } // Disable the process ASSERT_NO_FATAL_FAILURE(command(effect, CommandId::STOP)); EXPECT_NO_FATAL_FAILURE(EffectHelper::readFromFmq(statusMQ, 0, outputMQ, 0, outputBuffer)); // Disable the process ASSERT_NO_FATAL_FAILURE(command(effect, CommandId::RESET)); } Loading