| 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 192 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 203 | 203 |
| 204 void RampUpTester::ReportResult(const std::string& measurement, | 204 void RampUpTester::ReportResult(const std::string& measurement, |
| 205 size_t value, | 205 size_t value, |
| 206 const std::string& units) const { | 206 const std::string& units) const { |
| 207 webrtc::test::PrintResult( | 207 webrtc::test::PrintResult( |
| 208 measurement, "", | 208 measurement, "", |
| 209 ::testing::UnitTest::GetInstance()->current_test_info()->name(), | 209 ::testing::UnitTest::GetInstance()->current_test_info()->name(), |
| 210 value, units, false); | 210 value, units, false); |
| 211 } | 211 } |
| 212 | 212 |
| 213 void RampUpTester::GetStats(const VideoSendStream::StreamStats& stream, | 213 void RampUpTester::AccumulateStats(const VideoSendStream::StreamStats& stream, |
| 214 size_t* total_packets_sent, | 214 size_t* total_packets_sent, |
| 215 size_t* total_sent, | 215 size_t* total_sent, |
| 216 size_t* padding_sent, | 216 size_t* padding_sent, |
| 217 size_t* media_sent) const { | 217 size_t* media_sent) const { |
| 218 *total_packets_sent += stream.rtp_stats.transmitted.packets + | 218 *total_packets_sent += stream.rtp_stats.transmitted.packets + |
| 219 stream.rtp_stats.retransmitted.packets + | 219 stream.rtp_stats.retransmitted.packets + |
| 220 stream.rtp_stats.fec.packets; | 220 stream.rtp_stats.fec.packets; |
| 221 *total_sent += stream.rtp_stats.transmitted.TotalBytes() + | 221 *total_sent += stream.rtp_stats.transmitted.TotalBytes() + |
| 222 stream.rtp_stats.retransmitted.TotalBytes() + | 222 stream.rtp_stats.retransmitted.TotalBytes() + |
| 223 stream.rtp_stats.fec.TotalBytes(); | 223 stream.rtp_stats.fec.TotalBytes(); |
| 224 *padding_sent += stream.rtp_stats.transmitted.padding_bytes + | 224 *padding_sent += stream.rtp_stats.transmitted.padding_bytes + |
| 225 stream.rtp_stats.retransmitted.padding_bytes + | 225 stream.rtp_stats.retransmitted.padding_bytes + |
| 226 stream.rtp_stats.fec.padding_bytes; | 226 stream.rtp_stats.fec.padding_bytes; |
| 227 *media_sent += stream.rtp_stats.MediaPayloadBytes(); | 227 *media_sent += stream.rtp_stats.MediaPayloadBytes(); |
| 228 } | 228 } |
| 229 | 229 |
| 230 void RampUpTester::TriggerTestDone() { | 230 void RampUpTester::TriggerTestDone() { |
| 231 VideoSendStream::Stats send_stats = send_stream_->GetStats(); | 231 VideoSendStream::Stats send_stats = send_stream_->GetStats(); |
| 232 | 232 |
| 233 size_t total_packets_sent = 0; | 233 size_t total_packets_sent = 0; |
| 234 size_t total_sent = 0; | 234 size_t total_sent = 0; |
| 235 size_t padding_sent = 0; | 235 size_t padding_sent = 0; |
| 236 size_t media_sent = 0; | 236 size_t media_sent = 0; |
| 237 for (uint32_t ssrc : ssrcs_) { | 237 for (uint32_t ssrc : ssrcs_) { |
| 238 GetStats(send_stats.substreams[ssrc], &total_packets_sent, &total_sent, | 238 AccumulateStats(send_stats.substreams[ssrc], &total_packets_sent, |
| 239 &padding_sent, &media_sent); | 239 &total_sent, &padding_sent, &media_sent); |
| 240 } | 240 } |
| 241 | 241 |
| 242 size_t rtx_total_packets_sent = 0; | 242 size_t rtx_total_packets_sent = 0; |
| 243 size_t rtx_total_sent = 0; | 243 size_t rtx_total_sent = 0; |
| 244 size_t rtx_padding_sent = 0; | 244 size_t rtx_padding_sent = 0; |
| 245 size_t rtx_media_sent = 0; | 245 size_t rtx_media_sent = 0; |
| 246 for (uint32_t rtx_ssrc : rtx_ssrcs_) { | 246 for (uint32_t rtx_ssrc : rtx_ssrcs_) { |
| 247 GetStats(send_stats.substreams[rtx_ssrc], &total_packets_sent, &total_sent, | 247 AccumulateStats(send_stats.substreams[rtx_ssrc], &rtx_total_packets_sent, |
| 248 &padding_sent, &media_sent); | 248 &rtx_total_sent, &rtx_padding_sent, &rtx_media_sent); |
| 249 } | 249 } |
| 250 | 250 |
| 251 ReportResult("ramp-up-total-packets-sent", total_packets_sent, "packets"); | 251 ReportResult("ramp-up-total-packets-sent", total_packets_sent, "packets"); |
| 252 ReportResult("ramp-up-total-sent", total_sent, "bytes"); | 252 ReportResult("ramp-up-total-sent", total_sent, "bytes"); |
| 253 ReportResult("ramp-up-media-sent", media_sent, "bytes"); | 253 ReportResult("ramp-up-media-sent", media_sent, "bytes"); |
| 254 ReportResult("ramp-up-padding-sent", padding_sent, "bytes"); | 254 ReportResult("ramp-up-padding-sent", padding_sent, "bytes"); |
| 255 ReportResult("ramp-up-rtx-total-packets-sent", rtx_total_packets_sent, | 255 ReportResult("ramp-up-rtx-total-packets-sent", rtx_total_packets_sent, |
| 256 "packets"); | 256 "packets"); |
| 257 ReportResult("ramp-up-rtx-total-sent", rtx_total_sent, "bytes"); | 257 ReportResult("ramp-up-rtx-total-sent", rtx_total_sent, "bytes"); |
| 258 ReportResult("ramp-up-rtx-media-sent", rtx_media_sent, "bytes"); | 258 ReportResult("ramp-up-rtx-media-sent", rtx_media_sent, "bytes"); |
| (...skipping 232 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 491 RampUpTester test(3, 0, RtpExtension::kTransportSequenceNumber, true, true); | 491 RampUpTester test(3, 0, RtpExtension::kTransportSequenceNumber, true, true); |
| 492 RunBaseTest(&test); | 492 RunBaseTest(&test); |
| 493 } | 493 } |
| 494 | 494 |
| 495 TEST_F(RampUpTest, TransportSequenceNumberSingleStreamWithHighStartBitrate) { | 495 TEST_F(RampUpTest, TransportSequenceNumberSingleStreamWithHighStartBitrate) { |
| 496 RampUpTester test(1, 0.9 * kSingleStreamTargetBps, | 496 RampUpTester test(1, 0.9 * kSingleStreamTargetBps, |
| 497 RtpExtension::kTransportSequenceNumber, false, false); | 497 RtpExtension::kTransportSequenceNumber, false, false); |
| 498 RunBaseTest(&test); | 498 RunBaseTest(&test); |
| 499 } | 499 } |
| 500 } // namespace webrtc | 500 } // namespace webrtc |
| OLD | NEW |