Open3D (C++ API)  0.18.0+252c867
MKVReader.h
Go to the documentation of this file.
1 // ----------------------------------------------------------------------------
2 // - Open3D: www.open3d.org -
3 // ----------------------------------------------------------------------------
4 // Copyright (c) 2018-2023 www.open3d.org
5 // SPDX-License-Identifier: MIT
6 // ----------------------------------------------------------------------------
7 
8 #pragma once
9 
13 
14 struct _k4a_playback_t; // typedef _k4a_playback_t* k4a_playback_t;
15 struct _k4a_capture_t; // typedef _k4a_capture_t* k4a_capture_t;
16 struct _k4a_transformation_t; // typedef _k4a_transformation_t*
17  // k4a_transformation_t;
18 
19 namespace open3d {
20 namespace io {
21 
25 class MKVReader {
26 public:
28  MKVReader();
29  virtual ~MKVReader() {}
30 
32  bool IsOpened();
34  bool IsEOF() { return is_eof_; }
35 
39  bool Open(const std::string &filename);
41  void Close();
42 
44  MKVMetadata &GetMetadata() { return metadata_; }
46  bool SeekTimestamp(size_t timestamp);
48  std::shared_ptr<geometry::RGBDImage> NextFrame();
49 
50 private:
51  _k4a_playback_t *handle_;
52  _k4a_transformation_t *transformation_;
53  MKVMetadata metadata_;
54  bool is_eof_ = false;
55 
56  Json::Value GetMetadataJson();
57  std::string GetTagInMetadata(const std::string &tag_name);
58 };
59 } // namespace io
60 } // namespace open3d
Definition: MKVMetadata.h:26
Definition: MKVReader.h:25
std::shared_ptr< geometry::RGBDImage > NextFrame()
Get next frame from the mkv playback and returns the RGBD object.
Definition: MKVReader.cpp:139
bool IsOpened()
Check If the mkv file is opened.
Definition: MKVReader.cpp:26
virtual ~MKVReader()
Definition: MKVReader.h:29
bool SeekTimestamp(size_t timestamp)
Seek to the timestamp (in us).
Definition: MKVReader.cpp:118
bool Open(const std::string &filename)
Definition: MKVReader.cpp:43
MKVMetadata & GetMetadata()
Get metadata of the mkv playback.
Definition: MKVReader.h:44
MKVReader()
Default Constructor.
Definition: MKVReader.cpp:24
bool IsEOF()
Check if the mkv file is all read.
Definition: MKVReader.h:34
void Close()
Close the opened mkv playback.
Definition: MKVReader.cpp:60
Definition: PinholeCameraIntrinsic.cpp:16