5 #include "../include/librealsense2/hpp/rs_record_playback.hpp" 11 py::class_<rs2::playback, rs2::device>
playback(m,
"playback");
12 playback.def(py::init<rs2::device>(),
"device"_a)
13 .def(
"pause", &
rs2::playback::pause,
"Pauses the playback. Calling pause() in \"Paused\" status does nothing. If " 14 "pause() is called while playback status is \"Playing\" or \"Stopped\", the playback will not play until resume() is called.")
15 .def(
"resume", &
rs2::playback::resume,
"Un-pauses the playback. Calling resume() while playback status is \"Playing\" or \"Stopped\" does nothing.")
17 .def(
"get_position", &
rs2::playback::get_position,
"Retrieves the current position of the playback in the file in terms of time. Units are expressed in nanoseconds.")
19 .def(
"seek", &
rs2::playback::seek,
"Sets the playback to a specified time point of the played data.",
"time"_a)
21 .def(
"set_real_time", &
rs2::playback::set_real_time,
"Set the playback to work in real time or non real time. In real time mode, playback will " 22 "play the same way the file was recorded. If the application takes too long to handle the callback, frames may be dropped. In non real time " 23 "mode, playback will wait for each callback to finish handling the data before reading the next frame. In this mode no frames will be dropped, " 24 "and the application controls the framerate of playback via callback duration.",
"real_time"_a)
27 self.set_status_changed_callback(
callback);
28 },
"Register to receive callback from playback device upon its status changes. Callbacks are invoked from the reading thread, " 29 "and as such any heavy processing in the callback handler will affect the reading thread and may cause frame drops/high latency.",
"callback"_a)
33 py::class_<rs2::recorder, rs2::device>
recorder(m,
"recorder",
"Records the given device and saves it to the given file as rosbag format.");
34 recorder.def(py::init<const std::string&, rs2::device>())
35 .def(py::init<const std::string&, rs2::device, bool>())
36 .def(
"pause", &
rs2::recorder::pause,
"Pause the recording device without stopping the actual device from streaming.")
bool is_real_time() const
void seek(std::chrono::nanoseconds time)
uint64_t get_position() const
void init_record_playback(py::module &m)
rs2_playback_status current_status() const
std::chrono::nanoseconds get_duration() const
void set_real_time(bool real_time) const
std::string file_name() const