OLD | NEW |
1 /* | 1 /* |
2 * Copyright (c) 2012 The WebRTC project authors. All Rights Reserved. | 2 * Copyright (c) 2012 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 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
51 rtp_receive_statistics_(ReceiveStatistics::Create(clock_)), | 51 rtp_receive_statistics_(ReceiveStatistics::Create(clock_)), |
52 fec_receiver_(FecReceiver::Create(this)), | 52 fec_receiver_(FecReceiver::Create(this)), |
53 rtp_rtcp_(NULL), | 53 rtp_rtcp_(NULL), |
54 vcm_(module_vcm), | 54 vcm_(module_vcm), |
55 remote_bitrate_estimator_(remote_bitrate_estimator), | 55 remote_bitrate_estimator_(remote_bitrate_estimator), |
56 ntp_estimator_(new RemoteNtpTimeEstimator(clock_)), | 56 ntp_estimator_(new RemoteNtpTimeEstimator(clock_)), |
57 receiving_(false), | 57 receiving_(false), |
58 restored_packet_in_use_(false), | 58 restored_packet_in_use_(false), |
59 receiving_ast_enabled_(false), | 59 receiving_ast_enabled_(false), |
60 receiving_cvo_enabled_(false), | 60 receiving_cvo_enabled_(false), |
| 61 receiving_tsn_enabled_(false), |
61 last_packet_log_ms_(-1) { | 62 last_packet_log_ms_(-1) { |
62 assert(remote_bitrate_estimator); | 63 assert(remote_bitrate_estimator); |
63 } | 64 } |
64 | 65 |
65 ViEReceiver::~ViEReceiver() { | 66 ViEReceiver::~ViEReceiver() { |
66 UpdateHistograms(); | 67 UpdateHistograms(); |
67 } | 68 } |
68 | 69 |
69 void ViEReceiver::UpdateHistograms() { | 70 void ViEReceiver::UpdateHistograms() { |
70 FecPacketCounter counter = fec_receiver_->GetPacketCounter(); | 71 FecPacketCounter counter = fec_receiver_->GetPacketCounter(); |
(...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
192 } else { | 193 } else { |
193 return false; | 194 return false; |
194 } | 195 } |
195 } else { | 196 } else { |
196 receiving_cvo_enabled_ = false; | 197 receiving_cvo_enabled_ = false; |
197 return rtp_header_parser_->DeregisterRtpHeaderExtension( | 198 return rtp_header_parser_->DeregisterRtpHeaderExtension( |
198 kRtpExtensionVideoRotation); | 199 kRtpExtensionVideoRotation); |
199 } | 200 } |
200 } | 201 } |
201 | 202 |
| 203 bool ViEReceiver::SetReceiveTransportSequenceNumber(bool enable, int id) { |
| 204 if (enable) { |
| 205 if (rtp_header_parser_->RegisterRtpHeaderExtension( |
| 206 kRtpExtensionTransportSequenceNumber, id)) { |
| 207 receiving_tsn_enabled_ = true; |
| 208 return true; |
| 209 } else { |
| 210 return false; |
| 211 } |
| 212 } else { |
| 213 receiving_tsn_enabled_ = false; |
| 214 return rtp_header_parser_->DeregisterRtpHeaderExtension( |
| 215 kRtpExtensionTransportSequenceNumber); |
| 216 } |
| 217 } |
| 218 |
202 int ViEReceiver::ReceivedRTPPacket(const void* rtp_packet, | 219 int ViEReceiver::ReceivedRTPPacket(const void* rtp_packet, |
203 size_t rtp_packet_length, | 220 size_t rtp_packet_length, |
204 const PacketTime& packet_time) { | 221 const PacketTime& packet_time) { |
205 return InsertRTPPacket(static_cast<const uint8_t*>(rtp_packet), | 222 return InsertRTPPacket(static_cast<const uint8_t*>(rtp_packet), |
206 rtp_packet_length, packet_time); | 223 rtp_packet_length, packet_time); |
207 } | 224 } |
208 | 225 |
209 int ViEReceiver::ReceivedRTCPPacket(const void* rtcp_packet, | 226 int ViEReceiver::ReceivedRTCPPacket(const void* rtcp_packet, |
210 size_t rtcp_packet_length) { | 227 size_t rtcp_packet_length) { |
211 return InsertRTCPPacket(static_cast<const uint8_t*>(rtcp_packet), | 228 return InsertRTCPPacket(static_cast<const uint8_t*>(rtcp_packet), |
(...skipping 243 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
455 rtp_receive_statistics_->GetStatistician(header.ssrc); | 472 rtp_receive_statistics_->GetStatistician(header.ssrc); |
456 if (!statistician) | 473 if (!statistician) |
457 return false; | 474 return false; |
458 // Check if this is a retransmission. | 475 // Check if this is a retransmission. |
459 int64_t min_rtt = 0; | 476 int64_t min_rtt = 0; |
460 rtp_rtcp_->RTT(rtp_receiver_->SSRC(), NULL, NULL, &min_rtt, NULL); | 477 rtp_rtcp_->RTT(rtp_receiver_->SSRC(), NULL, NULL, &min_rtt, NULL); |
461 return !in_order && | 478 return !in_order && |
462 statistician->IsRetransmitOfOldPacket(header, min_rtt); | 479 statistician->IsRetransmitOfOldPacket(header, min_rtt); |
463 } | 480 } |
464 } // namespace webrtc | 481 } // namespace webrtc |
OLD | NEW |