Lines Matching refs:thread
332 sp<MmapThread> thread = mMmapThreads.valueFor(io); in openMmapStream() local
333 if (thread != 0) { in openMmapStream()
334 interface = new MmapThreadHandle(thread); in openMmapStream()
335 thread->configure(&localAttr, streamType, actualSessionId, callback, *deviceId, portId); in openMmapStream()
757 PlaybackThread *thread = checkPlaybackThread_l(output.outputId); in createTrack() local
758 if (thread == NULL) { in createTrack()
786 track = thread->createTrack_l(client, streamType, localAttr, &output.sampleRate, in createTrack()
796 output.afFrameCount = thread->frameCount(); in createTrack()
797 output.afSampleRate = thread->sampleRate(); in createTrack()
798 output.afLatencyMs = thread->latency(); in createTrack()
813 size_t frameCount = std::lcm(thread->frameCount(), secondaryThread->frameCount()); in createTrack()
866 Mutex::Autolock _dl(thread->mLock); in createTrack()
868 if (moveEffectChain_l(sessionId, effectThread, thread) == NO_ERROR) { in createTrack()
869 effectThreadId = thread->id(); in createTrack()
870 effectIds = thread->getEffectIds_l(sessionId); in createTrack()
877 if (thread->isValidSyncEvent(mPendingSyncEvents[i])) { in createTrack()
889 setAudioHwSyncForSession_l(thread, sessionId); in createTrack()
925 ThreadBase *thread = checkThread_l(ioHandle); in sampleRate() local
926 if (thread == NULL) { in sampleRate()
930 return thread->sampleRate(); in sampleRate()
936 PlaybackThread *thread = checkPlaybackThread_l(output); in format() local
937 if (thread == NULL) { in format()
941 return thread->format(); in format()
947 ThreadBase *thread = checkThread_l(ioHandle); in frameCount() local
948 if (thread == NULL) { in frameCount()
954 return thread->frameCount(); in frameCount()
960 ThreadBase *thread = checkThread_l(ioHandle); in frameCountHAL() local
961 if (thread == NULL) { in frameCountHAL()
965 return thread->frameCountHAL(); in frameCountHAL()
971 PlaybackThread *thread = checkPlaybackThread_l(output); in latency() local
972 if (thread == NULL) { in latency()
976 return thread->latency(); in latency()
1459 sp<ThreadBase> thread; in setParameters() local
1462 thread = checkPlaybackThread_l(ioHandle); in setParameters()
1463 if (thread == 0) { in setParameters()
1464 thread = checkRecordThread_l(ioHandle); in setParameters()
1465 if (thread == 0) { in setParameters()
1466 thread = checkMmapThread_l(ioHandle); in setParameters()
1468 } else if (thread == primaryPlaybackThread_l()) { in setParameters()
1478 if (thread != 0) { in setParameters()
1479 status_t result = thread->setParameters(filteredKeyValuePairs); in setParameters()
1480 forwardParametersToDownstreamPatches_l(thread->id(), filteredKeyValuePairs); in setParameters()
1511 ThreadBase *thread = (ThreadBase *)checkPlaybackThread_l(ioHandle); in getParameters() local
1512 if (thread == NULL) { in getParameters()
1513 thread = (ThreadBase *)checkRecordThread_l(ioHandle); in getParameters()
1514 if (thread == NULL) { in getParameters()
1515 thread = (ThreadBase *)checkMmapThread_l(ioHandle); in getParameters()
1516 if (thread == NULL) { in getParameters()
1521 return thread->getParameters(keys); in getParameters()
1715 sp<ThreadBase> thread; in getEffectThread_l() local
1719 ALOG_ASSERT(thread == 0); in getEffectThread_l()
1720 thread = mPlaybackThreads.valueAt(i); in getEffectThread_l()
1723 if (thread != nullptr) { in getEffectThread_l()
1724 return thread; in getEffectThread_l()
1728 ALOG_ASSERT(thread == 0); in getEffectThread_l()
1729 thread = mRecordThreads.valueAt(i); in getEffectThread_l()
1732 if (thread != nullptr) { in getEffectThread_l()
1733 return thread; in getEffectThread_l()
1737 ALOG_ASSERT(thread == 0); in getEffectThread_l()
1738 thread = mMmapThreads.valueAt(i); in getEffectThread_l()
1741 return thread; in getEffectThread_l()
1917 RecordThread *thread = checkRecordThread_l(output.inputId); in createRecord() local
1918 if (thread == NULL) { in createRecord()
1930 recordTrack = thread->createRecordTrack_l(client, input.attr, &output.sampleRate, in createRecord()
1954 Mutex::Autolock _l(thread->mLock); in createRecord()
1955 thread->addEffectChain_l(chain); in createRecord()
2088 PlaybackThread *thread = fastPlaybackThread_l(); in getPrimaryOutputSamplingRate() local
2089 return thread != NULL ? thread->sampleRate() : 0; in getPrimaryOutputSamplingRate()
2095 PlaybackThread *thread = fastPlaybackThread_l(); in getPrimaryOutputFrameCount() local
2096 return thread != NULL ? thread->frameCountHAL() : 0; in getPrimaryOutputFrameCount()
2211 sp<PlaybackThread> thread = mPlaybackThreads.valueAt(i); in getAudioHwSyncForSession() local
2212 uint32_t sessions = thread->hasAudioSession(sessionId); in getAudioHwSyncForSession()
2217 thread->setParameters(keyValuePairs); in getAudioHwSyncForSession()
2218 forwardParametersToDownstreamPatches_l(thread->id(), keyValuePairs, in getAudioHwSyncForSession()
2219 [](const sp<PlaybackThread>& thread) { return thread->usesHwAvSync(); }); in getAudioHwSyncForSession() argument
2238 ThreadBase *thread = (ThreadBase *)mPlaybackThreads.valueAt(i).get(); in systemReady() local
2239 thread->systemReady(); in systemReady()
2242 ThreadBase *thread = (ThreadBase *)mRecordThreads.valueAt(i).get(); in systemReady() local
2243 thread->systemReady(); in systemReady()
2257 void AudioFlinger::setAudioHwSyncForSession_l(PlaybackThread *thread, audio_session_t sessionId) in setAudioHwSyncForSession_l() argument
2266 thread->setParameters(keyValuePairs); in setAudioHwSyncForSession_l()
2267 forwardParametersToDownstreamPatches_l(thread->id(), keyValuePairs, in setAudioHwSyncForSession_l()
2268 [](const sp<PlaybackThread>& thread) { return thread->usesHwAvSync(); }); in setAudioHwSyncForSession_l() argument
2333 sp<MmapPlaybackThread> thread = in openOutput_l() local
2336 mMmapThreads.add(*output, thread); in openOutput_l()
2338 *output, thread.get()); in openOutput_l()
2339 return thread; in openOutput_l()
2341 sp<PlaybackThread> thread; in openOutput_l() local
2343 thread = new OffloadThread(this, outputStream, *output, devices, mSystemReady); in openOutput_l()
2345 *output, thread.get()); in openOutput_l()
2349 thread = new DirectOutputThread(this, outputStream, *output, devices, mSystemReady); in openOutput_l()
2351 *output, thread.get()); in openOutput_l()
2353 thread = new MixerThread(this, outputStream, *output, devices, mSystemReady); in openOutput_l()
2355 *output, thread.get()); in openOutput_l()
2357 mPlaybackThreads.add(*output, thread); in openOutput_l()
2359 return thread; in openOutput_l()
2389 sp<ThreadBase> thread = openOutput_l(module, output, config, *devices, address, flags); in openOutput() local
2390 if (thread != 0) { in openOutput()
2392 PlaybackThread *playbackThread = (PlaybackThread *)thread.get(); in openOutput()
2409 MmapThread *mmapThread = (MmapThread *)thread.get(); in openOutput()
2432 DuplicatingThread *thread = new DuplicatingThread(this, thread1, id, mSystemReady); in openDuplicateOutput() local
2433 thread->addOutputTrack(thread2); in openDuplicateOutput()
2434 mPlaybackThreads.add(id, thread); in openDuplicateOutput()
2436 thread->ioConfigChanged(AUDIO_OUTPUT_OPENED); in openDuplicateOutput()
2518 void AudioFlinger::closeOutputFinish(const sp<PlaybackThread>& thread) in closeOutputFinish() argument
2520 AudioStreamOut *out = thread->clearOutput(); in closeOutputFinish()
2526 void AudioFlinger::closeThreadInternal_l(const sp<PlaybackThread>& thread) in closeThreadInternal_l() argument
2528 mPlaybackThreads.removeItem(thread->mId); in closeThreadInternal_l()
2529 thread->exit(); in closeThreadInternal_l()
2530 closeOutputFinish(thread); in closeThreadInternal_l()
2536 PlaybackThread *thread = checkPlaybackThread_l(output); in suspendOutput() local
2538 if (thread == NULL) { in suspendOutput()
2543 thread->suspend(); in suspendOutput()
2551 PlaybackThread *thread = checkPlaybackThread_l(output); in restoreOutput() local
2553 if (thread == NULL) { in restoreOutput()
2559 thread->restore(); in restoreOutput()
2578 sp<ThreadBase> thread = openInput_l( in openInput() local
2581 if (thread != 0) { in openInput()
2583 thread->ioConfigChanged(AUDIO_INPUT_OPENED); in openInput()
2658 sp<MmapCaptureThread> thread = in openInput_l() local
2662 mMmapThreads.add(*input, thread); in openInput_l()
2664 thread.get()); in openInput_l()
2665 return thread; in openInput_l()
2670 sp<RecordThread> thread = new RecordThread(this, in openInput_l() local
2677 mRecordThreads.add(*input, thread); in openInput_l()
2678 ALOGV("openInput_l() created record thread: ID %d thread %p", *input, thread.get()); in openInput_l()
2679 return thread; in openInput_l()
2769 void AudioFlinger::closeInputFinish(const sp<RecordThread>& thread) in closeInputFinish() argument
2771 thread->exit(); in closeInputFinish()
2772 AudioStreamIn *in = thread->clearInput(); in closeInputFinish()
2778 void AudioFlinger::closeThreadInternal_l(const sp<RecordThread>& thread) in closeThreadInternal_l() argument
2780 mRecordThreads.removeItem(thread->mId); in closeThreadInternal_l()
2781 closeInputFinish(thread); in closeThreadInternal_l()
2790 PlaybackThread *thread = mPlaybackThreads.valueAt(i).get(); in invalidateStream() local
2791 thread->invalidateTracks(stream); in invalidateStream()
2968 void AudioFlinger::dumpToThreadLog_l(const sp<ThreadBase> &thread) in dumpToThreadLog_l() argument
2973 thread->dump(fd, {} /* args */); in dumpToThreadLog_l()
2981 ThreadBase *thread = checkMmapThread_l(ioHandle); in checkThread_l() local
2982 if (thread == 0) { in checkThread_l()
2985 thread = checkPlaybackThread_l(ioHandle); in checkThread_l()
2988 thread = checkRecordThread_l(ioHandle); in checkThread_l()
2994 return thread; in checkThread_l()
3006 PlaybackThread *thread = checkPlaybackThread_l(output); in checkMixerThread_l() local
3007 return thread != NULL && thread->type() != ThreadBase::DIRECT ? (MixerThread *) thread : NULL; in checkMixerThread_l()
3080 PlaybackThread *thread = mPlaybackThreads.valueAt(i).get(); in primaryPlaybackThread_l() local
3081 if(thread->isDuplicating()) { in primaryPlaybackThread_l()
3084 AudioStreamOut *output = thread->getOutput(); in primaryPlaybackThread_l()
3086 return thread; in primaryPlaybackThread_l()
3094 PlaybackThread *thread = primaryPlaybackThread_l(); in primaryOutputDevice_l() local
3096 if (thread == NULL) { in primaryOutputDevice_l()
3100 return thread->outDevice(); in primaryOutputDevice_l()
3108 PlaybackThread *thread = mPlaybackThreads.valueAt(i).get(); in fastPlaybackThread_l() local
3109 if (!thread->isDuplicating()) { in fastPlaybackThread_l()
3110 size_t frameCount = thread->frameCountHAL(); in fastPlaybackThread_l()
3112 (frameCount == minFrameCount && thread->hasFastMixer() && in fastPlaybackThread_l()
3115 minThread = thread; in fastPlaybackThread_l()
3419 ThreadBase *thread = checkRecordThread_l(io); in createEffect() local
3420 if (thread == NULL) { in createEffect()
3421 thread = checkPlaybackThread_l(io); in createEffect()
3422 if (thread == NULL) { in createEffect()
3423 thread = checkMmapThread_l(io); in createEffect()
3424 if (thread == NULL) { in createEffect()
3435 Mutex::Autolock _l(thread->mLock); in createEffect()
3436 thread->addEffectChain_l(chain); in createEffect()
3444 handle = thread->createEffect_l(client, effectClient, priority, sessionId, in createEffect()
3507 sp<ThreadBase> thread = getEffectThread_l(sessionId, effectId); in setEffectSuspended() local
3508 if (thread == nullptr) { in setEffectSuspended()
3511 Mutex::Autolock _sl(thread->mLock); in setEffectSuspended()
3512 sp<EffectModule> effect = thread->getEffect_l(sessionId, effectId); in setEffectSuspended()
3513 thread->setEffectSuspended_l(&effect->desc().type, suspended, sessionId); in setEffectSuspended()
3594 sp<PlaybackThread> thread = in moveAuxEffectToIo() local
3597 if (EffectId != 0 && thread != 0 && dstThread != thread.get()) { in moveAuxEffectToIo()
3599 Mutex::Autolock _sl(thread->mLock); in moveAuxEffectToIo()
3600 sp<EffectChain> srcChain = thread->getEffectChain_l(AUDIO_SESSION_OUTPUT_MIX); in moveAuxEffectToIo()
3610 thread->removeEffect_l(effect); in moveAuxEffectToIo()
3613 thread->addEffect_l(effect); in moveAuxEffectToIo()
3620 thread->addEffect_l(effect); in moveAuxEffectToIo()
3633 *srcThread = thread; in moveAuxEffectToIo()