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

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

Issue 2772033002: Add content type information to encoded images and corresponding rtp extension header (Closed)
Patch Set: Set EncodedImage content_type from vie_encoder Created 3 years, 9 months 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
OLDNEW
1 /* 1 /*
2 * Copyright 2016 The WebRTC project authors. All Rights Reserved. 2 * Copyright 2016 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 76 matching lines...) Expand 10 before | Expand all | Expand 10 after
87 TEST_F(ReceiveStatisticsProxyTest, OnDecodedFrameWithoutQpResetsQpSum) { 87 TEST_F(ReceiveStatisticsProxyTest, OnDecodedFrameWithoutQpResetsQpSum) {
88 EXPECT_EQ(rtc::Optional<uint64_t>(), statistics_proxy_->GetStats().qp_sum); 88 EXPECT_EQ(rtc::Optional<uint64_t>(), statistics_proxy_->GetStats().qp_sum);
89 statistics_proxy_->OnDecodedFrame(rtc::Optional<uint8_t>(3u)); 89 statistics_proxy_->OnDecodedFrame(rtc::Optional<uint8_t>(3u));
90 EXPECT_EQ(rtc::Optional<uint64_t>(3u), statistics_proxy_->GetStats().qp_sum); 90 EXPECT_EQ(rtc::Optional<uint64_t>(3u), statistics_proxy_->GetStats().qp_sum);
91 statistics_proxy_->OnDecodedFrame(rtc::Optional<uint8_t>()); 91 statistics_proxy_->OnDecodedFrame(rtc::Optional<uint8_t>());
92 EXPECT_EQ(rtc::Optional<uint64_t>(), statistics_proxy_->GetStats().qp_sum); 92 EXPECT_EQ(rtc::Optional<uint64_t>(), statistics_proxy_->GetStats().qp_sum);
93 } 93 }
94 94
95 TEST_F(ReceiveStatisticsProxyTest, OnRenderedFrameIncreasesFramesRendered) { 95 TEST_F(ReceiveStatisticsProxyTest, OnRenderedFrameIncreasesFramesRendered) {
96 EXPECT_EQ(0u, statistics_proxy_->GetStats().frames_rendered); 96 EXPECT_EQ(0u, statistics_proxy_->GetStats().frames_rendered);
97 webrtc::VideoFrame frame( 97 webrtc::VideoFrame frame(webrtc::I420Buffer::Create(1, 1), 0, 0,
98 webrtc::I420Buffer::Create(1, 1), 0, 0, webrtc::kVideoRotation_0); 98 webrtc::kVideoRotation_0,
99 webrtc::kVideoContent_Default);
99 for (uint32_t i = 1; i <= 3; ++i) { 100 for (uint32_t i = 1; i <= 3; ++i) {
100 statistics_proxy_->OnRenderedFrame(frame); 101 statistics_proxy_->OnRenderedFrame(frame);
101 EXPECT_EQ(i, statistics_proxy_->GetStats().frames_rendered); 102 EXPECT_EQ(i, statistics_proxy_->GetStats().frames_rendered);
102 } 103 }
103 } 104 }
104 105
105 TEST_F(ReceiveStatisticsProxyTest, GetStatsReportsSsrc) { 106 TEST_F(ReceiveStatisticsProxyTest, GetStatsReportsSsrc) {
106 EXPECT_EQ(kRemoteSsrc, statistics_proxy_->GetStats().ssrc); 107 EXPECT_EQ(kRemoteSsrc, statistics_proxy_->GetStats().ssrc);
107 } 108 }
108 109
(...skipping 280 matching lines...) Expand 10 before | Expand all | Expand 10 after
389 codec_info.codecType = kVideoCodecVP8; 390 codec_info.codecType = kVideoCodecVP8;
390 391
391 for (int i = 0; i < kMinRequiredSamples; ++i) 392 for (int i = 0; i < kMinRequiredSamples; ++i)
392 statistics_proxy_->OnPreDecode(encoded_image, &codec_info); 393 statistics_proxy_->OnPreDecode(encoded_image, &codec_info);
393 394
394 statistics_proxy_.reset(); 395 statistics_proxy_.reset();
395 EXPECT_EQ(0, metrics::NumSamples("WebRTC.Video.Decoded.Vp8.Qp")); 396 EXPECT_EQ(0, metrics::NumSamples("WebRTC.Video.Decoded.Vp8.Qp"));
396 } 397 }
397 398
398 } // namespace webrtc 399 } // namespace webrtc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698