24 auto sensor = std::make_shared<software_sensor>(
name,
this);
34 std::set<uint32_t> bad_groups;
36 if (pair.second.first > max_idx) max_idx = pair.second.first;
37 if (bad_groups.count(pair.second.first))
continue;
56 throw rs2::error(
"Requested index is out of range!");
63 _info = std::make_shared<software_device_info>(std::dynamic_pointer_cast<
software_device>(shared_from_this()));
84 std::vector<stream_interface*>
profiles;
86 for (
auto&&
s : _software_sensors)
87 for (
auto&&
p :
s->get_stream_profiles())
88 profiles.push_back(
p.get());
103 auto profile = std::make_shared<video_stream_profile>(
123 LOG_WARNING(
"Motion stream unique ID already exist!");
124 throw rs2::error(
"Stream unique ID already exist!");
127 auto profile = std::make_shared<motion_stream_profile>(
146 LOG_WARNING(
"Pose stream unique ID already exist!");
147 throw rs2::error(
"Stream unique ID already exist!");
150 auto profile = std::make_shared<pose_stream_profile>(
165 auto filtFunc = [&](std::shared_ptr<stream_profile_interface>
profile)
174 return std::shared_ptr<stream_profile_interface>();
184 *ptr = &(*_depth_extension);
193 *ptr = &(*_stereo_extension);
289 LOG_WARNING(
"Dropped video frame. alloc_frame(...) returned nullptr");
294 vid_frame->
assign(vid_profile->get_width(), vid_profile->get_height(), software_frame.
stride, software_frame.
bpp * 8);
299 }, software_frame.
pixels });
302 sd->register_extrinsic(*vid_profile);
329 LOG_WARNING(
"Dropped motion frame. alloc_frame(...) returned nullptr");
335 }, software_frame.
data });
362 LOG_WARNING(
"Dropped pose frame. alloc_frame(...) returned nullptr");
368 }, software_frame.
data });
382 register_option(option, std::make_shared<const_value_option>(
"bypass sensor read only option",
388 if (
auto opt = dynamic_cast<readonly_float_option*>(&
get_option(option)))
396 register_option(option, (is_writable? std::make_shared<float_option>(range) :
397 std::make_shared<readonly_float_option>(range)));
virtual rs2_stream get_stream_type() const =0
stream_profiles _profiles
const char * get_string(rs2_rs400_visual_preset value)
std::atomic< bool > _is_opened
GLuint const GLchar * name
void invoke_callback(frame_holder frame) const
rs2_option
Defines general configuration controls. These can generally be mapped to camera UVC controls...
virtual ~software_device()
void init(std::shared_ptr< metadata_parser_map > metadata_parsers)
std::shared_ptr< stream_profile_interface > add_video_stream(rs2_video_stream video_stream, bool is_default=false)
std::shared_ptr< rs2_frame_callback > frame_callback_ptr
void add_option(rs2_option option, option_range range, bool is_writable)
std::shared_ptr< software_device_info > _info
const rs2_stream_profile * profile
void open(const stream_profiles &requests) override
lazy< depth_extension > _depth_extension
All the parameters required to define a video stream.
All the parameters required to define a pose frame.
std::map< rs2_frame_metadata_value, rs2_metadata_type > _metadata_map
software_sensor(std::string name, software_device *owner)
bool supports_option(rs2_option id) const override
void on_notification(rs2_software_notification notif)
std::shared_ptr< stream_profile_interface > add_motion_stream(rs2_motion_stream motion_stream, bool is_default=false)
GLsizei const GLchar *const * string
rs2_timestamp_domain domain
const char * serialized_data
option & get_option(rs2_option id) override
rs2_timestamp_domain domain
void on_pose_frame(rs2_software_pose_frame frame)
void register_destruction_callback(software_device_destruction_callback_ptr)
void register_option(rs2_option id, std::shared_ptr< option > option)
void set_active_streams(const stream_profiles &requests)
const rs2_stream_profile * profile
void register_info(rs2_camera_info info, const std::string &val)
std::shared_ptr< option > get_published_size_option()
stream_profiles init_stream_profiles() override
void register_extrinsic(const stream_interface &stream)
All the parameters required to define a pose stream.
rs2_matchers
Specifies types of different matchers.
void raise_on_before_streaming_changes(bool streaming)
rs2_log_severity severity
void set_stream(std::shared_ptr< stream_profile_interface > sp) override
void set_sensor(const std::shared_ptr< sensor_interface > &s)
std::shared_ptr< notifications_processor > _notifications_processor
std::map< int, std::pair< uint32_t, std::shared_ptr< const stream_interface > > > _extrinsics
rs2_notification_category category
void attach_continuation(frame_continuation &&continuation) override
void add_read_only_option(rs2_option option, float val)
unsigned long long frame_number
All the parameters required to define a motion stream.
software_sensor & add_software_sensor(const std::string &name)
const rs2_stream_profile * profile
std::vector< std::shared_ptr< stream_profile_interface >> stream_profiles
frame_interface * alloc_frame(rs2_extension type, size_t size, frame_additional_data additional_data, bool requires_memory) const
static environment & get_instance()
int add_sensor(const std::shared_ptr< sensor_interface > &sensor_base)
extrinsics_graph & get_extrinsics_graph()
std::shared_ptr< software_device_info > get_info()
std::shared_ptr< stream_profile_interface > add_pose_stream(rs2_pose_stream pose_stream, bool is_default=false)
librealsense::stream_profile_interface * profile
std::shared_ptr< stream_profile_interface > find_profile_by_uid(int uid)
Cross-stream extrinsics: encodes the topology describing how the different devices are oriented...
void on_video_frame(rs2_software_video_frame frame)
void assign(int width, int height, int stride, int bpp)
void set_metadata(rs2_frame_metadata_value key, rs2_metadata_type value)
All the parameters required to define a sensor notification.
rs2_extension
Specifies advanced interfaces (capabilities) objects may implement.
long long rs2_metadata_type
rs2_timestamp_domain timestamp_domain
std::shared_ptr< metadata_parser_map > _metadata_parsers
librealsense::software_device_destruction_callback_ptr _user_destruction_callback
All the parameters required to define a motion frame.
rs2_timestamp_domain domain
std::vector< std::shared_ptr< software_sensor > > _software_sensors
typename::boost::move_detail::remove_reference< T >::type && move(T &&t) BOOST_NOEXCEPT
void set_callback(frame_callback_ptr callback)
std::shared_ptr< matcher > create_matcher(const frame_holder &frame) const override
void on_motion_frame(rs2_software_motion_frame frame)
rs2_motion_device_intrinsic intrinsics
void register_stream_to_extrinsic_group(const stream_interface &stream, uint32_t groupd_index)
bool try_fetch_extrinsics(const stream_interface &from, const stream_interface &to, rs2_extrinsics *extr)
static uint64_t generate_id()
rs2_intrinsics intrinsics
void update_read_only_option(rs2_option option, float val)
software_sensor & get_software_sensor(int index)
bool extend_to(rs2_extension extension_type, void **ptr) override
static std::shared_ptr< metadata_parser_map > create_metadata_parser_map()
All the parameters required to define a video frame.
std::atomic< bool > _is_streaming
std::shared_ptr< rs2_software_device_destruction_callback > software_device_destruction_callback_ptr
std::array< uint8_t, MAX_META_DATA_SIZE > metadata_blob
rs2_frame_metadata_value
Per-Frame-Metadata is the set of read-only properties that might be exposed for each individual frame...
void set_matcher_type(rs2_matchers matcher)
void start(frame_callback_ptr callback) override
std::string to_string(T value)
static std::shared_ptr< matcher > create(rs2_matchers matcher, std::vector< stream_interface * > profiles)