| 2433 | } |
| 2434 | |
| 2435 | XnBool xnDidNodeAdvanced(XnNodeHandle hNode) |
| 2436 | { |
| 2437 | XnUInt64 nTimestamp; |
| 2438 | if (!xnIsNewDataAvailableImpl(hNode, &nTimestamp)) |
| 2439 | { |
| 2440 | return (FALSE); |
| 2441 | } |
| 2442 | |
| 2443 | // node has new data |
| 2444 | if (hNode->hFrameSyncedWith != NULL) |
| 2445 | { |
| 2446 | // check that other node also have new data |
| 2447 | XnUInt64 nOtherTimestamp; |
| 2448 | if (!xnIsNewDataAvailableImpl(hNode->hFrameSyncedWith, &nOtherTimestamp)) |
| 2449 | { |
| 2450 | return (FALSE); |
| 2451 | } |
| 2452 | |
| 2453 | // check for frame sync |
| 2454 | XnUInt64 nNow; |
| 2455 | xnOSGetHighResTimeStamp(&nNow); |
| 2456 | xnDumpFileWriteString(hNode->pContext->pDumpDataFlow, "%llu,FrameSyncCheck,%s,%llu\n", nNow, hNode->pNodeInfo->strInstanceName, nTimestamp); |
| 2457 | xnDumpFileWriteString(hNode->pContext->pDumpDataFlow, "%llu,FrameSyncCheck,%s,%llu\n", nNow, hNode->hFrameSyncedWith->pNodeInfo->strInstanceName, nOtherTimestamp); |
| 2458 | XnUInt64 nDiff = (nTimestamp >= nOtherTimestamp) ? (nTimestamp - nOtherTimestamp) : (nOtherTimestamp - nTimestamp); |
| 2459 | return (nDiff <= XN_FRAME_SYNC_THRESHOLD); |
| 2460 | } |
| 2461 | else |
| 2462 | { |
| 2463 | return (TRUE); |
| 2464 | } |
| 2465 | } |
| 2466 | |
| 2467 | XnBool XN_CALLBACK_TYPE xnDidAllNodesAdvanced(void* pConditionData) |
| 2468 | { |
no test coverage detected