11 #include <condition_variable>
14 #include <unordered_map>
63 virtual bool IsOpened()
const override {
return is_opened_; }
66 virtual bool IsEOF()
const override;
71 virtual bool Open(
const std::string &filename)
override;
74 virtual void Close()
override;
96 virtual std::string
GetFilename()
const override {
return filename_; };
102 std::string filename_;
105 std::atomic<bool> is_eof_{
false};
106 std::atomic<bool> is_opened_{
false};
116 std::vector<t::geometry::RGBDImage> frame_buffer_;
117 std::vector<uint64_t>
119 static const size_t BUFFER_REFILL_FACTOR =
121 std::atomic<uint64_t> head_fid_{
123 std::atomic<uint64_t> tail_fid_{0};
124 std::atomic<uint64_t> seek_to_{UINT64_MAX};
125 std::condition_variable need_frames_;
131 void fill_frame_buffer();
132 std::thread frame_reader_thread_;
134 std::unique_ptr<rs2::pipeline> pipe_;
136 Json::Value GetMetadataJson();
137 std::string GetTagInMetadata(
const std::string &tag_name);
RGBDImage A pair of color and depth images.
Definition: RGBDImage.h:21
Definition: RGBDVideoReader.h:18
virtual void SaveFrames(const std::string &frame_path, uint64_t start_time_us=0, uint64_t end_time_us=UINT64_MAX)
Definition: RGBDVideoReader.cpp:33
virtual std::string ToString() const
Text description.
Definition: RGBDVideoReader.cpp:22
Definition: RSBagReader.h:48
virtual bool Open(const std::string &filename) override
Definition: RSBagReader.cpp:41
RSBagReader & operator=(const RSBagReader &)=delete
virtual bool IsEOF() const override
Check if the RSBag file is all read.
Definition: RSBagReader.cpp:164
RSBagReader(size_t buffer_size=DEFAULT_BUFFER_SIZE)
Definition: RSBagReader.cpp:32
static const size_t DEFAULT_BUFFER_SIZE
Definition: RSBagReader.h:50
virtual RGBDVideoMetadata & GetMetadata() override
Get reference to the metadata of the RGBD video playback.
Definition: RSBagReader.h:82
virtual bool IsOpened() const override
Check If the RSBag file is opened.
Definition: RSBagReader.h:63
virtual ~RSBagReader()
Definition: RSBagReader.cpp:37
virtual t::geometry::RGBDImage NextFrame() override
Copy next frame from the bag file and return the RGBDImage object.
Definition: RSBagReader.cpp:166
virtual uint64_t GetTimestamp() const override
Get current timestamp (in us).
Definition: RSBagReader.cpp:208
virtual void Close() override
Close the opened RSBag playback.
Definition: RSBagReader.cpp:74
virtual bool SeekTimestamp(uint64_t timestamp) override
Definition: RSBagReader.cpp:189
virtual std::string GetFilename() const override
Return filename being read.
Definition: RSBagReader.h:96
RSBagReader(const RSBagReader &)=delete
virtual const RGBDVideoMetadata & GetMetadata() const override
Get (read-only) metadata of the playback.
Definition: RSBagReader.h:77
const char const char value recording_handle imu_sample recording_handle uint8_t size_t data_size k4a_record_configuration_t config target_format k4a_capture_t capture_handle k4a_imu_sample_t imu_sample uint64_t
Definition: K4aPlugin.cpp:343
Definition: PinholeCameraIntrinsic.cpp:16
Definition: RealSenseSensor.h:17