-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathVideoIOSettings.cpp
More file actions
116 lines (105 loc) · 3.88 KB
/
Copy pathVideoIOSettings.cpp
File metadata and controls
116 lines (105 loc) · 3.88 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
#include "VideoIOSettings.hpp"
// =============================================================================
// Serialization
// =============================================================================
template <>
void DataStreamReader::read(const Gfx::VideoIO::VideoOutputSettings& n)
{
m_stream << static_cast<int>(n.vendor) << n.deviceName << n.deviceIndex
<< n.channelIndex << n.width << n.height << n.rate << n.videoFormat
<< n.pixelFormat << n.useRDMA << n.mode8K << n.hdrMode;
insertDelimiter();
}
template <>
void DataStreamWriter::write(Gfx::VideoIO::VideoOutputSettings& n)
{
int vendor = 0;
m_stream >> vendor >> n.deviceName >> n.deviceIndex >> n.channelIndex >> n.width
>> n.height >> n.rate >> n.videoFormat >> n.pixelFormat >> n.useRDMA
>> n.mode8K >> n.hdrMode;
n.vendor = static_cast<Gfx::VideoIO::Vendor>(vendor);
checkDelimiter();
}
template <>
void JSONReader::read(const Gfx::VideoIO::VideoOutputSettings& n)
{
obj["Vendor"] = static_cast<int>(n.vendor);
obj["DeviceName"] = n.deviceName;
obj["DeviceIndex"] = n.deviceIndex;
obj["ChannelIndex"] = n.channelIndex;
obj["Width"] = n.width;
obj["Height"] = n.height;
obj["Rate"] = n.rate;
obj["VideoFormat"] = n.videoFormat;
obj["PixelFormat"] = n.pixelFormat;
obj["UseRDMA"] = n.useRDMA;
obj["Mode8K"] = n.mode8K;
obj["HDRMode"] = n.hdrMode;
}
template <>
void JSONWriter::write(Gfx::VideoIO::VideoOutputSettings& n)
{
n.vendor = static_cast<Gfx::VideoIO::Vendor>(obj["Vendor"].toInt());
n.deviceName = obj["DeviceName"].toString();
n.deviceIndex = obj["DeviceIndex"].toInt();
n.channelIndex = obj["ChannelIndex"].toInt();
n.width = obj["Width"].toInt();
n.height = obj["Height"].toInt();
n.rate = obj["Rate"].toDouble();
n.videoFormat = obj["VideoFormat"].toString();
n.pixelFormat = obj["PixelFormat"].toString();
n.useRDMA = obj["UseRDMA"].toBool();
n.mode8K = obj["Mode8K"].toInt();
n.hdrMode = obj["HDRMode"].toInt();
}
SCORE_SERALIZE_DATASTREAM_DEFINE(Gfx::VideoIO::VideoOutputSettings);
template <>
void DataStreamReader::read(const Gfx::VideoIO::VideoInputSettings& n)
{
m_stream << static_cast<int>(n.vendor) << n.deviceName << n.devicePath
<< n.rigPaths << n.deviceIndex << n.channelIndex << n.videoFormat << n.pixelFormat
<< n.resolutionMode << n.routingMode << n.useRDMA;
insertDelimiter();
}
template <>
void DataStreamWriter::write(Gfx::VideoIO::VideoInputSettings& n)
{
int vendor = 0;
m_stream >> vendor >> n.deviceName >> n.devicePath >> n.rigPaths
>> n.deviceIndex
>> n.channelIndex >> n.videoFormat >> n.pixelFormat >> n.resolutionMode
>> n.routingMode >> n.useRDMA;
n.vendor = static_cast<Gfx::VideoIO::Vendor>(vendor);
checkDelimiter();
}
template <>
void JSONReader::read(const Gfx::VideoIO::VideoInputSettings& n)
{
obj["Vendor"] = static_cast<int>(n.vendor);
obj["DeviceName"] = n.deviceName;
obj["DevicePath"] = n.devicePath;
obj["RigPaths"] = n.rigPaths;
obj["DeviceIndex"] = n.deviceIndex;
obj["ChannelIndex"] = n.channelIndex;
obj["VideoFormat"] = n.videoFormat;
obj["PixelFormat"] = n.pixelFormat;
obj["ResolutionMode"] = n.resolutionMode;
obj["RoutingMode"] = n.routingMode;
obj["UseRDMA"] = n.useRDMA;
}
template <>
void JSONWriter::write(Gfx::VideoIO::VideoInputSettings& n)
{
n.vendor = static_cast<Gfx::VideoIO::Vendor>(obj["Vendor"].toInt());
n.deviceName = obj["DeviceName"].toString();
n.devicePath = obj["DevicePath"].toString();
n.rigPaths = obj["RigPaths"].toString();
n.deviceIndex = obj["DeviceIndex"].toInt();
n.channelIndex = obj["ChannelIndex"].toInt();
n.videoFormat = obj["VideoFormat"].toString();
n.pixelFormat = obj["PixelFormat"].toString();
n.resolutionMode = obj["ResolutionMode"].toInt();
n.routingMode = obj["RoutingMode"].toInt();
n.useRDMA = obj["UseRDMA"].toBool();
}
SCORE_SERALIZE_DATASTREAM_DEFINE(Gfx::VideoIO::VideoInputSettings);