src/stream.cpp
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 #include "stream.h"
5 
6 namespace librealsense
7 {
8  stream::stream(rs2_stream stream_type, int index)
9  : _index(index), _type(stream_type)
10  {
12  }
13 
15  {
16  return _index;
17  }
18 
20  {
21  _index = index;
22  }
23 
25  {
26  return _type;
27  }
28 
30  {
31  _type = stream;
32  }
33 
36  {
37  _c_ptr = &_c_wrapper;
38  _c_wrapper.profile = this;
39  _c_wrapper.clone = nullptr;
40  }
41 
43  {
44  return _index;
45  }
46 
48  {
49  _index = index;
50  }
51 
53  {
54  return _type;
55  }
56 
58  {
59  _type = stream;
60  }
61 
63  {
64  return _format;
65  }
66 
68  {
69  _format = format;
70  }
71 
73  {
74  return _framerate;
75  }
76 
78  {
79  _framerate = val;
80  }
81 
83  {
84  return _tag;
85  }
86 
88  {
89  _tag = tag;
90  }
91 
92  std::shared_ptr<stream_profile_interface> stream_profile_base::clone() const
93  {
94  auto res = std::make_shared<stream_profile_base>(get_backend_profile());
95  res->set_unique_id(environment::get_instance().generate_stream_id());
96  res->set_framerate(get_framerate());
97  return res;
98  }
99 
101  {
102  return _c_ptr;
103  }
104 
106  {
107  _c_ptr = wrapper;
108  }
109  void stream_profile_base::create_snapshot(std::shared_ptr<stream_profile_interface>& snapshot) const
110  {
111  auto ptr = std::const_pointer_cast<stream_interface>(shared_from_this());
112  snapshot = std::dynamic_pointer_cast<stream_profile_interface>(ptr);
113  }
114  void stream_profile_base::enable_recording(std::function<void(const stream_profile_interface&)> record_action)
115  {
116  //TODO: implement or remove inheritance from recordable<T>
117  throw not_implemented_exception(__FUNCTION__);
118  }
119 }
120 
int get_tag() const override
Definition: src/stream.cpp:82
int get_stream_index() const override
Definition: src/stream.cpp:14
void set_c_wrapper(rs2_stream_profile *wrapper) override
Definition: src/stream.cpp:105
boost_foreach_argument_dependent_lookup_hack tag
Definition: foreach_fwd.hpp:31
rs2_stream get_stream_type() const override
Definition: src/stream.cpp:52
void enable_recording(std::function< void(const stream_profile_interface &)> record_action) override
Definition: src/stream.cpp:114
stream_profile_base(platform::stream_profile sp)
Definition: src/stream.cpp:34
rs2_stream _type
Definition: src/stream.h:31
void set_framerate(uint32_t val) override
Definition: src/stream.cpp:77
void set_stream_index(int index) override
Definition: src/stream.cpp:47
void set_format(rs2_format format) override
Definition: src/stream.cpp:67
GLuint GLuint stream
Definition: glext.h:1790
uint32_t get_framerate() const override
Definition: src/stream.cpp:72
GLuint index
GLuint GLfloat * val
rs2_stream_profile * get_c_wrapper() const override
Definition: src/stream.cpp:100
std::shared_ptr< librealsense::stream_profile_interface > clone
Definition: context.h:35
std::shared_ptr< stream_profile_interface > clone() const override
Definition: src/stream.cpp:92
void tag_profile(int tag) override
Definition: src/stream.cpp:87
void set_stream_index(int index) override
Definition: src/stream.cpp:19
unsigned int uint32_t
Definition: stdint.h:80
void set_stream_type(rs2_stream stream) override
Definition: src/stream.cpp:29
rs2_stream get_stream_type() const override
Definition: src/stream.cpp:24
GLint GLint GLsizei GLint GLenum format
rs2_format
A stream&#39;s format identifies how binary data is encoded within a frame.
Definition: rs_sensor.h:59
int get_stream_index() const override
Definition: src/stream.cpp:42
stream(rs2_stream stream_type, int index=0)
Definition: src/stream.cpp:8
rs2_stream
Streams are different types of data provided by RealSense devices.
Definition: rs_sensor.h:42
static environment & get_instance()
librealsense::stream_profile_interface * profile
Definition: context.h:34
platform::stream_profile get_backend_profile() const
Definition: src/stream.h:39
typename::boost::move_detail::remove_reference< T >::type && move(T &&t) BOOST_NOEXCEPT
void create_snapshot(std::shared_ptr< stream_profile_interface > &snapshot) const override
Definition: src/stream.cpp:109
rs2_format get_format() const override
Definition: src/stream.cpp:62
GLuint res
Definition: glext.h:8856
void set_stream_type(rs2_stream stream) override
Definition: src/stream.cpp:57
rs2_stream_profile _c_wrapper
Definition: src/stream.h:87
rs2_stream_profile * _c_ptr
Definition: src/stream.h:88


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