synthetic-stream.cpp
Go to the documentation of this file.
1 // License: Apache 2.0. See LICENSE file in root directory.
2 // Copyright(c) 2017 Intel Corporation. All Rights Reserved.
3 
5 
6 #include "core/video.h"
7 #include "option.h"
8 #include "context.h"
9 #include "stream.h"
10 #include "types.h"
11 
12 namespace librealsense
13 {
15  {
16  std::lock_guard<std::mutex> lock(_mutex);
18  }
19 
21  {
22  _source.set_callback(callback);
23  }
24 
27  {
30  _source.init(std::shared_ptr<metadata_parser_map>());
31  }
32 
34  {
36  try
37  {
38  if (_callback)
39  {
40  frame_interface* ptr = nullptr;
41  std::swap(f.frame, ptr);
42 
44  }
45  }
46  catch (std::exception const & e)
47  {
48  LOG_ERROR("Exception was thrown during user processing callback: " + std::string(e.what()));
49  }
50  catch (...)
51  {
52  LOG_ERROR("Exception was thrown during user processing callback!");
53  }
54  }
55 
57  : processing_block(name)
58  {
59  auto on_frame = [this](rs2::frame f, const rs2::frame_source& source)
60  {
61  std::lock_guard<std::mutex> lock(_mutex);
62 
63  std::vector<rs2::frame> frames_to_process;
64 
65  frames_to_process.push_back(f);
66  if (auto composite = f.as<rs2::frameset>())
67  for (auto f : composite)
68  frames_to_process.push_back(f);
69 
70  std::vector<rs2::frame> results;
71  for (auto f : frames_to_process)
72  {
73  if (should_process(f))
74  {
75  auto res = process_frame(source, f);
76  if (!res) continue;
77  if (auto composite = res.as<rs2::frameset>())
78  {
79  for (auto f : composite)
80  if (f)
81  results.push_back(f);
82  }
83  else
84  {
85  results.push_back(res);
86  }
87  //if frame was processed as frameset, don't process single frames
88  if (f.is<rs2::frameset>())
89  break;
90  }
91  }
92 
93  auto out = prepare_output(source, f, results);
94  if(out)
95  source.frame_ready(out);
96  };
97 
99  processing_block::set_processing_callback(std::shared_ptr<rs2_frame_processor_callback>(callback));
100  }
101 
103  {
104  // this function prepares the processing block output frame(s) by the following heuristic:
105  // in case the input is a single frame, return the processed frame.
106  // in case the input frame is a frameset, create an output frameset from the input frameset and the processed frame by the following heuristic:
107  // if one of the input frames has the same stream type and format as the processed frame,
108  // remove the input frame from the output frameset (i.e. temporal filter), otherwise keep the input frame (i.e. colorizer).
109  // the exception is in case one of the input frames is z16/z16h or disparity and the result frame is disparity or z16 respectively,
110  // in this case the input frame will be removed.
111 
112  if (results.empty())
113  {
114  return input;
115  }
116 
117  bool disparity_result_frame = false;
118  bool depth_result_frame = false;
119 
120  for (auto f : results)
121  {
122  auto format = f.get_profile().format();
124  disparity_result_frame = true;
125  if (format == RS2_FORMAT_Z16)
126  depth_result_frame = true;
127  }
128 
129  std::vector<rs2::frame> original_set;
130  if (auto composite = input.as<rs2::frameset>())
131  composite.foreach_rs([&](const rs2::frame& frame)
132  {
133  auto format = frame.get_profile().format();
135  return;
136  if (disparity_result_frame && format == RS2_FORMAT_Z16)
137  return;
138  original_set.push_back(frame);
139  });
140  else
141  {
142  return results[0];
143  }
144 
145  for (auto s : original_set)
146  {
147  auto curr_profile = s.get_profile();
148  //if the processed frames doesn't match any of the original frames add the original frame to the results queue
149  if (find_if(results.begin(), results.end(), [&curr_profile](rs2::frame& frame) {
150  auto processed_profile = frame.get_profile();
151  return curr_profile.stream_type() == processed_profile.stream_type() &&
152  curr_profile.format() == processed_profile.format() &&
153  curr_profile.stream_index() == processed_profile.stream_index(); }) == results.end())
154  {
155  results.push_back(s);
156  }
157  }
158 
159  return source.allocate_composite_frame(results);
160  }
161 
164  {
166  _source.init(std::shared_ptr<metadata_parser_map>());
167 
168  auto stream_selector = std::make_shared<ptr_option<int>>(RS2_STREAM_ANY, RS2_STREAM_COUNT, 1, RS2_STREAM_ANY, (int*)&_stream_filter.stream, "Stream type");
169  for (int s = RS2_STREAM_ANY; s < RS2_STREAM_COUNT; s++)
170  {
171  stream_selector->set_description(float(s), "Process - " + std::string (rs2_stream_to_string((rs2_stream)s)));
172  }
173  std::weak_ptr<ptr_option<int>> stream_selector_ref = stream_selector;
174  stream_selector->on_set([this, stream_selector_ref](float val)
175  {
176  std::lock_guard<std::mutex> lock(_mutex);
177 
178  if (!stream_selector_ref.lock()->is_valid(val))
180  << "Unsupported stream filter, " << val << " is out of range.");
181 
182  _stream_filter.stream = static_cast<rs2_stream>((int)val);
183  });
184 
185  auto format_selector = std::make_shared<ptr_option<int>>(RS2_FORMAT_ANY, RS2_FORMAT_COUNT, 1, RS2_FORMAT_ANY, (int*)&_stream_filter.format, "Stream format");
186  for (int f = RS2_FORMAT_ANY; f < RS2_FORMAT_COUNT; f++)
187  {
188  format_selector->set_description(float(f), "Process - " + std::string(rs2_format_to_string((rs2_format)f)));
189  }
190  std::weak_ptr<ptr_option<int>> format_selector_ref = format_selector;
191  format_selector->on_set([this, format_selector_ref](float val)
192  {
193  std::lock_guard<std::mutex> lock(_mutex);
194 
195  if (!format_selector_ref.lock()->is_valid(val))
197  << "Unsupported stream format filter, " << val << " is out of range.");
198 
199  _stream_filter.format = static_cast<rs2_format>((int)val);
200  });
201 
202  auto index_selector = std::make_shared<ptr_option<int>>(-1, std::numeric_limits<int>::max(), 1, -1, &_stream_filter.index, "Stream index");
203  std::weak_ptr<ptr_option<int>> index_selector_ref = index_selector;
204  index_selector->on_set([this, index_selector_ref](float val)
205  {
206  std::lock_guard<std::mutex> lock(_mutex);
207 
208  if (!index_selector_ref.lock()->is_valid(val))
210  << "Unsupported stream index filter, " << val << " is out of range.");
211 
212  _stream_filter.index = (int)val;
213  });
214 
215  register_option(RS2_OPTION_STREAM_FILTER, stream_selector);
218  }
219 
220  functional_processing_block::functional_processing_block(const char * name, rs2_format target_format, rs2_stream target_stream, rs2_extension extension_type) :
221  stream_filter_processing_block(name), _target_format(target_format), _target_stream(target_stream), _extension_type(extension_type) {}
222 
224  {
225  auto p = f->get_profile();
226  if (p.get() != _source_stream_profile.get())
227  {
229  _target_stream_profile = p.clone(p.stream_type(), p.stream_index(), _target_format);
231  }
232  }
233 
235  {
236  auto&& ret = prepare_frame(source, f);
237  int width = 0;
238  int height = 0;
239  int raw_size = 0;
240  auto vf = ret.as<rs2::video_frame>();
241  if (vf)
242  {
243  width = vf.get_width();
244  height = vf.get_height();
246  raw_size = static_cast<int>(f.get_frame_metadata(RS2_FRAME_METADATA_RAW_FRAME_SIZE));
247  }
248  byte* planes[1];
249  planes[0] = (byte*)ret.get_data();
250 
251  process_function(planes, static_cast<const byte*>(f.get_data()), width, height, height * width * _target_bpp, raw_size);
252 
253  return ret;
254  }
255 
257  {
258  init_profiles_info(&f);
259  auto vf = f.as<rs2::video_frame>();
260  if (vf)
261  {
262  int width = vf.get_width();
263  int height = vf.get_height();
265  width, height, width * _target_bpp, _extension_type);
266  }
267  auto mf = f.as<rs2::motion_frame>();
268  if (mf)
269  {
271  }
272  throw invalid_value_exception("Unable to allocate unknown frame type");
273  }
274 
276  {
277  if (format == RS2_FORMAT_Z16 || format == RS2_FORMAT_DISPARITY16 || format == RS2_FORMAT_DISPARITY32)
278  return true;
279  return false;
280  }
281 
283  {
284  if (!frame || frame.is<rs2::frameset>())
285  return false;
286  auto profile = frame.get_profile();
287  rs2_stream stream = profile.stream_type();
289  int index = profile.stream_index();
290 
292  return false;
294  {
296  return false;
297  }
298  else
299  {
301  return false;
302  }
303 
304  if (_stream_filter.index != -1 && _stream_filter.index != index)
305  return false;
306  return true;
307  }
308 
310  {
311  if (!frame || frame.is<rs2::frameset>())
312  return false;
313  auto profile = frame.get_profile();
314  return _stream_filter.match(frame);
315  }
316 
318  {
319  _actual_source.invoke_callback(std::move(result));
320  }
321 
322  frame_interface* synthetic_source::allocate_points(std::shared_ptr<stream_profile_interface> stream, frame_interface* original, rs2_extension frame_type)
323  {
324  auto vid_stream = dynamic_cast<video_stream_profile_interface*>(stream.get());
325  if (vid_stream)
326  {
328  data.frame_number = original->get_frame_number();
329  data.timestamp = original->get_frame_timestamp();
330  data.timestamp_domain = original->get_frame_timestamp_domain();
331  data.metadata_size = 0;
332  data.system_time = _actual_source.get_time();
333  data.is_blocking = original->is_blocking();
334 
335  auto res = _actual_source.alloc_frame(frame_type, vid_stream->get_width() * vid_stream->get_height() * sizeof(float) * 5, data, true);
336  if (!res) throw wrong_api_call_sequence_exception("Out of frame resources!");
337  res->set_sensor(original->get_sensor());
338  res->set_stream(stream);
339  return res;
340  }
341  return nullptr;
342  }
343 
344 
345  frame_interface* synthetic_source::allocate_video_frame(std::shared_ptr<stream_profile_interface> stream,
346  frame_interface* original,
347  int new_bpp,
348  int new_width,
349  int new_height,
350  int new_stride,
351  rs2_extension frame_type)
352  {
353  video_frame* vf = nullptr;
354 
355  if (new_bpp == 0 || (new_width == 0 && new_stride == 0) || new_height == 0)
356  {
357  // If the user wants to delegate width, height and etc to original frame, it must be a video frame
359  {
360  throw std::runtime_error("If original frame is not video frame, you must specify new bpp, width/stide and height!");
361  }
362  vf = static_cast<video_frame*>(original);
363  }
364 
365  auto width = new_width;
366  auto height = new_height;
367  auto bpp = new_bpp * 8;
368  auto stride = new_stride;
369 
370  if (bpp == 0)
371  {
372  bpp = vf->get_bpp();
373  }
374 
375  if (width == 0 && stride == 0)
376  {
377  width = vf->get_width();
378  stride = width * bpp / 8;
379  }
380  else if (width == 0)
381  {
382  width = stride * 8 / bpp;
383  }
384  else if (stride == 0)
385  {
386  stride = width * bpp / 8;
387  }
388 
389  if (height == 0)
390  {
391  height = vf->get_height();
392  }
393 
394  auto of = dynamic_cast<frame*>(original);
395  frame_additional_data data = of->additional_data;
396  auto res = _actual_source.alloc_frame(frame_type, stride * height, data, true);
397  if (!res) throw wrong_api_call_sequence_exception("Out of frame resources!");
398  vf = dynamic_cast<video_frame*>(res);
399  vf->metadata_parsers = of->metadata_parsers;
400  vf->assign(width, height, stride, bpp);
401  vf->set_sensor(original->get_sensor());
402  res->set_stream(stream);
403 
404  if (frame_type == RS2_EXTENSION_DEPTH_FRAME)
405  {
406  original->acquire();
407  (dynamic_cast<depth_frame*>(res))->set_original(original);
408  }
409 
410  return res;
411  }
412 
413  frame_interface* synthetic_source::allocate_motion_frame(std::shared_ptr<stream_profile_interface> stream,
414  frame_interface* original,
415  rs2_extension frame_type)
416  {
417  auto of = dynamic_cast<frame*>(original);
418  frame_additional_data data = of->additional_data;
419  auto res = _actual_source.alloc_frame(frame_type, of->get_frame_data_size(), data, true);
420  if (!res) throw wrong_api_call_sequence_exception("Out of frame resources!");
421  auto mf = dynamic_cast<motion_frame*>(res);
422  mf->metadata_parsers = of->metadata_parsers;
423  mf->set_sensor(original->get_sensor());
424  res->set_stream(stream);
425 
426  return res;
427  }
428 
430  {
431  if (f == nullptr) return 0;
432  if (auto c = dynamic_cast<composite_frame*>(f))
433  return static_cast<int>(c->get_embedded_frames_count());
434  return 1;
435  }
436 
438  {
439  if (auto comp = dynamic_cast<composite_frame*>(from.frame))
440  {
441  auto frame_buff = comp->get_frames();
442  for (size_t i = 0; i < comp->get_embedded_frames_count(); i++)
443  {
444  std::swap(*target, frame_buff[i]);
445  target++;
446  }
447  from.frame->disable_continuation();
448  }
449  else
450  {
451  *target = nullptr; // "move" the frame ref into target
452  std::swap(*target, from.frame);
453  target++;
454  }
455  }
456 
458  {
460 
461  auto req_size = 0;
462  for (auto&& f : holders)
463  req_size += get_embeded_frames_size(f.frame);
464 
465  auto res = _actual_source.alloc_frame(RS2_EXTENSION_COMPOSITE_FRAME, req_size * sizeof(rs2_frame*), d, true);
466  if (!res) return nullptr;
467 
468  auto cf = static_cast<composite_frame*>(res);
469 
470  for (auto&& f : holders)
471  {
472  if (f.is_blocking())
473  res->set_blocking(true);
474  }
475 
476  auto frames = cf->get_frames();
477  for (auto&& f : holders)
479  frames -= req_size;
480 
481  auto releaser = [frames, req_size]()
482  {
483  for (auto i = 0; i < req_size; i++)
484  {
485  frames[i]->release();
486  frames[i] = nullptr;
487  }
488  };
489  frame_continuation release_frames(releaser, nullptr);
490  cf->attach_continuation(std::move(release_frames));
491  cf->set_stream(cf->first()->get_stream());
492 
493  return res;
494  }
495 
497  composite_processing_block("Composite Processing Block")
498  {}
499 
501  processing_block(name)
502  {}
503 
505  {
506  // Find the first block which supports the option.
507  // It doesn't matter which one is selected, as long as it supports the option, because of the
508  // option propogation caused by bypass_option::set(value)
509  int i = 0;
510  for (i = 0; i < _processing_blocks.size(); i++)
511  {
512  if (_processing_blocks[i]->supports_option(option))
513  {
514  auto val = _processing_blocks[i]->get_option(option).query();
515  if (val > 0.f) break;
516  }
517  }
518 
520 
521  return *_processing_blocks[i];
522  }
523 
524  void composite_processing_block::add(std::shared_ptr<processing_block> block)
525  {
526  _processing_blocks.push_back(block);
527 
528  const auto&& supported_options = block->get_supported_options();
529  for (auto&& opt : supported_options)
530  {
531  register_option(opt, std::make_shared<bypass_option>(this, opt));
532  }
533 
535  }
536 
538  {
539  // Each processing block will process the preceding processing block output frame.
540  size_t i = 0;
541  for (i = 1; i < _processing_blocks.size(); i++)
542  {
543  auto output_cb = [i, this](frame_holder fh) {
544  _processing_blocks[i]->invoke(std::move(fh));
545  };
546  _processing_blocks[i - 1]->set_output_callback(std::make_shared<internal_frame_callback<decltype(output_cb)>>(output_cb));
547  }
548 
549  // Set the output callback of the composite processing block as last processing block in the vector.
550  _processing_blocks.back()->set_output_callback(callback);
551  }
552 
554  {
555  // Invoke the first processing block.
556  // This will trigger processing the frame in a chain by the order of the given processing blocks vector.
557  _processing_blocks.front()->invoke(std::move(frames));
558  }
559 
561  rs2_format source_format,
562  rs2_format left_target_format,
563  rs2_stream left_target_stream,
564  rs2_extension left_extension_type,
565  int left_idx,
566  rs2_format right_target_format,
567  rs2_stream right_target_stream,
568  rs2_extension right_extension_type,
569  int right_idx)
570  : processing_block(name),
571  _source_format(source_format),
572  _left_target_format(left_target_format),
573  _left_target_stream(left_target_stream),
574  _left_extension_type(left_extension_type),
575  _left_target_profile_idx(left_idx),
576  _right_target_format(right_target_format),
577  _right_target_stream(right_target_stream),
578  _right_extension_type(right_extension_type),
579  _right_target_profile_idx(right_idx)
580  {
582  }
583 
585  {
586  // define and set the frame processing callback
587  auto process_callback = [&](frame_holder frame, synthetic_source_interface* source)
588  {
589  auto profile = As<video_stream_profile, stream_profile_interface>(frame.frame->get_stream());
590  if (!profile)
591  {
592  LOG_ERROR("Failed configuring interleaved funcitonal processing block: ", get_info(RS2_CAMERA_INFO_NAME));
593  return;
594  }
595 
596  auto w = profile->get_width();
597  auto h = profile->get_height();
598 
599  if (profile.get() != _source_stream_profile.get())
600  {
604 
607 
616  }
617 
618  // passthrough the frame if we don't need to process it.
619  auto format = profile->get_format();
620  if (format != _source_format)
621  {
622  source->frame_ready(std::move(frame));
623  return;
624  }
625 
626  frame_holder lf, rf;
627 
628  lf = source->allocate_video_frame(_left_target_stream_profile, frame, _left_target_bpp,
630  rf = source->allocate_video_frame(_right_target_stream_profile, frame, _right_target_bpp,
632 
633  // process the frame
634  byte* planes[2];
635  planes[0] = (byte*)lf.frame->get_frame_data();
636  planes[1] = (byte*)rf.frame->get_frame_data();
637 
638  process_function(planes, (const byte*)frame->get_frame_data(), w, h, 0, 0);
639 
640  source->frame_ready(std::move(lf));
641  source->frame_ready(std::move(rf));
642  };
643 
644  set_processing_callback(std::shared_ptr<rs2_frame_processor_callback>(
645  new internal_frame_processor_callback<decltype(process_callback)>(process_callback)));
646  }
647 }
int get_width() const
Definition: archive.h:279
static const textual_icon lock
Definition: model-views.h:218
virtual const byte * get_frame_data() const =0
const char * rs2_format_to_string(rs2_format format)
Definition: rs.cpp:1263
virtual rs2_timestamp_domain get_frame_timestamp_domain() const =0
frame allocate_motion_frame(const stream_profile &profile, const frame &original, rs2_extension frame_type=RS2_EXTENSION_MOTION_FRAME) const
virtual rs2::frame prepare_output(const rs2::frame_source &source, rs2::frame input, std::vector< rs2::frame > results)
void copy_frames(frame_holder from, frame_interface **&target)
GLuint const GLchar * name
std::vector< std::shared_ptr< processing_block > > _processing_blocks
rs2_option
Defines general configuration controls. These can generally be mapped to camera UVC controls...
Definition: rs_option.h:22
frame_interface * allocate_motion_frame(std::shared_ptr< stream_profile_interface > stream, frame_interface *original, rs2_extension frame_type=RS2_EXTENSION_MOTION_FRAME) override
GLdouble s
int get_embeded_frames_size(frame_interface *f)
void init(std::shared_ptr< metadata_parser_map > metadata_parsers)
Definition: source.cpp:50
int rs2_is_frame_extendable_to(const rs2_frame *frame, rs2_extension extension_type, rs2_error **error)
Definition: rs.cpp:1461
std::shared_ptr< rs2_frame_callback > frame_callback_ptr
Definition: src/types.h:1071
GLfloat GLfloat p
Definition: glext.h:12687
rs2_metadata_type get_frame_metadata(rs2_frame_metadata_value frame_metadata) const
Definition: rs_frame.hpp:497
bool val_in_range(const T &val, const std::initializer_list< T > &list)
Definition: src/types.h:174
std::shared_ptr< stream_profile_interface > _left_target_stream_profile
void invoke(frame_holder frames) override
stream_profile get_profile() const
Definition: rs_frame.hpp:557
virtual rs2::frame process_frame(const rs2::frame_source &source, const rs2::frame &f)=0
std::function< void(frame_interface *)> on_frame
Definition: streaming.h:164
virtual bool is_blocking() const =0
bool supports_option(rs2_option id) const override
Definition: options.h:51
const void * get_data() const
Definition: rs_frame.hpp:545
bool supports_frame_metadata(rs2_frame_metadata_value frame_metadata) const
Definition: rs_frame.hpp:509
bool should_process(const rs2::frame &frame) override
GLdouble GLdouble GLdouble w
GLsizei const GLchar *const * string
d
Definition: rmse.py:171
rs2::frame process_frame(const rs2::frame_source &source, const rs2::frame &f) override
virtual rs2::frame prepare_frame(const rs2::frame_source &source, const rs2::frame &f)
virtual void process_function(byte *const dest[], const byte *source, int width, int height, int actual_size, int input_size)=0
GLfloat GLfloat GLfloat GLfloat h
Definition: glext.h:1960
e
Definition: rmse.py:177
frame_processor_callback_ptr _callback
GLuint index
void register_option(rs2_option id, std::shared_ptr< option > option)
Definition: options.h:86
frame allocate_video_frame(const stream_profile &profile, const frame &original, int new_bpp=0, int new_width=0, int new_height=0, int new_stride=0, rs2_extension frame_type=RS2_EXTENSION_VIDEO_FRAME) const
GLuint GLfloat * val
std::shared_ptr< stream_profile_interface > _right_target_stream_profile
rs2_source * get_c_wrapper() override
bool should_process(const rs2::frame &frame) override
bool is_z_or_disparity(rs2_format format)
frame_interface * allocate_video_frame(std::shared_ptr< stream_profile_interface > stream, frame_interface *original, int new_bpp=0, int new_width=0, int new_height=0, int new_stride=0, rs2_extension frame_type=RS2_EXTENSION_VIDEO_FRAME) override
GLdouble f
bool is() const
Definition: rs_frame.hpp:570
void register_info(rs2_camera_info info, const std::string &val)
Definition: sensor.cpp:602
std::shared_ptr< option > get_published_size_option()
Definition: source.cpp:39
virtual void init_profiles_info(const rs2::frame *f)
void invoke(frame_holder frames) override
const GLubyte * c
Definition: glext.h:12690
processing_block & get(rs2_option option)
std::shared_ptr< rs2_frame_processor_callback > frame_processor_callback_ptr
Definition: src/types.h:1072
void set_output_callback(frame_callback_ptr callback) override
GLint GLsizei GLsizei height
bool match(const rs2::frame &frame)
frame allocate_composite_frame(std::vector< frame > frames) const
GLint GLint GLsizei GLint GLenum format
GLenum target
Definition: glext.h:1565
def callback(frame)
Definition: t265_stereo.py:91
void set_blocking(bool state) override
Definition: archive.h:171
GLdouble GLdouble GLint stride
void frame_ready(frame_holder result) override
rs2_format
A stream&#39;s format identifies how binary data is encoded within a frame.
Definition: rs_sensor.h:59
interleaved_functional_processing_block(const char *name, rs2_format source_format, rs2_format left_target_format, rs2_stream left_target_stream, rs2_extension left_extension_type, int left_idx, rs2_format right_target_format, rs2_stream right_target_stream, rs2_extension right_extension_type, int right_idx)
virtual rs2_time_t get_frame_timestamp() const =0
void set_processing_callback(frame_processor_callback_ptr callback) override
#define LOG_ERROR(...)
Definition: src/types.h:242
void update_info(rs2_camera_info info, const std::string &val)
Definition: sensor.cpp:614
const std::string & get_info(rs2_camera_info info) const override
Definition: sensor.cpp:621
void swap(nlohmann::json &j1, nlohmann::json &j2) noexcept(is_nothrow_move_constructible< nlohmann::json >::value andis_nothrow_move_assignable< nlohmann::json >::value)
exchanges the values of two JSON objects
Definition: json.hpp:12141
rs2_stream
Streams are different types of data provided by RealSense devices.
Definition: rs_sensor.h:42
virtual std::shared_ptr< sensor_interface > get_sensor() const =0
void add(std::shared_ptr< processing_block > block)
void set_sensor(std::shared_ptr< sensor_interface > s) override
Definition: archive.cpp:24
virtual void disable_continuation()=0
virtual void process_function(byte *const dest[], const byte *source, int width, int height, int actual_size, int input_size)=0
std::shared_ptr< metadata_parser_map > metadata_parsers
Definition: archive.h:102
virtual std::shared_ptr< stream_profile_interface > get_stream() const =0
rs2_format format() const
Definition: rs_frame.hpp:44
frame_interface * allocate_composite_frame(std::vector< frame_holder > frames) override
void assign(int width, int height, int stride, int bpp)
Definition: archive.h:284
unsigned char byte
Definition: src/types.h:52
frame_interface * frame
Definition: streaming.h:126
const char * rs2_stream_to_string(rs2_stream stream)
Definition: rs.cpp:1262
rs2_extension
Specifies advanced interfaces (capabilities) objects may implement.
Definition: rs_types.h:166
GLenum GLenum GLenum input
Definition: glext.h:10805
virtual bool should_process(const rs2::frame &frame)=0
const rs2_stream_profile * get() const
Definition: rs_frame.hpp:137
void set_output_callback(frame_callback_ptr callback) override
typename::boost::move_detail::remove_reference< T >::type && move(T &&t) BOOST_NOEXCEPT
void set_callback(frame_callback_ptr callback)
Definition: source.cpp:102
GLsizei GLsizei GLchar * source
int i
GLuint res
Definition: glext.h:8856
frame_interface * allocate_points(std::shared_ptr< stream_profile_interface > stream, frame_interface *original, rs2_extension frame_type=RS2_EXTENSION_POINTS) override
rs2_format format
GLboolean * data
rs2_stream stream_type() const
Definition: rs_frame.hpp:39
int get_bpp() const
Definition: archive.h:282
virtual unsigned long long get_frame_number() const =0
GLuint64EXT * result
Definition: glext.h:10921
int get_image_bpp(rs2_format format)
Definition: image.cpp:21
stream_profile clone(rs2_stream type, int index, rs2_format format) const
Definition: rs_frame.hpp:63
int get_width() const
Definition: rs_frame.hpp:659
Definition: parser.hpp:150
int get_height() const
Definition: archive.h:280
struct rs2_frame rs2_frame
Definition: rs_types.h:261
GLint GLsizei width
callback_invocation_holder begin_callback()
Definition: source.cpp:70
std::shared_ptr< stream_profile_interface > _source_stream_profile
functional_processing_block(const char *name, rs2_format target_format, rs2_stream target_stream=RS2_STREAM_ANY, rs2_extension extension_type=RS2_EXTENSION_VIDEO_FRAME)
T as() const
Definition: rs_frame.hpp:580
std::string to_string(T value)


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