Skip to content

Commit

Permalink
[apps] Added SRT library version in help
Browse files Browse the repository at this point in the history
  • Loading branch information
maxsharabayko committed Dec 17, 2019
1 parent e21e3ff commit 59be423
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 2 deletions.
14 changes: 13 additions & 1 deletion apps/srt-file-transmit.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,19 @@ int parse_args(FileTransmitConfig &cfg, int argc, char** argv)
if (print_help)
{
cout << "SRT sample application to transmit files.\n";
cerr << "SRT Library version: " << SRT_VERSION << endl;
cerr << "Built with SRT Library version: " << SRT_VERSION << endl;
uint32_t srtver = 0;
if (srt_getversion(&srtver, sizeof(uint32_t)) == 0)
{
const int major = srtver / 0x10000;
const int minor = (srtver / 0x100) % 0x100;
const int patch = srtver % 0x100;
cerr << "SRT Library version: " << major << "." << minor << "." << patch << endl;
}
else
{
cerr << "SRT Library version: FAILED to retrieve" << endl;
}
cerr << "Usage: srt-file-transmit [options] <input-uri> <output-uri>\n";
cerr << "\n";

Expand Down
14 changes: 13 additions & 1 deletion apps/srt-live-transmit.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -224,7 +224,19 @@ int parse_args(LiveTransmitConfig &cfg, int argc, char** argv)
if (print_help)
{
cout << "SRT sample application to transmit live streaming.\n";
cerr << "SRT Library version: " << SRT_VERSION << endl;
cerr << "Built with SRT Library version: " << SRT_VERSION << endl;
uint32_t srtver = 0;
if (srt_getversion(&srtver, sizeof(uint32_t)) == 0)
{
const int major = srtver / 0x10000;
const int minor = (srtver / 0x100) % 0x100;
const int patch = srtver % 0x100;
cerr << "SRT Library version: " << major << "." << minor << "." << patch << endl;
}
else
{
cerr << "SRT Library version: FAILED to retrieve"<< endl;
}
cerr << "Usage: srt-live-transmit [options] <input-uri> <output-uri>\n";
cerr << "\n";
#ifndef _WIN32
Expand Down

0 comments on commit 59be423

Please sign in to comment.