-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathConfig.h
108 lines (100 loc) · 3.35 KB
/
Config.h
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
#pragma once
#include <array>
#include <chrono>
#include <cstdint>
#include <string>
struct Config
{
Config()
: whipEndpointUrl_(),
whipEndpointAuthKey_(),
udpSourceAddress_("0.0.0.0"),
udpSourcePort_(0),
udpSourceQueueMinTime_(0),
restreamAddress_(),
restreamPort_(0),
showTimer_(false),
srtTransport_(false),
tsDemuxLatency_(0),
jitterBufferLatency_(0),
srtSourceLatency_(125),
h264encodeBitrate(2000),
audio_(true),
video_(true),
bypass_audio_(false),
bypass_video_(false)
{
}
std::string toString()
{
std::string result;
result.append("whipEndpointUrl: ");
result.append(whipEndpointUrl_);
result.append("\n");
result.append("whipEndpointAuthKey: ");
result.append(whipEndpointAuthKey_.empty() ? "unset" : "set");
result.append("\n");
result.append("udpSourceAddress: ");
result.append(udpSourceAddress_);
result.append("\n");
result.append("udpSourcePort: ");
result.append(std::to_string(udpSourcePort_));
result.append("\n");
result.append("udpSourceQueueMinTime: ");
result.append(std::to_string(udpSourceQueueMinTime_.count()));
result.append("\n");
result.append("restreamAddress: ");
result.append(restreamAddress_.empty() ? "unset" : restreamAddress_);
result.append("\n");
result.append("restreamPort: ");
result.append(std::to_string(restreamPort_));
result.append("\n");
result.append("h264encodeBitrate: ");
result.append(std::to_string(h264encodeBitrate));
result.append("\n");
result.append("showTimer: ");
result.append(showTimer_ ? "true" : "false");
result.append("\n");
result.append("srtTransport: ");
result.append(srtTransport_ ? "true" : "false");
result.append("\n");
result.append("tsDemuxLatency: ");
result.append(std::to_string(tsDemuxLatency_));
result.append("\n");
result.append("jitterBufferLatency: ");
result.append(std::to_string(jitterBufferLatency_));
result.append("\n");
result.append("srtSourceLatency: ");
result.append(std::to_string(srtSourceLatency_));
result.append("\n");
result.append("audio: ");
result.append(audio_ ? "true" : "false");
result.append("\n");
result.append("video: ");
result.append(video_ ? "true" : "false");
result.append("\n");
result.append("bypass audio: ");
result.append(bypass_audio_ ? "true" : "false");
result.append("\n");
result.append("bypass video: ");
result.append(bypass_video_ ? "true" : "false");
return result;
}
std::string whipEndpointUrl_;
std::string whipEndpointAuthKey_;
std::string udpSourceAddress_;
uint32_t udpSourcePort_;
std::chrono::milliseconds udpSourceQueueMinTime_;
std::string restreamAddress_;
uint32_t restreamPort_;
bool showTimer_;
bool srtTransport_;
uint32_t tsDemuxLatency_;
uint32_t jitterBufferLatency_;
uint32_t srtSourceLatency_;
uint32_t h264encodeBitrate;
bool audio_;
bool video_;
bool bypass_audio_;
bool bypass_video_;
};