OLD | NEW |
---|---|
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 #include <algorithm> | 10 #include <algorithm> |
(...skipping 2083 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
2094 | 2094 |
2095 private: | 2095 private: |
2096 Action OnSendRtp(const uint8_t* packet, size_t length) override { | 2096 Action OnSendRtp(const uint8_t* packet, size_t length) override { |
2097 if (MinMetricRunTimePassed()) | 2097 if (MinMetricRunTimePassed()) |
2098 observation_complete_.Set(); | 2098 observation_complete_.Set(); |
2099 | 2099 |
2100 // GetStats calls GetSendChannelRtcpStatistics | 2100 // GetStats calls GetSendChannelRtcpStatistics |
2101 // (via VideoSendStream::GetRtt) which updates ReportBlockStats used by | 2101 // (via VideoSendStream::GetRtt) which updates ReportBlockStats used by |
2102 // WebRTC.Video.SentPacketsLostInPercent. | 2102 // WebRTC.Video.SentPacketsLostInPercent. |
2103 // TODO(asapersson): Remove dependency on calling GetStats. | 2103 // TODO(asapersson): Remove dependency on calling GetStats. |
2104 sender_call_->GetStats(); | 2104 sender_call_->GetStats(); |
åsapersson
2016/02/08 09:26:14
can this be removed?
sprang
2016/02/08 10:34:24
Done.
| |
2105 | 2105 |
2106 return SEND_PACKET; | 2106 return SEND_PACKET; |
2107 } | 2107 } |
2108 | 2108 |
2109 bool MinMetricRunTimePassed() { | 2109 bool MinMetricRunTimePassed() { |
2110 int64_t now = Clock::GetRealTimeClock()->TimeInMilliseconds(); | 2110 int64_t now = Clock::GetRealTimeClock()->TimeInMilliseconds(); |
2111 if (start_runtime_ms_ == -1) { | 2111 if (start_runtime_ms_ == -1) { |
2112 start_runtime_ms_ = now; | 2112 start_runtime_ms_ = now; |
2113 return false; | 2113 return false; |
2114 } | 2114 } |
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
2192 EXPECT_EQ(1, test::NumHistogramSamples( | 2192 EXPECT_EQ(1, test::NumHistogramSamples( |
2193 "WebRTC.Video.PliPacketsSentPerMinute")); | 2193 "WebRTC.Video.PliPacketsSentPerMinute")); |
2194 EXPECT_EQ(1, test::NumHistogramSamples( | 2194 EXPECT_EQ(1, test::NumHistogramSamples( |
2195 "WebRTC.Video.PliPacketsReceivedPerMinute")); | 2195 "WebRTC.Video.PliPacketsReceivedPerMinute")); |
2196 | 2196 |
2197 EXPECT_EQ( | 2197 EXPECT_EQ( |
2198 1, test::NumHistogramSamples(video_prefix + "KeyFramesSentInPermille")); | 2198 1, test::NumHistogramSamples(video_prefix + "KeyFramesSentInPermille")); |
2199 EXPECT_EQ(1, test::NumHistogramSamples( | 2199 EXPECT_EQ(1, test::NumHistogramSamples( |
2200 "WebRTC.Video.KeyFramesReceivedInPermille")); | 2200 "WebRTC.Video.KeyFramesReceivedInPermille")); |
2201 | 2201 |
2202 EXPECT_EQ(1, test::NumHistogramSamples( | 2202 if (screenshare) { |
åsapersson
2016/02/08 09:26:14
use video_prefix?
sprang
2016/02/08 10:34:24
Done.
| |
2203 "WebRTC.Video.SentPacketsLostInPercent")); | 2203 EXPECT_EQ(1, test::NumHistogramSamples( |
2204 "WebRTC.Video.Screenshare.SentPacketsLostInPercent")); | |
2205 } else { | |
2206 EXPECT_EQ( | |
2207 1, test::NumHistogramSamples("WebRTC.Video.SentPacketsLostInPercent")); | |
2208 } | |
2204 EXPECT_EQ(1, test::NumHistogramSamples( | 2209 EXPECT_EQ(1, test::NumHistogramSamples( |
2205 "WebRTC.Video.ReceivedPacketsLostInPercent")); | 2210 "WebRTC.Video.ReceivedPacketsLostInPercent")); |
2206 | 2211 |
2207 EXPECT_EQ(1, test::NumHistogramSamples(video_prefix + "InputWidthInPixels")); | 2212 EXPECT_EQ(1, test::NumHistogramSamples(video_prefix + "InputWidthInPixels")); |
2208 EXPECT_EQ(1, test::NumHistogramSamples(video_prefix + "InputHeightInPixels")); | 2213 EXPECT_EQ(1, test::NumHistogramSamples(video_prefix + "InputHeightInPixels")); |
2209 EXPECT_EQ(1, test::NumHistogramSamples(video_prefix + "SentWidthInPixels")); | 2214 EXPECT_EQ(1, test::NumHistogramSamples(video_prefix + "SentWidthInPixels")); |
2210 EXPECT_EQ(1, test::NumHistogramSamples(video_prefix + "SentHeightInPixels")); | 2215 EXPECT_EQ(1, test::NumHistogramSamples(video_prefix + "SentHeightInPixels")); |
2211 EXPECT_EQ(1, test::NumHistogramSamples("WebRTC.Video.ReceivedWidthInPixels")); | 2216 EXPECT_EQ(1, test::NumHistogramSamples("WebRTC.Video.ReceivedWidthInPixels")); |
2212 EXPECT_EQ(1, | 2217 EXPECT_EQ(1, |
2213 test::NumHistogramSamples("WebRTC.Video.ReceivedHeightInPixels")); | 2218 test::NumHistogramSamples("WebRTC.Video.ReceivedHeightInPixels")); |
(...skipping 1300 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
3514 private: | 3519 private: |
3515 bool video_observed_; | 3520 bool video_observed_; |
3516 bool audio_observed_; | 3521 bool audio_observed_; |
3517 SequenceNumberUnwrapper unwrapper_; | 3522 SequenceNumberUnwrapper unwrapper_; |
3518 std::set<int64_t> received_packet_ids_; | 3523 std::set<int64_t> received_packet_ids_; |
3519 } test; | 3524 } test; |
3520 | 3525 |
3521 RunBaseTest(&test); | 3526 RunBaseTest(&test); |
3522 } | 3527 } |
3523 } // namespace webrtc | 3528 } // namespace webrtc |
OLD | NEW |