MCPcopy Create free account
hub / github.com/audeering/opensmile / notifyEmptyTickloop

Method notifyEmptyTickloop

src/android/openslesSource.cpp:246–273  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

244 */
245
246bool cOpenslesSource::notifyEmptyTickloop() {
247 smileMutexLock(threadMutex_);
248 bool threadStarted = threadStarted_;
249 smileMutexUnlock(threadMutex_);
250 // we must check threadStarted and NOT threadActive here,
251 // to avoid exiting when thread is just about starting
252 if (!threadStarted) {
253 return false;
254 }
255 smileCondTimedWait(threadCondition_, 1.000);
256 smileMutexLock(dataFlagMutex_);
257 if (dataFlag_) {
258 dataFlag_ = false;
259 smileMutexUnlock(dataFlagMutex_);
260 // return 1 (true) when data was received from audio device since last tick
261 return true;
262 }
263 smileMutexUnlock(dataFlagMutex_);
264 smileMutexLock(threadMutex_);
265 bool threadActive = threadActive_;
266 smileMutexUnlock(threadMutex_);
267 if (threadActive) {
268 return true;
269 } else {
270 // return false, when no data received for 1 second
271 return false;
272 }
273}
274
275eTickResult cOpenslesSource::myTick(long long t)
276{

Callers 1

Calls 3

smileMutexLockFunction · 0.85
smileMutexUnlockFunction · 0.85
smileCondTimedWaitFunction · 0.85

Tested by

no test coverage detected