Index: webrtc/video/send_statistics_proxy_unittest.cc |
diff --git a/webrtc/video/send_statistics_proxy_unittest.cc b/webrtc/video/send_statistics_proxy_unittest.cc |
index a98505f84d1e01f3837a05d588826377853096b6..5c04b4bb6c2ba9dec905125fe173b7687c03b14f 100644 |
--- a/webrtc/video/send_statistics_proxy_unittest.cc |
+++ b/webrtc/video/send_statistics_proxy_unittest.cc |
@@ -327,6 +327,29 @@ TEST_F(SendStatisticsProxyTest, SwitchContentTypeUpdatesHistograms) { |
EXPECT_EQ(1, test::NumHistogramSamples("WebRTC.Video.InputWidthInPixels")); |
} |
+TEST_F(SendStatisticsProxyTest, VerifyQpHistogramStats) { |
+ test::ClearHistograms(); |
+ const int kMinRequiredSamples = 200; |
+ const int kQpIdx0 = 21; |
+ const int kQpIdx1 = 39; |
+ EncodedImage encoded_image; |
+ |
+ RTPVideoHeader rtp_video_header; |
+ rtp_video_header.codec = kRtpVideoVp8; |
+ |
+ for (int i = 0; i < kMinRequiredSamples; ++i) { |
+ rtp_video_header.simulcastIdx = 0; |
+ encoded_image.qp_ = kQpIdx0; |
+ statistics_proxy_->OnSendEncodedImage(encoded_image, &rtp_video_header); |
+ rtp_video_header.simulcastIdx = 1; |
+ encoded_image.qp_ = kQpIdx1; |
+ statistics_proxy_->OnSendEncodedImage(encoded_image, &rtp_video_header); |
+ } |
+ statistics_proxy_.reset(); |
+ EXPECT_EQ(2, test::NumHistogramSamples("WebRTC.Video.Encoded.Qp.Vp8")); |
+ EXPECT_EQ(kQpIdx1, test::LastHistogramSample("WebRTC.Video.Encoded.Qp.Vp8")); |
stefan-webrtc
2016/03/22 15:12:46
Shouldn't this be the average of 21 and 39?
åsapersson
2016/03/22 15:29:46
QP is stored per ssrc e.g.
two qp samples should b
|
+} |
+ |
TEST_F(SendStatisticsProxyTest, NoSubstreams) { |
uint32_t excluded_ssrc = |
std::max( |