// Must be called with EffectChain::mLock locked
void AudioFlinger::EffectChain::process_l()
{
sp<ThreadBase> thread = mThread.promote();
if (thread == 0) {
ALOGW("process_l(): cannot promote mixer thread");
return;
}
bool isGlobalSession = (mSessionId == AUDIO_SESSION_OUTPUT_MIX) ||
(mSessionId == AUDIO_SESSION_OUTPUT_STAGE);
// never process effects when:
// - on an OFFLOAD thread
// - no more tracks are on the session and the effect tail has been rendered
bool doProcess = (thread->type() != ThreadBase::OFFLOAD);
//1、对于非全局effect,如果没有关联的track且tailBuffCount为0,则不使用音效
// 每次新增激活track,都会将tailBuffCount置为MaxCount,所以当激活track
// 数量不为0时,tailBuffCount肯定大于0,因此当有激活track存在时,一定会
// 执行音效处理,如果没有激活track存在时,如果有关联的track,虽然调用了音效
// 处理,但实际上输入已经经过清理了,
Audio笔记之EffectChain::process_l
最新推荐文章于 2022-08-27 10:57:44 发布
![](https://img-home.csdnimg.cn/images/20240711042549.png)