30 #include <condition_variable> 33 #include <unordered_map> 70 static const size_t DEFAULT_BUFFER_SIZE = 32;
76 explicit RSBagReader(
size_t buffer_size = DEFAULT_BUFFER_SIZE);
83 virtual bool IsOpened()
const override {
return is_opened_; }
86 virtual bool IsEOF()
const override;
91 virtual bool Open(
const std::string &filename)
override;
94 virtual void Close()
override;
107 virtual bool SeekTimestamp(
uint64_t timestamp)
override;
110 virtual uint64_t GetTimestamp()
const override;
116 virtual std::string
GetFilename()
const override {
return filename_; };
118 using RGBDVideoReader::SaveFrames;
119 using RGBDVideoReader::ToString;
122 std::string filename_;
125 std::atomic<bool> is_eof_{
false};
126 std::atomic<bool> is_opened_{
false};
136 std::vector<t::geometry::RGBDImage> frame_buffer_;
137 std::vector<uint64_t>
139 static const size_t BUFFER_REFILL_FACTOR =
141 std::atomic<uint64_t> head_fid_{
143 std::atomic<uint64_t> tail_fid_{0};
144 std::atomic<uint64_t> seek_to_{UINT64_MAX};
145 std::condition_variable need_frames_;
151 void fill_frame_buffer();
152 std::thread frame_reader_thread_;
154 std::unique_ptr<rs2::pipeline> pipe_;
155 std::unique_ptr<rs2::align> align_to_color_;
157 Json::Value GetMetadataJson();
158 std::string GetTagInMetadata(
const std::string &tag_name);
virtual const RGBDVideoMetadata & GetMetadata() const override
Get (read-only) metadata of the playback.
Definition: RSBagReader.h:97
virtual bool IsOpened() const override
Check If the RSBag file is opened.
Definition: RSBagReader.h:83
Definition: RealSenseSensor.h:36
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:352
Definition: RGBDVideoReader.h:37
virtual std::string GetFilename() const override
Return filename being read.
Definition: RSBagReader.h:116
Definition: PinholeCameraIntrinsic.cpp:35
RGBDImage A pair of color and depth images.
Definition: RGBDImage.h:40
virtual RGBDVideoMetadata & GetMetadata() override
Get reference to the metadata of the RGBD video playback.
Definition: RSBagReader.h:102
Definition: RSBagReader.h:68