Typedefs | Enumerations | Functions
rs_record_playback.h File Reference

Exposes record and playback functionality for C compilers. More...

#include "rs_types.h"
Include dependency graph for rs_record_playback.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Typedefs

typedef enum rs2_playback_status rs2_playback_status
 
typedef void(* rs2_playback_status_changed_callback_ptr) (rs2_playback_status)
 

Enumerations

enum  rs2_playback_status {
  RS2_PLAYBACK_STATUS_UNKNOWN, RS2_PLAYBACK_STATUS_PLAYING, RS2_PLAYBACK_STATUS_PAUSED, RS2_PLAYBACK_STATUS_STOPPED,
  RS2_PLAYBACK_STATUS_COUNT
}
 

Functions

rs2_devicers2_create_playback_device (const char *file, rs2_error **error)
 
rs2_devicers2_create_record_device (const rs2_device *device, const char *file, rs2_error **error)
 
rs2_devicers2_create_record_device_ex (const rs2_device *device, const char *file, int compression_enabled, rs2_error **error)
 
rs2_playback_status rs2_playback_device_get_current_status (const rs2_device *device, rs2_error **error)
 
const char * rs2_playback_device_get_file_path (const rs2_device *device, rs2_error **error)
 
int rs2_playback_device_is_real_time (const rs2_device *device, rs2_error **error)
 
void rs2_playback_device_pause (const rs2_device *device, rs2_error **error)
 
void rs2_playback_device_resume (const rs2_device *device, rs2_error **error)
 
void rs2_playback_device_set_playback_speed (const rs2_device *device, float speed, rs2_error **error)
 
void rs2_playback_device_set_real_time (const rs2_device *device, int real_time, rs2_error **error)
 
void rs2_playback_device_set_status_changed_callback (const rs2_device *device, rs2_playback_status_changed_callback *callback, rs2_error **error)
 
void rs2_playback_device_stop (const rs2_device *device, rs2_error **error)
 
unsigned long long int rs2_playback_get_duration (const rs2_device *device, rs2_error **error)
 
unsigned long long int rs2_playback_get_position (const rs2_device *device, rs2_error **error)
 
void rs2_playback_seek (const rs2_device *device, long long int time, rs2_error **error)
 
const char * rs2_playback_status_to_string (rs2_playback_status status)
 
const char * rs2_record_device_filename (const rs2_device *device, rs2_error **error)
 
void rs2_record_device_pause (const rs2_device *device, rs2_error **error)
 
void rs2_record_device_resume (const rs2_device *device, rs2_error **error)
 

Detailed Description

Exposes record and playback functionality for C compilers.

Definition in file rs_record_playback.h.

Typedef Documentation

typedef void(* rs2_playback_status_changed_callback_ptr) (rs2_playback_status)

Definition at line 30 of file rs_record_playback.h.

Enumeration Type Documentation

Enumerator
RS2_PLAYBACK_STATUS_UNKNOWN 

Unknown state

RS2_PLAYBACK_STATUS_PLAYING 

One or more sensors were started, playback is reading and raising data

RS2_PLAYBACK_STATUS_PAUSED 

One or more sensors were started, but playback paused reading and paused raising data

RS2_PLAYBACK_STATUS_STOPPED 

All sensors were stopped, or playback has ended (all data was read). This is the initial playback status

RS2_PLAYBACK_STATUS_COUNT 

Definition at line 19 of file rs_record_playback.h.

Function Documentation

rs2_device* rs2_create_playback_device ( const char *  file,
rs2_error **  error 
)

Creates a playback device to play the content of the given file

Parameters
[in]filePath to the file to play
[out]errorIf non-null, receives any error that occurs during this call, otherwise, errors are ignored
Returns
A pointer to a device that plays data from the file, or null in case of failure
rs2_device* rs2_create_record_device ( const rs2_device device,
const char *  file,
rs2_error **  error 
)

Creates a recording device to record the given device and save it to the given file

Parameters
[in]deviceThe device to record
[in]fileThe desired path to which the recorder should save the data
[out]errorIf non-null, receives any error that occurs during this call, otherwise, errors are ignored
Returns
A pointer to a device that records its data to file, or null in case of failure

Definition at line 1656 of file rs.cpp.

rs2_device* rs2_create_record_device_ex ( const rs2_device device,
const char *  file,
int  compression_enabled,
rs2_error **  error 
)

Creates a recording device to record the given device and save it to the given file

Parameters
[in]deviceThe device to record
[in]fileThe desired path to which the recorder should save the data
[in]compression_enabledIndicates if compression is enabled, 0 means false, otherwise true
[out]errorIf non-null, receives any error that occurs during this call, otherwise, errors are ignored
Returns
A pointer to a device that records its data to file, or null in case of failure

Definition at line 1666 of file rs.cpp.

rs2_playback_status rs2_playback_device_get_current_status ( const rs2_device device,
rs2_error **  error 
)

Returns the current state of the playback device

Parameters
[in]deviceA playback device
[out]errorIf non-null, receives any error that occurs during this call, otherwise, errors are ignored
Returns
Current state of the playback

Definition at line 1632 of file rs.cpp.

