ACloudViewer  3.9.4
A Modern Library for 3D Data Processing
MKVMetadata.cpp
Go to the documentation of this file.
1 // ----------------------------------------------------------------------------
2 // - CloudViewer: www.cloudViewer.org -
3 // ----------------------------------------------------------------------------
4 // Copyright (c) 2018-2024 www.cloudViewer.org
5 // SPDX-License-Identifier: MIT
6 // ----------------------------------------------------------------------------
7 
9 
10 #include <json/json.h>
11 
12 #include <unordered_map>
13 
14 namespace cloudViewer {
15 namespace io {
16 
17 bool MKVMetadata::ConvertToJsonValue(Json::Value &value) const {
19 
20  value["serial_number_"] = serial_number_;
21  value["color_mode"] = color_mode_;
22  value["depth_mode"] = depth_mode_;
23 
24  value["stream_length_usec"] = stream_length_usec_;
25  value["width"] = width_;
26  value["height"] = height_;
27 
28  return true;
29 }
30 bool MKVMetadata::ConvertFromJsonValue(const Json::Value &value) {
32 
33  serial_number_ = value["serial_number"].asString();
34  color_mode_ = value["color_mode"].asString();
35  depth_mode_ = value["depth_mode"].asString();
36 
37  stream_length_usec_ = value["stream_length_usec"].asUInt64();
38  width_ = value["width"].asInt();
39  height_ = value["height"].asInt();
40 
41  return true;
42 }
43 } // namespace io
44 } // namespace cloudViewer
bool ConvertFromJsonValue(const Json::Value &value) override
bool ConvertToJsonValue(Json::Value &value) const override
uint64_t stream_length_usec_
Length of the video (usec).
Definition: MKVMetadata.h:40
bool ConvertFromJsonValue(const Json::Value &value) override
Definition: MKVMetadata.cpp:30
camera::PinholeCameraIntrinsic intrinsics_
Shared intrinsics betwee RGB & depth.
Definition: MKVMetadata.h:36
int width_
Width of the video.
Definition: MKVMetadata.h:42
bool ConvertToJsonValue(Json::Value &value) const override
Definition: MKVMetadata.cpp:17
int height_
Height of the video.
Definition: MKVMetadata.h:44
Generic file read and write utility for python interface.