Public Member Functions | Static Public Attributes | Private Member Functions | Private Attributes | List of all members
librealsense::record_device Class Reference

#include <record_device.h>

Inheritance diagram for librealsense::record_device:
Inheritance graph
[legend]

Public Member Functions

bool compress_while_record () const override
 
bool contradicts (const stream_profile_interface *a, const std::vector< stream_profile > &others) const override
 
virtual std::shared_ptr< matchercreate_matcher (const frame_holder &frame) const override
 
bool extend_to (rs2_extension extension_type, void **ext) override
 
std::shared_ptr< contextget_context () const override
 
platform::backend_device_group get_device_data () const override
 
std::pair< uint32_t, rs2_extrinsicsget_extrinsics (const stream_interface &stream) const override
 
const std::stringget_filename () const
 
const std::stringget_info (rs2_camera_info info) const override
 
std::vector< tagged_profileget_profiles_tags () const override
 
sensor_interfaceget_sensor (size_t i) override
 
const sensor_interfaceget_sensor (size_t i) const override
 
size_t get_sensors_count () const override
 
void hardware_reset () override
 
bool is_valid () const override
 
void pause_recording ()
 
 record_device (std::shared_ptr< device_interface > device, std::shared_ptr< device_serializer::writer > serializer)
 
void resume_recording ()
 
bool supports_info (rs2_camera_info info) const override
 
void tag_profiles (stream_profiles profiles) const override
 
virtual ~record_device ()
 
- Public Member Functions inherited from librealsense::device_interface
virtual ~device_interface ()=default
 
- Public Member Functions inherited from librealsense::info_interface
virtual ~info_interface ()=default
 
- Public Member Functions inherited from librealsense::recordable< info_interface >
virtual ~recordable ()=default
 
- Public Member Functions inherited from librealsense::extendable_interface
virtual ~extendable_interface ()=default
 
- Public Member Functions inherited from librealsense::info_container
void create_snapshot (std::shared_ptr< info_interface > &snapshot) const override
 
void enable_recording (std::function< void(const info_interface &)> record_action) override
 
void register_info (rs2_camera_info info, const std::string &val)
 
void update (std::shared_ptr< extension_snapshot > ext) override
 
void update_info (rs2_camera_info info, const std::string &val)
 
- Public Member Functions inherited from librealsense::extension_snapshot
virtual ~extension_snapshot ()=default
 

Static Public Attributes

static const uint64_t MAX_CACHED_DATA_SIZE = 1920 * 1080 * 4 * 30
 

Private Member Functions

std::vector< std::shared_ptr< record_sensor > > create_record_sensors (std::shared_ptr< device_interface > m_device)
 
template<rs2_extension E, typename P >
bool extend_to_aux (std::shared_ptr< P > p, void **ext)
 
std::chrono::nanoseconds get_capture_time () const
 
template<typename T >
device_serializer::snapshot_collection get_extensions_snapshots (T *extendable)
 
void initialize_recording ()
 
void stop_gracefully (to_string error_msg)
 
template<typename T , typename Ext >
void try_add_snapshot (T *extendable, device_serializer::snapshot_collection &snapshots)
 
void write_data (size_t sensor_index, frame_holder f, std::function< void(std::string const &)> on_error)
 
template<typename T >
void write_device_extension_changes (const T &ext)
 
void write_header ()
 
void write_notification (size_t sensor_index, const notification &n)
 
void write_sensor_extension_snapshot (size_t sensor_index, rs2_extension ext, std::shared_ptr< extension_snapshot > snapshot, std::function< void(std::string const &)> on_error)
 

Private Attributes

uint64_t m_cached_data_size
 
std::chrono::high_resolution_clock::time_point m_capture_time_base
 
std::shared_ptr< device_interfacem_device
 
std::once_flag m_first_call_flag
 
std::once_flag m_first_frame_flag
 
bool m_is_recording
 
std::mutex m_mutex
 
int m_on_extension_change_token
 
int m_on_frame_token
 
int m_on_notification_token
 
