Lines Matching refs:stream

72     Stream *stream = lookupStreamFromId(streamID);  in findStream()  local
73 return stream != nullptr && stream->getStreamID() == streamID ? stream : nullptr; in findStream()
76 size_t StreamMap::streamPosition(const Stream* stream) const in streamPosition()
78 ptrdiff_t index = stream - mStreamPool.get(); in streamPosition()
89 int32_t StreamMap::getNextIdForStream(Stream* stream) const { in getNextIdForStream()
92 stream, in getNextIdForStream()
93 [] (Stream *stream) { in getNextIdForStream() argument
94 return stream == nullptr ? 0 : stream->getStreamID(); in getNextIdForStream()
96 stream->getStreamID() /* oldID */); in getNextIdForStream()
119 forEach([this](Stream *stream) { in __anon8f171ec20302() argument
120 stream->setStreamManager(this); in __anon8f171ec20302()
121 if ((streamPosition(stream) & 1) == 0) { // put the first stream of pair as available. in __anon8f171ec20302()
122 mAvailableStreams.insert(stream); in __anon8f171ec20302()
146 forEach([](Stream *stream) { stream->stop(); }); in ~StreamManager() argument
151 forEach([](Stream *stream) { stream->clearAudioTrack(); }); in ~StreamManager() argument
177 for (auto stream : mAvailableStreams) { in queueForPlay() local
178 if (stream->getSoundID() == soundID) { in queueForPlay()
179 newStream = stream; in queueForPlay()
194 for (auto [unused , stream] : mRestartStreams) { in queueForPlay()
195 if (!stream->getPairStream()->hasSound()) { in queueForPlay()
196 if (stream->getSoundID() == soundID) { in queueForPlay()
198 newStream = stream; in queueForPlay()
203 newStream = stream; in queueForPlay()
211 for (auto stream : mActiveStreams) { in queueForPlay() local
212 if (stream->getPriority() <= priority) { in queueForPlay()
214 || newStream->getPriority() > stream->getPriority()) { in queueForPlay()
215 newStream = stream; in queueForPlay()
227 for (auto [unused, stream] : mRestartStreams) { in queueForPlay()
228 if (stream->getPairPriority() <= priority) { in queueForPlay()
230 newStream = stream; in queueForPlay()
281 Stream* stream, int32_t activeStreamIDToMatch) in moveToRestartQueue() argument
284 __func__, stream->getStreamID(), activeStreamIDToMatch); in moveToRestartQueue()
289 if (mProcessingStreams.count(stream) > 0 || in moveToRestartQueue()
290 mProcessingStreams.count(stream->getPairStream()) > 0) { in moveToRestartQueue()
292 __func__, stream->getStreamID()); in moveToRestartQueue()
295 moveToRestartQueue_l(stream, activeStreamIDToMatch); in moveToRestartQueue()
308 Stream* stream, int32_t activeStreamIDToMatch) in moveToRestartQueue_l() argument
311 __func__, stream->getStreamID(), activeStreamIDToMatch); in moveToRestartQueue_l()
312 if (activeStreamIDToMatch > 0 && stream->getStreamID() != activeStreamIDToMatch) { in moveToRestartQueue_l()
315 const ssize_t found = removeFromQueues_l(stream, activeStreamIDToMatch); in moveToRestartQueue_l()
320 addToRestartQueue_l(stream); in moveToRestartQueue_l()
326 Stream* stream, int32_t activeStreamIDToMatch) { in removeFromQueues_l() argument
329 if (*it == stream) { in removeFromQueues_l()
341 if (it->second == stream) { in removeFromQueues_l()
347 found += mAvailableStreams.erase(stream); in removeFromQueues_l()
354 void StreamManager::addToRestartQueue_l(Stream *stream) { in addToRestartQueue_l() argument
355 mRestartStreams.emplace(stream->getStopTimeNs(), stream); in addToRestartQueue_l()
358 void StreamManager::addToActiveQueue_l(Stream *stream) { in addToActiveQueue_l() argument
360 mActiveStreams.push_back(stream); // oldest to newest in addToActiveQueue_l()
362 mActiveStreams.push_front(stream); // newest to oldest in addToActiveQueue_l()
389 Stream* const stream = it->second; in run() local
390 const int64_t diffNs = stream->getStopTimeNs() - nowNs; in run()
396 mProcessingStreams.emplace(stream); in run()
398 stream->stop(); in run()
399 ALOGV("%s(%d) stopping streamID:%d", __func__, id, stream->getStreamID()); in run()
400 if (Stream* nextStream = stream->playPairStream(garbage)) { in run()
413 mAvailableStreams.insert(stream); in run()
415 mProcessingStreams.erase(stream); in run()
430 forEach([](const Stream *stream) { stream->dump(); }); in dump() argument