Intel® RealSense™ Cross Platform API
Intel Realsense Cross-platform API
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
rs2::playback Class Reference

#include <rs_record_playback.hpp>

Inheritance diagram for rs2::playback:

Public Member Functions

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

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

Constructor & Destructor Documentation

◆ playback() [1/2]

rs2::playback::playback ( device  d)

◆ playback() [2/2]

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

Member Function Documentation

◆ current_status()

rs2_playback_status rs2::playback::current_status ( ) const

Returns the current state of the playback device

Current state of the playback

◆ file_name()

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

Retrieves the name of the playback file

Name of the playback file

◆ get_duration()

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

Retrieves the total duration of the file

Total duration of the file

◆ get_position()

uint64_t rs2::playback::get_position ( ) const

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

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

◆ is_real_time()

bool rs2::playback::is_real_time ( ) const

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

True iff playback is in real time mode

◆ pause()

void rs2::playback::pause ( )

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

◆ resume()

void rs2::playback::resume ( )

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

◆ seek()

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

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

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

◆ set_playback_speed()

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

Set the playing speed

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

◆ set_real_time()

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

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).

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

◆ set_status_changed_callback()

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

Start passing frames into user provided callback

[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

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

◆ stop()

void rs2::playback::stop ( )

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

Member Data Documentation

◆ context

friend rs2::playback::context

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