| 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 138 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 149 void ViEReceiver::RegisterRtpRtcpModules( | 149 void ViEReceiver::RegisterRtpRtcpModules( |
| 150 const std::vector<RtpRtcp*>& rtp_modules) { | 150 const std::vector<RtpRtcp*>& rtp_modules) { |
| 151 rtc::CritScope lock(&receive_cs_); | 151 rtc::CritScope lock(&receive_cs_); |
| 152 // Only change the "simulcast" modules, the base module can be accessed | 152 // Only change the "simulcast" modules, the base module can be accessed |
| 153 // without a lock whereas the simulcast modules require locking as they can be | 153 // without a lock whereas the simulcast modules require locking as they can be |
| 154 // changed in runtime. | 154 // changed in runtime. |
| 155 rtp_rtcp_simulcast_ = | 155 rtp_rtcp_simulcast_ = |
| 156 std::vector<RtpRtcp*>(rtp_modules.begin() + 1, rtp_modules.end()); | 156 std::vector<RtpRtcp*>(rtp_modules.begin() + 1, rtp_modules.end()); |
| 157 } | 157 } |
| 158 | 158 |
| 159 bool ViEReceiver::SetReceiveTimestampOffsetStatus(bool enable, int id) { | 159 bool ViEReceiver::SetReceiveTimestampOffsetStatus(int id) { |
| 160 if (enable) { | 160 return rtp_header_parser_->RegisterRtpHeaderExtension( |
| 161 return rtp_header_parser_->RegisterRtpHeaderExtension( | 161 kRtpExtensionTransmissionTimeOffset, id); |
| 162 kRtpExtensionTransmissionTimeOffset, id); | 162 } |
| 163 |
| 164 bool ViEReceiver::SetReceiveAbsoluteSendTimeStatus(int id) { |
| 165 if (rtp_header_parser_->RegisterRtpHeaderExtension( |
| 166 kRtpExtensionAbsoluteSendTime, id)) { |
| 167 receiving_ast_enabled_ = true; |
| 168 return true; |
| 163 } else { | 169 } else { |
| 164 return rtp_header_parser_->DeregisterRtpHeaderExtension( | 170 return false; |
| 165 kRtpExtensionTransmissionTimeOffset); | |
| 166 } | 171 } |
| 167 } | 172 } |
| 168 | 173 |
| 169 bool ViEReceiver::SetReceiveAbsoluteSendTimeStatus(bool enable, int id) { | 174 bool ViEReceiver::SetReceiveVideoRotationStatus(int id) { |
| 170 if (enable) { | 175 if (rtp_header_parser_->RegisterRtpHeaderExtension( |
| 171 if (rtp_header_parser_->RegisterRtpHeaderExtension( | 176 kRtpExtensionVideoRotation, id)) { |
| 172 kRtpExtensionAbsoluteSendTime, id)) { | 177 receiving_cvo_enabled_ = true; |
| 173 receiving_ast_enabled_ = true; | 178 return true; |
| 174 return true; | |
| 175 } else { | |
| 176 return false; | |
| 177 } | |
| 178 } else { | 179 } else { |
| 179 receiving_ast_enabled_ = false; | 180 return false; |
| 180 return rtp_header_parser_->DeregisterRtpHeaderExtension( | |
| 181 kRtpExtensionAbsoluteSendTime); | |
| 182 } | 181 } |
| 183 } | 182 } |
| 184 | 183 |
| 185 bool ViEReceiver::SetReceiveVideoRotationStatus(bool enable, int id) { | 184 bool ViEReceiver::SetReceiveTransportSequenceNumber(int id) { |
| 186 if (enable) { | 185 if (rtp_header_parser_->RegisterRtpHeaderExtension( |
| 187 if (rtp_header_parser_->RegisterRtpHeaderExtension( | 186 kRtpExtensionTransportSequenceNumber, id)) { |
| 188 kRtpExtensionVideoRotation, id)) { | 187 receiving_tsn_enabled_ = true; |
| 189 receiving_cvo_enabled_ = true; | 188 return true; |
| 190 return true; | |
| 191 } else { | |
| 192 return false; | |
| 193 } | |
| 194 } else { | 189 } else { |
| 195 receiving_cvo_enabled_ = false; | 190 return false; |
| 196 return rtp_header_parser_->DeregisterRtpHeaderExtension( | |
| 197 kRtpExtensionVideoRotation); | |
| 198 } | 191 } |
| 199 } | 192 } |
| 200 | 193 |
| 201 bool ViEReceiver::SetReceiveTransportSequenceNumber(bool enable, int id) { | |
| 202 if (enable) { | |
| 203 if (rtp_header_parser_->RegisterRtpHeaderExtension( | |
| 204 kRtpExtensionTransportSequenceNumber, id)) { | |
| 205 receiving_tsn_enabled_ = true; | |
| 206 return true; | |
| 207 } else { | |
| 208 return false; | |
| 209 } | |
| 210 } else { | |
| 211 receiving_tsn_enabled_ = false; | |
| 212 return rtp_header_parser_->DeregisterRtpHeaderExtension( | |
| 213 kRtpExtensionTransportSequenceNumber); | |
| 214 } | |
| 215 } | |
| 216 | |
| 217 int32_t ViEReceiver::OnReceivedPayloadData(const uint8_t* payload_data, | 194 int32_t ViEReceiver::OnReceivedPayloadData(const uint8_t* payload_data, |
| 218 const size_t payload_size, | 195 const size_t payload_size, |
| 219 const WebRtcRTPHeader* rtp_header) { | 196 const WebRtcRTPHeader* rtp_header) { |
| 220 RTC_DCHECK(vcm_); | 197 RTC_DCHECK(vcm_); |
| 221 WebRtcRTPHeader rtp_header_with_ntp = *rtp_header; | 198 WebRtcRTPHeader rtp_header_with_ntp = *rtp_header; |
| 222 rtp_header_with_ntp.ntp_time_ms = | 199 rtp_header_with_ntp.ntp_time_ms = |
| 223 ntp_estimator_->Estimate(rtp_header->header.timestamp); | 200 ntp_estimator_->Estimate(rtp_header->header.timestamp); |
| 224 if (vcm_->IncomingPacket(payload_data, | 201 if (vcm_->IncomingPacket(payload_data, |
| 225 payload_size, | 202 payload_size, |
| 226 rtp_header_with_ntp) != 0) { | 203 rtp_header_with_ntp) != 0) { |
| (...skipping 231 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 458 rtp_receive_statistics_->GetStatistician(header.ssrc); | 435 rtp_receive_statistics_->GetStatistician(header.ssrc); |
| 459 if (!statistician) | 436 if (!statistician) |
| 460 return false; | 437 return false; |
| 461 // Check if this is a retransmission. | 438 // Check if this is a retransmission. |
| 462 int64_t min_rtt = 0; | 439 int64_t min_rtt = 0; |
| 463 rtp_rtcp_->RTT(rtp_receiver_->SSRC(), NULL, NULL, &min_rtt, NULL); | 440 rtp_rtcp_->RTT(rtp_receiver_->SSRC(), NULL, NULL, &min_rtt, NULL); |
| 464 return !in_order && | 441 return !in_order && |
| 465 statistician->IsRetransmitOfOldPacket(header, min_rtt); | 442 statistician->IsRetransmitOfOldPacket(header, min_rtt); |
| 466 } | 443 } |
| 467 } // namespace webrtc | 444 } // namespace webrtc |
| OLD | NEW |