| 493 | } |
| 494 | |
| 495 | XnStatus PlayerNode::ProcessEachNodeLastData(XnUInt32 nIDToProcessLast) |
| 496 | { |
| 497 | XnStatus nRetVal = XN_STATUS_OK; |
| 498 | XnUInt32 nItNodeID = 0; //Node ID handled in each iteration. |
| 499 | |
| 500 | for (XnUInt32 i = 0; i < m_nMaxNodes; i++) |
| 501 | { |
| 502 | /*We switch positions between nIDToProcessLast and the last position, to make sure that nIDToProcessLast is |
| 503 | handled last. This way the position at the end of our seek operation is right after the record we read |
| 504 | for nIDToProcessLast.*/ |
| 505 | if (i == nIDToProcessLast) |
| 506 | { |
| 507 | nItNodeID = m_nMaxNodes - 1; |
| 508 | } |
| 509 | else if (i == m_nMaxNodes - 1) |
| 510 | { |
| 511 | nItNodeID = nIDToProcessLast; |
| 512 | } |
| 513 | else |
| 514 | { |
| 515 | nItNodeID = i; |
| 516 | } |
| 517 | PlayerNodeInfo &pni = m_pNodeInfoMap[nItNodeID]; |
| 518 | if (pni.bIsGenerator) |
| 519 | { |
| 520 | if (!pni.bValid) |
| 521 | { |
| 522 | xnLogError(XN_MASK_OPEN_NI, "Node with ID %u is not valid", nItNodeID); |
| 523 | XN_ASSERT(FALSE); |
| 524 | return XN_STATUS_CORRUPT_FILE; |
| 525 | } |
| 526 | |
| 527 | if (pni.nLastDataPos == 0) |
| 528 | { |
| 529 | /*This means we had to undo this node's data, but found no data frame before our main node's |
| 530 | data frame. In this case we push a 0 frame.*/ |
| 531 | memset(m_pRecordBuffer, 0, RECORD_MAX_SIZE); |
| 532 | nRetVal = m_pNodeNotifications->OnNodeNewData(m_pNotificationsCookie, pni.strName, 0, 0, m_pRecordBuffer, RECORD_MAX_SIZE); |
| 533 | XN_IS_STATUS_OK(nRetVal); |
| 534 | } |
| 535 | else |
| 536 | { |
| 537 | nRetVal = SeekStream(XN_OS_SEEK_SET, pni.nLastDataPos); |
| 538 | XN_IS_STATUS_OK(nRetVal); |
| 539 | nRetVal = ProcessRecord(TRUE); |
| 540 | XN_IS_STATUS_OK(nRetVal); |
| 541 | } |
| 542 | } |
| 543 | } |
| 544 | //Now our position is right after the last data of the node with id nIDToProcessLast |
| 545 | |
| 546 | return XN_STATUS_OK; |
| 547 | } |
| 548 | |
| 549 | XnStatus PlayerNode::TellTimestamp(XnUInt64& nTimestamp) |
| 550 | { |
nothing calls this directly
no test coverage detected