/
ikvm_args.hpp
156 lines (141 loc) · 3.74 KB
/
ikvm_args.hpp
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
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
#pragma once
#include <string>
namespace ikvm
{
/*
* @class Args
* @brief Command line argument parser and storage
*/
class Args
{
public:
/*
* @struct CommandLine
* @brief Stores the original command line arguments for later use
*/
struct CommandLine
{
/*
* @brief Constructs CommandLine object
*
* @param[in] c - Number of arguments
* @param[in] v - Array of arguments
*/
CommandLine(int c, char** v) : argc(c), argv(v) {}
~CommandLine() = default;
CommandLine(const CommandLine&) = default;
CommandLine& operator=(const CommandLine&) = default;
CommandLine(CommandLine&&) = default;
CommandLine& operator=(CommandLine&&) = default;
int argc;
char** argv;
};
/*
* @brief Constructs Args object
*
* @param[in] argc - The number of arguments in the command line call
* @param[in] argv - The array of arguments from the command line
*/
Args(int argc, char* argv[]);
~Args() = default;
Args(const Args&) = default;
Args& operator=(const Args&) = default;
Args(Args&&) = default;
Args& operator=(Args&&) = default;
/*
* @brief Get the original command line arguments
*
* @return Reference to the CommandLine structure storing the original
* command line arguments
*/
inline const CommandLine& getCommandLine() const
{
return commandLine;
}
/*
* @brief Get the desired video frame rate
*
* @return Value of the desired frame rate in frames per second
*/
inline int getFrameRate() const
{
return frameRate;
}
/*
* @brief Get the video subsampling
*
* @return Value of the video subsampling
*/
inline int getSubsampling() const
{
return subsampling;
}
/*
* @brief Get the path to the USB keyboard device
*
* @return Reference to the string storing the path to the keyboard device
*/
inline const std::string& getKeyboardPath() const
{
return keyboardPath;
}
/*
* @brief Get the path to the USB mouse device
*
* @return Reference to the string storing the path to the mouse device
*/
inline const std::string& getPointerPath() const
{
return pointerPath;
}
/*
* @brief Get the name of UDC
*
* @return Reference to the string storing the name of UDC
*/
inline const std::string& getUdcName() const
{
return udcName;
}
/*
* @brief Get the path to the V4L2 video device
*
* @return Reference to the string storing the path to the video device
*/
inline const std::string& getVideoPath() const
{
return videoPath;
}
/*
* @brief Get the identical frames detection setting
*
* @return True if identical frames detection is enabled
*/
inline bool getCalcFrameCRC() const
{
return calcFrameCRC;
}
private:
/* @brief Prints the application usage to stderr */
void printUsage();
/*
* @brief Desired frame rate (in frames per second) of the video
* stream
*/
int frameRate;
/* @brief Desired subsampling (0: 444, 1: 420) */
int subsampling;
/* @brief Path to the USB keyboard device */
std::string keyboardPath;
/* @brief Path to the USB mouse device */
std::string pointerPath;
/* @brief Name of UDC */
std::string udcName;
/* @brief Path to the V4L2 video device */
std::string videoPath;
/* @brief Identical frames detection */
bool calcFrameCRC;
/* @brief Original command line arguments passed to the application */
CommandLine commandLine;
};
} // namespace ikvm