OpenNI 1.5.4
Playing a file recording

The following code opens a file recording and reads data from it:

// Initialize OpenNI
xn::Context context;
nRetVal = context.Init();
// TODO: check error code
// Open file recording
nRetVal = context.OpenFileRecording(".\\MyRecording.oni");
// TODO: check error code
// Look for the depth node
nRetVal = context.FindExistingNode(XN_NODE_TYPE_DEPTH, depth);
if (nRetVal != XN_STATUS_OK)
{
printf("Can't run - no depth generator is present in recording!\n");
exit(-1);
}
// TODO: mainloop - process data
xn::Context::FindExistingNode
XnStatus FindExistingNode(XnProductionNodeType type, ProductionNode &node) const
Searches for an existing created node of a specified type and returns a reference to it.
Definition: XnCppWrapper.h:9128
XN_STATUS_OK
#define XN_STATUS_OK
Definition: XnStatus.h:37
XN_NODE_TYPE_DEPTH
@ XN_NODE_TYPE_DEPTH
Definition: XnTypes.h:106
xn::DepthGenerator
Definition: XnCppWrapper.h:4714
xn::Context::Init
XnStatus Init()
Builds the context's general software environment.
Definition: XnCppWrapper.h:8727
xn::Context::OpenFileRecording
XnStatus OpenFileRecording(const XnChar *strFileName, ProductionNode &playerNode)
Recreates a production graph from a recorded ONI file and then replays the data generation exactly as...
Definition: XnCppWrapper.h:8841
xn::Context
Definition: XnCppWrapper.h:8613