16 std::ostringstream os;
19 os << s->get_unique_id() <<
", " <<
20 s->get_format() <<
", " <<
21 s->get_stream_type() <<
"_" <<
22 s->get_stream_index() <<
" @ " <<
30 m_sensor_description(sensor_description),
31 m_sensor_id(sensor_description.get_sensor_index()),
32 m_parent_device(parent_device),
33 _default_queue_size(1)
48 if (!
d.second->empty())
62 if (
p->get_tag() &
tag)
63 profiles.push_back(
p);
75 for (
auto&&
r : requests)
81 throw std::runtime_error(
to_string() <<
"Failed to open sensor, requested profile: " <<
profile_to_string(
r) <<
" is not available");
84 std::vector<device_serializer::stream_identifier> opened_streams;
98 opened_streams.push_back(
f);
107 std::vector<device_serializer::stream_identifier> closed_streams;
113 if (available_profile->get_unique_id() ==
dispatcher.first)
119 m_dispatchers.clear();
139 std::lock_guard<std::mutex> l(
m_mutex);
151 std::lock_guard<std::mutex> l(
m_mutex);
210 if (info_snapshot ==
nullptr)
212 LOG_WARNING(
"Recorded file does not contain sensor information");
215 auto info_api = As<info_interface>(info_snapshot);
216 if (info_api ==
nullptr)
224 if (info_api->supports_info(info))
236 if (options_snapshot ==
nullptr)
238 LOG_WARNING(
"Recorded file does not contain sensor options");
241 auto options_api = As<options_interface>(options_snapshot);
242 if (options_api ==
nullptr)
252 if (options_api->supports_option(option_id))
254 auto&&
option = options_api->get_option(option_id);
260 catch (std::exception&
e)
262 LOG_WARNING(
"Failed to register option " << option_id <<
". Exception: " << e.what());
device_interface & m_parent_device
static const textual_icon lock
rs2_camera_info
Read-only strings that can be queried from the device. Not all information attributes are available o...
device_serializer::sensor_snapshot m_sensor_description
boost_foreach_argument_dependent_lookup_hack tag
virtual const char * get_description() const =0
rs2_option
Defines general configuration controls. These can generally be mapped to camera UVC controls...
virtual ~playback_sensor()
const unsigned int _default_queue_size
signal< playback_sensor, const std::vector< device_serializer::stream_identifier > & > opened
std::shared_ptr< rs2_frame_callback > frame_callback_ptr
void register_sensor_streams(const stream_profiles &vector)
void set_frames_callback(frame_callback_ptr callback) override
int register_before_streaming_changes_callback(std::function< void(bool)> callback) override
void register_notifications_callback(notifications_callback_ptr callback) override
void raise_notification(const notification)
std::atomic< bool > m_is_started
stream_profiles m_active_streams
GLsizei const GLchar *const * string
notifications_processor _notifications_processor
virtual float query() const =0
void start(frame_callback_ptr callback) override
signal< playback_sensor, uint32_t, frame_callback_ptr > started
void register_option(rs2_option id, std::shared_ptr< option > option)
static bool try_extend_snapshot(std::shared_ptr< extension_snapshot > &e, rs2_extension extension_type, void **ext)
def info(name, value, persistent=False)
std::function< void(cancellable_timer const &)> action
void register_info(rs2_camera_info info, const std::string &val)
snapshot_collection get_sensor_extensions_snapshots() const
void update(const device_serializer::sensor_snapshot &sensor_snapshot)
bool extend_to(rs2_extension extension_type, void **ext) override
stream_profiles get_stream_profiles(int tag=profile_tag::PROFILE_TAG_ANY) const override
void raise_notification(const notification &n)
std::string profile_to_string(std::shared_ptr< stream_profile_interface > s)
std::shared_ptr< extension_snapshot > find(rs2_extension t) const
std::shared_ptr< rs2_notifications_callback > notifications_callback_ptr
signal< playback_sensor, const std::vector< device_serializer::stream_identifier > & > closed
frame_callback_ptr m_user_callback
void open(const stream_profiles &requests) override
void register_sensor_options(const device_serializer::sensor_snapshot &sensor_snapshot)
void update_option(rs2_option id, std::shared_ptr< option > option)
void flush_pending_frames()
bool streams_contains_one_frame_or_more()
stream_profiles m_available_profiles
std::vector< std::shared_ptr< stream_profile_interface >> stream_profiles
signal< playback_sensor, uint32_t, bool > stopped
void set_active_streams(const stream_profiles &requests)
static environment & get_instance()
void register_sensor_infos(const device_serializer::sensor_snapshot &sensor_snapshot)
stream_profiles get_active_streams() const override
notifications_callback_ptr get_notifications_callback() const override
rs2_extension
Specifies advanced interfaces (capabilities) objects may implement.
std::mutex m_active_profile_mutex
void unregister_before_start_callback(int token) override
device_interface & get_device() override
stream_profiles get_stream_profiles() const
void set_callback(notifications_callback_ptr callback)
typename::boost::move_detail::remove_reference< T >::type && move(T &&t) BOOST_NOEXCEPT
std::map< stream_unique_id, std::shared_ptr< dispatcher > > m_dispatchers
frame_callback_ptr get_frames_callback() const override
bool is_streaming() const override
std::map< std::pair< rs2_stream, uint32_t >, std::shared_ptr< stream_profile_interface > > m_streams
notifications_callback_ptr get_callback() const
constexpr uint32_t get_device_index()
std::string to_string(T value)
playback_sensor(device_interface &parent_device, const device_serializer::sensor_snapshot &sensor_description)