6 #include "../../include/librealsense2/h/rs_internal.h" 68 std::vector<uint8_t> decode(
const std::vector<uint8_t>&
input)
const;
90 bool had_error =
false;
112 recording(std::shared_ptr<time_service> ts =
nullptr, std::shared_ptr<playback_device_watcher> watcher =
nullptr);
115 void save(
const char*
filename,
const char*
section,
bool append =
false)
const;
116 static std::shared_ptr<recording> load(
const char* filename,
const char* section, std::shared_ptr<playback_device_watcher> watcher =
nullptr,
std::string min_api_version =
"");
118 int save_blob(
const void* ptr,
size_t size);
123 std::pair<int, int>
range;
125 range.first =
static_cast<int>(target.size());
126 for (
auto&&
i : list) target.push_back(
i);
127 range.second =
static_cast<int>(target.size());
135 std::lock_guard<std::recursive_mutex>
lock(_mutex);
139 auto range = insert_list(list, target);
149 std::lock_guard<std::recursive_mutex>
lock(_mutex);
155 return calls[calls.size() - 1];
161 std::vector<T> results;
162 std::lock_guard<std::recursive_mutex>
lock(_mutex);
165 results.push_back(source[
i]);
173 std::vector<T> results;
174 std::lock_guard<std::recursive_mutex>
lock(_mutex);
177 results.push_back(source[
i]);
183 std::lock_guard<std::recursive_mutex>
lock(_mutex);
249 auto&&
c = find_call(type,
id);
257 old.
uvc_devices = load_list(uvc_device_infos,
c.param1,
c.param2);
258 old.
usb_devices = load_list(usb_device_infos,
c.param3,
c.param4);
259 old.
hid_devices = load_list(hid_device_infos,
c.param5,
c.param6);
261 curr.
uvc_devices = load_list(uvc_device_infos,
c.param7,
c.param8);
262 curr.
usb_devices = load_list(usb_device_infos,
c.param9,
c.param10);
263 curr.
hid_devices = load_list(hid_device_infos,
c.param11,
c.param12);
270 return load_list(usb_device_infos,
c);
276 return load_list(uvc_device_infos,
c);
282 return load_list(hid_device_infos,
c);
288 return load_list(hid_sensors,
c);
296 call& find_call(
call_type t,
int entity_id, std::function<
bool(
const call&
c)> history_match_validation = [](
const call& c) {
return true; });
298 call* pick_next_call(
int id = 0);
299 size_t size()
const {
return calls.size(); }
303 std::vector<std::vector<uint8_t>>
blobs;
313 std::shared_ptr<time_service>
_ts;
318 double get_current_time();
320 void invoke_device_changed_event();
322 double _curr_time = 0;
332 void start_callbacks()
override;
333 void stop_callbacks()
override;
344 std::vector<stream_profile> get_profiles()
const override;
345 void lock()
const override;
346 void unlock()
const override;
348 usb_spec get_usb_specification()
const override;
351 std::shared_ptr<uvc_device>
source,
352 std::shared_ptr<compression_algorithm> compression,
354 : _source(source), _entity_id(id),
355 _compression(compression), _owner(owner) {}
367 void register_profiles(
const std::vector<hid_profile>& hid_profiles)
override;
368 void open(
const std::vector<hid_profile>& hid_profiles)
override;
369 void close()
override;
370 void stop_capture()
override;
372 std::vector<hid_sensor> get_sensors()
override;
373 std::vector<uint8_t> get_custom_report_data(
const std::string& custom_sensor_name,
379 : _source(source), _entity_id(id), _owner(owner) {}
390 std::vector<uint8_t> send_receive(
const std::vector<uint8_t>&
data,
int timeout_ms,
bool require_response)
override;
394 : _source(source), _entity_id(id), _owner(owner) {}
407 _source_watcher(source_watcher), _owner(owner), _entity_id(id) {}
416 void stop()
override;
433 std::shared_ptr<time_service> create_time_service()
const override;
434 std::shared_ptr<device_watcher> create_device_watcher()
const override;
452 return t(_rec.get(), k);
454 catch (
const std::exception& ex)
456 auto&&
c = _rec->add_call(k);
458 c.inline_string = ex.what();
464 auto&&
c = _rec->add_call(k);
466 c.inline_string =
"Unknown exception has occurred!";
477 std::shared_ptr<recording>
_rec;
494 void stop()
override;
512 void start_callbacks()
override;
513 void stop_callbacks()
override;
524 std::vector<stream_profile> get_profiles()
const override;
525 void lock()
const override;
526 void unlock()
const override;
528 usb_spec get_usb_specification()
const override;
532 void callback_thread();
538 std::shared_ptr<recording>
_rec;
552 std::vector<uint8_t> send_receive(
const std::vector<uint8_t>&
data,
int timeout_ms,
bool require_response)
override;
555 int id) : _rec(rec), _entity_id(id)
559 std::shared_ptr<recording>
_rec;
566 void register_profiles(
const std::vector<hid_profile>& hid_profiles)
override;
567 void open(
const std::vector<hid_profile>& hid_profiles)
override;
568 void close()
override;
569 void stop_capture()
override;
571 std::vector<hid_sensor> get_sensors()
override;
572 std::vector<uint8_t> get_custom_report_data(
const std::string& custom_sensor_name,
575 void callback_thread();
581 std::shared_ptr<recording>
_rec;
598 std::shared_ptr<time_service> create_time_service()
const override;
599 std::shared_ptr<device_watcher> create_device_watcher()
const override;
605 std::shared_ptr<recording>
_rec;
616 return _rec.get_time();
static const textual_icon lock
static const textual_icon unlock
rs2_option
Defines general configuration controls. These can generally be mapped to camera UVC controls...
void write_to_file(void const *data, size_t cb, std::string const &dir, char const *filename)
GLsizei const GLchar *const * string
static const textual_icon stop
def info(name, value, persistent=False)
std::vector< std::shared_ptr< stream_profile_interface >> stream_profiles
GLenum GLenum GLenum input
GLsizei GLsizei GLchar * source
BOOST_DEDUCED_TYPENAME range_iterator< C >::type range_end(C &c)