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

Method FinalizeStream

Source/Modules/nimRecorder/RecorderNode.cpp:441–468  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

439}
440
441XnStatus RecorderNode::FinalizeStream()
442{
443 XN_VALIDATE_INPUT_PTR(m_pOutputStream);
444 EndRecord endRecord(m_pRecordBuffer, RECORD_MAX_SIZE, FALSE);
445 XnStatus nRetVal = endRecord.Encode();
446 XN_IS_STATUS_OK(nRetVal);
447 /* Write End Record */
448 nRetVal = WriteRecordToStream(NULL, endRecord);
449 XN_IS_STATUS_OK(nRetVal);
450
451 /* Remove all nodes in the map. When each node is removed, we write its number of frames and max time stamp */
452 RecordedNodesInfo::ConstIterator it = m_recordedNodesInfo.Begin();
453 while (it != m_recordedNodesInfo.End())
454 {
455 RecordedNodesInfo::ConstIterator curr = it;
456 ++it;
457 nRetVal = RemoveNode(curr->Key());
458 XN_IS_STATUS_OK(nRetVal);
459 }
460
461 /* Re-write header with correct max timestamp*/
462 nRetVal = SeekStream(XN_OS_SEEK_SET, 0);
463 XN_IS_STATUS_OK(nRetVal);
464 nRetVal = WriteHeader(m_nGlobalMaxTimeStamp, m_nNumNodes);
465 XN_IS_STATUS_OK(nRetVal);
466
467 return XN_STATUS_OK;
468}
469
470XnStatus RecorderNode::CloseStream()
471{

Callers

nothing calls this directly

Calls 3

EncodeMethod · 0.80
BeginMethod · 0.45
EndMethod · 0.45

Tested by

no test coverage detected