Public Member Functions | Private Member Functions | Private Attributes | Friends | List of all members
openni::PlaybackControl Class Reference

#include <OpenNI.h>

Public Member Functions

int getNumberOfFrames (const VideoStream &stream) const
 
bool getRepeatEnabled () const
 
float getSpeed () const
 
bool isValid () const
 
Status seek (const VideoStream &stream, int frameIndex)
 
Status setRepeatEnabled (bool repeat)
 
Status setSpeed (float speed)
 
 ~PlaybackControl ()
 

Private Member Functions

Status attach (Device *device)
 
void detach ()
 
 PlaybackControl (Device *pDevice)
 

Private Attributes

Devicem_pDevice
 

Friends

class Device
 

Detailed Description

The PlaybackControl class provides access to a series of specific to playing back a recording from a file device.

When playing a stream back from a recording instead of playing from a live device, it is possible to vary playback speed, change the current time location (ie fast forward / rewind / seek), specify whether the playback should be repeated at the end of the recording, and query the total size of the recording.

Since none of these functions make sense in the context of a physical device, they are split out into a seperate playback control class. To use, simply create your file device, create a PlaybackControl, and then attach the PlaybackControl to the file device.

Definition at line 1661 of file OpenNI.h.

Constructor & Destructor Documentation

openni::PlaybackControl::~PlaybackControl ( )
inline

Deconstructor. Destroys a PlaybackControl class. The deconstructor presently detaches from its recording automatically, but it is considered a best practice for applications to manually detach from any stream that was attached to.

Definition at line 1670 of file OpenNI.h.

openni::PlaybackControl::PlaybackControl ( Device pDevice)
inlineprivate

Definition at line 1829 of file OpenNI.h.

Member Function Documentation

Status openni::PlaybackControl::attach ( Device device)
inlineprivate

Definition at line 1811 of file OpenNI.h.

void openni::PlaybackControl::detach ( )
inlineprivate

Definition at line 1823 of file OpenNI.h.

int openni::PlaybackControl::getNumberOfFrames ( const VideoStream stream) const
inline

Provides the a count of frames that this recording contains for a given stream. This is useful both to determine the length of the recording, and to ensure that a valid Frame Index is set when using the PlaybackControl::seek() function.

Parameters
[in]streamThe video stream to count frames for
Returns
Number of frames in provided VideoStream, or 0 if the stream is not part of the recording

Definition at line 1795 of file OpenNI.h.

bool openni::PlaybackControl::getRepeatEnabled ( ) const
inline

Gets the current repeat setting of the file device.

Returns
true if repeat is enabled, false if not enabled.

Definition at line 1730 of file OpenNI.h.

float openni::PlaybackControl::getSpeed ( ) const
inline

Getter function for the current playback speed of this device.

This value is expressed as a multiple of the speed the original recording was taken at. For example, if the original recording was at 30fps, and playback speed is set to 0.5, then the recording will play at 15fps. If playback speed is set to 2.0, then the recording would playback at 60fps.

In addition, there are two "special" values. A playback speed of 0.0 indicates that the playback should occur as fast as the system is capable of returning frames. This is most useful when testing algorithms on large datasets, as it enables playback to be done at a much higher rate than would otherwise be possible.

A value of -1 indicates that speed is "manual". In this mode, new frames will only become available when an application manually reads them. If used in a polling loop, this setting also enables systems to read and process frames limited only by available processing speeds.

Returns
Current playback speed of the device, measured as ratio of recording speed.

Definition at line 1695 of file OpenNI.h.

bool openni::PlaybackControl::isValid ( ) const
inline

Definition at line 1806 of file OpenNI.h.

Status openni::PlaybackControl::seek ( const VideoStream stream,
int  frameIndex 
)
inline

Seeks within a VideoStream to a given FrameID. Note that when this function is called on one stream, all other streams will also be changed to the corresponding place in the recording. The FrameIDs of different streams may not match, since FrameIDs may differ for streams that are not synchronized, but the recording will set all streams to the same moment in time.

Parameters
[in]streamStream for which the frameIndex value is valid.
[in]frameIndexFrame index to move playback to
Returns
Status code indicating success or failure of this operation

Definition at line 1775 of file OpenNI.h.

Status openni::PlaybackControl::setRepeatEnabled ( bool  repeat)
inline

Changes the current repeat mode of the device. If repeat mode is turned on, then the recording will begin playback again at the beginning after the last frame is read. If turned off, no more frames will become available after last frame is read.

Parameters
[in]repeatNew value for repeat – true to enable, false to disable
Returns
Status code indicating success or failure of this operations.

Definition at line 1755 of file OpenNI.h.

Status openni::PlaybackControl::setSpeed ( float  speed)
inline

Setter function for the playback speed of the device. For a full explaination of what this value means

See also
PlaybackControl::getSpeed().
Parameters
[in]speedDesired new value of playback speed, as ratio of original recording.
Returns
Status code indicating success or failure of this operation.

Definition at line 1716 of file OpenNI.h.

Friends And Related Function Documentation

friend class Device
friend

Definition at line 1828 of file OpenNI.h.

Member Data Documentation

Device* openni::PlaybackControl::m_pDevice
private

Definition at line 1837 of file OpenNI.h.


The documentation for this class was generated from the following file:


libfreenect
Author(s): Hector Martin, Josh Blake, Kyle Machulis, OpenKinect community
autogenerated on Thu Jun 6 2019 19:25:39