-
Notifications
You must be signed in to change notification settings - Fork 867
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Added improvements for recvlive to make it suitable for performance testing #2320
base: master
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The main(..)
function of an example application grows by 100 LOC to parse input arguments.
Please move argument parsing logic to a dedicated function so it does not obstruct reading the code related to SRT API calls.
Better, but still 50 lines in main() that are not directly related to the SRT API usage in the example app. struct Config {
Config()
: opt_quiet(false)
, service("9000")
{}
bool opt_quiet;
string service;
};
// Not exactly nice to fill Config by reference. Better to return. But for the same of simplicity
// and not catching exceptions in main() should be fine for the example code.
// Returns false on command-line error, true otherwise.
bool ParseOptions(const vector<string>& cmdline_args, Config &cfg);
int main(int argc, char* argv[])
{
//...
if (!ParseOptions(args))
return 1; |
Well, I even like it. The parser function can be even a method ;) BTW. As per that mutable reference, it was a mistake. Changed to const already. |
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #2320 +/- ##
==========================================
- Coverage 67.01% 66.79% -0.23%
==========================================
Files 103 103
Lines 20476 20476
==========================================
- Hits 13723 13677 -46
- Misses 6753 6799 +46 ☔ View full report in Codecov by Sentry. |
This adds a possibility to manage simple options for the program (also for the future) and adds one option
-echo quiet
that blocks most of the messages printed on stdout that could influence performance.