8 #include <unordered_set> 84 LOG_DEBUG(
"Registered token #" << token <<
" to \"on_before_streaming_changes\"");
91 if (!successful_unregister)
93 LOG_WARNING(
"Failed to unregister token #" << token <<
" from \"on_before_streaming_changes\"");
126 std::string metadata_found_str =
"Metadata attribute parser for " + metadata_type_str +
" was previously defined";
147 if (
p.first == fourcc_format)
163 if (
p.first == fourcc_format)
187 auto uid = stream->get_unique_id();
188 target->set_unique_id(
uid);
203 auto curr_tag =
p->get_tag();
204 if( ! need_debug && ( curr_tag & profile_tag::PROFILE_TAG_DEBUG ) )
207 if( curr_tag & tag || need_any )
209 results.push_back(
p );
219 auto dec = std::make_shared<decimation_filter>();
231 auto huffman_decode = std::make_shared<depth_decompression_huffman>();
232 res.push_back(huffman_decode);
234 auto dec = std::make_shared<decimation_filter>();
252 const unsigned long long& last_frame_number,
253 std::shared_ptr<stream_profile_interface>
profile)
256 auto fr = std::make_shared<frame>();
260 fr->set_stream(profile);
273 fr->additional_data = additional_data;
279 fr->additional_data = additional_data;
300 LOG_ERROR(
"An error has occurred while stop_streaming()!");
306 std::lock_guard<std::mutex>
lock(_configure_lock);
312 auto on = std::unique_ptr<power>(
new power(std::dynamic_pointer_cast<uvc_sensor>(shared_from_this())));
317 std::vector<platform::stream_profile> commited;
319 for (
auto&& req_profile : requests)
324 unsigned long long last_frame_number = 0;
326 _device->probe_and_commit(req_profile_base->get_backend_profile(),
330 const auto&& fr =
generate_frame_from_data(f, _timestamp_reader.get(), last_timestamp, last_frame_number, req_profile_base);
331 const auto&& requires_processing =
true;
332 const auto&& timestamp_domain = _timestamp_reader->get_frame_timestamp_domain(fr);
335 auto&&
timestamp = fr->additional_data.timestamp;
339 LOG_WARNING(
"Frame received with streaming inactive," 341 << req_profile_base->get_stream_index()
342 <<
", Arrived," << std::fixed << f.backend_time <<
" " <<
system_time);
349 <<
",Counter," << std::dec << fr->additional_data.frame_number
350 <<
",Index," << req_profile_base->get_stream_index()
351 <<
",BackEndTS," << std::fixed << f.backend_time
353 <<
" ,diff_ts[Sys-BE]," <<
system_time - f.backend_time
355 <<
",last_frame_number," << last_frame_number <<
",last_timestamp," << last_timestamp);
360 const auto&& vsp = As<video_stream_profile, stream_profile_interface>(req_profile);
361 int width = vsp ? vsp->get_width() : 0;
362 int height = vsp ? vsp->get_height() : 0;
364 frame_holder fh =
_source.
alloc_frame(stream_to_frame_types(req_profile_base->get_stream_type()), width * height *
bpp / 8, fr->additional_data, requires_processing);
367 LOG_DEBUG(
"!! Frame allocation took " << diff <<
" msec");
373 video->assign(width, height, width *
bpp / 8,
bpp);
379 LOG_INFO(
"Dropped frame. alloc_frame(...) returned nullptr");
385 LOG_DEBUG(
"!! Frame memcpy took " << diff <<
" msec");
386 if (!requires_processing)
399 for (
auto&& commited_profile : commited)
401 _device->close(commited_profile);
405 commited.push_back(req_profile_base->get_backend_profile());
424 std::stringstream error_msg;
425 error_msg <<
"\tFormats: \n";
435 error_msg << std::endl;
440 throw std::runtime_error(error_msg.str());
442 if (Is<librealsense::global_time_interface>(
_owner))
444 As<librealsense::global_time_interface>(
_owner)->enable_time_diff_keeper(
true);
451 std::lock_guard<std::mutex>
lock(_configure_lock);
466 if (Is<librealsense::global_time_interface>(
_owner))
468 As<librealsense::global_time_interface>(
_owner)->enable_time_diff_keeper(
false);
482 std::lock_guard<std::mutex>
lock(_configure_lock);
491 _device->start_callbacks();
496 std::lock_guard<std::mutex>
lock(_configure_lock);
501 _device->stop_callbacks();
509 _timestamp_reader->reset();
514 std::lock_guard<std::mutex>
lock(_power_lock);
515 if (_user_count.fetch_add(1) == 0)
520 for(
auto && xu : _xus )
521 _device->init_xu( xu );
523 catch( std::exception
const &
e )
525 _user_count.fetch_add( -1 );
526 LOG_ERROR(
"acquire_power failed: " << e.what() );
531 _user_count.fetch_add( -1 );
540 std::lock_guard< std::mutex >
lock( _power_lock );
541 if( _user_count.fetch_add( -1 ) == 1 )
547 catch( std::exception
const &
e )
550 LOG_ERROR(
"release_power failed: " << e.what() );
562 std::unordered_set<std::shared_ptr<video_stream_profile>>
profiles;
563 power on(std::dynamic_pointer_cast<uvc_sensor>(shared_from_this()));
573 auto&&
profile = std::make_shared<video_stream_profile>(
p);
631 snapshot = std::make_shared<info_container>(*this);
640 if (
auto&& info_api = As<info_interface>(ext))
645 if (info_api->supports_info(info))
662 hid_sensor::hid_sensor(std::shared_ptr<platform::hid_device> hid_device, std::unique_ptr<frame_timestamp_reader> hid_iio_timestamp_reader,
663 std::unique_ptr<frame_timestamp_reader> custom_hid_timestamp_reader,
664 const std::map<
rs2_stream, std::map<unsigned, unsigned>>& fps_and_sampling_frequency_per_rs2_stream,
665 const std::vector<std::pair<std::string, stream_profile>>& sensor_name_and_hid_profiles,
668 _fps_and_sampling_frequency_per_rs2_stream(fps_and_sampling_frequency_per_rs2_stream),
669 _hid_device(hid_device),
671 _hid_iio_timestamp_reader(
move(hid_iio_timestamp_reader)),
672 _custom_hid_timestamp_reader(
move(custom_hid_timestamp_reader))
676 std::map<std::string, uint32_t> frequency_per_sensor;
677 for (
auto&& elem : sensor_name_and_hid_profiles)
678 frequency_per_sensor.insert(make_pair(elem.first, elem.second.fps));
680 std::vector<platform::hid_profile> profiles_vector;
681 for (
auto&& elem : frequency_per_sensor)
701 LOG_ERROR(
"An error has occurred while stop_streaming()!");
710 if (!elem.first.compare(sensor_name))
712 auto&&
p = elem.second;
714 auto profile = std::make_shared<motion_stream_profile>(sp);
734 std::vector<platform::hid_profile> configured_hid_profiles;
735 for (
auto&& request : requests)
744 if (Is<librealsense::global_time_interface>(
_owner))
746 As<librealsense::global_time_interface>(
_owner)->enable_time_diff_keeper(
true);
765 if (Is<librealsense::global_time_interface>(
_owner))
767 As<librealsense::global_time_interface>(
_owner)->enable_time_diff_keeper(
false);
798 unsigned long long last_frame_number = 0;
806 static const std::string custom_sensor_name =
"custom";
809 bool is_custom_sensor =
false;
810 static const uint32_t custom_source_id_offset = 16;
813 if (sensor_name == custom_sensor_name)
824 is_custom_sensor =
true;
830 auto stream_type = request->get_stream_type();
831 LOG_INFO(
"HID Frame received when Streaming is not active," 839 const auto&& timestamp_domain = timestamp_reader->get_frame_timestamp_domain(fr);
840 auto&&
timestamp = fr->additional_data.timestamp;
850 <<
",last_frame_number," << last_frame_number <<
",last_timestamp," << last_timestamp);
855 memcpy((
void*)frame->
get_frame_data(), fr->data.data(),
sizeof(
byte)*fr->data.size());
858 LOG_INFO(
"Dropped frame. alloc_frame(...) returned nullptr");
887 return _hid_device->get_custom_report_data(custom_sensor_name, report_name, report_field);
896 stream_requests.insert(stream_requests.end(),
profiles.begin(),
profiles.end());
899 return stream_requests;
906 if (stream == elem.second.stream)
918 catch (std::out_of_range)
933 auto fps_mapping =
it->second.find(fps);
934 if (fps_mapping !=
it->second.end())
935 return fps_mapping->second;
941 std::shared_ptr<platform::uvc_device> uvc_device,
942 std::unique_ptr<frame_timestamp_reader> timestamp_reader,
945 _device(
move(uvc_device)),
947 _timestamp_reader(
std::
move(timestamp_reader))
961 std::lock_guard<std::recursive_mutex>
lock(_mtx);
963 for (
auto i = 0;
i < sensors; ++
i)
971 std::lock_guard<std::recursive_mutex>
lock(_mtx);
974 if (has_metadata(frame))
984 auto timestamp = *(
reinterpret_cast<uint32_t*
>(
f->additional_data.metadata_blob.data()));
994 LOG_WARNING(
"HID timestamp not found, switching to Host timestamps.");
1005 if (
f->additional_data.metadata_size > 0)
1014 std::lock_guard<std::recursive_mutex>
lock(_mtx);
1025 if (has_metadata(frame))
1037 std::shared_ptr<sensor_base>
sensor,
1039 const std::map<uint32_t, rs2_format>& fourcc_to_rs2_format_map,
1040 const std::map<uint32_t, rs2_stream>& fourcc_to_rs2_stream_map)
1044 auto& raw_fourcc_to_rs2_format_map =
_raw_sensor->get_fourcc_to_rs2_format_map();
1048 auto& raw_fourcc_to_rs2_stream_map =
_raw_sensor->get_fourcc_to_rs2_stream_map();
1065 LOG_ERROR(
"An error has occurred while stop_streaming()!");
1082 auto range = option->get_range();
1090 <<
" control. descriptor: [min/max/step/default]= [" 1098 <<
" control was added as read-only. descriptor: [min/max/step/default]= [" 1103 auto val = option->query();
1107 <<
", val = " <<
val <<
" range [min..max] = [" <<
range.min <<
"/" <<
range.max <<
"]");
1128 const auto&& raw_uvc_sensor = As<uvc_sensor, sensor_base>(
_raw_sensor);
1129 register_option(
id, std::make_shared<uvc_pu_option>(*raw_uvc_sensor.get(),
id));
1134 const auto&& raw_uvc_sensor = As<uvc_sensor, sensor_base>(
_raw_sensor);
1140 std::sort(profiles->begin(), profiles->end(), [](
const std::shared_ptr<stream_profile_interface>& ap,
1141 const std::shared_ptr<stream_profile_interface>& bp)
1150 const auto&& bt = std::make_tuple(b.stream, -b.index, b.width, b.height, b.fps, b.stream ==
RS2_STREAM_COLOR && b.format ==
RS2_FORMAT_RGB8, b.format);
1160 if (
auto vsp = std::dynamic_pointer_cast<video_stream_profile>(profile))
1163 std::dynamic_pointer_cast<
video_stream_profile>(cloned)->set_dims(vsp->get_width(), vsp->get_height());
1166 if (
auto msp = std::dynamic_pointer_cast<motion_stream_profile>(profile))
1172 cloned->set_unique_id(profile->get_unique_id());
1173 cloned->set_format(profile->get_format());
1174 cloned->set_stream_index(profile->get_stream_index());
1175 cloned->set_stream_type(profile->get_stream_type());
1176 cloned->set_framerate(profile->get_framerate());
1186 for (
auto&& opt : options)
1188 const auto&& already_registered_predicate = [&opt](
const rs2_option& o) {
return o == opt; };
1189 if (std::none_of(
begin(options),
end(options), already_registered_predicate))
1202 for (
auto&& opt : options)
1204 const auto&& cached_option_predicate = [&opt](
const rs2_option& o) {
return o == opt; };
1218 const auto&& is_duplicate_predicate = [&duplicate](
const std::shared_ptr<stream_profile_interface>& spi) {
1222 return std::any_of(
begin(profiles),
end(profiles), is_duplicate_predicate);
1232 const auto&&
sources = pbf->get_source_info();
1233 const auto&& targets = pbf->get_target_info();
1243 for (
auto target : targets)
1248 cloned_profile->set_format(
target.format);
1249 cloned_profile->set_stream_index(
target.index);
1250 cloned_profile->set_stream_type(
target.stream);
1252 auto&& cloned_vsp = As<video_stream_profile, stream_profile_interface>(cloned_profile);
1255 const auto&&
res =
target.stream_resolution({ cloned_vsp->get_width(), cloned_vsp->get_height() });
1276 if (sources.size() > 1 &&
target.format !=
source.format)
1279 result_profiles.push_back(cloned_profile);
1288 return result_profiles;
1299 std::shared_ptr<processing_block_factory> best_match_processing_block_factory;
1301 int max_satisfied_req = 0;
1302 int best_source_size = 0;
1303 int satisfied_count = 0;
1308 satisfied_count = (int)satisfied_req.size();
1309 if (satisfied_count > max_satisfied_req
1310 || (satisfied_count == max_satisfied_req
1311 && pbf->get_source_info().size() < best_source_size))
1313 max_satisfied_req = satisfied_count;
1314 best_source_size = (int)pbf->get_source_info().size();
1315 best_match_processing_block_factory = pbf;
1316 best_match_requests = satisfied_req;
1320 return { best_match_processing_block_factory, best_match_requests };
1332 auto source_profile = source_profile_[0];
1333 source_profile->set_stream_index(target->get_stream_index());
1334 source_profile->set_unique_id(target->get_unique_id());
1335 source_profile->set_stream_type(target->get_stream_type());
1336 auto&& vsp = As<video_stream_profile, stream_profile_interface>(source_profile);
1337 const auto&& cvsp = As<video_stream_profile, stream_profile_interface>(
target);
1340 vsp->set_intrinsics([cvsp]() {
1343 return cvsp->get_intrinsics();
1348 vsp->set_dims(cvsp->get_width(), cvsp->get_height());
1368 std::unordered_set<std::shared_ptr<stream_profile_interface>> resolved_req_set;
1373 for (
auto&& req : requests)
1379 while (!unhandled_reqs.empty())
1383 auto&& best_pbf = best_match.first;
1384 auto&& best_reqs = best_match.second;
1387 for (
auto&& req : best_reqs)
1389 const auto&& matching_req_predicate = [&req](
const std::shared_ptr<stream_profile_interface>& sp) {
1392 unhandled_reqs.erase(std::remove_if(
begin(unhandled_reqs),
end(unhandled_reqs), matching_req_predicate));
1396 std::unordered_set<std::shared_ptr<stream_profile_interface>> current_resolved_reqs;
1397 auto best_pb = best_pbf->generate();
1399 for (
auto&& req : best_reqs)
1404 for (
auto&& source_profile : mapped_source_profiles)
1406 if (best_pbf->has_source(source_profile))
1408 resolved_req_set.insert(source_profile);
1409 current_resolved_reqs.insert(source_profile);
1415 const stream_profiles&& print_current_resolved_reqs = { current_resolved_reqs.begin(), current_resolved_reqs.end() };
1416 LOG_INFO(
"Request: " << best_reqs <<
"\nResolved to: " << print_current_resolved_reqs);
1418 resolved_req = { resolved_req_set.begin(), resolved_req_set.end() };
1419 return resolved_req;
1426 for (
auto source : requests)
1436 catch (
const std::runtime_error&
e)
1439 std::stringstream requests_info;
1440 for (
auto&&
r : requests)
1445 throw recoverable_exception(
"\nFailed to resolve the request: \n" + requests_info.str() +
"\nInto:\n" + e.what(),
1458 for (
auto&& pb :
entry.second)
1461 _profiles_to_processing_block.erase(
begin(_profiles_to_processing_block),
end(_profiles_to_processing_block));
1482 auto&& reqs = cached_req->second;
1483 auto&& req_it = std::find_if(
begin(reqs),
end(reqs), [&f](
const std::shared_ptr<stream_profile_interface>& req) {
1484 return (req->get_stream_index() == f->
get_stream()->get_stream_index() &&
1485 req->get_stream_type() == f->
get_stream()->get_stream_type());
1488 return req_it !=
end(reqs) ? *req_it :
nullptr;
1501 std::vector<frame_interface*> processed_frames;
1502 processed_frames.push_back(f.
frame);
1507 for (
size_t i = 0;
i < composite->get_embedded_frames_count();
i++)
1509 processed_frames.push_back(composite->get_frame(
i));
1514 for (
auto&& fr : processed_frames)
1516 if (!dynamic_cast<composite_frame*>(fr))
1522 fr->set_stream(cached_profile);
1536 auto&& pbs = pb_entry.second;
1537 for (
auto&& pb : pbs)
1540 pb->set_output_callback(output_cb);
1549 auto&& pbs = _profiles_to_processing_block[f->
get_stream()];
1550 for (
auto&& pb : pbs)
1553 pb->invoke(f.
frame);
1568 const std::vector<stream_profile>& to,
1569 std::function<std::shared_ptr<processing_block>(
void)> generate_func)
1571 _pb_factories.push_back(std::make_shared<processing_block_factory>(from, to, generate_func));
1576 _pb_factories.push_back(std::make_shared<processing_block_factory>(pbf));
1581 for (
auto&& pbf : pbfs)
1600 _raw_sensor->register_notifications_callback(callback);
1610 _raw_sensor->unregister_before_start_callback(token);
1616 _raw_sensor->register_metadata(metadata, metadata_parser);
1631 snapshot = std::make_shared<motion_sensor_snapshot>();
1636 snapshot = std::make_shared<fisheye_sensor_snapshot>();
std::pair< std::shared_ptr< processing_block_factory >, stream_profiles > find_requests_best_pb_match(const stream_profiles &sp)
static const textual_icon lock
virtual void register_option(rs2_option id, std::shared_ptr< option > option)
rs2_camera_info
Read-only strings that can be queried from the device. Not all information attributes are available o...
bool is_streaming() const override
virtual const byte * get_frame_data() const =0
const char * rs2_format_to_string(rs2_format format)
notifications_callback_ptr get_notifications_callback() const override
static const double TIMESTAMP_USEC_TO_MSEC
GLboolean GLboolean GLboolean b
void register_xu(platform::extension_unit xu)
boost_foreach_argument_dependent_lookup_hack tag
const char * get_string(rs2_rs400_visual_preset value)
std::atomic< bool > _is_opened
GLuint const GLchar * name
void unregister_processing_block_options(const processing_block &pb)
void invoke_callback(frame_holder frame) const
const char * rs2_timestamp_domain_to_string(rs2_timestamp_domain info)
virtual bool is_opened() const
void tag_profiles(stream_profiles profiles) const override
const char * rs2_frame_metadata_to_string(rs2_frame_metadata_value metadata)
stream_profiles init_stream_profiles() override
rs2_option
Defines general configuration controls. These can generally be mapped to camera UVC controls...
void open(const stream_profiles &requests) override
uvc_sensor(std::string name, std::shared_ptr< platform::uvc_device > uvc_device, std::unique_ptr< frame_timestamp_reader > timestamp_reader, device *dev)
std::shared_ptr< platform::time_service > get_time_service()
virtual std::shared_ptr< notifications_processor > get_notifications_processor() const
hid_sensor(std::shared_ptr< platform::hid_device > hid_device, std::unique_ptr< frame_timestamp_reader > hid_iio_timestamp_reader, std::unique_ptr< frame_timestamp_reader > custom_hid_timestamp_reader, const std::map< rs2_stream, std::map< unsigned, unsigned >> &fps_and_sampling_frequency_per_rs2_stream, const std::vector< std::pair< std::string, stream_profile >> &sensor_name_and_hid_profiles, device *dev)
void init(std::shared_ptr< metadata_parser_map > metadata_parsers)
std::shared_ptr< rs2_frame_callback > frame_callback_ptr
frame_callback_ptr get_frames_callback() const override
void register_processing_block(const std::vector< stream_profile > &from, const std::vector< stream_profile > &to, std::function< std::shared_ptr< processing_block >(void)> generate_func)
stream_profiles resolve_requests(const stream_profiles &requests)
void set_source_owner(sensor_base *owner)
const char * rs2_option_to_string(rs2_option option)
stream_profiles get_stream_profiles(int tag=profile_tag::PROFILE_TAG_ANY) const override
std::mutex _synthetic_configure_lock
processing_blocks get_color_recommended_proccesing_blocks()
frame_callback_ptr make_callback(T callback)
std::unordered_map< processing_block_factory *, stream_profiles > _pbf_supported_profiles
rs2_timestamp_domain get_frame_timestamp_domain(const std::shared_ptr< frame_interface > &frame) const override
virtual stream_profiles init_stream_profiles() override
void start(frame_callback_ptr callback) override
void create_snapshot(std::shared_ptr< info_interface > &snapshot) const override
std::vector< platform::hid_sensor > _hid_sensors
rs2_format fourcc_to_rs2_format(uint32_t format) const
void register_metadata(rs2_frame_metadata_value metadata, std::shared_ptr< md_attribute_parser_base > metadata_parser) const override
std::unordered_map< stream_profile, stream_profiles > _target_to_source_profiles_map
bool supports_info(rs2_camera_info info) const override
int register_before_streaming_changes_callback(std::function< void(bool)> callback) override
void register_same_extrinsics(const stream_interface &from, const stream_interface &to)
bool supports_option(rs2_option id) const override
void register_pu(rs2_option id)
virtual void register_metadata(rs2_frame_metadata_value metadata, std::shared_ptr< md_attribute_parser_base > metadata_parser) const
virtual bool try_register_option(rs2_option id, std::shared_ptr< option > option)
GLsizei const GLchar *const * string
bool has_metadata(const std::shared_ptr< frame_interface > &frame) const
void open(const stream_profiles &requests) override
void create_snapshot(std::shared_ptr< fisheye_sensor > &snapshot) const override
std::shared_ptr< platform::hid_device > _hid_device
std::map< rs2_camera_info, std::string > _camera_info
option & get_option(rs2_option id) override
frame_callback_ptr _post_process_callback
void sort(sort_type m_sort_type, const std::string &in, const std::string &out)
std::mutex _active_profile_mutex
std::vector< bool > _is_configured_stream
std::shared_ptr< sensor_base > _raw_sensor
~synthetic_sensor() override
void unregister_option(rs2_option id)
void register_option(rs2_option id, std::shared_ptr< option > option)
void open(const stream_profiles &requests) override
void create_snapshot(std::shared_ptr< motion_sensor > &snapshot) const override
GLboolean GLboolean GLboolean GLboolean a
const std::map< rs2_stream, uint32_t > stream_and_fourcc
std::vector< rs2_option > get_supported_options() const override
std::unique_ptr< frame_timestamp_reader > _hid_iio_timestamp_reader
std::shared_ptr< frame > generate_frame_from_data(const platform::frame_object &fo, frame_timestamp_reader *timestamp_reader, const rs2_time_t &last_timestamp, const unsigned long long &last_frame_number, std::shared_ptr< stream_profile_interface > profile)
def info(name, value, persistent=False)
void set_active_streams(const stream_profiles &requests)
virtual ~uvc_sensor() override
std::unordered_map< rs2_format, stream_profiles > _cached_requests
frame_callback_ptr get_callback() const
void register_info(rs2_camera_info info, const std::string &val)
virtual stream_profiles init_stream_profiles()=0
std::shared_ptr< option > get_published_size_option()
void register_pu(rs2_option id)
std::shared_ptr< std::map< uint32_t, rs2_format > > & get_fourcc_to_rs2_format_map()
std::mutex _configure_lock
processing_blocks get_depth_recommended_proccesing_blocks()
void start(frame_callback_ptr callback) override
std::shared_ptr< std::map< uint32_t, rs2_format > > _fourcc_to_rs2_format
stream_profiles _active_profiles
std::unique_ptr< frame_timestamp_reader > _custom_hid_timestamp_reader
void raise_on_before_streaming_changes(bool streaming)
static rs2_stream custom_gpio_to_stream_type(uint32_t custom_gpio)
std::shared_ptr< rs2_notifications_callback > notifications_callback_ptr
std::multimap< rs2_frame_metadata_value, std::shared_ptr< md_attribute_parser_base > > metadata_parser_map
rs2_time_t backend_timestamp
const std::string & get_info(rs2_camera_info info) const override
void set_sensor(const std::shared_ptr< sensor_interface > &s)
std::shared_ptr< notifications_processor > _notifications_processor
GLint GLsizei GLsizei height
std::vector< platform::stream_profile > _uvc_profiles
virtual void set_frames_callback(frame_callback_ptr callback) override
void add_source_profile_missing_data(std::shared_ptr< stream_profile_interface > &source_profile)
stream_profiles get_sensor_profiles(std::string sensor_name) const
unsigned long long frame_number
void unregister_before_start_callback(int token) override
const std::vector< std::pair< std::string, stream_profile > > _sensor_name_and_hid_profiles
rs2_format
A stream's format identifies how binary data is encoded within a frame.
void update(std::shared_ptr< extension_snapshot > ext) override
iio_hid_timestamp_reader()
bool supports_info(rs2_camera_info info) const override
std::vector< platform::stream_profile > _internal_config
signal< sensor_base, bool > on_before_streaming_changes
GLint GLint GLsizei GLint GLenum GLenum const void * pixels
void update_info(rs2_camera_info info, const std::string &val)
const std::string & get_info(rs2_camera_info info) const override
std::vector< std::shared_ptr< stream_profile_interface >> stream_profiles
rs2_extension stream_to_frame_types(rs2_stream stream) const
rs2_stream
Streams are different types of data provided by RealSense devices.
void register_processing_block_options(const processing_block &pb)
bool is_streaming() const override
frame_interface * alloc_frame(rs2_extension type, size_t size, frame_additional_data additional_data, bool requires_memory) const
static environment & get_instance()
void enable_recording(std::function< void(const info_interface &)> record_action) override
extrinsics_graph & get_extrinsics_graph()
std::shared_ptr< std::map< uint32_t, rs2_stream > > & get_fourcc_to_rs2_stream_map()
void sort_profiles(stream_profiles *profiles)
synthetic_sensor(std::string name, std::shared_ptr< sensor_base > sensor, device *device, const std::map< uint32_t, rs2_format > &fourcc_to_rs2_format_map=std::map< uint32_t, rs2_format >(), const std::map< uint32_t, rs2_stream > &fourcc_to_rs2_stream_map=std::map< uint32_t, rs2_stream >())
LOG_INFO("Log message using LOG_INFO()")
virtual std::shared_ptr< stream_profile_interface > get_stream() const =0
void unregister_before_start_callback(int token) override
device_interface & get_device() override
std::shared_ptr< stream_profile_interface > clone_profile(const std::shared_ptr< stream_profile_interface > &profile)
std::vector< uint8_t > get_custom_report_data(const std::string &custom_sensor_name, const std::string &report_name, platform::custom_sensor_report_field report_field) const
sensor_base(std::string name, device *device, recommended_proccesing_blocks_interface *owner)
virtual unsigned long long get_frame_counter(const std::shared_ptr< frame_interface > &frame) const =0
virtual frame_callback_ptr get_frames_callback() const override
sensor_base * _source_owner
const char * rs2_stream_to_string(rs2_stream stream)
rs2_extension
Specifies advanced interfaces (capabilities) objects may implement.
rs2_stream fourcc_to_rs2_stream(uint32_t fourcc_format) const
::realsense_legacy_msgs::metadata_< std::allocator< void > > metadata
stream_profile to_profile(const stream_profile_interface *sp)
std::shared_ptr< metadata_parser_map > _metadata_parsers
void assign_stream(const std::shared_ptr< stream_interface > &stream, std::shared_ptr< stream_profile_interface > target) const
lazy< stream_profiles > _profiles
stream_profiles get_active_streams() const override
unsigned long long get_frame_counter(const std::shared_ptr< frame_interface > &frame) const override
uint32_t fps_to_sampling_frequency(rs2_stream stream, uint32_t fps) const
bool try_register_pu(rs2_option id)
std::vector< std::shared_ptr< processing_block_factory > > _pb_factories
typename::boost::move_detail::remove_reference< T >::type && move(T &&t) BOOST_NOEXCEPT
void set_callback(frame_callback_ptr callback)
std::unordered_map< std::shared_ptr< stream_profile_interface >, std::unordered_set< std::shared_ptr< processing_block > > > _profiles_to_processing_block
GLsizei GLsizei GLchar * source
std::shared_ptr< stream_profile_interface > filter_frame_by_requests(const frame_interface *f)
std::unordered_map< std::shared_ptr< stream_profile_interface >, stream_profiles > _source_to_target_profiles_map
rs2_time_t get_frame_timestamp(const std::shared_ptr< frame_interface > &frame) override
std::vector< rs2_option > _cached_processing_blocks_options
int register_before_streaming_changes_callback(std::function< void(bool)> callback) override
virtual void set_timestamp_domain(rs2_timestamp_domain timestamp_domain)=0
virtual double get_frame_timestamp(const std::shared_ptr< frame_interface > &frame)=0
uint32_t stream_to_fourcc(rs2_stream stream) const
void start(frame_callback_ptr callback) override
std::shared_ptr< md_attribute_parser_base > make_additional_data_parser(Attribute St::*attribute)
A utility function to create additional_data parser.
void unregister_option(rs2_option id)
void add_source_profiles_missing_data()
void register_notifications_callback(notifications_callback_ptr callback) override
stream_profiles init_stream_profiles() override
void register_notifications_callback(notifications_callback_ptr callback) override
bool is_duplicated_profile(const std::shared_ptr< stream_profile_interface > &duplicate, const stream_profiles &profiles)
std::atomic< bool > _is_streaming
bool is_opened() const override
virtual void attach_continuation(frame_continuation &&continuation)=0
const std::string & rs2_stream_to_sensor_name(rs2_stream stream) const
std::shared_ptr< std::map< uint32_t, rs2_stream > > _fourcc_to_rs2_stream
void set_frames_callback(frame_callback_ptr callback) override
std::map< rs2_stream, std::map< uint32_t, uint32_t > > _fps_and_sampling_frequency_per_rs2_stream
int get_image_bpp(rs2_format format)
std::map< std::string, std::shared_ptr< stream_profile_interface > > _configured_profiles
GeneratorWrapper< T > map(Func &&function, GeneratorWrapper< U > &&generator)
rs2_frame_metadata_value
Per-Frame-Metadata is the set of read-only properties that might be exposed for each individual frame...
struct rs2_frame rs2_frame
virtual void set_stream(std::shared_ptr< stream_profile_interface > sp)=0
unsigned long long last_frame_number
std::string to_string(T value)
rs2_timestamp_domain
Specifies the clock in relation to which the frame timestamp was measured.