45 mutable std::recursive_mutex
_mtx;
51 std::lock_guard<std::recursive_mutex>
lock(_mtx);
60 std::lock_guard<std::recursive_mutex>
lock(_mtx);
66 LOG_ERROR(
"Frame is not valid. Failed to downcast to librealsense::frame.");
69 uint32_t rolling_timestamp = *
reinterpret_cast<const uint32_t *
>(
f->get_frame_data());
72 total = last_timestamp = rolling_timestamp;
73 last_timestamp = rolling_timestamp;
78 last_timestamp = rolling_timestamp;
81 return total * 0.00001;
86 std::lock_guard<std::recursive_mutex>
lock(_mtx);
95 LOG_ERROR(
"Frame is not valid. Failed to downcast to librealsense::frame.");
109 mutable std::recursive_mutex
_mtx;
119 LOG_ERROR(
"Frame is not valid. Failed to downcast to librealsense::frame.");
123 const bool has_md_ts = [&] { std::lock_guard<std::recursive_mutex>
lock(_mtx);
135 LOG_ERROR(
"Frame is not valid. Failed to downcast to librealsense::frame.");
139 const bool has_md_frame_counter = [&] { std::lock_guard<std::recursive_mutex>
lock(_mtx);
143 return has_md_frame_counter;
155 unsigned long long get_frame_counter(
const std::shared_ptr<frame_interface>& frame)
const override;
157 void reset()
override;
165 std::shared_ptr<device_interface> create(std::shared_ptr<context>
ctx,
166 bool register_device_notifications)
const override;
175 static std::vector<std::shared_ptr<device_info>> pick_sr300_devices(
176 std::shared_ptr<context> ctx,
177 std::vector<platform::uvc_device_info>& platform,
178 std::vector<platform::usb_device_info>& usb);
201 std::vector<tagged_profile>
tags;
215 _owner.rs2_apply_ivcam_preset(static_cast<int>(
value));
217 _recording_function(*
this);
220 float query()
const override {
return last_value; }
226 return "Recommended sets of options optimized for different visual use-cases";
232 static_cast<rs2_sr300_visual_preset>(
233 static_cast<int>(val)));
253 :
synthetic_sensor(
"Coded-Light Depth Sensor", uvc_sensor, owner, sr300_depth_fourcc_to_rs2_format, sr300_depth_fourcc_to_rs2_stream), _owner(owner)
258 return make_depth_intrinsics(*_owner->_camer_calib_params, { int(profile.width), int(profile.height) });
267 for (
auto&&
p : results)
272 assign_stream(_owner->_depth_stream,
p);
276 assign_stream(_owner->_ir_stream,
p);
283 std::weak_ptr<sr300_depth_sensor> wp =
286 video->set_intrinsics([
profile, wp]()
290 return sp->get_intrinsics(
profile);
308 recording_function(*
this);
316 return get_sr300_depth_recommended_proccesing_blocks();
323 std::shared_ptr<synthetic_sensor> create_depth_device(std::shared_ptr<context>
ctx,
328 return _hw_monitor->send(input);
333 force_hardware_reset();
348 bool register_device_notifications);
352 const auto DEPTH_CONTROLS = 5;
353 const rs2_option arr_options[DEPTH_CONTROLS] = {
384 { 1, -1, -1, -1, -1 },
388 { 1, -1, -1, -1, -1 }
396 for (
auto opt : arr_options)
398 auto&& o = get_depth_sensor().get_option(opt);
399 o.set(o.get_range().def);
404 for (
auto i = 0;
i < DEPTH_CONTROLS;
i++)
406 if (arr_values[preset][
i] >= 0)
408 auto&& o = get_depth_sensor().get_option(arr_options[
i]);
409 o.set(arr_values[preset][i]);
416 void create_snapshot(std::shared_ptr<debug_interface>& snapshot)
const override;
417 void enable_recording(std::function<
void(
const debug_interface&)> record_action)
override;
419 void enter_update_state()
const override;
423 virtual std::shared_ptr<matcher> create_matcher(
const frame_holder&
frame)
const override;
427 bool _is_locked =
true;
433 auto raw_uvc_sensor = As<uvc_sensor, sensor_base>(raw_sensor);
444 auto arr = std::make_shared<ivcam::cam_auto_range_request>();
445 auto arr_reader_writer = make_struct_interface<ivcam::cam_auto_range_request>(
446 [arr]() {
return *arr; },
459 float read_mems_temp()
const;
460 int read_ir_temp()
const;
462 void force_hardware_reset()
const;
463 void enable_timestamp(
bool colorEnable,
bool depthEnable)
const;
471 command get_firmware_logs_command()
const;
472 command get_flash_logs_command()
const;
490 std::shared_ptr<synthetic_sensor> create_color_device(std::shared_ptr<context>
ctx,
500 :
synthetic_sensor(
"RGB Camera", uvc_sensor, owner, sr300_color_fourcc_to_rs2_format, sr300_color_fourcc_to_rs2_stream), _owner(owner)
505 return make_color_intrinsics(*_owner->_camer_calib_params, { int(profile.width), int(profile.height) });
514 for (
auto&&
p : results)
519 assign_stream(_owner->_color_stream,
p);
526 std::weak_ptr<sr300_color_sensor> wp =
528 video->set_intrinsics([
profile, wp]()
532 return sp->get_intrinsics(
profile);
555 bool register_device_notifications);
557 virtual std::shared_ptr<matcher> create_matcher(
const frame_holder&
frame)
const override;
574 bool register_device_notifications);
583 bool register_device_notifications);
587 std::vector<tagged_profile>
tags;
void enable_recording(std::function< void(const depth_sensor &)> recording_function) override
stream_profiles init_stream_profiles() override
static const textual_icon lock
virtual void register_option(rs2_option id, std::shared_ptr< option > option)
preset_option(sr3xx_camera &owner, const option_range &opt_range)
sr300_color_sensor(sr300_camera *owner, std::shared_ptr< uvc_sensor > uvc_sensor, const std::map< uint32_t, rs2_format > &sr300_color_fourcc_to_rs2_format, const std::map< uint32_t, rs2_stream > &sr300_color_fourcc_to_rs2_stream)
std::vector< tagged_profile > get_profiles_tags() const override
const uint8_t _color_device_idx
rs2_option
Defines general configuration controls. These can generally be mapped to camera UVC controls...
const uint16_t SR300_RECOVERY
std::map< uint32_t, rs2_stream > sr300_color_fourcc_to_rs2_stream
const uint8_t _depth_device_idx
std::shared_ptr< sensor_base > get_raw_sensor() const
const sr3xx_camera * _owner
bool is_enabled() const override
processing_blocks get_color_recommended_proccesing_blocks()
const platform::extension_unit depth_xu
virtual stream_profiles init_stream_profiles() override
const uint16_t SR300v2_PID
GLint GLint GLsizei GLsizei GLsizei depth
std::vector< tagged_profile > get_profiles_tags() const override
GLsizei const GLchar *const * string
const char * rs2_sr300_visual_preset_to_string(rs2_sr300_visual_preset preset)
std::shared_ptr< hw_monitor > _hw_monitor
rs2_intrinsics get_intrinsics(const stream_profile &profile) const override
GLenum GLenum GLsizei void * image
bool is_valid(const plane_3d &p)
std::shared_ptr< rs2_update_progress_callback > update_progress_callback_ptr
rs2_intrinsics get_intrinsics(const stream_profile &profile) const override
std::map< uint32_t, rs2_format > sr300_color_fourcc_to_rs2_format
stream_profiles init_stream_profiles() override
const char * get_description() const override
sr300_info(std::shared_ptr< context > ctx, platform::uvc_device_info color, platform::uvc_device_info depth, platform::usb_device_info hwm)
std::shared_ptr< lazy< rs2_extrinsics > > _depth_to_color_extrinsics
processing_blocks get_recommended_processing_blocks() const override
const char * get_value_description(float val) const override
platform::usb_device_info _hwm
const double TIMESTAMP_10NSEC_TO_MSEC
void hardware_reset() override
void register_autorange_options()
std::map< uint32_t, rs2_format > sr300_depth_fourcc_to_rs2_format
platform::uvc_device_info _depth
float get_depth_scale() const override
unsigned __int64 uint64_t
std::map< uint32_t, rs2_stream > sr300_depth_fourcc_to_rs2_stream
float get_depth_scale(rs2::device dev)
const sr300_camera * _owner
lazy< ivcam::camera_calib_params > _camer_calib_params
platform::backend_device_group get_device_data() const override
std::vector< std::shared_ptr< stream_profile_interface >> stream_profiles
processing_blocks get_recommended_processing_blocks() const override
static environment & get_instance()
extrinsics_graph & get_extrinsics_graph()
void create_snapshot(std::shared_ptr< depth_sensor > &snapshot) const override
sensor_interface & get_sensor(size_t subdevice) override
std::shared_ptr< stream_interface > _ir_stream
std::vector< uint8_t > send_receive_raw_data(const std::vector< uint8_t > &input) override
std::shared_ptr< stream_interface > _depth_stream
GLenum GLenum GLenum input
stream_profile to_profile(const stream_profile_interface *sp)
float query() const override
double get_frame_timestamp(const std::shared_ptr< frame_interface > &frame) override
typename::boost::move_detail::remove_reference< T >::type && move(T &&t) BOOST_NOEXCEPT
std::vector< tagged_profile > get_profiles_tags() const override
rs2_timestamp_domain get_frame_timestamp_domain(const std::shared_ptr< frame_interface > &frame) const override
unsigned long long get_frame_counter(const std::shared_ptr< frame_interface > &frame) const override
uvc_sensor & get_raw_depth_sensor()
platform::uvc_device_info _color
void rs2_apply_ivcam_preset(int preset)
std::shared_ptr< stream_interface > _color_stream
sr300_depth_sensor(sr3xx_camera *owner, std::shared_ptr< uvc_sensor > uvc_sensor, const std::map< uint32_t, rs2_format > &sr300_depth_fourcc_to_rs2_format, const std::map< uint32_t, rs2_stream > &sr300_depth_fourcc_to_rs2_stream)
std::recursive_mutex _mtx
void register_depth_xu(synthetic_sensor &depth, rs2_option opt, uint8_t id, std::string desc) const
synthetic_sensor & get_depth_sensor()
std::string to_string(T value)
rs2_timestamp_domain
Specifies the clock in relation to which the frame timestamp was measured.