Skip to content

Commit

Permalink
Use PrintResult* instead of printf in video/video_quality_test.cc
Browse files Browse the repository at this point in the history
Use the PrintResult* functions from test/testsupport/perf_test.h
instead of using printf directly.

Bug: webrtc:8566
Change-Id: Icc3418402e5fbe4e695a64d0523e1f64aa27edf8
Reviewed-on: https://webrtc-review.googlesource.com/36420
Reviewed-by: Henrik Andreassson <[email protected]>
Reviewed-by: Patrik Höglund <[email protected]>
Commit-Queue: Edward Lemur <[email protected]>
Cr-Commit-Position: refs/heads/master@{#21483}
  • Loading branch information
ehlemur-zz authored and Commit Bot committed Jan 3, 2018
1 parent d420903 commit d1d6743
Showing 1 changed file with 10 additions and 12 deletions.
22 changes: 10 additions & 12 deletions video/video_quality_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@
#include "test/statistics.h"
#include "test/testsupport/fileutils.h"
#include "test/testsupport/frame_writer.h"
#include "test/testsupport/perf_test.h"
#include "test/testsupport/test_artifacts.h"
#include "test/vcm_capturer.h"
#include "test/video_renderer.h"
Expand Down Expand Up @@ -793,18 +794,18 @@ class VideoAnalyzer : public PacketReceiver,
PrintResult("send_bandwidth", send_bandwidth_bps_, " bps");

if (worst_frame_) {
printf("RESULT min_psnr: %s = %lf dB\n", test_label_.c_str(),
worst_frame_->psnr);
test::PrintResult("min_psnr", "", test_label_.c_str(), worst_frame_->psnr,
"dB", false);
}

if (receive_stream_ != nullptr) {
PrintResult("decode_time", decode_time_ms_, " ms");
}

printf("RESULT dropped_frames: %s = %d frames\n", test_label_.c_str(),
dropped_frames_);
printf("RESULT cpu_usage: %s = %lf %%\n", test_label_.c_str(),
GetCpuUsagePercent());
test::PrintResult("dropped_frames", "", test_label_.c_str(),
dropped_frames_, "frames", false);
test::PrintResult("cpu_usage", "", test_label_.c_str(),
GetCpuUsagePercent(), "%", false);

#if defined(WEBRTC_WIN)
// On Linux and Mac in Resident Set some unused pages may be counted.
Expand Down Expand Up @@ -893,12 +894,9 @@ class VideoAnalyzer : public PacketReceiver,
void PrintResult(const char* result_type,
test::Statistics stats,
const char* unit) {
printf("RESULT %s: %s = {%f, %f}%s\n",
result_type,
test_label_.c_str(),
stats.Mean(),
stats.StandardDeviation(),
unit);
test::PrintResultMeanAndError(result_type, "", test_label_.c_str(),
stats.Mean(), stats.StandardDeviation(), unit,
false);
}

void PrintSamplesToFile(void) {
Expand Down

0 comments on commit d1d6743

Please sign in to comment.