const char* rs2_playback_device_get_file_path ( const rs2_device device,
rs2_error **  error 
)

Gets the path of the file used by the playback device

Parameters
[in]deviceA playback device
[out]errorIf non-null, receives any error that occurs during this call, otherwise, errors are ignored
Returns
Path to the file used by the playback device

Definition at line 1556 of file rs.cpp.

int rs2_playback_device_is_real_time ( const rs2_device device,
rs2_error **  error 
)

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

Parameters
[in]deviceA playback device
[out]errorIf non-null, receives any error that occurs during this call, otherwise, errors are ignored
Returns
True iff playback is in real time mode. 0 means false, otherwise true

Definition at line 1613 of file rs.cpp.

void rs2_playback_device_pause ( const rs2_device device,
rs2_error **  error 
)

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

Parameters
[in]deviceA playback device
[out]errorIf non-null, receives any error that occurs during this call, otherwise, errors are ignored

Definition at line 1597 of file rs.cpp.

void rs2_playback_device_resume ( const rs2_device device,
rs2_error **  error 
)

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

Parameters
[in]deviceA playback device
[out]errorIf non-null, receives any error that occurs during this call, otherwise, errors are ignored

Definition at line 1589 of file rs.cpp.

void rs2_playback_device_set_playback_speed ( const rs2_device device,
float  speed,
rs2_error **  error 
)

Set the playing speed

Parameters
[in]deviceA playback device
[in]speedIndicates a multiplication of the speed to play (e.g: 1 = normal, 0.5 twice as slow)
[out]errorIf non-null, receives any error that occurs during this call, otherwise, errors are ignored

Definition at line 1640 of file rs.cpp.

void rs2_playback_device_set_real_time ( const rs2_device device,
int  real_time,
rs2_error **  error 
)

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]deviceA playback device
[in]real_timeIndicates if real time is requested, 0 means false, otherwise true
[out]errorIf non-null, receives any error that occurs during this call, otherwise, errors are ignored

Definition at line 1605 of file rs.cpp.

void rs2_playback_device_set_status_changed_callback ( const rs2_device device,
rs2_playback_status_changed_callback callback,
rs2_error **  error 
)

Register to receive callback from playback device upon its status changes

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

Parameters
[in]deviceA playback device
[in]callbackA callback handler that will be invoked when the playback status changes
[out]errorIf non-null, receives any error that occurs during this call, otherwise, errors are ignored

Definition at line 1621 of file rs.cpp.

void rs2_playback_device_stop ( const rs2_device device,
rs2_error **  error 
)

Stops the playback Calling stop() will stop all streaming playbakc sensors and will reset the playback (returning to beginning of file)

Parameters
[in]deviceA playback device
[out]errorIf non-null, receives any error that occurs during this call, otherwise, errors are ignored

Definition at line 1648 of file rs.cpp.

unsigned long long int rs2_playback_get_duration ( const rs2_device device,
rs2_error **  error 
)

Gets the total duration of the file in units of nanoseconds

Parameters
[in]deviceA playback device
[out]errorIf non-null, receives any error that occurs during this call, otherwise, errors are ignored
Returns
Total duration of the file in units of nanoseconds

Definition at line 1564 of file rs.cpp.

unsigned long long int rs2_playback_get_position ( const rs2_device device,
rs2_error **  error 
)

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

Parameters
[in]deviceA playback device
[out]errorIf non-null, receives any error that occurs during this call, otherwise, errors are ignored
Returns
Current position of the playback in the file in terms of time. Units are expressed in nanoseconds

Definition at line 1581 of file rs.cpp.

void rs2_playback_seek ( const rs2_device device,
long long int  time,
rs2_error **  error 
)

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

Parameters
[in]deviceA playback device.
[in]timeThe time point to which playback should seek, expressed in units of nanoseconds (zero value = start)
[out]errorIf non-null, receives any error that occurs during this call, otherwise, errors are ignored

Definition at line 1572 of file rs.cpp.

const char* rs2_playback_status_to_string ( rs2_playback_status  status)

Definition at line 1273 of file rs.cpp.

const char* rs2_record_device_filename ( const rs2_device device,
rs2_error **  error 
)

Gets the name of the file to which the recorder is writing

Parameters
[in]deviceA recording device
[out]errorIf non-null, receives any error that occurs during this call, otherwise, errors are ignored
Returns
The name of the file to which the recorder is writing

Definition at line 1695 of file rs.cpp.

void rs2_record_device_pause ( const rs2_device device,
rs2_error **  error 
)

Pause the recording device without stopping the actual device from streaming. Pausing will cause the device to stop writing new data to the file, in particular, frames and changes to extensions

Parameters
[in]deviceA recording device
[out]errorIf non-null, receives any error that occurs during this call, otherwise, errors are ignored

Definition at line 1679 of file rs.cpp.

void rs2_record_device_resume ( const rs2_device device,
rs2_error **  error 
)

Unpause the recording device. Resume will cause the device to continue writing new data to the file, in particular, frames and changes to extensions

Parameters
[in]deviceA recording device
[out]errorIf non-null, receives any error that occurs during this call, otherwise, errors are ignored

Definition at line 1687 of file rs.cpp.



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