Lines Matching refs:thread
64 AudioFlinger::EffectModule::EffectModule(ThreadBase *thread, in EffectModule() argument
71 mThread(thread), mChain(chain), mId(id), mSessionId(sessionId), in EffectModule()
82 mAudioFlinger(thread->mAudioFlinger)
97 &desc->uuid, sessionId, thread->id(), &mEffectInterface);
110 setOffloaded(thread->type() == ThreadBase::OFFLOAD, thread->id());
189 sp <ThreadBase> thread = mThread.promote(); in updatePolicyState() local
191 if (thread == nullptr || chain == nullptr) { in updatePolicyState()
194 io = thread->id(); in updatePolicyState()
566 sp<ThreadBase> thread; in configure() local
575 thread = mThread.promote(); in configure()
576 if (thread == 0) { in configure()
585 channelMask = thread->channelMask(); in configure()
622 if ((thread->type() == ThreadBase::OFFLOAD) && !isOffloaded()) { in configure()
626 mConfig.inputCfg.samplingRate = thread->sampleRate(); in configure()
652 mConfig.inputCfg.buffer.frameCount = thread->frameCount(); in configure()
656 this, thread.get(), mConfig.inputCfg.buffer.raw, mConfig.inputCfg.buffer.frameCount); in configure()
671 thread->isOutput() && in configure()
739 PlaybackThread *pbt = thread->mAudioFlinger->checkPlaybackThread_l(thread->mId); in configure()
789 sp<ThreadBase> thread = mThread.promote(); in addEffectToHal_l() local
790 if (thread != 0) { in addEffectToHal_l()
791 sp<StreamHalInterface> stream = thread->stream(); in addEffectToHal_l()
897 sp<ThreadBase> thread = mThread.promote(); in remove_effect_from_hal_l() local
898 if (thread != 0) { in remove_effect_from_hal_l()
899 sp<StreamHalInterface> stream = thread->stream(); in remove_effect_from_hal_l()
1220 sp<ThreadBase> thread = mThread.promote(); in setVolumeForOutput_l() local
1221 if (thread != 0 && in setVolumeForOutput_l()
1222 (thread->type() == ThreadBase::OFFLOAD || thread->type() == ThreadBase::DIRECT) && in setVolumeForOutput_l()
1224 PlaybackThread *t = (PlaybackThread *)thread.get(); in setVolumeForOutput_l()
1635 sp<ThreadBase> thread = effect->thread().promote(); in enable() local
1636 if (thread != 0) { in enable()
1637 thread->checkSuspendOnEffectEnabled(effect, true, effect->sessionId()); in enable()
1647 if (thread != 0) { in enable()
1648 thread->checkSuspendOnEffectEnabled(effect, false, effect->sessionId()); in enable()
1652 if (thread != 0) { in enable()
1653 if (thread->type() == ThreadBase::OFFLOAD || thread->type() == ThreadBase::MMAP) { in enable()
1654 Mutex::Autolock _l(thread->mLock); in enable()
1655 thread->broadcast_l(); in enable()
1658 if (thread->type() == ThreadBase::OFFLOAD) { in enable()
1659 PlaybackThread *t = (PlaybackThread *)thread.get(); in enable()
1663 thread->mAudioFlinger->onNonOffloadableGlobalEffectEnable(); in enable()
1696 sp<ThreadBase> thread = effect->thread().promote(); in disable() local
1697 if (thread != 0) { in disable()
1698 thread->checkSuspendOnEffectEnabled(effect, false, effect->sessionId()); in disable()
1699 if (thread->type() == ThreadBase::OFFLOAD || thread->type() == ThreadBase::MMAP) { in disable()
1700 Mutex::Autolock _l(thread->mLock); in disable()
1701 thread->broadcast_l(); in disable()
1728 sp<ThreadBase> thread = effect->thread().promote(); in disconnect() local
1729 if (thread != 0) { in disconnect()
1730 thread->disconnectEffectHandle(this, unpinIfLast); in disconnect()
1949 AudioFlinger::EffectChain::EffectChain(ThreadBase *thread, in EffectChain() argument
1951 : mThread(thread), mSessionId(sessionId), mActiveTrackCnt(0), mTrackCnt(0), mTailBufferCount(0), in EffectChain()
1956 if (thread == NULL) { in EffectChain()
1959 mMaxTailBuffers = ((kProcessTailDurationMs * thread->sampleRate()) / 1000) / in EffectChain()
1960 thread->frameCount(); in EffectChain()
2022 sp<ThreadBase> thread = mThread.promote(); in clearInputBuffer() local
2023 if (thread == 0) { in clearInputBuffer()
2027 clearInputBuffer_l(thread); in clearInputBuffer()
2031 void AudioFlinger::EffectChain::clearInputBuffer_l(const sp<ThreadBase>& thread) in clearInputBuffer_l() argument
2037 audio_bytes_per_sample(EFFECT_BUFFER_FORMAT) * thread->channelCount(); in clearInputBuffer_l()
2039 memset(mInBuffer->audioBuffer()->raw, 0, thread->frameCount() * frameSize); in clearInputBuffer_l()
2046 sp<ThreadBase> thread = mThread.promote(); in process_l() local
2047 if (thread == 0) { in process_l()
2056 bool doProcess = (thread->type() != ThreadBase::OFFLOAD) in process_l()
2057 && (thread->type() != ThreadBase::MMAP); in process_l()
2069 clearInputBuffer_l(thread); in process_l()
2105 ThreadBase *thread, in createEffect_l() argument
2112 effect = new EffectModule(thread, this, desc, id, sessionId, pinned); in createEffect_l()
2136 sp<ThreadBase> thread = mThread.promote(); in addEffect_ll() local
2137 if (thread == 0) { in addEffect_ll()
2140 effect->setThread(thread); in addEffect_ll()
2151 size_t numSamples = thread->frameCount(); in addEffect_ll()
2154 status_t result = thread->mAudioFlinger->mEffectsFactoryHal->allocateBuffer( in addEffect_ll()
2157 status_t result = thread->mAudioFlinger->mEffectsFactoryHal->allocateBuffer( in addEffect_ll()
2655 void AudioFlinger::EffectChain::setThread(const sp<ThreadBase>& thread) in setThread() argument
2658 mThread = thread; in setThread()
2660 mEffects[i]->setThread(thread); in setThread()
2710 bool AudioFlinger::EffectChain::isCompatibleWithThread_l(const sp<ThreadBase>& thread) const in isCompatibleWithThread_l()
2714 if (thread->checkEffectCompatibility_l(&(mEffects[i]->desc()), mSessionId) != NO_ERROR) { in isCompatibleWithThread_l()