pipeline.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 "device_hub.h"
10 #include "sync.h"
11 #include "profile.h"
12 #include "config.h"
13 #include "resolver.h"
14 #include "aggregator.h"
15 
16 namespace librealsense
17 {
18  namespace pipeline
19  {
20  class pipeline : public std::enable_shared_from_this<pipeline>
21  {
22  public:
23  //Top level API
24  explicit pipeline(std::shared_ptr<librealsense::context> ctx);
25  virtual ~pipeline();
26  std::shared_ptr<profile> start(std::shared_ptr<config> conf, frame_callback_ptr callback = nullptr);
27  void stop();
28  std::shared_ptr<profile> get_active_profile() const;
29  frame_holder wait_for_frames(unsigned int timeout_ms);
31  bool try_wait_for_frames(frame_holder* frame, unsigned int timeout_ms);
32 
33  //Non top level API
34  std::shared_ptr<device_interface> wait_for_device(const std::chrono::milliseconds& timeout = std::chrono::hours::max(),
35  const std::string& serial = "");
36  std::shared_ptr<librealsense::context> get_context() const;
37 
38  protected:
39  frame_callback_ptr get_callback(std::vector<int> unique_ids);
40  std::vector<int> on_start(std::shared_ptr<profile> profile);
41 
42  void unsafe_start(std::shared_ptr<config> conf);
43  void unsafe_stop();
44 
45  mutable std::mutex _mtx;
46  std::shared_ptr<profile> _active_profile;
48  std::shared_ptr<config> _prev_conf;
49 
50  private:
51  std::shared_ptr<profile> unsafe_get_active_profile() const;
52 
53  std::shared_ptr<librealsense::context> _ctx;
56 
57  std::unique_ptr<syncer_process_unit> _syncer;
58  std::unique_ptr<aggregator> _aggregator;
59 
61  std::vector<rs2_stream> _synced_streams;
62  };
63  }
64 }
std::unique_ptr< aggregator > _aggregator
Definition: pipeline.h:58
std::shared_ptr< rs2_frame_callback > frame_callback_ptr
Definition: src/types.h:1071
bool poll_for_frames(frame_holder *frame)
frame_holder wait_for_frames(unsigned int timeout_ms)
GLsizei const GLchar *const * string
std::vector< rs2_stream > _synced_streams
Definition: pipeline.h:61
bool try_wait_for_frames(frame_holder *frame, unsigned int timeout_ms)
std::unique_ptr< syncer_process_unit > _syncer
Definition: pipeline.h:57
void unsafe_start(std::shared_ptr< config > conf)
pipeline(std::shared_ptr< librealsense::context > ctx)
std::vector< int > on_start(std::shared_ptr< profile > profile)
std::shared_ptr< profile > start(std::shared_ptr< config > conf, frame_callback_ptr callback=nullptr)
def callback(frame)
Definition: t265_stereo.py:91
frame_callback_ptr get_callback(std::vector< int > unique_ids)
frame_callback_ptr _streams_callback
Definition: pipeline.h:60
std::shared_ptr< profile > _active_profile
Definition: pipeline.h:46
std::shared_ptr< config > _prev_conf
Definition: pipeline.h:48
GLbitfield GLuint64 timeout
std::shared_ptr< profile > unsafe_get_active_profile() const
std::shared_ptr< librealsense::context > get_context() const
std::shared_ptr< device_interface > wait_for_device(const std::chrono::milliseconds &timeout=std::chrono::hours::max(), const std::string &serial="")
std::shared_ptr< profile > get_active_profile() const
std::shared_ptr< librealsense::context > _ctx
Definition: pipeline.h:53


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