19 std::map<stream_id, frame_holder> _last_set;
20 std::unique_ptr<single_consumer_queue<frame_holder>> _queue;
21 std::vector<int> _streams_ids;
34 std::shared_ptr<device_interface>
get_device();
38 std::shared_ptr<device_interface> _dev;
43 class pipeline :
public std::enable_shared_from_this<pipeline>
47 explicit pipeline(std::shared_ptr<librealsense::context> ctx);
49 std::shared_ptr<pipeline_profile>
start(std::shared_ptr<pipeline_config> conf);
50 std::shared_ptr<pipeline_profile>
start_with_record(std::shared_ptr<pipeline_config> conf,
const std::string& file);
57 std::shared_ptr<device_interface>
wait_for_device(
const std::chrono::milliseconds& timeout = std::chrono::hours::max(),
58 const std::string& serial =
"");
59 std::shared_ptr<librealsense::context>
get_context()
const;
63 void unsafe_start(std::shared_ptr<pipeline_config> conf);
65 std::shared_ptr<pipeline_profile> unsafe_get_active_profile()
const;
67 std::shared_ptr<librealsense::context> _ctx;
68 mutable std::mutex _mtx;
70 std::shared_ptr<pipeline_profile> _active_profile;
72 std::unique_ptr<syncer_process_unit> _syncer;
73 std::unique_ptr<pipeline_processing_block> _pipeline_process;
74 std::shared_ptr<pipeline_config> _prev_conf;
75 int _playback_stopped_token = -1;
90 std::shared_ptr<pipeline_profile>
resolve(std::shared_ptr<pipeline> pipe,
const std::chrono::milliseconds& timeout = std::chrono::milliseconds(0));
101 _device_request = other._device_request;
102 _stream_requests = other._stream_requests;
103 _enable_all_streams = other._enable_all_streams;
104 _stream_requests = other._stream_requests;
105 _resolved_profile =
nullptr;
108 struct device_request
111 std::string filename;
112 std::string record_output;
114 std::shared_ptr<device_interface> get_or_add_playback_device(std::shared_ptr<pipeline> pipe,
const std::string& file);
115 std::shared_ptr<device_interface> resolve_device_requests(std::shared_ptr<pipeline> pipe,
const std::chrono::milliseconds& timeout);
116 stream_profiles get_default_configuration(std::shared_ptr<device_interface> dev);
118 device_request _device_request;
121 bool _enable_all_streams =
false;
122 std::shared_ptr<pipeline_profile> _resolved_profile;
pipeline_processing_block(const std::vector< int > &streams_to_aggregate)
void enable_device(const std::string &serial)
std::shared_ptr< rs2_frame_callback > frame_callback_ptr
Definition: types.h:822
bool poll_for_frames(frame_holder *frame)
std::shared_ptr< pipeline_profile > resolve(std::shared_ptr< pipeline > pipe, const std::chrono::milliseconds &timeout=std::chrono::milliseconds(0))
std::shared_ptr< device_interface > get_device()
std::shared_ptr< pipeline_profile > get_active_profile() const
void enable_stream(rs2_stream stream, int index, int width, int height, rs2_format format, int framerate)
std::shared_ptr< pipeline_profile > start_with_record(std::shared_ptr< pipeline_config > conf, const std::string &file)
Definition: concurrency.h:125
Definition: synthetic-stream.h:41
void disable_all_streams()
void enable_device_from_file(const std::string &file)
bool try_dequeue(frame_holder *item)
Definition: device_hub.h:15
std::shared_ptr< librealsense::context > get_context() const
stream_profiles get_active_streams() const
pipeline(std::shared_ptr< librealsense::context > ctx)
std::shared_ptr< pipeline_profile > start(std::shared_ptr< pipeline_config > conf)
Definition: pipeline.h:30
void enable_record_to_file(const std::string &file)
rs2_format
Format identifies how binary data is encoded within a frame.
Definition: rs_sensor.h:52
rs2_stream
Streams are different types of data provided by RealSense devices.
Definition: rs_sensor.h:36
std::shared_ptr< device_interface > wait_for_device(const std::chrono::milliseconds &timeout=std::chrono::hours::max(), const std::string &serial="")
std::shared_ptr< pipeline_profile > get_cached_resolved_profile()
frame_holder wait_for_frames(unsigned int timeout_ms=5000)
Definition: processing.h:19
void disable_stream(rs2_stream stream, int index=-1)
bool dequeue(frame_holder *item, unsigned int timeout_ms=5000)
std::vector< std::shared_ptr< stream_profile_interface > > stream_profiles
Definition: streaming.h:104
pipeline_config(const pipeline_config &other)
Definition: pipeline.h:96
Definition: pipeline.h:79
bool can_resolve(std::shared_ptr< pipeline > pipe)
Definition: pipeline.h:43
Definition: pipeline.h:16
util::config::multistream _multistream
Definition: pipeline.h:36
pipeline_profile(std::shared_ptr< device_interface > dev, util::config config, const std::string &file="")