std::chrono::high_resolution_clock::duration m_record_pause_time
 
std::shared_ptr< device_serializer::writerm_ros_writer
 
std::vector< std::shared_ptr< record_sensor > > m_sensors
 
std::chrono::high_resolution_clock::time_point m_time_of_pause
 
lazy< std::shared_ptr< dispatcher > > m_write_thread
 

Detailed Description

Definition at line 16 of file record_device.h.

Constructor & Destructor Documentation

librealsense::record_device::record_device ( std::shared_ptr< device_interface device,
std::shared_ptr< device_serializer::writer serializer 
)

Definition at line 12 of file record_device.cpp.

librealsense::record_device::~record_device ( )
virtual

Definition at line 54 of file record_device.cpp.

Member Function Documentation

bool librealsense::record_device::compress_while_record ( ) const
inlineoverridevirtual

Implements librealsense::device_interface.

Definition at line 48 of file record_device.h.

bool librealsense::record_device::contradicts ( const stream_profile_interface a,
const std::vector< stream_profile > &  others 
) const
inlineoverridevirtual

Implements librealsense::device_interface.

Definition at line 49 of file record_device.h.

std::shared_ptr< matcher > record_device::create_matcher ( const frame_holder frame) const
overridevirtual

Implements librealsense::device_interface.

Definition at line 418 of file record_device.cpp.

std::vector< std::shared_ptr< librealsense::record_sensor > > librealsense::record_device::create_record_sensors ( std::shared_ptr< device_interface m_device)
private

Definition at line 35 of file record_device.cpp.

bool librealsense::record_device::extend_to ( rs2_extension  extension_type,
void **  ext 
)
overridevirtual

Implements librealsense::extendable_interface.

Definition at line 349 of file record_device.cpp.

template<rs2_extension E, typename P >
bool librealsense::record_device::extend_to_aux ( std::shared_ptr< P >  p,
void **  ext 
)
private

Definition at line 331 of file record_device.cpp.

std::chrono::nanoseconds librealsense::record_device::get_capture_time ( ) const
private

Definition at line 106 of file record_device.cpp.

std::shared_ptr< context > librealsense::record_device::get_context ( ) const
overridevirtual

Implements librealsense::device_interface.

Definition at line 73 of file record_device.cpp.

platform::backend_device_group record_device::get_device_data ( ) const
overridevirtual

Implements librealsense::device_interface.

Definition at line 414 of file record_device.cpp.

template<typename T >
device_serializer::snapshot_collection librealsense::record_device::get_extensions_snapshots ( T *  extendable)
private

Go over the extendable instance and find all extensions

Template Parameters
T
Parameters
extendable
Returns

Definition at line 229 of file record_device.cpp.

std::pair< uint32_t, rs2_extrinsics > record_device::get_extrinsics ( const stream_interface stream) const
overridevirtual

Implements librealsense::device_interface.

Definition at line 438 of file record_device.cpp.

const std::string & librealsense::record_device::get_filename ( ) const

Definition at line 410 of file record_device.cpp.

const std::string & librealsense::record_device::get_info ( rs2_camera_info  info) const
overridevirtual

Reimplemented from librealsense::info_container.

Definition at line 174 of file record_device.cpp.

std::vector<tagged_profile> librealsense::record_device::get_profiles_tags ( ) const
inlineoverridevirtual

Implements librealsense::device_interface.

Definition at line 46 of file record_device.h.

librealsense::sensor_interface & librealsense::record_device::get_sensor ( size_t  i)
overridevirtual

Implements librealsense::device_interface.

Definition at line 78 of file record_device.cpp.

const librealsense::sensor_interface & librealsense::record_device::get_sensor ( size_t  i) const
overridevirtual

Implements librealsense::device_interface.

Definition at line 184 of file record_device.cpp.

size_t librealsense::record_device::get_sensors_count ( ) const
overridevirtual

Implements librealsense::device_interface.

Definition at line 83 of file record_device.cpp.

void librealsense::record_device::hardware_reset ( )
overridevirtual

