Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(93)

Side by Side Diff: webrtc/video/send_statistics_proxy_unittest.cc

Issue 2437323002: Add qp counter for H264 in SendStatisticsProxy. (Closed)
Patch Set: rebase Created 4 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « webrtc/video/send_statistics_proxy.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (c) 2013 The WebRTC project authors. All Rights Reserved. 2 * Copyright (c) 2013 The WebRTC project authors. All Rights Reserved.
3 * 3 *
4 * Use of this source code is governed by a BSD-style license 4 * Use of this source code is governed by a BSD-style license
5 * that can be found in the LICENSE file in the root of the source 5 * that can be found in the LICENSE file in the root of the source
6 * tree. An additional intellectual property rights grant can be found 6 * tree. An additional intellectual property rights grant can be found
7 * in the file PATENTS. All contributing project authors may 7 * in the file PATENTS. All contributing project authors may
8 * be found in the AUTHORS file in the root of the source tree. 8 * be found in the AUTHORS file in the root of the source tree.
9 */ 9 */
10 10
(...skipping 449 matching lines...) Expand 10 before | Expand all | Expand 10 after
460 for (int i = 0; i < SendStatisticsProxy::kMinRequiredMetricsSamples; ++i) { 460 for (int i = 0; i < SendStatisticsProxy::kMinRequiredMetricsSamples; ++i) {
461 encoded_image.qp_ = kQpIdx0; 461 encoded_image.qp_ = kQpIdx0;
462 codec_info.codecSpecific.VP9.spatial_idx = 0; 462 codec_info.codecSpecific.VP9.spatial_idx = 0;
463 statistics_proxy_->OnSendEncodedImage(encoded_image, &codec_info); 463 statistics_proxy_->OnSendEncodedImage(encoded_image, &codec_info);
464 } 464 }
465 statistics_proxy_.reset(); 465 statistics_proxy_.reset();
466 EXPECT_EQ(1, metrics::NumSamples("WebRTC.Video.Encoded.Qp.Vp9")); 466 EXPECT_EQ(1, metrics::NumSamples("WebRTC.Video.Encoded.Qp.Vp9"));
467 EXPECT_EQ(1, metrics::NumEvents("WebRTC.Video.Encoded.Qp.Vp9", kQpIdx0)); 467 EXPECT_EQ(1, metrics::NumEvents("WebRTC.Video.Encoded.Qp.Vp9", kQpIdx0));
468 } 468 }
469 469
470 TEST_F(SendStatisticsProxyTest, VerifyQpHistogramStats_H264) {
471 EncodedImage encoded_image;
472 CodecSpecificInfo codec_info;
473 codec_info.codecType = kVideoCodecH264;
474
475 for (int i = 0; i < SendStatisticsProxy::kMinRequiredMetricsSamples; ++i) {
476 encoded_image.qp_ = kQpIdx0;
477 statistics_proxy_->OnSendEncodedImage(encoded_image, &codec_info);
478 }
479 statistics_proxy_.reset();
480 EXPECT_EQ(1, metrics::NumSamples("WebRTC.Video.Encoded.Qp.H264"));
481 EXPECT_EQ(1, metrics::NumEvents("WebRTC.Video.Encoded.Qp.H264", kQpIdx0));
482 }
483
470 TEST_F(SendStatisticsProxyTest, 484 TEST_F(SendStatisticsProxyTest,
471 BandwidthLimitedHistogramsNotUpdatedWhenDisabled) { 485 BandwidthLimitedHistogramsNotUpdatedWhenDisabled) {
472 EncodedImage encoded_image; 486 EncodedImage encoded_image;
473 // encoded_image.adapt_reason_.bw_resolutions_disabled by default: -1 487 // encoded_image.adapt_reason_.bw_resolutions_disabled by default: -1
474 for (int i = 0; i < SendStatisticsProxy::kMinRequiredMetricsSamples; ++i) 488 for (int i = 0; i < SendStatisticsProxy::kMinRequiredMetricsSamples; ++i)
475 statistics_proxy_->OnSendEncodedImage(encoded_image, nullptr); 489 statistics_proxy_->OnSendEncodedImage(encoded_image, nullptr);
476 490
477 // Histograms are updated when the statistics_proxy_ is deleted. 491 // Histograms are updated when the statistics_proxy_ is deleted.
478 statistics_proxy_.reset(); 492 statistics_proxy_.reset();
479 EXPECT_EQ(0, metrics::NumSamples( 493 EXPECT_EQ(0, metrics::NumSamples(
(...skipping 469 matching lines...) Expand 10 before | Expand all | Expand 10 after
949 963
950 EXPECT_EQ( 964 EXPECT_EQ(
951 1, metrics::NumSamples("WebRTC.Video.Screenshare.FecBitrateSentInKbps")); 965 1, metrics::NumSamples("WebRTC.Video.Screenshare.FecBitrateSentInKbps"));
952 EXPECT_EQ(1, metrics::NumEvents( 966 EXPECT_EQ(1, metrics::NumEvents(
953 "WebRTC.Video.Screenshare.FecBitrateSentInKbps", 967 "WebRTC.Video.Screenshare.FecBitrateSentInKbps",
954 static_cast<int>((rtx_counters.fec.TotalBytes() * 2 * 8) / 968 static_cast<int>((rtx_counters.fec.TotalBytes() * 2 * 8) /
955 metrics::kMinRunTimeInSeconds / 1000))); 969 metrics::kMinRunTimeInSeconds / 1000)));
956 } 970 }
957 971
958 } // namespace webrtc 972 } // namespace webrtc
OLDNEW
« no previous file with comments | « webrtc/video/send_statistics_proxy.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698