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

Side by Side Diff: webrtc/media/engine/webrtcvideoengine2_unittest.cc

Issue 2421193003: Implement framesEncoded stat in video send ssrc stats. (Closed)
Patch Set: Change type of stat int -> uint32_t. Created 4 years, 2 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
« no previous file with comments | « webrtc/media/engine/webrtcvideoengine2.cc ('k') | webrtc/video/send_statistics_proxy.cc » ('j') | 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) 2004 The WebRTC project authors. All Rights Reserved. 2 * Copyright (c) 2004 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 2876 matching lines...) Expand 10 before | Expand all | Expand 10 after
2887 stats.avg_encode_time_ms = 13; 2887 stats.avg_encode_time_ms = 13;
2888 stats.encode_usage_percent = 42; 2888 stats.encode_usage_percent = 42;
2889 stream->SetStats(stats); 2889 stream->SetStats(stats);
2890 2890
2891 cricket::VideoMediaInfo info; 2891 cricket::VideoMediaInfo info;
2892 ASSERT_TRUE(channel_->GetStats(&info)); 2892 ASSERT_TRUE(channel_->GetStats(&info));
2893 EXPECT_EQ(stats.avg_encode_time_ms, info.senders[0].avg_encode_ms); 2893 EXPECT_EQ(stats.avg_encode_time_ms, info.senders[0].avg_encode_ms);
2894 EXPECT_EQ(stats.encode_usage_percent, info.senders[0].encode_usage_percent); 2894 EXPECT_EQ(stats.encode_usage_percent, info.senders[0].encode_usage_percent);
2895 } 2895 }
2896 2896
2897 TEST_F(WebRtcVideoChannel2Test, GetStatsReportsFramesEncoded) {
2898 FakeVideoSendStream* stream = AddSendStream();
2899 webrtc::VideoSendStream::Stats stats;
2900 stats.frames_encoded = 13;
2901 stream->SetStats(stats);
2902
2903 cricket::VideoMediaInfo info;
2904 ASSERT_TRUE(channel_->GetStats(&info));
2905 EXPECT_EQ(stats.frames_encoded, info.senders[0].frames_encoded);
2906 }
2907
2897 TEST_F(WebRtcVideoChannel2Test, GetStatsReportsUpperResolution) { 2908 TEST_F(WebRtcVideoChannel2Test, GetStatsReportsUpperResolution) {
2898 FakeVideoSendStream* stream = AddSendStream(); 2909 FakeVideoSendStream* stream = AddSendStream();
2899 webrtc::VideoSendStream::Stats stats; 2910 webrtc::VideoSendStream::Stats stats;
2900 stats.substreams[17].width = 123; 2911 stats.substreams[17].width = 123;
2901 stats.substreams[17].height = 40; 2912 stats.substreams[17].height = 40;
2902 stats.substreams[42].width = 80; 2913 stats.substreams[42].width = 80;
2903 stats.substreams[42].height = 31; 2914 stats.substreams[42].height = 31;
2904 stats.substreams[11].width = 20; 2915 stats.substreams[11].width = 20;
2905 stats.substreams[11].height = 90; 2916 stats.substreams[11].height = 90;
2906 stream->SetStats(stats); 2917 stream->SetStats(stats);
(...skipping 949 matching lines...) Expand 10 before | Expand all | Expand 10 after
3856 } 3867 }
3857 3868
3858 // Test that we normalize send codec format size in simulcast. 3869 // Test that we normalize send codec format size in simulcast.
3859 TEST_F(WebRtcVideoChannel2SimulcastTest, SetSendCodecsWithOddSizeInSimulcast) { 3870 TEST_F(WebRtcVideoChannel2SimulcastTest, SetSendCodecsWithOddSizeInSimulcast) {
3860 cricket::VideoCodec codec(kVp8Codec270p); 3871 cricket::VideoCodec codec(kVp8Codec270p);
3861 codec.width += 1; 3872 codec.width += 1;
3862 codec.height += 1; 3873 codec.height += 1;
3863 VerifySimulcastSettings(codec, 2, 2); 3874 VerifySimulcastSettings(codec, 2, 2);
3864 } 3875 }
3865 } // namespace cricket 3876 } // namespace cricket
OLDNEW
« no previous file with comments | « webrtc/media/engine/webrtcvideoengine2.cc ('k') | webrtc/video/send_statistics_proxy.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698