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 103 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
114 rtp_rtcp_->SetREMBData(bitrate, ssrcs); | 114 rtp_rtcp_->SetREMBData(bitrate, ssrcs); |
115 rtp_rtcp_->Process(); | 115 rtp_rtcp_->Process(); |
116 } | 116 } |
117 | 117 |
118 bool StreamObserver::SendRtp(const uint8_t* packet, size_t length) { | 118 bool StreamObserver::SendRtp(const uint8_t* packet, size_t length) { |
119 rtc::CritScope lock(&crit_); | 119 rtc::CritScope lock(&crit_); |
120 RTPHeader header; | 120 RTPHeader header; |
121 EXPECT_TRUE(rtp_parser_->Parse(packet, length, &header)); | 121 EXPECT_TRUE(rtp_parser_->Parse(packet, length, &header)); |
122 receive_stats_->IncomingPacket(header, length, false); | 122 receive_stats_->IncomingPacket(header, length, false); |
123 payload_registry_->SetIncomingPayloadType(header); | 123 payload_registry_->SetIncomingPayloadType(header); |
124 remote_bitrate_estimator_->IncomingPacket( | 124 remote_bitrate_estimator_->IncomingPacket(clock_->TimeInMilliseconds(), |
125 clock_->TimeInMilliseconds(), length - 12, header); | 125 length - 12, header, true); |
126 if (remote_bitrate_estimator_->TimeUntilNextProcess() <= 0) { | 126 if (remote_bitrate_estimator_->TimeUntilNextProcess() <= 0) { |
127 remote_bitrate_estimator_->Process(); | 127 remote_bitrate_estimator_->Process(); |
128 } | 128 } |
129 total_sent_ += length; | 129 total_sent_ += length; |
130 padding_sent_ += header.paddingLength; | 130 padding_sent_ += header.paddingLength; |
131 ++total_packets_sent_; | 131 ++total_packets_sent_; |
132 if (header.paddingLength > 0) | 132 if (header.paddingLength > 0) |
133 ++padding_packets_sent_; | 133 ++padding_packets_sent_; |
134 if (rtx_media_ssrcs_.find(header.ssrc) != rtx_media_ssrcs_.end()) { | 134 if (rtx_media_ssrcs_.find(header.ssrc) != rtx_media_ssrcs_.end()) { |
135 rtx_media_sent_ += length - header.headerLength - header.paddingLength; | 135 rtx_media_sent_ += length - header.headerLength - header.paddingLength; |
(...skipping 124 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
260 } | 260 } |
261 return test::DirectTransport::SendRtp(data, length); | 261 return test::DirectTransport::SendRtp(data, length); |
262 } | 262 } |
263 | 263 |
264 PacketReceiver::DeliveryStatus LowRateStreamObserver::DeliverPacket( | 264 PacketReceiver::DeliveryStatus LowRateStreamObserver::DeliverPacket( |
265 MediaType media_type, const uint8_t* packet, size_t length) { | 265 MediaType media_type, const uint8_t* packet, size_t length) { |
266 rtc::CritScope lock(&crit_); | 266 rtc::CritScope lock(&crit_); |
267 RTPHeader header; | 267 RTPHeader header; |
268 EXPECT_TRUE(rtp_parser_->Parse(packet, length, &header)); | 268 EXPECT_TRUE(rtp_parser_->Parse(packet, length, &header)); |
269 receive_stats_->IncomingPacket(header, length, false); | 269 receive_stats_->IncomingPacket(header, length, false); |
270 remote_bitrate_estimator_->IncomingPacket( | 270 remote_bitrate_estimator_->IncomingPacket(clock_->TimeInMilliseconds(), |
271 clock_->TimeInMilliseconds(), length - 12, header); | 271 length - 12, header, true); |
272 if (remote_bitrate_estimator_->TimeUntilNextProcess() <= 0) { | 272 if (remote_bitrate_estimator_->TimeUntilNextProcess() <= 0) { |
273 remote_bitrate_estimator_->Process(); | 273 remote_bitrate_estimator_->Process(); |
274 } | 274 } |
275 suspended_in_stats_ = send_stream_->GetStats().suspended; | 275 suspended_in_stats_ = send_stream_->GetStats().suspended; |
276 return DELIVERY_OK; | 276 return DELIVERY_OK; |
277 } | 277 } |
278 | 278 |
279 bool LowRateStreamObserver::SendRtcp(const uint8_t* packet, size_t length) { | 279 bool LowRateStreamObserver::SendRtcp(const uint8_t* packet, size_t length) { |
280 return true; | 280 return true; |
281 } | 281 } |
(...skipping 269 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
551 | 551 |
552 TEST_F(RampUpTest, AbsSendTimeSimulcastByRedWithRtx) { | 552 TEST_F(RampUpTest, AbsSendTimeSimulcastByRedWithRtx) { |
553 RunRampUpTest(3, 0, RtpExtension::kAbsSendTime, true, true); | 553 RunRampUpTest(3, 0, RtpExtension::kAbsSendTime, true, true); |
554 } | 554 } |
555 | 555 |
556 TEST_F(RampUpTest, AbsSendTimeSingleStreamWithHighStartBitrate) { | 556 TEST_F(RampUpTest, AbsSendTimeSingleStreamWithHighStartBitrate) { |
557 RunRampUpTest(1, 0.9 * kSingleStreamTargetBps, RtpExtension::kAbsSendTime, | 557 RunRampUpTest(1, 0.9 * kSingleStreamTargetBps, RtpExtension::kAbsSendTime, |
558 false, false); | 558 false, false); |
559 } | 559 } |
560 } // namespace webrtc | 560 } // namespace webrtc |
OLD | NEW |