MCPcopy Create free account
hub / github.com/OpenNI/OpenNI / PlaybackThread

Method PlaybackThread

Source/OpenNI/XnPlayerImpl.cpp:757–784  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

755}
756
757void PlayerImpl::PlaybackThread()
758{
759 XnStatus nRetVal = XN_STATUS_OK;
760
761 while (!m_bPlaybackThreadShutdown)
762 {
763 nRetVal = xnOSWaitEvent(m_hPlaybackEvent, XN_WAIT_INFINITE);
764 if (nRetVal != XN_STATUS_OK && nRetVal != XN_STATUS_OS_EVENT_TIMEOUT)
765 {
766 xnLogWarning(XN_MASK_OPEN_NI, "Failed to wait for event: %s", xnGetStatusString(nRetVal));
767 xnOSSleep(1);
768 continue;
769 }
770
771 if (m_bPlaybackThreadShutdown)
772 {
773 return;
774 }
775
776 nRetVal = xnPlayerReadNext(m_hPlayer);
777 if (nRetVal != XN_STATUS_OK)
778 {
779 xnLogWarning(XN_MASK_OPEN_NI, "Failed to playback: %s", xnGetStatusString(nRetVal));
780 xnOSSleep(1);
781 continue;
782 }
783 }
784}
785
786XN_THREAD_PROC PlayerImpl::PlaybackThread(XN_THREAD_PARAM pThreadParam)
787{

Callers

nothing calls this directly

Calls 4

xnGetStatusStringFunction · 0.85
xnPlayerReadNextFunction · 0.85
xnOSWaitEventFunction · 0.50
xnOSSleepFunction · 0.50

Tested by

no test coverage detected