From d47d3ebdff2e2f8dbce68cece845b3019020a77d Mon Sep 17 00:00:00 2001 From: Ilya Nikolaevskiy Date: Mon, 21 Jan 2019 16:27:17 +0100 Subject: [PATCH] Report rendered pixels statistic in full stack tests MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Also, attach analyzer to the correct receive stream, instead of attaching it only if there's one receive stream. Bug: None Change-Id: I34888b5bd09b61f0939d77b26cb0d10f9261d3cb Reviewed-on: https://webrtc-review.googlesource.com/c/118688 Reviewed-by: Erik Språng Commit-Queue: Ilya Nikolaevskiy Cr-Commit-Position: refs/heads/master@{#26357} --- video/video_analyzer.cc | 4 ++++ video/video_analyzer.h | 1 + video/video_quality_test.cc | 4 ++-- 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/video/video_analyzer.cc b/video/video_analyzer.cc index 8987a829df..e29d53eb48 100644 --- a/video/video_analyzer.cc +++ b/video/video_analyzer.cc @@ -471,6 +471,9 @@ void VideoAnalyzer::PollStats() { decode_time_ms_.AddSample(receive_stats.decode_ms); if (receive_stats.max_decode_ms > 0) decode_time_max_ms_.AddSample(receive_stats.max_decode_ms); + if (receive_stats.width > 0 && receive_stats.height > 0) { + pixels_.AddSample(receive_stats.width * receive_stats.height); + } } if (audio_receive_stream_ != nullptr) { @@ -579,6 +582,7 @@ void VideoAnalyzer::PrintResults() { PrintResult("fec_bitrate", fec_bitrate_bps_, " bps"); PrintResult("send_bandwidth", send_bandwidth_bps_, " bps"); PrintResult("time_between_freezes", time_between_freezes_, " ms"); + PrintResult("pixels_per_frame", pixels_, " px"); if (worst_frame_) { test::PrintResult("min_psnr", "", test_label_.c_str(), worst_frame_->psnr, diff --git a/video/video_analyzer.h b/video/video_analyzer.h index 8226270730..4e2abcd4e1 100644 --- a/video/video_analyzer.h +++ b/video/video_analyzer.h @@ -230,6 +230,7 @@ class VideoAnalyzer : public PacketReceiver, test::Statistics audio_expand_rate_ RTC_GUARDED_BY(comparison_lock_); test::Statistics audio_accelerate_rate_ RTC_GUARDED_BY(comparison_lock_); test::Statistics audio_jitter_buffer_ms_ RTC_GUARDED_BY(comparison_lock_); + test::Statistics pixels_ RTC_GUARDED_BY(comparison_lock_); // Rendered frame with worst PSNR is saved for further analysis. absl::optional worst_frame_ RTC_GUARDED_BY(comparison_lock_); diff --git a/video/video_quality_test.cc b/video/video_quality_test.cc index b4dfe4c63b..c8b2041f68 100644 --- a/video/video_quality_test.cc +++ b/video/video_quality_test.cc @@ -1095,8 +1095,8 @@ void VideoQualityTest::RunWithAnalyzer(const Params& params) { CreateFlexfecStreams(); CreateVideoStreams(); analyzer_->SetSendStream(video_send_streams_[0]); - if (video_receive_streams_.size() == 1) - analyzer_->SetReceiveStream(video_receive_streams_[0]); + analyzer_->SetReceiveStream( + video_receive_streams_[params_.ss[0].selected_stream]); GetVideoSendStream()->SetSource(analyzer_->OutputInterface(), degradation_preference_);