Implements librealsense::device_interface.

Definition at line 188 of file record_device.cpp.

void record_device::initialize_recording ( )
private

Definition at line 423 of file record_device.cpp.

bool record_device::is_valid ( ) const
overridevirtual

Implements librealsense::device_interface.

Definition at line 443 of file record_device.cpp.

void librealsense::record_device::pause_recording ( )

Definition at line 374 of file record_device.cpp.

void librealsense::record_device::resume_recording ( )

Definition at line 393 of file record_device.cpp.

void record_device::stop_gracefully ( to_string  error_msg)
private

Definition at line 429 of file record_device.cpp.

bool librealsense::record_device::supports_info ( rs2_camera_info  info) const
overridevirtual

Reimplemented from librealsense::info_container.

Definition at line 179 of file record_device.cpp.

void librealsense::record_device::tag_profiles ( stream_profiles  profiles) const
inlineoverridevirtual

Implements librealsense::device_interface.

Definition at line 47 of file record_device.h.

template<typename T , typename Ext >
void librealsense::record_device::try_add_snapshot ( T *  extendable,
device_serializer::snapshot_collection snapshots 
)
private

Definition at line 194 of file record_device.cpp.

void librealsense::record_device::write_data ( size_t  sensor_index,
librealsense::frame_holder  frame,
std::function< void(std::string const &)>  on_error 
)
private

Definition at line 116 of file record_device.cpp.

template<typename T >
void librealsense::record_device::write_device_extension_changes ( const T &  ext)
private

Definition at line 267 of file record_device.cpp.

void librealsense::record_device::write_header ( )
private

Definition at line 88 of file record_device.cpp.

void librealsense::record_device::write_notification ( size_t  sensor_index,
const notification n 
)
private

Definition at line 312 of file record_device.cpp.

void record_device::write_sensor_extension_snapshot ( size_t  sensor_index,
rs2_extension  ext,
std::shared_ptr< extension_snapshot snapshot,
std::function< void(std::string const &)>  on_error 
)
private

Definition at line 292 of file record_device.cpp.

Member Data Documentation

uint64_t librealsense::record_device::m_cached_data_size
private

Definition at line 79 of file record_device.h.

std::chrono::high_resolution_clock::time_point librealsense::record_device::m_capture_time_base
private

Definition at line 69 of file record_device.h.

std::shared_ptr<device_interface> librealsense::record_device::m_device
private

Definition at line 63 of file record_device.h.

std::once_flag librealsense::record_device::m_first_call_flag
private

Definition at line 80 of file record_device.h.

std::once_flag librealsense::record_device::m_first_frame_flag
private

Definition at line 75 of file record_device.h.

bool librealsense::record_device::m_is_recording
private

Definition at line 74 of file record_device.h.

std::mutex librealsense::record_device::m_mutex
private

Definition at line 73 of file record_device.h.

int librealsense::record_device::m_on_extension_change_token
private

Definition at line 78 of file record_device.h.

int librealsense::record_device::m_on_frame_token
private

Definition at line 77 of file record_device.h.

int librealsense::record_device::m_on_notification_token
private

Definition at line 76 of file record_device.h.

std::chrono::high_resolution_clock::duration librealsense::record_device::m_record_pause_time
private

Definition at line 70 of file record_device.h.

std::shared_ptr<device_serializer::writer> librealsense::record_device::m_ros_writer
private

Definition at line 67 of file record_device.h.

std::vector<std::shared_ptr<record_sensor> > librealsense::record_device::m_sensors
private

Definition at line 64 of file record_device.h.

std::chrono::high_resolution_clock::time_point librealsense::record_device::m_time_of_pause
private

Definition at line 71 of file record_device.h.

lazy<std::shared_ptr<dispatcher> > librealsense::record_device::m_write_thread
private

Definition at line 66 of file record_device.h.

const uint64_t librealsense::record_device::MAX_CACHED_DATA_SIZE = 1920 * 1080 * 4 * 30
static

Definition at line 21 of file record_device.h.


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


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