Intel® RealSense™ Cross Platform API
Intel Realsense Cross-platform API
sr300.h
Go to the documentation of this file.
1 // License: Apache 2.0. See LICENSE file in root directory.
2 // Copyright(c) 2015 Intel Corporation. All Rights Reserved.
3 
4 #pragma once
5 
6 #include <vector>
7 #include <mutex>
8 #include <string>
9 
10 #include "device.h"
11 #include "context.h"
12 #include "backend.h"
13 #include "ivcam-private.h"
14 #include "hw-monitor.h"
15 #include "metadata-parser.h"
16 #include "image.h"
17 #include <cstddef>
18 #include "environment.h"
19 #include "core/debug.h"
20 #include "stream.h"
21 
22 namespace librealsense
23 {
24  const uint16_t SR300_PID = 0x0aa5;
25 
26  const double TIMESTAMP_10NSEC_TO_MSEC = 0.00001;
27 
28  class sr300_camera;
29 
31  {
32  bool started;
33  uint64_t total;
34 
35  uint32_t last_timestamp;
36  mutable uint64_t counter;
37  mutable std::recursive_mutex _mtx;
38  public:
39  sr300_timestamp_reader() : started(false), total(0), last_timestamp(0), counter(0) {}
40 
41  void reset() override
42  {
43  std::lock_guard<std::recursive_mutex> lock(_mtx);
44  started = false;
45  total = 0;
46  last_timestamp = 0;
47  counter = 0;
48  }
49 
50  double get_frame_timestamp(const request_mapping& /*mode*/, const platform::frame_object& fo) override
51  {
52  std::lock_guard<std::recursive_mutex> lock(_mtx);
53  // Timestamps are encoded within the first 32 bits of the image and provided in 10nsec units
54  uint32_t rolling_timestamp = *reinterpret_cast<const uint32_t *>(fo.pixels);
55  if (!started)
56  {
57  total = last_timestamp = rolling_timestamp;
58  last_timestamp = rolling_timestamp;
59  started = true;
60  }
61 
62  const int delta = rolling_timestamp - last_timestamp; // NOTE: Relies on undefined behavior: signed int wraparound
63  last_timestamp = rolling_timestamp;
64  total += delta;
65 
66  return total * 0.00001; // to msec
67  }
68 
69  unsigned long long get_frame_counter(const request_mapping & /*mode*/, const platform::frame_object& fo) const override
70  {
71  std::lock_guard<std::recursive_mutex> lock(_mtx);
72  return ++counter;
73  }
74 
76  {
79  else
81  }
82  };
83 
85  {
86  std::unique_ptr<sr300_timestamp_reader> _backup_timestamp_reader;
87  bool one_time_note;
88  mutable std::recursive_mutex _mtx;
90 
91  protected:
92 
94  {
95  // Metadata support for a specific stream is immutable
96  const bool has_md_ts = [&]{ std::lock_guard<std::recursive_mutex> lock(_mtx);
97  return ((fo.metadata != nullptr) && (fo.metadata_size >= platform::uvc_header_size) && ((byte*)fo.metadata)[0] >= platform::uvc_header_size);
98  }();
99 
100  return has_md_ts;
101  }
102 
104  {
105  // Metadata support for a specific stream is immutable
106  const bool has_md_frame_counter = [&] { std::lock_guard<std::recursive_mutex> lock(_mtx);
107  return ((fo.metadata != nullptr) && (fo.metadata_size > platform::uvc_header_size) && ((byte*)fo.metadata)[0] > platform::uvc_header_size);
108  }();
109 
110  return has_md_frame_counter;
111  }
112 
113  public:
114  sr300_timestamp_reader_from_metadata() :_backup_timestamp_reader(nullptr), one_time_note(false)
115  {
116  _backup_timestamp_reader = std::unique_ptr<sr300_timestamp_reader>(new sr300_timestamp_reader());
117  reset();
118  }
119 
120  rs2_time_t get_frame_timestamp(const request_mapping& mode, const platform::frame_object& fo) override;
121 
122  unsigned long long get_frame_counter(const request_mapping & mode, const platform::frame_object& fo) const override;
123 
124  void reset() override;
125 
127  };
128 
129  class sr300_info : public device_info
130  {
131  public:
132  std::shared_ptr<device_interface> create(std::shared_ptr<context> ctx,
133  bool register_device_notifications) const override;
134 
135  sr300_info(std::shared_ptr<context> ctx,
139  : device_info(ctx), _color(std::move(color)),
140  _depth(std::move(depth)), _hwm(std::move(hwm)) {}
141 
142  static std::vector<std::shared_ptr<device_info>> pick_sr300_devices(
143  std::shared_ptr<context> ctx,
144  std::vector<platform::uvc_device_info>& platform,
145  std::vector<platform::usb_device_info>& usb);
146 
148  {
149  return platform::backend_device_group({ _color, _depth }, { _hwm });
150  }
151 
152  private:
156  };
157 
158  class sr300_camera final : public virtual device, public debug_interface
159  {
160  public:
161  class preset_option : public option_base
162  {
163  public:
164  void set(float value) override
165  {
166  if (!is_valid(value))
167  throw invalid_value_exception(to_string() << "set(preset_option) failed! Given value " << value << " is out of range.");
168 
169  _owner.rs2_apply_ivcam_preset(static_cast<int>(value));
170  last_value = value;
171  _recording_function(*this);
172  }
173 
174  float query() const override { return last_value; }
175 
176  bool is_enabled() const override { return true; }
177 
178  const char* get_description() const override
179  {
180  return "Recommended sets of options optimized for different visual use-cases";
181  }
182 
183  const char* get_value_description(float val) const override
184  {
186  static_cast<rs2_sr300_visual_preset>(
187  static_cast<int>(val)));
188  }
189 
190  explicit preset_option(sr300_camera& owner, const option_range& opt_range)
191  : option_base(opt_range),
192  _owner(owner)
193  {}
194 
195  private:
196  float last_value = RS2_SR300_VISUAL_PRESET_DEFAULT;
197  sr300_camera& _owner;
198  };
199 
201  {
202  public:
203  explicit sr300_color_sensor(sr300_camera* owner, std::shared_ptr<platform::uvc_device> uvc_device,
204  std::unique_ptr<frame_timestamp_reader> timestamp_reader,
205  std::shared_ptr<context> ctx)
206  : uvc_sensor("RGB Camera", uvc_device, move(timestamp_reader), owner), _owner(owner)
207  {}
208 
209  rs2_intrinsics get_intrinsics(const stream_profile& profile) const override
210  {
211  return make_color_intrinsics(*_owner->_camer_calib_params, { int(profile.width), int(profile.height) });
212  }
213 
215  {
217 
218  auto results = uvc_sensor::init_stream_profiles();
219 
220  for (auto p : results)
221  {
222  // Register stream types
223  if (p->get_stream_type() == RS2_STREAM_COLOR)
224  {
225  assign_stream(_owner->_color_stream, p);
226  }
227 
228  // Register intrinsics
229  auto video = dynamic_cast<video_stream_profile_interface*>(p.get());
230 
231 
232  if (video->get_width() == 1920 && video->get_height() == 1080 && video->get_format() == RS2_FORMAT_RGB8 && video->get_framerate() == 30)
233  video->make_default();
234 
235  auto profile = to_profile(p.get());
236  std::weak_ptr<sr300_color_sensor> wp =
237  std::dynamic_pointer_cast<sr300_color_sensor>(this->shared_from_this());
238  video->set_intrinsics([profile, wp]()
239  {
240  auto sp = wp.lock();
241  if (sp)
242  return sp->get_intrinsics(profile);
243  else
244  return rs2_intrinsics{};
245  });
246  }
247 
248  return results;
249  }
250  private:
251  const sr300_camera* _owner;
252  };
253 
255  {
256  public:
257  explicit sr300_depth_sensor(sr300_camera* owner, std::shared_ptr<platform::uvc_device> uvc_device,
258  std::unique_ptr<frame_timestamp_reader> timestamp_reader,
259  std::shared_ptr<context> ctx)
260  : uvc_sensor("Coded-Light Depth Sensor", uvc_device, move(timestamp_reader), owner), _owner(owner)
261  {}
262 
263  rs2_intrinsics get_intrinsics(const stream_profile& profile) const override
264  {
265  return make_depth_intrinsics(*_owner->_camer_calib_params, { int(profile.width), int(profile.height) });
266  }
267 
269  {
271 
272  auto results = uvc_sensor::init_stream_profiles();
273 
274  for (auto p : results)
275  {
276  // Register stream types
277  if (p->get_stream_type() == RS2_STREAM_DEPTH)
278  {
279  assign_stream(_owner->_depth_stream, p);
280  }
281  else if (p->get_stream_type() == RS2_STREAM_INFRARED)
282  {
283  assign_stream(_owner->_ir_stream, p);
284  }
285 
286  // Register intrinsics
287  auto video = dynamic_cast<video_stream_profile_interface*>(p.get());
288 
289 
290  if (video->get_width() == 640 && video->get_height() == 480 && video->get_format() == RS2_FORMAT_Z16 && video->get_framerate() == 30)
291  video->make_default();
292 
293  auto profile = to_profile(p.get());
294  std::weak_ptr<sr300_depth_sensor> wp =
295  std::dynamic_pointer_cast<sr300_depth_sensor>(this->shared_from_this());
296 
297  video->set_intrinsics([profile, wp]()
298  {
299  auto sp = wp.lock();
300  if (sp)
301  return sp->get_intrinsics(profile);
302  else
303  return rs2_intrinsics{};
304  });
305  }
306 
307  return results;
308  }
309 
310  float get_depth_scale() const override { return get_option(RS2_OPTION_DEPTH_UNITS).query(); }
311 
312  void create_snapshot(std::shared_ptr<depth_sensor>& snapshot) const override
313  {
314  snapshot = std::make_shared<depth_sensor_snapshot>(get_depth_scale());
315  }
316  void enable_recording(std::function<void(const depth_sensor&)> recording_function) override
317  {
318  get_option(RS2_OPTION_DEPTH_UNITS).enable_recording([this, recording_function](const option& o) {
319  recording_function(*this);
320  });
321  }
322  private:
323  const sr300_camera* _owner;
324  };
325 
326  std::shared_ptr<uvc_sensor> create_color_device(std::shared_ptr<context> ctx,
327  const platform::uvc_device_info& color)
328  {
329  auto color_ep = std::make_shared<sr300_color_sensor>(this, ctx->get_backend().create_uvc_device(color),
330  std::unique_ptr<frame_timestamp_reader>(new sr300_timestamp_reader_from_metadata()),
331  ctx);
332  color_ep->register_pixel_format(pf_yuy2);
333  color_ep->register_pixel_format(pf_yuyv);
334 
335  color_ep->register_pu(RS2_OPTION_BACKLIGHT_COMPENSATION);
336  color_ep->register_pu(RS2_OPTION_BRIGHTNESS);
337  color_ep->register_pu(RS2_OPTION_CONTRAST);
338  color_ep->register_pu(RS2_OPTION_GAIN);
339  color_ep->register_pu(RS2_OPTION_GAMMA);
340  color_ep->register_pu(RS2_OPTION_HUE);
341  color_ep->register_pu(RS2_OPTION_SATURATION);
342  color_ep->register_pu(RS2_OPTION_SHARPNESS);
343 
344  auto white_balance_option = std::make_shared<uvc_pu_option>(*color_ep, RS2_OPTION_WHITE_BALANCE);
345  auto auto_white_balance_option = std::make_shared<uvc_pu_option>(*color_ep, RS2_OPTION_ENABLE_AUTO_WHITE_BALANCE);
346  color_ep->register_option(RS2_OPTION_WHITE_BALANCE, white_balance_option);
347  color_ep->register_option(RS2_OPTION_ENABLE_AUTO_WHITE_BALANCE, auto_white_balance_option);
348  color_ep->register_option(RS2_OPTION_WHITE_BALANCE,
349  std::make_shared<auto_disabling_control>(
350  white_balance_option,
351  auto_white_balance_option));
352 
353  auto exposure_option = std::make_shared<uvc_pu_option>(*color_ep, RS2_OPTION_EXPOSURE);
354  auto auto_exposure_option = std::make_shared<uvc_pu_option>(*color_ep, RS2_OPTION_ENABLE_AUTO_EXPOSURE);
355  color_ep->register_option(RS2_OPTION_EXPOSURE, exposure_option);
356  color_ep->register_option(RS2_OPTION_ENABLE_AUTO_EXPOSURE, auto_exposure_option);
357  color_ep->register_option(RS2_OPTION_EXPOSURE,
358  std::make_shared<auto_disabling_control>(
359  exposure_option,
360  auto_exposure_option));
361 
362  auto md_offset = offsetof(metadata_raw, mode);
364  [](rs2_metadata_type param) { return static_cast<rs2_metadata_type>(param * TIMESTAMP_10NSEC_TO_MSEC); }));
368  color_ep->register_metadata(RS2_FRAME_METADATA_ACTUAL_EXPOSURE, make_sr300_attribute_parser(&md_sr300_rgb::actual_exposure, md_offset, [](rs2_metadata_type param) { return param*100; }));
369  color_ep->register_metadata(RS2_FRAME_METADATA_AUTO_EXPOSURE, make_sr300_attribute_parser(&md_sr300_rgb::auto_exp_mode, md_offset, [](rs2_metadata_type param) { return (param !=1); }));
370  color_ep->register_metadata(RS2_FRAME_METADATA_GAIN_LEVEL, make_sr300_attribute_parser(&md_sr300_rgb::gain, md_offset));
372 
373  return color_ep;
374  }
375 
376  std::shared_ptr<uvc_sensor> create_depth_device(std::shared_ptr<context> ctx,
377  const platform::uvc_device_info& depth)
378  {
379  using namespace ivcam;
380 
381  auto&& backend = ctx->get_backend();
382 
383  // create uvc-endpoint from backend uvc-device
384  auto depth_ep = std::make_shared<sr300_depth_sensor>(this, backend.create_uvc_device(depth),
385  std::unique_ptr<frame_timestamp_reader>(new sr300_timestamp_reader_from_metadata()),
386  ctx);
387  depth_ep->register_xu(depth_xu); // make sure the XU is initialized everytime we power the camera
388  depth_ep->register_pixel_format(pf_invz);
389  depth_ep->register_pixel_format(pf_y8);
390  depth_ep->register_pixel_format(pf_sr300_invi);
391  depth_ep->register_pixel_format(pf_sr300_inzi);
392 
393  register_depth_xu<uint8_t>(*depth_ep, RS2_OPTION_LASER_POWER, IVCAM_DEPTH_LASER_POWER,
394  "Power of the SR300 projector, with 0 meaning projector off");
395  register_depth_xu<uint8_t>(*depth_ep, RS2_OPTION_ACCURACY, IVCAM_DEPTH_ACCURACY,
396  "Set the number of patterns projected per frame.\nThe higher the accuracy value the more patterns projected.\nIncreasing the number of patterns help to achieve better accuracy.\nNote that this control is affecting the Depth FPS");
397  register_depth_xu<uint8_t>(*depth_ep, RS2_OPTION_MOTION_RANGE, IVCAM_DEPTH_MOTION_RANGE,
398  "Motion vs. Range trade-off, with lower values allowing for better motion\nsensitivity and higher values allowing for better depth range");
399  register_depth_xu<uint8_t>(*depth_ep, RS2_OPTION_CONFIDENCE_THRESHOLD, IVCAM_DEPTH_CONFIDENCE_THRESH,
400  "The confidence level threshold used by the Depth algorithm pipe to set whether\na pixel will get a valid range or will be marked with invalid range");
401  register_depth_xu<uint8_t>(*depth_ep, RS2_OPTION_FILTER_OPTION, IVCAM_DEPTH_FILTER_OPTION,
402  "Set the filter to apply to each depth frame.\nEach one of the filter is optimized per the application requirements");
403 
404  depth_ep->register_option(RS2_OPTION_VISUAL_PRESET, std::make_shared<preset_option>(*this,
406 
407  auto md_offset = offsetof(metadata_raw, mode);
408 
410  [](rs2_metadata_type param) { return static_cast<rs2_metadata_type>(param * TIMESTAMP_10NSEC_TO_MSEC); }));
413  [](rs2_metadata_type param) { return param * 100; }));
415 
416  return depth_ep;
417  }
418 
419  std::vector<uint8_t> send_receive_raw_data(const std::vector<uint8_t>& input) override
420  {
421  return _hw_monitor->send(input);
422  }
423 
424  void hardware_reset() override
425  {
426  force_hardware_reset();
427  }
428 
429  uvc_sensor& get_depth_sensor() { return dynamic_cast<uvc_sensor&>(get_sensor(_depth_device_idx)); }
430 
431 
432  sr300_camera(std::shared_ptr<context> ctx,
433  const platform::uvc_device_info& color,
434  const platform::uvc_device_info& depth,
435  const platform::usb_device_info& hwm_device,
436  const platform::backend_device_group& group,
437  bool register_device_notifications);
438 
440  {
441  const auto DEPTH_CONTROLS = 5;
442  const rs2_option arr_options[DEPTH_CONTROLS] = {
448  };
449 
450  // This extra functionality is disable for now:
451  //const ivcam::cam_auto_range_request ar_requests[RS2_IVCAM_VISUAL_PRESET_COUNT] =
452  //{
453  // { 1, 1, 180, 303, 180, 2, 16, -1, 1000, 450 }, /* ShortRange */
454  // { 1, 0, 303, 605, 303, -1, -1, -1, 1250, 975 }, /* LongRange */
455  // { 0, 0, -1, -1, -1, -1, -1, -1, -1, -1 }, /* BackgroundSegmentation */
456  // { 1, 1, 100, 179, 100, 2, 16, -1, 1000, 450 }, /* GestureRecognition */
457  // { 0, 1, -1, -1, -1, 2, 16, 16, 1000, 450 }, /* ObjectScanning */
458  // { 0, 0, -1, -1, -1, -1, -1, -1, -1, -1 }, /* FaceAnalytics */
459  // { 2, 0, 40, 1600, 800, -1, -1, -1, -1, -1 }, /* FaceLogin */
460  // { 1, 1, 100, 179, 179, 2, 16, -1, 1000, 450 }, /* GRCursor */
461  // { 0, 0, -1, -1, -1, -1, -1, -1, -1, -1 }, /* Default */
462  // { 1, 1, 180, 605, 303, 2, 16, -1, 1250, 650 }, /* MidRange */
463  // { 2, 0, 40, 1600, 800, -1, -1, -1, -1, -1 }, /* IROnly */
464  //};
465 
466  const float arr_values[RS2_SR300_VISUAL_PRESET_COUNT][DEPTH_CONTROLS] = {
467  { 1, 1, 5, 1, -1 }, /* ShortRange */
468  { 1, 1, 7, 0, -1 }, /* LongRange */
469  { 16, 1, 6, 2, 22 }, /* BackgroundSegmentation */
470  { 1, 1, 6, 3, -1 }, /* GestureRecognition */
471  { 1, 1, 3, 1, 9 }, /* ObjectScanning */
472  { 16, 1, 5, 1, 22 }, /* FaceAnalytics */
473  { 1, -1, -1, -1, -1 }, /* FaceLogin */
474  { 1, 1, 6, 1, -1 }, /* GRCursor */
475  { 16, 1, 5, 3, 9 }, /* Default */
476  { 1, 1, 5, 1, -1 }, /* MidRange */
477  { 1, -1, -1, -1, - 1 } /* IROnly */
478  };
479 
480  // The Default preset is handled differently from all the rest,
481  // When the user applies the Default preset the camera is expected to return to
482  // Default values of depth options:
483  if (preset == RS2_SR300_VISUAL_PRESET_DEFAULT)
484  {
485  for (auto opt : arr_options)
486  {
487  auto&& o = get_depth_sensor().get_option(opt);
488  o.set(o.get_range().def);
489  }
490  }
491  else
492  {
493  for (auto i = 0; i < DEPTH_CONTROLS; i++)
494  {
495  if (arr_values[preset][i] >= 0)
496  {
497  auto&& o = get_depth_sensor().get_option(arr_options[i]);
498  o.set(arr_values[preset][i]);
499  }
500  }
501  //if (arr_values[preset][0] == 1)
502  //set_auto_range(ar_requests[preset]);
503  }
504  }
505  void create_snapshot(std::shared_ptr<debug_interface>& snapshot) const override;
506  void enable_recording(std::function<void(const debug_interface&)> record_action) override;
507 
508 
509  virtual std::shared_ptr<matcher> create_matcher(const frame_holder& frame) const override;
510  private:
511  const uint8_t _depth_device_idx;
512  const uint8_t _color_device_idx;
513  std::shared_ptr<hw_monitor> _hw_monitor;
514 
515  template<class T>
516  void register_depth_xu(uvc_sensor& depth, rs2_option opt, uint8_t id, std::string desc) const
517  {
518  depth.register_option(opt,
519  std::make_shared<uvc_xu_option<T>>(
520  depth,
522  id, std::move(desc)));
523  }
524 
525  void register_autorange_options()
526  {
527  auto arr = std::make_shared<ivcam::cam_auto_range_request>();
528  auto arr_reader_writer = make_struct_interface<ivcam::cam_auto_range_request>(
529  [arr]() { return *arr; },
530  [arr, this](ivcam::cam_auto_range_request r) {
531  set_auto_range(r);
532  *arr = r;
533  });
534  //register_option(RS2_OPTION_SR300_AUTO_RANGE_ENABLE_MOTION_VERSUS_RANGE, RS2_SUBDEVICE_DEPTH,
535  // make_field_option(arr_reader_writer, &ivcam::cam_auto_range_request::enableMvR, { 0, 2, 1, 1 }));
536  //register_option(RS2_OPTION_SR300_AUTO_RANGE_ENABLE_LASER, RS2_SUBDEVICE_DEPTH,
537  // make_field_option(arr_reader_writer, &ivcam::cam_auto_range_request::enableLaser, { 0, 1, 1, 1 }));
538  // etc..
539  }
540 
541  static rs2_intrinsics make_depth_intrinsics(const ivcam::camera_calib_params& c, const int2& dims);
542  static rs2_intrinsics make_color_intrinsics(const ivcam::camera_calib_params& c, const int2& dims);
543  float read_mems_temp() const;
544  int read_ir_temp() const;
545 
546  void force_hardware_reset() const;
547  void enable_timestamp(bool colorEnable, bool depthEnable) const;
548  void set_auto_range(const ivcam::cam_auto_range_request& c) const;
549 
550  ivcam::camera_calib_params get_calibration() const;
551 
552  std::shared_ptr<stream_interface> _depth_stream;
553  std::shared_ptr<stream_interface> _ir_stream;
554  std::shared_ptr<stream_interface> _color_stream;
555  std::shared_ptr<lazy<rs2_extrinsics>> _depth_to_color_extrinsics;
556 
557  lazy<ivcam::camera_calib_params> _camer_calib_params;
558  };
559 }
Definition: ivcam-private.h:57
stream_profiles init_stream_profiles() override
Definition: sr300.h:214
Definition: rs_frame.h:33
Definition: rs_frame.h:32
sr300_timestamp_reader_from_metadata()
Definition: sr300.h:114
Definition: rs_option.h:33
uint32_t timestamp
Definition: backend.h:160
sr300_color_sensor(sr300_camera *owner, std::shared_ptr< platform::uvc_device > uvc_device, std::unique_ptr< frame_timestamp_reader > timestamp_reader, std::shared_ptr< context > ctx)
Definition: sr300.h:203
Definition: backend.h:380
stream_profiles init_stream_profiles() override
uint16_t actual_fps
Definition: metadata.h:238
rs2_option
Defines general configuration controls. These can generally be mapped to camera UVC controls...
Definition: rs_option.h:22
unsigned char byte
Definition: types.h:33
metadata_raw - metadata structure layout as transmitted and received by backend
Definition: metadata.h:544
void hardware_reset() override
Definition: sr300.h:424
Definition: rs_frame.h:21
const char * get_value_description(float val) const override
Definition: sr300.h:183
Definition: options.h:20
constexpr uint8_t uvc_header_size
Definition: backend.h:165
std::shared_ptr< uvc_sensor > create_color_device(std::shared_ptr< context > ctx, const platform::uvc_device_info &color)
Definition: sr300.h:326
Definition: rs_option.h:41
const native_pixel_format pf_y8
Definition: rs_sensor.h:58
const platform::extension_unit depth_xu
Definition: ivcam-private.h:25
Definition: rs_option.h:31
const void * metadata
Definition: backend.h:172
Definition: stream.h:188
Definition: rs_option.h:39
Definition: sr300.h:129
float query() const override
Definition: sr300.h:174
Definition: rs_option.h:26
const char * rs2_sr300_visual_preset_to_string(rs2_sr300_visual_preset preset)
Definition: rs_option.h:52
uint16_t frame_latency
Definition: metadata.h:204
Definition: rs_option.h:30
unsigned long long get_frame_counter(const request_mapping &, const platform::frame_object &fo) const override
Definition: sr300.h:69
rs2_intrinsics get_intrinsics(const stream_profile &profile) const override
Definition: sr300.h:209
uint32_t frame_counter
Definition: metadata.h:176
uvc_sensor & get_depth_sensor()
Definition: sr300.h:429
void register_option(rs2_option id, std::shared_ptr< option > option)
Definition: options.h:75
Definition: rs_sensor.h:42
Definition: rs_sensor.h:62
Definition: archive.h:63
Definition: algo.h:16
Definition: rs_frame.h:36
Definition: rs_option.h:37
uint16_t actual_exposure
Definition: metadata.h:234
bool has_metadata_fc(const platform::frame_object &fo) const
Definition: sr300.h:103
Definition: sr300.h:158
Definition: rs_option.h:24
sr300_info(std::shared_ptr< context > ctx, platform::uvc_device_info color, platform::uvc_device_info depth, platform::usb_device_info hwm)
Definition: sr300.h:135
preset_option(sr300_camera &owner, const option_range &opt_range)
Definition: sr300.h:190
Definition: option.h:64
std::shared_ptr< uvc_sensor > create_depth_device(std::shared_ptr< context > ctx, const platform::uvc_device_info &depth)
Definition: sr300.h:376
Definition: rs_frame.h:30
sr300_timestamp_reader()
Definition: sr300.h:39
Definition: rs_option.h:81
const double TIMESTAMP_10NSEC_TO_MSEC
Definition: sr300.h:26
uint16_t actual_fps
Definition: metadata.h:200
const native_pixel_format pf_yuy2
Definition: backend.h:167
uint8_t gain
Definition: metadata.h:191
const uint8_t IVCAM_DEPTH_FILTER_OPTION
Definition: ivcam-private.h:15
Definition: context.h:46
void rs2_apply_ivcam_preset(int preset)
Definition: sr300.h:439
uint16_t actual_exposure
Definition: metadata.h:202
sr300_depth_sensor(sr300_camera *owner, std::shared_ptr< platform::uvc_device > uvc_device, std::unique_ptr< frame_timestamp_reader > timestamp_reader, std::shared_ptr< context > ctx)
Definition: sr300.h:257
const uint8_t IVCAM_DEPTH_MOTION_RANGE
Definition: ivcam-private.h:13
bool has_metadata_ts(const platform::frame_object &fo) const
Definition: sr300.h:93
Definition: rs_option.h:29
Definition: rs_frame.h:37
Definition: rs_option.h:28
Definition: debug.h:11
Definition: options.h:12
rs2_timestamp_domain get_frame_timestamp_domain(const request_mapping &mode, const platform::frame_object &fo) const override
Definition: sr300.h:75
std::vector< uint8_t > send_receive_raw_data(const std::vector< uint8_t > &input) override
Definition: sr300.h:419
std::shared_ptr< md_attribute_parser_base > make_uvc_header_parser(Attribute St::*attribute, attrib_modifyer mod=nullptr)
A utility function to create UVC metadata header parser.
Definition: metadata-parser.h:162
void enable_recording(std::function< void(const depth_sensor &)> recording_function) override
Definition: sr300.h:316
uint8_t metadata_size
Definition: backend.h:170
platform::backend_device_group get_device_data() const override
Definition: sr300.h:147
Definition: rs_frame.h:34
const platform::extension_unit depth_xu
Definition: ds5-private.h:80
std::vector< std::shared_ptr< stream_profile_interface >> stream_profiles
Definition: streaming.h:104
const uint8_t IVCAM_DEPTH_CONFIDENCE_THRESH
Definition: ivcam-private.h:16
const char * get_description() const override
Definition: sr300.h:178
Definition: rs_sensor.h:41
Definition: rs_frame.h:41
Definition: ivcam-private.h:28
Definition: rs_frame.h:31
Definition: rs_sensor.h:43
Definition: types.h:55
Definition: option.h:191
rs2_intrinsics get_intrinsics(const stream_profile &profile) const override
Definition: sr300.h:263
void reset() override
Definition: sr300.h:41
Definition: types.h:470
extrinsics_graph & get_extrinsics_graph()
bool is_enabled() const override
Definition: sr300.h:176
Definition: presets.h:99
const uint8_t IVCAM_DEPTH_LASER_POWER
Definition: ivcam-private.h:11
double get_frame_timestamp(const request_mapping &, const platform::frame_object &fo) override
Definition: sr300.h:50
stream_profile to_profile(const stream_profile_interface *sp)
Definition: stream.h:170
long long rs2_metadata_type
Definition: rs_types.h:181
stream_profiles init_stream_profiles() override
Definition: sr300.h:268
Definition: types.h:637
const native_pixel_format pf_yuyv
Definition: rs_option.h:27
const uint8_t IVCAM_DEPTH_ACCURACY
Definition: ivcam-private.h:12
Video stream intrinsics.
Definition: rs_types.h:56
Definition: rs_option.h:34
const native_pixel_format pf_sr300_invi
Definition: rs_option.h:35
Definition: streaming.h:158
const uint16_t SR300_PID
Definition: sr300.h:24
uint16_t color_temperature
Definition: metadata.h:203
double rs2_time_t
Definition: rs_types.h:180
void create_snapshot(std::shared_ptr< depth_sensor > &snapshot) const override
Definition: sr300.h:312
Definition: sensor.h:113
Definition: rs_option.h:32
const native_pixel_format pf_sr300_inzi
Definition: types.h:606
Definition: types.h:413
std::shared_ptr< md_attribute_parser_base > make_sr300_attribute_parser(Attribute S::*attribute, unsigned long long offset, attrib_modifyer mod=nullptr)
A helper function to create a specialized attribute parser. Return it as a pointer to a base-class...
Definition: metadata-parser.h:359
const native_pixel_format pf_invz
static environment & get_instance()
Definition: device.h:43
Definition: rs_frame.h:22
Definition: rs_option.h:38
const void * pixels
Definition: backend.h:171
Definition: sensor.h:175
Definition: rs_option.h:36
Definition: rs_option.h:84
Definition: rs_option.h:25
Definition: rs_option.h:40
uint32_t frame_counter
Definition: metadata.h:214
uint8_t auto_exp_mode
Definition: metadata.h:189
float get_depth_scale() const override
Definition: sr300.h:310
rs2_timestamp_domain
Specifies the clock in relation to which the frame timestamp was measured.
Definition: rs_frame.h:19