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 | 10 |
(...skipping 270 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
281 int avg_delay_ms = ssrc; | 281 int avg_delay_ms = ssrc; |
282 int max_delay_ms = ssrc + 1; | 282 int max_delay_ms = ssrc + 1; |
283 observer->SendSideDelayUpdated(avg_delay_ms, max_delay_ms, ssrc); | 283 observer->SendSideDelayUpdated(avg_delay_ms, max_delay_ms, ssrc); |
284 expected_.substreams[ssrc].avg_delay_ms = avg_delay_ms; | 284 expected_.substreams[ssrc].avg_delay_ms = avg_delay_ms; |
285 expected_.substreams[ssrc].max_delay_ms = max_delay_ms; | 285 expected_.substreams[ssrc].max_delay_ms = max_delay_ms; |
286 } | 286 } |
287 VideoSendStream::Stats stats = statistics_proxy_->GetStats(); | 287 VideoSendStream::Stats stats = statistics_proxy_->GetStats(); |
288 ExpectEqual(expected_, stats); | 288 ExpectEqual(expected_, stats); |
289 } | 289 } |
290 | 290 |
291 TEST_F(SendStatisticsProxyTest, OnEncodedFrame) { | |
292 const int kEncodeTimeMs = 11; | |
293 statistics_proxy_->OnEncodedFrame(kEncodeTimeMs); | |
294 | |
295 VideoSendStream::Stats stats = statistics_proxy_->GetStats(); | |
296 EXPECT_EQ(kEncodeTimeMs, stats.avg_encode_time_ms); | |
pbos-webrtc
2015/12/07 10:55:02
If you wanna, add two samples and make sure the av
| |
297 } | |
298 | |
291 TEST_F(SendStatisticsProxyTest, NoSubstreams) { | 299 TEST_F(SendStatisticsProxyTest, NoSubstreams) { |
292 uint32_t excluded_ssrc = | 300 uint32_t excluded_ssrc = |
293 std::max( | 301 std::max( |
294 *std::max_element(config_.rtp.ssrcs.begin(), config_.rtp.ssrcs.end()), | 302 *std::max_element(config_.rtp.ssrcs.begin(), config_.rtp.ssrcs.end()), |
295 *std::max_element(config_.rtp.rtx.ssrcs.begin(), | 303 *std::max_element(config_.rtp.rtx.ssrcs.begin(), |
296 config_.rtp.rtx.ssrcs.end())) + | 304 config_.rtp.rtx.ssrcs.end())) + |
297 1; | 305 1; |
298 // From RtcpStatisticsCallback. | 306 // From RtcpStatisticsCallback. |
299 RtcpStatistics rtcp_stats; | 307 RtcpStatistics rtcp_stats; |
300 RtcpStatisticsCallback* rtcp_callback = statistics_proxy_.get(); | 308 RtcpStatisticsCallback* rtcp_callback = statistics_proxy_.get(); |
(...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
397 VideoSendStream::Stats stats = statistics_proxy_->GetStats(); | 405 VideoSendStream::Stats stats = statistics_proxy_->GetStats(); |
398 EXPECT_EQ(static_cast<int>(bitrate.bitrate_bps), | 406 EXPECT_EQ(static_cast<int>(bitrate.bitrate_bps), |
399 stats.substreams[config_.rtp.ssrcs[0]].total_bitrate_bps); | 407 stats.substreams[config_.rtp.ssrcs[0]].total_bitrate_bps); |
400 EXPECT_EQ(static_cast<int>(bitrate.bitrate_bps), | 408 EXPECT_EQ(static_cast<int>(bitrate.bitrate_bps), |
401 stats.substreams[config_.rtp.ssrcs[0]].retransmit_bitrate_bps); | 409 stats.substreams[config_.rtp.ssrcs[0]].retransmit_bitrate_bps); |
402 EXPECT_EQ(0, stats.substreams[config_.rtp.ssrcs[1]].total_bitrate_bps); | 410 EXPECT_EQ(0, stats.substreams[config_.rtp.ssrcs[1]].total_bitrate_bps); |
403 EXPECT_EQ(0, stats.substreams[config_.rtp.ssrcs[1]].retransmit_bitrate_bps); | 411 EXPECT_EQ(0, stats.substreams[config_.rtp.ssrcs[1]].retransmit_bitrate_bps); |
404 } | 412 } |
405 | 413 |
406 } // namespace webrtc | 414 } // namespace webrtc |
OLD | NEW |