| 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 100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 111 max_nack_reordering_threshold); | 111 max_nack_reordering_threshold); |
| 112 rtp_receiver_->SetNACKStatus(enable ? kNackRtcp : kNackOff); | 112 rtp_receiver_->SetNACKStatus(enable ? kNackRtcp : kNackOff); |
| 113 } | 113 } |
| 114 | 114 |
| 115 void ViEReceiver::SetRtxPayloadType(int payload_type, | 115 void ViEReceiver::SetRtxPayloadType(int payload_type, |
| 116 int associated_payload_type) { | 116 int associated_payload_type) { |
| 117 rtp_payload_registry_->SetRtxPayloadType(payload_type, | 117 rtp_payload_registry_->SetRtxPayloadType(payload_type, |
| 118 associated_payload_type); | 118 associated_payload_type); |
| 119 } | 119 } |
| 120 | 120 |
| 121 void ViEReceiver::SetUseRtxPayloadMappingOnRestore(bool val) { |
| 122 rtp_payload_registry_->set_use_rtx_payload_mapping_on_restore(val); |
| 123 } |
| 124 |
| 121 void ViEReceiver::SetRtxSsrc(uint32_t ssrc) { | 125 void ViEReceiver::SetRtxSsrc(uint32_t ssrc) { |
| 122 rtp_payload_registry_->SetRtxSsrc(ssrc); | 126 rtp_payload_registry_->SetRtxSsrc(ssrc); |
| 123 } | 127 } |
| 124 | 128 |
| 125 bool ViEReceiver::GetRtxSsrc(uint32_t* ssrc) const { | 129 bool ViEReceiver::GetRtxSsrc(uint32_t* ssrc) const { |
| 126 return rtp_payload_registry_->GetRtxSsrc(ssrc); | 130 return rtp_payload_registry_->GetRtxSsrc(ssrc); |
| 127 } | 131 } |
| 128 | 132 |
| 129 bool ViEReceiver::IsFecEnabled() const { | 133 bool ViEReceiver::IsFecEnabled() const { |
| 130 return rtp_payload_registry_->ulpfec_payload_type() > -1; | 134 return rtp_payload_registry_->ulpfec_payload_type() > -1; |
| (...skipping 223 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 354 // Remove the RTX header and parse the original RTP header. | 358 // Remove the RTX header and parse the original RTP header. |
| 355 if (packet_length < header.headerLength) | 359 if (packet_length < header.headerLength) |
| 356 return false; | 360 return false; |
| 357 if (packet_length > sizeof(restored_packet_)) | 361 if (packet_length > sizeof(restored_packet_)) |
| 358 return false; | 362 return false; |
| 359 CriticalSectionScoped cs(receive_cs_.get()); | 363 CriticalSectionScoped cs(receive_cs_.get()); |
| 360 if (restored_packet_in_use_) { | 364 if (restored_packet_in_use_) { |
| 361 LOG(LS_WARNING) << "Multiple RTX headers detected, dropping packet."; | 365 LOG(LS_WARNING) << "Multiple RTX headers detected, dropping packet."; |
| 362 return false; | 366 return false; |
| 363 } | 367 } |
| 364 uint8_t* restored_packet_ptr = restored_packet_; | |
| 365 if (!rtp_payload_registry_->RestoreOriginalPacket( | 368 if (!rtp_payload_registry_->RestoreOriginalPacket( |
| 366 &restored_packet_ptr, packet, &packet_length, rtp_receiver_->SSRC(), | 369 restored_packet_, packet, &packet_length, rtp_receiver_->SSRC(), |
| 367 header)) { | 370 header)) { |
| 368 LOG(LS_WARNING) << "Incoming RTX packet: Invalid RTP header"; | 371 LOG(LS_WARNING) << "Incoming RTX packet: Invalid RTP header"; |
| 369 return false; | 372 return false; |
| 370 } | 373 } |
| 371 restored_packet_in_use_ = true; | 374 restored_packet_in_use_ = true; |
| 372 bool ret = OnRecoveredPacket(restored_packet_ptr, packet_length); | 375 bool ret = OnRecoveredPacket(restored_packet_, packet_length); |
| 373 restored_packet_in_use_ = false; | 376 restored_packet_in_use_ = false; |
| 374 return ret; | 377 return ret; |
| 375 } | 378 } |
| 376 return false; | 379 return false; |
| 377 } | 380 } |
| 378 | 381 |
| 379 void ViEReceiver::NotifyReceiverOfFecPacket(const RTPHeader& header) { | 382 void ViEReceiver::NotifyReceiverOfFecPacket(const RTPHeader& header) { |
| 380 int8_t last_media_payload_type = | 383 int8_t last_media_payload_type = |
| 381 rtp_payload_registry_->last_received_media_payload_type(); | 384 rtp_payload_registry_->last_received_media_payload_type(); |
| 382 if (last_media_payload_type < 0) { | 385 if (last_media_payload_type < 0) { |
| (...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 470 rtp_receive_statistics_->GetStatistician(header.ssrc); | 473 rtp_receive_statistics_->GetStatistician(header.ssrc); |
| 471 if (!statistician) | 474 if (!statistician) |
| 472 return false; | 475 return false; |
| 473 // Check if this is a retransmission. | 476 // Check if this is a retransmission. |
| 474 int64_t min_rtt = 0; | 477 int64_t min_rtt = 0; |
| 475 rtp_rtcp_->RTT(rtp_receiver_->SSRC(), NULL, NULL, &min_rtt, NULL); | 478 rtp_rtcp_->RTT(rtp_receiver_->SSRC(), NULL, NULL, &min_rtt, NULL); |
| 476 return !in_order && | 479 return !in_order && |
| 477 statistician->IsRetransmitOfOldPacket(header, min_rtt); | 480 statistician->IsRetransmitOfOldPacket(header, min_rtt); |
| 478 } | 481 } |
| 479 } // namespace webrtc | 482 } // namespace webrtc |
| OLD | NEW |