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 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
48 : EndToEndTest(test::CallTest::kLongTimeoutMs), | 48 : EndToEndTest(test::CallTest::kLongTimeoutMs), |
49 event_(false, false), | 49 event_(false, false), |
50 clock_(Clock::GetRealTimeClock()), | 50 clock_(Clock::GetRealTimeClock()), |
51 num_streams_(num_streams), | 51 num_streams_(num_streams), |
52 rtx_(rtx), | 52 rtx_(rtx), |
53 red_(red), | 53 red_(red), |
54 send_stream_(nullptr), | 54 send_stream_(nullptr), |
55 start_bitrate_bps_(start_bitrate_bps), | 55 start_bitrate_bps_(start_bitrate_bps), |
56 start_bitrate_verified_(false), | 56 start_bitrate_verified_(false), |
57 expected_bitrate_bps_(0), | 57 expected_bitrate_bps_(0), |
58 test_start_ms_(clock_->TimeInMilliseconds()), | 58 test_start_ms_(-1), |
59 ramp_up_finished_ms_(-1), | 59 ramp_up_finished_ms_(-1), |
60 extension_type_(extension_type), | 60 extension_type_(extension_type), |
61 ssrcs_(GenerateSsrcs(num_streams, 100)), | 61 ssrcs_(GenerateSsrcs(num_streams, 100)), |
62 rtx_ssrcs_(GenerateSsrcs(num_streams, 200)), | 62 rtx_ssrcs_(GenerateSsrcs(num_streams, 200)), |
63 poller_thread_(ThreadWrapper::CreateThread(&BitrateStatsPollingThread, | 63 poller_thread_(ThreadWrapper::CreateThread(&BitrateStatsPollingThread, |
64 this, | 64 this, |
65 "BitrateStatsPollingThread")), | 65 "BitrateStatsPollingThread")), |
66 sender_call_(nullptr) { | 66 sender_call_(nullptr) { |
67 if (rtx_) { | 67 if (rtx_) { |
68 for (size_t i = 0; i < ssrcs_.size(); ++i) | 68 for (size_t i = 0; i < ssrcs_.size(); ++i) |
(...skipping 150 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
219 *total_sent += stream.rtp_stats.transmitted.TotalBytes() + | 219 *total_sent += stream.rtp_stats.transmitted.TotalBytes() + |
220 stream.rtp_stats.retransmitted.TotalBytes() + | 220 stream.rtp_stats.retransmitted.TotalBytes() + |
221 stream.rtp_stats.fec.TotalBytes(); | 221 stream.rtp_stats.fec.TotalBytes(); |
222 *padding_sent += stream.rtp_stats.transmitted.padding_bytes + | 222 *padding_sent += stream.rtp_stats.transmitted.padding_bytes + |
223 stream.rtp_stats.retransmitted.padding_bytes + | 223 stream.rtp_stats.retransmitted.padding_bytes + |
224 stream.rtp_stats.fec.padding_bytes; | 224 stream.rtp_stats.fec.padding_bytes; |
225 *media_sent += stream.rtp_stats.MediaPayloadBytes(); | 225 *media_sent += stream.rtp_stats.MediaPayloadBytes(); |
226 } | 226 } |
227 | 227 |
228 void RampUpTester::TriggerTestDone() { | 228 void RampUpTester::TriggerTestDone() { |
| 229 RTC_DCHECK_GE(test_start_ms_, 0); |
| 230 |
229 VideoSendStream::Stats send_stats = send_stream_->GetStats(); | 231 VideoSendStream::Stats send_stats = send_stream_->GetStats(); |
230 | 232 |
231 size_t total_packets_sent = 0; | 233 size_t total_packets_sent = 0; |
232 size_t total_sent = 0; | 234 size_t total_sent = 0; |
233 size_t padding_sent = 0; | 235 size_t padding_sent = 0; |
234 size_t media_sent = 0; | 236 size_t media_sent = 0; |
235 for (uint32_t ssrc : ssrcs_) { | 237 for (uint32_t ssrc : ssrcs_) { |
236 AccumulateStats(send_stats.substreams[ssrc], &total_packets_sent, | 238 AccumulateStats(send_stats.substreams[ssrc], &total_packets_sent, |
237 &total_sent, &padding_sent, &media_sent); | 239 &total_sent, &padding_sent, &media_sent); |
238 } | 240 } |
(...skipping 16 matching lines...) Expand all Loading... |
255 ReportResult("ramp-up-rtx-total-sent", rtx_total_sent, "bytes"); | 257 ReportResult("ramp-up-rtx-total-sent", rtx_total_sent, "bytes"); |
256 ReportResult("ramp-up-rtx-media-sent", rtx_media_sent, "bytes"); | 258 ReportResult("ramp-up-rtx-media-sent", rtx_media_sent, "bytes"); |
257 ReportResult("ramp-up-rtx-padding-sent", rtx_padding_sent, "bytes"); | 259 ReportResult("ramp-up-rtx-padding-sent", rtx_padding_sent, "bytes"); |
258 if (ramp_up_finished_ms_ >= 0) { | 260 if (ramp_up_finished_ms_ >= 0) { |
259 ReportResult("ramp-up-time", ramp_up_finished_ms_ - test_start_ms_, | 261 ReportResult("ramp-up-time", ramp_up_finished_ms_ - test_start_ms_, |
260 "milliseconds"); | 262 "milliseconds"); |
261 } | 263 } |
262 } | 264 } |
263 | 265 |
264 void RampUpTester::PerformTest() { | 266 void RampUpTester::PerformTest() { |
| 267 test_start_ms_ = clock_->TimeInMilliseconds(); |
265 poller_thread_->Start(); | 268 poller_thread_->Start(); |
266 if (Wait() != kEventSignaled) { | 269 if (Wait() != kEventSignaled) { |
267 printf("Timed out while waiting for ramp-up to complete."); | 270 printf("Timed out while waiting for ramp-up to complete."); |
268 return; | 271 return; |
269 } | 272 } |
270 TriggerTestDone(); | 273 TriggerTestDone(); |
271 poller_thread_->Stop(); | 274 poller_thread_->Stop(); |
272 } | 275 } |
273 | 276 |
274 RampUpDownUpTester::RampUpDownUpTester(size_t num_streams, | 277 RampUpDownUpTester::RampUpDownUpTester(size_t num_streams, |
(...skipping 216 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
491 RampUpTester test(3, 0, RtpExtension::kTransportSequenceNumber, true, true); | 494 RampUpTester test(3, 0, RtpExtension::kTransportSequenceNumber, true, true); |
492 RunBaseTest(&test); | 495 RunBaseTest(&test); |
493 } | 496 } |
494 | 497 |
495 TEST_F(RampUpTest, TransportSequenceNumberSingleStreamWithHighStartBitrate) { | 498 TEST_F(RampUpTest, TransportSequenceNumberSingleStreamWithHighStartBitrate) { |
496 RampUpTester test(1, 0.9 * kSingleStreamTargetBps, | 499 RampUpTester test(1, 0.9 * kSingleStreamTargetBps, |
497 RtpExtension::kTransportSequenceNumber, false, false); | 500 RtpExtension::kTransportSequenceNumber, false, false); |
498 RunBaseTest(&test); | 501 RunBaseTest(&test); |
499 } | 502 } |
500 } // namespace webrtc | 503 } // namespace webrtc |
OLD | NEW |