33 if (!_is_locked)
return;
49 bool _is_locked =
true;
55 class synthetic_source_interface;
65 typedef std::function<void(frame_holder, syncronization_environment)>
sync_callback;
73 virtual const std::vector<stream_id>&
get_streams()
const = 0;
75 virtual std::string
get_name()
const = 0;
81 matcher(std::vector<stream_id> streams_id = {});
84 const std::vector<stream_id>&
get_streams()
const override;
90 virtual std::string
get_name()
const;
133 std::map<stream_id, std::shared_ptr<matcher>>
_matchers;
150 std::map<matcher*,unsigned long long> _last_arrived;
167 std::map<matcher*, double> _last_arrived;
168 std::map<matcher*, unsigned int> _fps;
timestamp_composite_matcher(std::vector< std::shared_ptr< matcher >> matchers)
std::map< matcher *, double > _next_expected
Definition: sync.h:134
void clean_inactive_streams(frame_holder &f) override
virtual std::string get_name() const =0
sync_callback _callback
Definition: sync.h:97
void sync(frame_holder f, syncronization_environment env) override
std::function< void(frame_holder, syncronization_environment)> sync_callback
Definition: sync.h:65
virtual void set_callback(sync_callback f)
virtual void update_last_arrived(frame_holder &f, matcher *m) override
bool is_smaller_than(frame_holder &a, frame_holder &b) override
virtual void set_callback(sync_callback f)=0
sync_lock(std::mutex &mutex)
Definition: sync.h:22
bool skip_missing_stream(std::vector< matcher *> synced, matcher *missing) override
virtual void update_last_arrived(frame_holder &f, matcher *m) override
single_consumer_queue< frame_holder > & matches
Definition: sync.h:61
std::vector< rs2_stream > _streams_type
Definition: sync.h:96
identity_matcher(stream_id stream, rs2_stream streams_type)
matcher(std::vector< stream_id > streams_id={})
bool _active
Definition: sync.h:100
callback_invocation_holder begin_callback()
virtual void sync(frame_holder f, syncronization_environment env)=0
std::map< stream_id, std::shared_ptr< matcher > > _matchers
Definition: sync.h:133
callbacks_heap _callback_inflight
Definition: sync.h:98
virtual const std::vector< stream_id > & get_streams() const =0
virtual const std::vector< rs2_stream > & get_streams_types() const =0
~sync_lock()
Definition: sync.h:39
std::string frames_to_string(std::vector< librealsense::matcher *> matchers)
bool is_smaller_than(frame_holder &a, frame_holder &b) override
bool are_equivalent(frame_holder &a, frame_holder &b) override
void unlock_preemptively()
Definition: sync.h:27
virtual void update_last_arrived(frame_holder &f, matcher *m)=0
virtual void clean_inactive_streams(frame_holder &f)=0
std::string _name
Definition: sync.h:99
virtual bool skip_missing_stream(std::vector< matcher *> synced, matcher *missing)=0
bool are_equivalent(frame_holder &a, frame_holder &b) override
synthetic_source_interface * source
Definition: sync.h:59
rs2_stream
Streams are different types of data provided by RealSense devices.
Definition: rs_sensor.h:36
void update_next_expected(const frame_holder &f) override
virtual void update_next_expected(const frame_holder &f)=0
virtual bool is_smaller_than(frame_holder &a, frame_holder &b)=0
void update_next_expected(const frame_holder &f) override
void set_active(const bool active)
std::map< matcher *, rs2_timestamp_domain > _next_expected_domain
Definition: sync.h:135
const std::vector< stream_id > & get_streams() const override
Definition: concurrency.h:15
std::shared_ptr< matcher > find_matcher(const frame_holder &f)
frame_number_composite_matcher(std::vector< std::shared_ptr< matcher >> matchers)
virtual std::string get_name() const
int stream_id
Definition: sync.h:17
virtual void dispatch(frame_holder f, syncronization_environment env)=0
const std::vector< rs2_stream > & get_streams_types() const override
bool skip_missing_stream(std::vector< matcher *> synced, matcher *missing) override
Definition: processing.h:19
composite_matcher(std::vector< std::shared_ptr< matcher >> matchers, std::string name)
virtual bool are_equivalent(frame_holder &a, frame_holder &b)=0
void dispatch(frame_holder f, syncronization_environment env) override
std::map< matcher *, single_consumer_queue< frame_holder > > _frames_queue
Definition: sync.h:132
void dispatch(frame_holder f, syncronization_environment env) override
void clean_inactive_streams(frame_holder &f) override
virtual void sync(frame_holder f, syncronization_environment env)
std::vector< stream_id > _streams_id
Definition: sync.h:95