Added improvements for recvlive to make it suitable for performance testing#2320
Open
ethouris wants to merge 5 commits intoHaivision:masterfrom
Open
Added improvements for recvlive to make it suitable for performance testing#2320ethouris wants to merge 5 commits intoHaivision:masterfrom
ethouris wants to merge 5 commits intoHaivision:masterfrom
Conversation
maxsharabayko
requested changes
Apr 29, 2022
Collaborator
maxsharabayko
left a comment
There was a problem hiding this comment.
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.
Collaborator
|
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; |
Collaborator
Author
|
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 file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This adds a possibility to manage simple options for the program (also for the future) and adds one option
-echo quietthat blocks most of the messages printed on stdout that could influence performance.