20 public std::enable_shared_from_this<playback_sensor>
34 void close()
override;
43 void stop(
bool invoke_required);
56 if (processing_blocks_snapshot ==
nullptr)
60 auto processing_blocks_api = As<recommended_proccesing_blocks_interface>(processing_blocks_snapshot);
61 if (processing_blocks_api ==
nullptr)
65 return processing_blocks_api->get_recommended_processing_blocks();
85 std::map<std::pair<rs2_stream, uint32_t>, std::shared_ptr<stream_profile_interface>>
m_streams;
99 template <
class T,
class K,
class P>
102 if (frame ==
nullptr)
115 auto pf = std::make_shared<frame_holder>(
std::move(frame));
120 if (sleep_for.count() > 0)
121 t.try_sleep(sleep_for.count() * 1
e-6);
130 m_user_callback->on_frame((
rs2_frame*)pframe);
131 update_last_pushed_frame();
133 m_dispatchers.at(stream_id)->invoke(callback, !is_real_time);
device_interface & m_parent_device
device_serializer::sensor_snapshot m_sensor_description
boost_foreach_argument_dependent_lookup_hack tag
rs2_option
Defines general configuration controls. These can generally be mapped to camera UVC controls...
std::function< void(frame_holder)> frame_interface_callback_t
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
virtual processing_blocks get_recommended_processing_blocks() const override
std::atomic< bool > m_is_started
stream_profiles m_active_streams
notifications_processor _notifications_processor
void start(frame_callback_ptr callback) override
signal< playback_sensor, uint32_t, frame_callback_ptr > started
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::shared_ptr< extension_snapshot > find(rs2_extension t) const
virtual archive_interface * get_owner() const =0
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
virtual void set_sensor(std::shared_ptr< sensor_interface > s)=0
void swap(nlohmann::json &j1, nlohmann::json &j2) noexcept(is_nothrow_move_constructible< nlohmann::json >::value andis_nothrow_move_assignable< nlohmann::json >::value)
exchanges the values of two JSON objects
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)
void register_sensor_infos(const device_serializer::sensor_snapshot &sensor_snapshot)
std::chrono::duration< uint64_t, std::nano > nanoseconds
stream_profiles get_active_streams() const override
virtual std::shared_ptr< stream_profile_interface > get_stream() const =0
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
typename::boost::move_detail::remove_reference< T >::type && move(T &&t) BOOST_NOEXCEPT
std::string frame_holder_to_string(const frame_holder &f)
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
void handle_frame(frame_holder frame, bool is_real_time, T calc_sleep, K is_paused, P update_last_pushed_frame)
struct rs2_frame rs2_frame
virtual void set_stream(std::shared_ptr< stream_profile_interface > sp)=0
playback_sensor(device_interface &parent_device, const device_serializer::sensor_snapshot &sensor_description)