Public Member Functions | Protected Member Functions | Protected Attributes | Private Attributes | List of all members
rs2::playback Class Reference

#include <rs_record_playback.hpp>

Inheritance diagram for rs2::playback:
Inheritance graph
[legend]

Public Member Functions

rs2_playback_status current_status () const
 
std::string file_name () const
 
std::chrono::nanoseconds get_duration () const
 
uint64_t get_position () const
 
bool is_real_time () const
 
void pause ()
 
 playback (device d)
 
void resume ()
 
void seek (std::chrono::nanoseconds time)
 
void set_playback_speed (float speed) const
 
void set_real_time (bool real_time) const
 
template<typename T >
void set_status_changed_callback (T callback)
 
void stop ()
 
- Public Member Functions inherited from rs2::device
template<class T >
as () const
 
 device ()
 
 device (std::shared_ptr< rs2_device > dev)
 
template<class T >
first () const
 
const std::shared_ptr< rs2_device > & get () const
 
const char * get_info (rs2_camera_info info) const
 
void hardware_reset ()
 
template<class T >
bool is () const
 
 operator bool () const
 
 operator std::shared_ptr< rs2_device > ()
 
deviceoperator= (const std::shared_ptr< rs2_device > dev)
 
deviceoperator= (const device &dev)
 
std::vector< sensorquery_sensors () const
 
bool supports (rs2_camera_info info) const
 
virtual ~device ()
 

Protected Member Functions

 playback (std::shared_ptr< rs2_device > dev)
 

Protected Attributes

friend context
 
- Protected Attributes inherited from rs2::device
std::shared_ptr< rs2_device_dev
 

Private Attributes

std::string m_file
 

Detailed Description

Definition at line 27 of file rs_record_playback.hpp.

Constructor & Destructor Documentation

rs2::playback::playback ( device  d)
inline

Definition at line 30 of file rs_record_playback.hpp.

rs2::playback::playback ( std::shared_ptr< rs2_device dev)
inlineexplicitprotected

Definition at line 184 of file rs_record_playback.hpp.

Member Function Documentation

rs2_playback_status rs2::playback::current_status ( ) const
inline

Returns the current state of the playback device

Returns
Current state of the playback

Definition at line 164 of file rs_record_playback.hpp.

std::string rs2::playback::file_name ( ) const
inline

Retrieves the name of the playback file

Returns
Name of the playback file

Definition at line 59 of file rs_record_playback.hpp.

std::chrono::nanoseconds rs2::playback::get_duration ( ) const
inline

Retrieves the total duration of the file

Returns
Total duration of the file

Definition at line 80 of file rs_record_playback.hpp.

uint64_t rs2::playback::get_position ( ) const
inline

Retrieves the current position of the playback in the file in terms of time. Units are expressed in nanoseconds

Returns
Current position of the playback in the file in terms of time. Units are expressed in nanoseconds

Definition at line 68 of file rs_record_playback.hpp.

bool rs2::playback::is_real_time ( ) const
inline

Indicates if playback is in real time mode or non real time

Returns
True iff playback is in real time mode

Definition at line 103 of file rs_record_playback.hpp.

void rs2::playback::pause ( )
inline

Pauses the playback Calling pause() in "Paused" status does nothing If pause() is called while playback status is "Playing" or "Stopped", the playback will not play until resume() is called

Definition at line 37 of file rs_record_playback.hpp.

void rs2::playback::resume ( )
inline

Un-pauses the playback Calling resume() while playback status is "Playing" or "Stopped" does nothing

Definition at line 48 of file rs_record_playback.hpp.

void rs2::playback::seek ( std::chrono::nanoseconds  time)
inline

Sets the playback to a specified time point of the played data

Parameters
[in]timeThe time point to which playback should seek, expressed in units of nanoseconds (zero value = start)

Definition at line 92 of file rs_record_playback.hpp.

void rs2::playback::set_playback_speed ( float  speed) const
inline

Set the playing speed

Parameters
[in]speedIndicates a multiplication of the speed to play (e.g: 1 = normal, 0.5 twice as slow)

Definition at line 133 of file rs_record_playback.hpp.

void rs2::playback::set_real_time ( bool  real_time) const
inline

Set the playback to work in real time or non real time

In real time mode, playback will play the same way the file was recorded. In real time mode if the application takes too long to handle the callback, frames may be dropped. In non real time mode, playback will wait for each callback to finish handling the data before reading the next frame. In this mode no frames will be dropped, and the application controls the frame rate of the playback (according to the callback handler duration).

Parameters
[in]real_timeIndicates if real time is requested, 0 means false, otherwise true
Returns
True on successfully setting the requested mode

Definition at line 122 of file rs_record_playback.hpp.

template<typename T >
void rs2::playback::set_status_changed_callback ( callback)
inline

Start passing frames into user provided callback

Parameters
[in]callbackStream callback, can be any callable object accepting rs2::frame Register to receive callback from playback device upon its status changes

Callbacks are invoked from the reading thread, and as such any heavy processing in the callback handler will affect the reading thread and may cause frame drops\ high latency

Parameters
[in]callbackA callback handler that will be invoked when the playback status changes, can be any callable object accepting rs2_playback_status

Definition at line 153 of file rs_record_playback.hpp.

void rs2::playback::stop ( )
inline

Stops the playback, effectively stopping all streaming playback sensors, and resetting the playback.

Definition at line 176 of file rs_record_playback.hpp.

Member Data Documentation

friend rs2::playback::context
protected

Definition at line 183 of file rs_record_playback.hpp.

std::string rs2::playback::m_file
private

Definition at line 201 of file rs_record_playback.hpp.


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


librealsense2
Author(s): Sergey Dorodnicov , Doron Hirshberg , Mark Horn , Reagan Lopez , Itay Carpis
autogenerated on Mon May 3 2021 02:50:41