config.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 <map>
7 #include <utility>
8 
9 #include "resolver.h"
10 
11 namespace librealsense
12 {
13  namespace pipeline
14  {
15  class profile;
16  class pipeline;
17 
18  class config
19  {
20  public:
21  config();
23  void enable_all_stream();
24  void enable_device(const std::string& serial);
25  void enable_device_from_file(const std::string& file, bool repeat_playback);
26  void enable_record_to_file(const std::string& file);
27  void disable_stream(rs2_stream stream, int index = -1);
28  void disable_all_streams();
29  std::shared_ptr<profile> resolve(std::shared_ptr<pipeline> pipe, const std::chrono::milliseconds& timeout = std::chrono::milliseconds(0));
30  bool can_resolve(std::shared_ptr<pipeline> pipe);
31  bool get_repeat_playback();
32 
33  //Non top level API
34  std::shared_ptr<profile> get_cached_resolved_profile();
35 
36  config(const config& other)
37  {
42  _resolved_profile = nullptr;
44  }
45  private:
47  {
51  };
52  std::shared_ptr<device_interface> get_or_add_playback_device(std::shared_ptr<context> ctx, const std::string& file);
53  std::shared_ptr<device_interface> resolve_device_requests(std::shared_ptr<pipeline> pipe, const std::chrono::milliseconds& timeout);
54  stream_profiles get_default_configuration(std::shared_ptr<device_interface> dev);
55  std::shared_ptr<profile> resolve(std::shared_ptr<device_interface> dev);
57 
59  std::map<std::pair<rs2_stream, int>, stream_profile> _stream_requests;
60  std::mutex _mtx;
61  bool _enable_all_streams = false;
62  std::shared_ptr<profile> _resolved_profile;
63  bool _playback_loop = false;
64  std::vector<std::pair<rs2_stream, int>> _streams_to_disable;
65  };
66  }
67 }
format
GLint GLint GLsizei GLint GLenum format
Definition: glad/glad/glad.h:1412
librealsense
Definition: algo.h:18
librealsense::pipeline::config::enable_stream
void enable_stream(rs2_stream stream, int index, uint32_t width, uint32_t height, rs2_format format, uint32_t framerate)
Definition: pipeline/config.cpp:20
librealsense::pipeline::config::_enable_all_streams
bool _enable_all_streams
Definition: config.h:61
librealsense::pipeline::config::device_request
Definition: config.h:46
librealsense::pipeline::config::enable_record_to_file
void enable_record_to_file(const std::string &file)
Definition: pipeline/config.cpp:58
index
GLuint index
Definition: glad/glad/glad.h:2777
librealsense::pipeline::config::device_request::serial
std::string serial
Definition: config.h:48
string
GLsizei const GLchar *const * string
Definition: glad/glad/glad.h:2861
librealsense::pipeline::config::_playback_loop
bool _playback_loop
Definition: config.h:63
librealsense::pipeline::config::get_cached_resolved_profile
std::shared_ptr< profile > get_cached_resolved_profile()
Definition: pipeline/config.cpp:69
librealsense::pipeline::config::filter_stream_requests
util::config filter_stream_requests(const stream_profiles &profiles) const
Definition: pipeline/config.cpp:105
librealsense::stream_profile
Definition: core/stream-profile.h:15
librealsense::pipeline::config::device_request::filename
std::string filename
Definition: config.h:49
width
GLint GLsizei width
Definition: glad/glad/glad.h:1397
librealsense::pipeline::config::_mtx
std::mutex _mtx
Definition: config.h:60
rs2_format
rs2_format
A stream's format identifies how binary data is encoded within a frame.
Definition: rs_sensor.h:61
realdds::topics::notification::stream_header::key::profiles
const std::string profiles
Definition: fps.py:80
librealsense::pipeline::config::_stream_requests
std::map< std::pair< rs2_stream, int >, stream_profile > _stream_requests
Definition: config.h:59
uint32_t
unsigned int uint32_t
Definition: stdint.h:80
librealsense::pipeline::config::resolve
std::shared_ptr< profile > resolve(std::shared_ptr< pipeline > pipe, const std::chrono::milliseconds &timeout=std::chrono::milliseconds(0))
Definition: pipeline/config.cpp:188
librealsense::pipeline::config::can_resolve
bool can_resolve(std::shared_ptr< pipeline > pipe)
Definition: pipeline/config.cpp:230
librealsense::pipeline::config
Definition: config.h:18
librealsense::pipeline::config::enable_device_from_file
void enable_device_from_file(const std::string &file, bool repeat_playback)
Definition: pipeline/config.cpp:46
librealsense::pipeline::config::enable_all_stream
void enable_all_stream()
Definition: pipeline/config.cpp:30
height
GLint GLsizei GLsizei height
Definition: glad/glad/glad.h:1397
librealsense::pipeline::config::config
config(const config &other)
Definition: config.h:36
test-non-realtime.repeat_playback
repeat_playback
Definition: test-non-realtime.py:24
librealsense::pipeline::config::_streams_to_disable
std::vector< std::pair< rs2_stream, int > > _streams_to_disable
Definition: config.h:64
librealsense::pipeline::config::disable_all_streams
void disable_all_streams()
Definition: pipeline/config.cpp:96
librealsense::pipeline::config::enable_device
void enable_device(const std::string &serial)
Definition: pipeline/config.cpp:39
librealsense::pipeline::config::get_or_add_playback_device
std::shared_ptr< device_interface > get_or_add_playback_device(std::shared_ptr< context > ctx, const std::string &file)
Definition: pipeline/config.cpp:249
test-projection-from-recording.dev
dev
Definition: test-projection-from-recording.py:17
librealsense::stream
Definition: src/stream.h:30
librealsense::pipeline::config::device_request::record_output
std::string record_output
Definition: config.h:50
resolver.h
librealsense::stream_profiles
std::vector< std::shared_ptr< stream_profile_interface > > stream_profiles
Definition: stream-profile-interface.h:38
librealsense::pipeline::config::_device_request
device_request _device_request
Definition: config.h:58
test-d405-calibration-stream.pipeline
pipeline
Definition: test-d405-calibration-stream.py:21
librealsense::util::config
Definition: resolver.h:28
test-projection-from-recording.ctx
ctx
Definition: test-projection-from-recording.py:16
librealsense::pipeline::config::get_default_configuration
stream_profiles get_default_configuration(std::shared_ptr< device_interface > dev)
Definition: pipeline/config.cpp:320
librealsense::pipeline::config::_resolved_profile
std::shared_ptr< profile > _resolved_profile
Definition: config.h:62
librealsense::pipeline::config::disable_stream
void disable_stream(rs2_stream stream, int index=-1)
Definition: pipeline/config.cpp:75
librealsense::pipeline::config::get_repeat_playback
bool get_repeat_playback()
Definition: pipeline/config.cpp:334
timeout
GLbitfield GLuint64 timeout
Definition: glad/glad/glad.h:3384
rs2_stream
rs2_stream
Streams are different types of data provided by RealSense devices.
Definition: rs_sensor.h:43
librealsense::pipeline::config::config
config()
Definition: pipeline/config.cpp:16
librealsense::pipeline::config::resolve_device_requests
std::shared_ptr< device_interface > resolve_device_requests(std::shared_ptr< pipeline > pipe, const std::chrono::milliseconds &timeout)
Definition: pipeline/config.cpp:264
test-hdr-long.pipe
pipe
Definition: test-hdr-long.py:88
profile
Definition: unit-tests-common.h:58


librealsense2
Author(s): LibRealSense ROS Team
autogenerated on Fri Aug 2 2024 08:30:01