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 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
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_(-1), | 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_(PlatformThread::CreateThread(&BitrateStatsPollingThread, | 63 poller_thread_(&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) |
69 rtx_ssrc_map_[rtx_ssrcs_[i]] = ssrcs_[i]; | 69 rtx_ssrc_map_[rtx_ssrcs_[i]] = ssrcs_[i]; |
70 } | 70 } |
71 } | 71 } |
72 | 72 |
73 RampUpTester::~RampUpTester() { | 73 RampUpTester::~RampUpTester() { |
74 event_.Set(); | 74 event_.Set(); |
75 } | 75 } |
(...skipping 194 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
270 ReportResult("ramp-up-rtx-media-sent", rtx_media_sent, "bytes"); | 270 ReportResult("ramp-up-rtx-media-sent", rtx_media_sent, "bytes"); |
271 ReportResult("ramp-up-rtx-padding-sent", rtx_padding_sent, "bytes"); | 271 ReportResult("ramp-up-rtx-padding-sent", rtx_padding_sent, "bytes"); |
272 if (ramp_up_finished_ms_ >= 0) { | 272 if (ramp_up_finished_ms_ >= 0) { |
273 ReportResult("ramp-up-time", ramp_up_finished_ms_ - test_start_ms_, | 273 ReportResult("ramp-up-time", ramp_up_finished_ms_ - test_start_ms_, |
274 "milliseconds"); | 274 "milliseconds"); |
275 } | 275 } |
276 } | 276 } |
277 | 277 |
278 void RampUpTester::PerformTest() { | 278 void RampUpTester::PerformTest() { |
279 test_start_ms_ = clock_->TimeInMilliseconds(); | 279 test_start_ms_ = clock_->TimeInMilliseconds(); |
280 poller_thread_->Start(); | 280 poller_thread_.Start(); |
281 EXPECT_EQ(kEventSignaled, Wait()) | 281 EXPECT_EQ(kEventSignaled, Wait()) |
282 << "Timed out while waiting for ramp-up to complete."; | 282 << "Timed out while waiting for ramp-up to complete."; |
283 TriggerTestDone(); | 283 TriggerTestDone(); |
284 poller_thread_->Stop(); | 284 poller_thread_.Stop(); |
285 } | 285 } |
286 | 286 |
287 RampUpDownUpTester::RampUpDownUpTester(size_t num_streams, | 287 RampUpDownUpTester::RampUpDownUpTester(size_t num_streams, |
288 unsigned int start_bitrate_bps, | 288 unsigned int start_bitrate_bps, |
289 const std::string& extension_type, | 289 const std::string& extension_type, |
290 bool rtx, | 290 bool rtx, |
291 bool red) | 291 bool red) |
292 : RampUpTester(num_streams, start_bitrate_bps, extension_type, rtx, red), | 292 : RampUpTester(num_streams, start_bitrate_bps, extension_type, rtx, red), |
293 test_state_(kFirstRampup), | 293 test_state_(kFirstRampup), |
294 state_start_ms_(clock_->TimeInMilliseconds()), | 294 state_start_ms_(clock_->TimeInMilliseconds()), |
(...skipping 208 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
503 RampUpTester test(3, 0, RtpExtension::kTransportSequenceNumber, true, true); | 503 RampUpTester test(3, 0, RtpExtension::kTransportSequenceNumber, true, true); |
504 RunBaseTest(&test, FakeNetworkPipe::Config()); | 504 RunBaseTest(&test, FakeNetworkPipe::Config()); |
505 } | 505 } |
506 | 506 |
507 TEST_F(RampUpTest, TransportSequenceNumberSingleStreamWithHighStartBitrate) { | 507 TEST_F(RampUpTest, TransportSequenceNumberSingleStreamWithHighStartBitrate) { |
508 RampUpTester test(1, 0.9 * kSingleStreamTargetBps, | 508 RampUpTester test(1, 0.9 * kSingleStreamTargetBps, |
509 RtpExtension::kTransportSequenceNumber, false, false); | 509 RtpExtension::kTransportSequenceNumber, false, false); |
510 RunBaseTest(&test, FakeNetworkPipe::Config()); | 510 RunBaseTest(&test, FakeNetworkPipe::Config()); |
511 } | 511 } |
512 } // namespace webrtc | 512 } // namespace webrtc |
OLD | NEW |