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

Method Watch

Source/OpenNI/XnNodeWatcher.cpp:310–341  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

308}
309
310XnStatus GeneratorWatcher::Watch()
311{
312 XnStatus nRetVal = XN_STATUS_OK;
313
314 nRetVal = NodeWatcher::Watch();
315 XN_IS_STATUS_OK(nRetVal);
316
317 XnUInt64 nCurrentTimeStamp = m_generator.GetTimestamp();
318 XnUInt32 nCurrentFrameID = m_generator.GetFrameID();
319
320 // check if timestamp has changed since last time.
321 // Note that the first frame might have a timestamp of zero, so also make sure frame ID changes
322 if ((nCurrentTimeStamp > m_nLastDataTimeStamp) ||
323 (nCurrentFrameID > m_nLastDataFrameID))
324 {
325 m_nLastDataTimeStamp = nCurrentTimeStamp;
326 m_nLastDataFrameID = nCurrentFrameID;
327
328 const void* pData = GetCurrentData();
329 if (pData != NULL)
330 {
331 nRetVal = m_notifications.OnNodeNewData(m_pCookie,
332 m_generator.GetName(),
333 nCurrentTimeStamp,
334 m_generator.GetFrameID(),
335 pData,
336 m_generator.GetDataSize());
337 XN_IS_STATUS_OK(nRetVal);
338 }
339 }
340 return XN_STATUS_OK;
341}
342
343XnUInt64 GeneratorWatcher::GetTimestamp()
344{

Callers 1

RecordMethod · 0.45

Calls 5

GetNameMethod · 0.80
GetTimestampMethod · 0.45
GetFrameIDMethod · 0.45
OnNodeNewDataMethod · 0.45
GetDataSizeMethod · 0.45

Tested by

no test coverage detected