NetEQ RTP play: textlog to stderr as option
Bug: webrtc:10548 Change-Id: I260b6c63621c61e33fcc38fd0a39cfb0dba3bc20 Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/160413 Reviewed-by: Henrik Lundin <henrik.lundin@webrtc.org> Commit-Queue: Alessio Bazzica <alessiob@webrtc.org> Cr-Commit-Position: refs/heads/master@{#29915}
This commit is contained in:
committed by
Commit Bot
parent
27bd76bcb2
commit
a88655daf9
@ -247,11 +247,11 @@ bool ValidateOutputFilesOptions(bool textlog,
|
||||
return false;
|
||||
}
|
||||
// Without |output_audio_filename|, |output_files_base_name| is required when
|
||||
// one or more output files must be generated (in order to form a valid output
|
||||
// plotting output files must be generated (in order to form a valid output
|
||||
// file name).
|
||||
if (output_audio_filename.empty() && (textlog || plotting) &&
|
||||
if (output_audio_filename.empty() && plotting &&
|
||||
!output_files_base_name_specified) {
|
||||
std::cout << "Error: when no output audio file is specified and --textlog, "
|
||||
std::cout << "Error: when no output audio file is specified and "
|
||||
<< "--matlabplot and/or --pythonplot are used, "
|
||||
<< "--output_files_base_name must be also used." << std::endl;
|
||||
return false;
|
||||
@ -378,6 +378,7 @@ int main(int argc, char* argv[]) {
|
||||
if (!output_audio_filename.empty()) {
|
||||
config.output_audio_filename = output_audio_filename;
|
||||
}
|
||||
config.textlog = absl::GetFlag(FLAGS_textlog);
|
||||
config.textlog_filename = CreateOptionalOutputFileName(
|
||||
absl::GetFlag(FLAGS_textlog), output_files_base_name,
|
||||
output_audio_filename, ".text_log.txt");
|
||||
|
||||
@ -305,10 +305,15 @@ std::unique_ptr<NetEqTest> NetEqTestFactory::InitializeTest(
|
||||
}
|
||||
}
|
||||
|
||||
// Create a text log file if needed.
|
||||
// Create a text log output stream if needed.
|
||||
std::unique_ptr<std::ofstream> text_log;
|
||||
if (config.textlog_filename.has_value()) {
|
||||
if (config.textlog && config.textlog_filename.has_value()) {
|
||||
// Write to file.
|
||||
text_log = std::make_unique<std::ofstream>(*config.textlog_filename);
|
||||
} else if (config.textlog) {
|
||||
// Print to stdout.
|
||||
text_log = std::make_unique<std::ofstream>();
|
||||
text_log->basic_ios<char>::rdbuf(std::cout.rdbuf());
|
||||
}
|
||||
|
||||
NetEqTest::Callbacks callbacks;
|
||||
|
||||
@ -132,8 +132,10 @@ class NetEqTestFactory {
|
||||
int skip_get_audio_events = default_skip_get_audio_events();
|
||||
// Enables jitter buffer fast accelerate.
|
||||
bool enable_fast_accelerate = false;
|
||||
// Path to the output text log file that describes the simulation on a
|
||||
// step-by-step basis.
|
||||
// Dumps events that describes the simulation on a step-by-step basis.
|
||||
bool textlog = false;
|
||||
// If specified and |textlog| is true, the output of |textlog| is written to
|
||||
// the specified file name.
|
||||
absl::optional<std::string> textlog_filename;
|
||||
// Base name for the output script files for plotting the delay profile.
|
||||
absl::optional<std::string> plot_scripts_basename;
|
||||
|
||||
Reference in New Issue
Block a user