processing.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 #include "streaming.h"
6 
7 namespace librealsense
8 {
9  class synthetic_source_interface;
10 }
11 
12 struct rs2_source
13 {
15 };
16 
17 namespace librealsense
18 {
20  {
21  public:
22  virtual ~synthetic_source_interface() = default;
23 
24  virtual frame_interface* allocate_video_frame(std::shared_ptr<stream_profile_interface> stream,
25  frame_interface* original,
26  int new_bpp = 0,
27  int new_width = 0,
28  int new_height = 0,
29  int new_stride = 0,
30  rs2_extension frame_type = RS2_EXTENSION_VIDEO_FRAME) = 0;
31 
32  virtual frame_interface* allocate_motion_frame(std::shared_ptr<stream_profile_interface> stream,
33  frame_interface* original,
34  rs2_extension frame_type = RS2_EXTENSION_MOTION_FRAME) = 0;
35 
36  virtual frame_interface* allocate_composite_frame(std::vector<frame_holder> frames) = 0;
37 
38  virtual frame_interface* allocate_points(std::shared_ptr<stream_profile_interface> stream,
39  frame_interface* original,
40  rs2_extension frame_type = RS2_EXTENSION_POINTS) = 0;
41 
42  virtual void frame_ready(frame_holder result) = 0;
43  virtual rs2_source* get_c_wrapper() = 0;
44  };
45 
46  class processing_block_interface : public virtual options_interface, public virtual info_interface
47  {
48  public:
49  virtual void set_processing_callback(frame_processor_callback_ptr callback) = 0;
50  virtual void set_output_callback(frame_callback_ptr callback) = 0;
51  virtual void invoke(frame_holder frame) = 0;
52  virtual synthetic_source_interface& get_source() = 0;
53 
54  virtual ~processing_block_interface() = default;
55  };
56 
57  template<class T>
59  {
61  public:
62  explicit internal_frame_processor_callback(T on_frame) : on_frame_function(on_frame) {}
63 
64  void on_frame(rs2_frame * f, rs2_source * source) override
65  {
66  frame_holder front((frame_interface*)f);
67  on_frame_function(std::move(front), source->source);
68  }
69 
70  void release() override { delete this; }
71  };
72 }
std::shared_ptr< rs2_frame_callback > frame_callback_ptr
Definition: src/types.h:1071
std::function< void(frame_interface *)> on_frame
Definition: streaming.h:164
void on_frame(rs2_frame *f, rs2_source *source) override
Definition: processing.h:64
GLdouble f
std::shared_ptr< rs2_frame_processor_callback > frame_processor_callback_ptr
Definition: src/types.h:1072
librealsense::synthetic_source_interface * source
Definition: processing.h:14
def callback(frame)
Definition: t265_stereo.py:91
rs2_extension
Specifies advanced interfaces (capabilities) objects may implement.
Definition: rs_types.h:166
typename::boost::move_detail::remove_reference< T >::type && move(T &&t) BOOST_NOEXCEPT
GLsizei GLsizei GLchar * source
GLuint64EXT * result
Definition: glext.h:10921
struct rs2_frame rs2_frame
Definition: rs_types.h:261


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