36 if (prof != profiles.end())
97 std::vector<std::shared_ptr<matcher>> matchers;
98 for (
auto&
p : profiles)
99 matchers.push_back(std::make_shared<identity_matcher>(
p->get_unique_id(),
p->get_stream_type()));
105 std::vector<std::shared_ptr<matcher>> matchers;
106 for (
auto&
p : profiles)
107 matchers.push_back(std::make_shared<identity_matcher>(
p->get_unique_id(),
p->get_stream_type()));
119 return std::make_shared<frame_number_composite_matcher>(matchers);
123 return std::make_shared<timestamp_composite_matcher>(matchers);
128 bool device_changed_notifications)
129 :
_context(ctx), _group(group), _is_valid(true),
130 _device_changed_notifications(device_changed_notifications)
140 for (
auto& dev_info : removed->
list)
142 if (dev_info.info->get_device_data() ==
_group)
176 catch (std::out_of_range)
184 return static_cast<unsigned int>(
_sensors.size());
193 catch (std::out_of_range)
204 if (&s ==
sensor.get())
return idx;
207 throw std::runtime_error(
"Sensor not found!");
216 catch (std::out_of_range)
237 auto pin_stream = pair.second;
241 throw std::runtime_error(
to_string() <<
"Failed to fetch extrinsics between pin stream (" << pin_stream->get_unique_id() <<
") to given stream (" << stream.
get_unique_id() <<
")");
243 return std::make_pair(pair.first, ext);
250 [group_index](
const std::pair<int, std::pair<uint32_t, std::shared_ptr<const stream_interface>>>&
p) {
return p.second.first == group_index; });
268 switch (source_format)
278 LOG_ERROR(
"Format is not supported for mapping");
280 return target_formats;
289 if (
auto vp = dynamic_cast<video_stream_profile_interface*>(
profile.get()))
293 (
tag.width == -1 || vp->get_width() ==
tag.width) &&
294 (
tag.height == -1 || vp->get_height() ==
tag.height) &&
295 (
tag.fps == -1 || vp->get_framerate() ==
tag.fps) &&
296 (
tag.stream_index == -1 || vp->get_stream_index() ==
tag.stream_index))
300 if (
auto mp = dynamic_cast<motion_stream_profile_interface*>(
profile.get()))
304 (
tag.fps == -1 || mp->get_framerate() ==
tag.fps) &&
305 (
tag.stream_index == -1 || mp->get_stream_index() ==
tag.stream_index))
314 if (
auto vid_a = dynamic_cast<const video_stream_profile_interface*>(a))
316 for (
auto request : others)
320 if (vid_a->get_width() != 0 && request.width != 0 && (vid_a->get_width() != request.width))
322 if (vid_a->get_height() != 0 && request.height != 0 && (vid_a->get_height() != request.height))
336 for (
auto& opt :
sensor->get_supported_options())
343 if (
sensor->get_option(opt).query() > 0.f)
344 sensor->get_option(opt).set(
false);
348 LOG_ERROR(
"Failed to toggle off " << opt <<
" [" << snr_name <<
"]");
356 if (
sensor->is_streaming())
364 LOG_WARNING(
"Out of order stop/close invocation for " << snr_name <<
": " << exc.
what());
369 LOG_ERROR(
"Failed to deactivate " << snr_name);
static const textual_icon lock
virtual rs2_stream get_stream_type() const =0
static std::shared_ptr< matcher > create_timestamp_composite_matcher(std::vector< std::shared_ptr< matcher >> matchers)
std::mutex _device_changed_mtx
size_t find_sensor_idx(const sensor_interface &s) const
boost_foreach_argument_dependent_lookup_hack tag
virtual bool contradicts(const stream_profile_interface *a, const std::vector< stream_profile > &others) const override
void tag_profiles(stream_profiles profiles) const override
static std::shared_ptr< matcher > create_DLR_matcher(std::vector< stream_interface * > profiles)
bool val_in_range(const T &val, const std::initializer_list< T > &list)
GLint GLint GLsizei GLsizei GLsizei depth
std::vector< rs2_device_info > list
size_t get_sensors_count() const override
GLboolean GLboolean GLboolean GLboolean a
static std::shared_ptr< matcher > create_DLR_C_matcher(std::vector< stream_interface * > profiles)
bool _device_changed_notifications
stream_interface * find_profile(rs2_stream stream, int index, std::vector< stream_interface * > profiles)
static std::shared_ptr< matcher > create_frame_number_matcher(std::vector< stream_interface * > profiles)
rs2_matchers
Specifies types of different matchers.
int assign_sensor(const std::shared_ptr< sensor_interface > &sensor_base, uint8_t idx)
std::map< int, std::pair< uint32_t, std::shared_ptr< const stream_interface > > > _extrinsics
void hardware_reset() override
rs2_format
A stream's format identifies how binary data is encoded within a frame.
virtual std::vector< tagged_profile > get_profiles_tags() const =0
std::vector< std::shared_ptr< stream_profile_interface >> stream_profiles
rs2_stream
Streams are different types of data provided by RealSense devices.
virtual std::shared_ptr< matcher > create_matcher(const frame_holder &frame) const override
static environment & get_instance()
int add_sensor(const std::shared_ptr< sensor_interface > &sensor_base)
sensor_interface & get_sensor(size_t subdevice) override
Cross-stream extrinsics: encodes the topology describing how the different devices are oriented...
virtual std::shared_ptr< stream_profile_interface > get_stream() const =0
static std::shared_ptr< matcher > create_DI_C_matcher(std::vector< stream_interface * > profiles)
static std::shared_ptr< matcher > create_frame_number_composite_matcher(std::vector< std::shared_ptr< matcher >> matchers)
lazy< std::vector< tagged_profile > > _profiles_tags
const char * what() const noexceptoverride
std::shared_ptr< context > _context
std::vector< rs2_format > map_supported_color_formats(rs2_format source_format)
static std::shared_ptr< matcher > create_identity_matcher(stream_interface *profiles)
void register_stream_to_extrinsic_group(const stream_interface &stream, uint32_t groupd_index)
virtual uint32_t get_framerate() const =0
std::vector< std::shared_ptr< sensor_interface > > _sensors
device(std::shared_ptr< context > ctx, const platform::backend_device_group group, bool device_changed_notifications=false)
std::pair< uint32_t, rs2_extrinsics > get_extrinsics(const stream_interface &stream) const override
const platform::backend_device_group _group
virtual int get_unique_id() const =0
virtual void stop_activity() const
static std::shared_ptr< matcher > create_timestamp_matcher(std::vector< stream_interface * > profiles)
std::string to_string(T value)
static std::shared_ptr< matcher > create(rs2_matchers matcher, std::vector< stream_interface * > profiles)
static std::shared_ptr< matcher > create_DI_matcher(std::vector< stream_interface * > profiles)