OpenNI 1.5.4: xn::Recorder Class Reference


#include <XnCppWrapper.h>

Inheritance diagram for xn::Recorder:

List of all members.

Public Member Functions

 Recorder (XnNodeHandle hNode=NULL)
 Recorder (const NodeWrapper &other)
XnStatus Create (Context &context, const XnChar *strFormatName=NULL)
XnStatus SetDestination (XnRecordMedium destType, const XnChar *strDest)
XnStatus GetDestination (XnRecordMedium &destType, XnChar *strDest, XnUInt32 nBufSize)
XnStatus AddNodeToRecording (ProductionNode &Node, XnCodecID compression=XN_CODEC_NULL)
XnStatus RemoveNodeFromRecording (ProductionNode &Node)
XnStatus Record ()

Detailed Description

Purpose: To create and manage a Recorder node.

Usage: Instatiate and create a Recorder node.

Data output: Records to a specified destination medium the frames of data from each node that was added to the Recorder node.


Recordings are a powerful debug tool. A recording enables a full capture of data generation and the ability to later play it back by 'regeneration' so that applications can simulate an exact replica of the situation to be debugged.

OpenNI supports recordings of the production nodes in the production graph, both the entire configuration of each node, and all data streamed from a node.

OpenNI has a framework for recording data and for playing it back (using mock nodes). It also comes with the nimRecorder module, which defines a new file format (".ONI")

If a recorder exists while generating, the 'WaitXUpdateAll' functions automatically record the data from all nodes added to this recorder.

To record, an application creates a Recorder node, and set its destination - the file name to which it should write. The application must add to the Recorder node every production node that it wants to record. When adding a node to the recorder, the Recorder stores its configuration. It also registers to every possible event of the node, so that when any configuration change takes place, it is also recorded.

Once all required nodes are added, the application can read data from the nodes and record it. Recording of data can be achieved either by explicitly calling the xn::Recorder::Record() function, or by using one of the 'Update All'" functions.

Applications that initialize OpenNI using an XML file can easily record their session without any change to the code. All that is required is that they create an additional node in the XML file for the recorder, add nodes to it, and when the application calls one of the 'WaitXUpdateAll' functions, recording will occur. see Xml Scripts for explanation on how to do that.

Recordings are played back by using the services of the Player class.

Constructor & Destructor Documentation

xn::Recorder::Recorder ( XnNodeHandle  hNode = NULL) [inline]


[in]hNodeA node handle
xn::Recorder::Recorder ( const NodeWrapper other) [inline]

Member Function Documentation

XnStatus xn::Recorder::AddNodeToRecording ( ProductionNode Node,
XnCodecID  compression = XN_CODEC_NULL 
) [inline]

Adds a node to the recording setup, and starts recording data what the node generates. This method must be called for each node to be recorded with this recorder.

[in]NodeNode to add to the recording.
[in]compressionType of compression that will be used to encode the node's data (see XnCodecIDs.h). If XN_CODEC_NULL is specified, a default compression will be chosen according to the node type.
XnStatus xn::Recorder::Create ( Context context,
const XnChar *  strFormatName = NULL 
) [inline]

Creates a Recorder node.

[in]contextThe context in which to create the Recorder node.
[in]strFormatNameOptional. The name of the format the recorded file will be in. If NULL, file will be in ONI format.
XnStatus xn::Recorder::GetDestination ( XnRecordMedium destType,
XnChar *  strDest,
XnUInt32  nBufSize 
) [inline]

Gets the destination medium for the Recorder node to record to.

[out]destTypeThe type of medium to record to. Currently only XN_RECORD_MEDIUM_FILE is supported.
[out]strDestRecording destination. If destType is XN_RECORD_MEDIUM_FILE, this specifies a file name.
[in]nBufSizeDestination buffer size.
XnStatus xn::Recorder::Record ( ) [inline]

Records one frame of data from each node that was added to the recorder with AddNodeToRecording().


To record continually, the recorder node must be called repeatedly for each frame.

It is highly recommended that an application use the 'WaitXUpdateAll' methods, and not call Generator::WaitAndUpdateData() for each generator. When working with the 'WaitXUpdateAll' methods, OpenNI will automatically call Record(), and there is no need for the application to call this method.

XnStatus xn::Recorder::RemoveNodeFromRecording ( ProductionNode Node) [inline]

Removes a node from the Recorder node and stops recording the node output. This function is called on a node that was added to recording with AddNodeToRecording.

[in]NodeThe node to remove from recording.
XnStatus xn::Recorder::SetDestination ( XnRecordMedium  destType,
const XnChar *  strDest 
) [inline]

Specifies to where the recorder must send its recording. Typically this is a disk file of a particular file type.

[in]destTypeThe type of medium to record to. Currently only XN_RECORD_MEDIUM_FILE is supported.
[in]strDestRecording destination. If destType is XN_RECORD_MEDIUM_FILE, this specifies a file name.

The documentation for this class was generated from the following file:
Generated on Wed May 16 2012 10:16:07 for OpenNI 1.5.4 by   doxygen