+40
-16
lines changedFilter options
+40
-16
lines changed Original file line number Diff line number Diff line change
@@ -684,3 +684,36 @@ SrtStatsPrintFormat ParsePrintFormat(string pf, string& w_extras)
684
684
685
685
return SRTSTATS_PROFMAT_INVALID;
686
686
}
687
+
688
+
const char* SRTClockTypeStr()
689
+
{
690
+
const int clock_type = srt_clock_type();
691
+
692
+
switch (clock_type)
693
+
{
694
+
case SRT_SYNC_CLOCK_STDCXX_STEADY:
695
+
return "CXX11_STEADY";
696
+
case SRT_SYNC_CLOCK_GETTIME_MONOTONIC:
697
+
return "GETTIME_MONOTONIC";
698
+
case SRT_SYNC_CLOCK_WINQPC:
699
+
return "WIN_QPC";
700
+
case SRT_SYNC_CLOCK_MACH_ABSTIME:
701
+
return "MACH_ABSTIME";
702
+
case SRT_SYNC_CLOCK_POSIX_GETTIMEOFDAY:
703
+
return "POSIX_GETTIMEOFDAY";
704
+
default:
705
+
break;
706
+
}
707
+
708
+
return "UNKNOWN VALUE";
709
+
}
710
+
711
+
void PrintLibVersion()
712
+
{
713
+
cerr << "Built with SRT Library version: " << SRT_VERSION << endl;
714
+
const uint32_t srtver = srt_getversion();
715
+
const int major = srtver / 0x10000;
716
+
const int minor = (srtver / 0x100) % 0x100;
717
+
const int patch = srtver % 0x100;
718
+
cerr << "SRT Library version: " << major << "." << minor << "." << patch << ", clock type: " << SRTClockTypeStr() << endl;
719
+
}
Original file line number Diff line number Diff line change
@@ -419,5 +419,8 @@ extern std::vector<std::unique_ptr<SrtStatData>> g_SrtStatsTable;
419
419
420
420
std::shared_ptr<SrtStatsWriter> SrtStatsWriterFactory(SrtStatsPrintFormat printformat);
421
421
422
+
const char* SRTClockTypeStr();
423
+
void PrintLibVersion();
424
+
422
425
423
426
#endif // INC_SRT_APPCOMMON_H
Original file line number Diff line number Diff line change
@@ -52,7 +52,6 @@ void OnINT_ForceExit(int)
52
52
interrupt = true;
53
53
}
54
54
55
-
56
55
struct FileTransmitConfig
57
56
{
58
57
unsigned long chunk_size;
@@ -144,12 +143,7 @@ int parse_args(FileTransmitConfig &cfg, int argc, char** argv)
144
143
if (print_help)
145
144
{
146
145
cout << "SRT sample application to transmit files.\n";
147
-
cerr << "Built with SRT Library version: " << SRT_VERSION << endl;
148
-
const uint32_t srtver = srt_getversion();
149
-
const int major = srtver / 0x10000;
150
-
const int minor = (srtver / 0x100) % 0x100;
151
-
const int patch = srtver % 0x100;
152
-
cerr << "SRT Library version: " << major << "." << minor << "." << patch << endl;
146
+
PrintLibVersion();
153
147
cerr << "Usage: srt-file-transmit [options] <input-uri> <output-uri>\n";
154
148
cerr << "\n";
155
149
@@ -182,7 +176,7 @@ int parse_args(FileTransmitConfig &cfg, int argc, char** argv)
182
176
183
177
if (Option<OutBool>(params, false, o_version))
184
178
{
185
-
cerr << "SRT Library version: " << SRT_VERSION << endl;
179
+
PrintLibVersion();
186
180
return 2;
187
181
}
188
182
Original file line number Diff line number Diff line change
@@ -164,7 +164,6 @@ void PrintOptionHelp(const OptionName& opt_names, const string &value, const str
164
164
cerr << "\t- " << desc << "\n";
165
165
}
166
166
167
-
168
167
int parse_args(LiveTransmitConfig &cfg, int argc, char** argv)
169
168
{
170
169
const OptionName
@@ -269,12 +268,7 @@ int parse_args(LiveTransmitConfig &cfg, int argc, char** argv)
269
268
}
270
269
271
270
cout << "SRT sample application to transmit live streaming.\n";
272
-
cerr << "Built with SRT Library version: " << SRT_VERSION << endl;
273
-
const uint32_t srtver = srt_getversion();
274
-
const int major = srtver / 0x10000;
275
-
const int minor = (srtver / 0x100) % 0x100;
276
-
const int patch = srtver % 0x100;
277
-
cerr << "SRT Library version: " << major << "." << minor << "." << patch << endl;
271
+
PrintLibVersion();
278
272
cerr << "Usage: srt-live-transmit [options] <input-uri> <output-uri>\n";
279
273
cerr << "\n";
280
274
#ifndef _WIN32
@@ -313,7 +307,7 @@ int parse_args(LiveTransmitConfig &cfg, int argc, char** argv)
313
307
314
308
if (print_version)
315
309
{
316
-
cerr << "SRT Library version: " << SRT_VERSION << endl;
310
+
PrintLibVersion();
317
311
return 2;
318
312
}
319
313
You can’t perform that action at this time.
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4