![]() |
OpenNI 1.5.4
|
#include <XnCppWrapper.h>
Public Member Functions | |
Player (XnNodeHandle hNode=NULL) | |
Player (const NodeWrapper &other) | |
XnStatus | Create (Context &context, const XnChar *strFormatName) |
XnStatus | SetRepeat (XnBool bRepeat) |
XnStatus | SetSource (XnRecordMedium sourceType, const XnChar *strSource) |
XnStatus | GetSource (XnRecordMedium &sourceType, XnChar *strSource, XnUInt32 nBufSize) const |
XnStatus | ReadNext () |
XnStatus | SeekToTimeStamp (XnInt64 nTimeOffset, XnPlayerSeekOrigin origin) |
XnStatus | SeekToFrame (const XnChar *strNodeName, XnInt32 nFrameOffset, XnPlayerSeekOrigin origin) |
XnStatus | TellTimestamp (XnUInt64 &nTimestamp) const |
XnStatus | TellFrame (const XnChar *strNodeName, XnUInt32 &nFrame) const |
XnStatus | GetNumFrames (const XnChar *strNodeName, XnUInt32 &nFrames) const |
const XnChar * | GetSupportedFormat () const |
XnStatus | EnumerateNodes (NodeInfoList &list) const |
XnBool | IsEOF () const |
XnStatus | RegisterToEndOfFileReached (StateChangedHandler handler, void *pCookie, XnCallbackHandle &hCallback) |
void | UnregisterFromEndOfFileReached (XnCallbackHandle hCallback) |
XnStatus | SetPlaybackSpeed (XnDouble dSpeed) |
XnDouble | GetPlaybackSpeed () const |
![]() | |
ProductionNode (XnNodeHandle hNode=NULL) | |
ProductionNode (const NodeWrapper &other) | |
NodeInfo | GetInfo () const |
XnStatus | AddNeededNode (ProductionNode &needed) |
XnStatus | RemoveNeededNode (ProductionNode &needed) |
void | GetContext (Context &context) const |
Context | GetContext () const |
XnBool | IsCapabilitySupported (const XnChar *strCapabilityName) const |
XnStatus | SetIntProperty (const XnChar *strName, XnUInt64 nValue) |
XnStatus | SetRealProperty (const XnChar *strName, XnDouble dValue) |
XnStatus | SetStringProperty (const XnChar *strName, const XnChar *strValue) |
XnStatus | SetGeneralProperty (const XnChar *strName, XnUInt32 nBufferSize, const void *pBuffer) |
XnStatus | GetIntProperty (const XnChar *strName, XnUInt64 &nValue) const |
XnStatus | GetRealProperty (const XnChar *strName, XnDouble &dValue) const |
XnStatus | GetStringProperty (const XnChar *strName, XnChar *csValue, XnUInt32 nBufSize) const |
XnStatus | GetGeneralProperty (const XnChar *strName, XnUInt32 nBufferSize, void *pBuffer) const |
XnStatus | LockForChanges (XnLockHandle *phLock) |
void | UnlockForChanges (XnLockHandle hLock) |
XnStatus | LockedNodeStartChanges (XnLockHandle hLock) |
void | LockedNodeEndChanges (XnLockHandle hLock) |
const ErrorStateCapability | GetErrorStateCap () const |
ErrorStateCapability | GetErrorStateCap () |
GeneralIntCapability | GetGeneralIntCap (const XnChar *strCapability) |
![]() | |
NodeWrapper (XnNodeHandle hNode) | |
NodeWrapper (const NodeWrapper &other) | |
NodeWrapper & | operator= (const NodeWrapper &other) |
~NodeWrapper () | |
operator XnNodeHandle () const | |
XnNodeHandle | GetHandle () const |
XnBool | operator== (const NodeWrapper &other) |
XnBool | operator!= (const NodeWrapper &other) |
XnBool | IsValid () const |
const XnChar * | GetName () const |
XnStatus | AddRef () |
void | Release () |
void | SetHandle (XnNodeHandle hNode) |
void | TakeOwnership (XnNodeHandle hNode) |
Purpose: The Player class is used for creating and managing a Player node. This node plays a saved recording of an OpenNI data generation session.
Remarks:
To play a file recording, use the xn::Context::OpenFileRecording() function. OpenNI will open the file, create a mock node for each node in the file, and populate it with the recorded configuration.
An application may take the nodes it needs by calling the xn::Context::FindExistingNode() method, and use them normally.
Applications that initialize OpenNI using an XML file can easily replace their input. This means that instead of reading from a physical device, which generates data in real-time, they read from a recording by replacing the nodes in the XML file with a recording element (see Xml Scripts).
|
inline |
Ctor
[in] | hNode | Player node handle |
|
inline |
Creates a player node.
Remarks
See Concepts: the Create() Method for a detailed description about the operation of this method.
|
inline |
Retrieves a list of the nodes played by a player. For full details and usage, see xnEnumeratePlayerNodes
|
inline |
Gets the total number of frames a specific node has in the recording.
[in] | strNodeName | Name of the node for which to retrieve the number of frames. |
[out] | nFrames | Retrieved number of frames. |
|
inline |
Gets the playback speed.
|
inline |
|
inline |
Gets the name of the format supported by a player. For full details and usage, see xnGetPlayerSupportedFormat
|
inline |
Returns whether the player is at the end-of-file marker.
Remarks
When Repeat mode is on, this function never returns TRUE. However, the 'End of File Reached' event will be raised during rewind.
|
inline |
Reads the next data element from the player. For full details and usage, see xnPlayerReadNext
|
inline |
Registers an event handler for the 'End-Of-File Reached' event.
[in] | handler | Callback function to be invoked when the event is raised. |
[in] | pCookie | User's cookie, to be delivered to the callback. |
[out] | hCallback | Handle to the callback to be used for unregistering it. |
For full details and usage of the parameters, see Registering to Events.
|
inline |
Moves the player to a specific frame of a specific played node, e.g., an ImageGenerator node, so that playing will continue from that frame onwards.
[in] | strNodeName | Name of the node. |
[in] | nFrameOffset | Number of frames to move, relative to the specified origin. See remarks below. |
[in] | origin | Origin to seek from. See remarks below. |
The meaning of the nFrameOffset
parameter changes according to the origin parameter:
XN_PLAYER_SEEK_SET: nFrameOffset
specifies the total number of frames since the beginning of the node's recording. This must be a positive value.
XN_PLAYER_SEEK_CUR: nFrameOffset
specifies the number of frames to move, relative to the current frame of the specified node. A positive value means to move forward, and a negative value means to move backwards.
XN_PLAYER_SEEK_END: nFrameOffset
specifies the number of frames to move, relative to the end of the node's recording. This must be a negative value.
You can get different results using this function for different values of strNodeName, because the frame numbers of different nodes are not necessarily in sync.
|
inline |
Moves the player to a specific time, so that playback will continue from that point onwards.
[in] | nTimeOffset | Offset to move, relative to the specified origin. Units in microseconds. See the remark below. |
[in] | origin | Origin to seek from. See the remarks below. |
The meaning of the nTimeOffset
parameter changes according to the origin parameter:
XN_PLAYER_SEEK_SET: nTimeOffset
specifies the total time passed since the beginning of the recording. This must be a positive value.
XN_PLAYER_SEEK_CUR: nTimeOffset
specifies a period of time to move, relative to the current player position. A positive value means to move forward, and a negative value means to move backwards.
XN_PLAYER_SEEK_END: nTimeOffset
specifies a period of time to move, relative to the end of the recording. This must be a negative value.
Remarks
For the built-in ONI player, this function is not currently supported and always returns XN_STATUS_NOT_IMPLEMENTED.
|
inline |
Sets the player's playback speed, as a ratio of the rate that the recording was made at.
[in] | dSpeed | The speed ratio. |
Values:
dSpeed
= 1.0 - Player will try to output frames at the same rate they were recorded (according to their timestamps).
dSpeed
> 1.0 - Fast-forward
0 < dSpeed
< 1.0 - Slow-motion.
dSpeed
= XN_PLAYBACK_SPEED_FASTEST (0.0) - There will be no delay, and frames will be returned immediately on demand.
|
inline |
Specifies whether the player will automatically rewind to the beginning of the recording after reaching the end of the recording.
[in] | bRepeat | Determines whether the player will repeat or not. |
If bRepeat is set to TRUE, the player will automatically rewind when reaching the end.
If bRepeat is set to FALSE, the player will stop playing when reaching the end, and will raise the 'End-Of-File Reached' event. In this state, IsEOF() returns TRUE, and calls to ReadNext() will fail.
|
inline |
Sets the source for the player, i.e. where the played events will come from. For full details and usage, see xnSetPlayerSource
|
inline |
Gets the current frame number of a specific node played by a player, i.e., the number of frames passed since the beginning of the recording.
[in] | strNodeName | Name of the node. |
[out] | nFrame | Retrieved frame number. |
Remarks
Different nodes that belong to the player can have different frame numbers, because the nodes are not necessarily in synchronization.
|
inline |
Gets the current time of a player, i.e., the time passed since the beginning of the recording.
[out] | nTimestamp | Retrieved timestamp. Units are in microseconds. |
|
inline |
Unregisters the event handler for the 'End-Of-File Reached' event.
[in] | hCallback | Handle received from registration. |
For full details and usage of the parameter, see Unregistering from Events .