| 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 295 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 306 &payload_specific)) { | 306 &payload_specific)) { |
| 307 LOG(LS_WARNING) << "Failed to get payload specifics."; | 307 LOG(LS_WARNING) << "Failed to get payload specifics."; |
| 308 return; | 308 return; |
| 309 } | 309 } |
| 310 rtp_header.type.Video.codec = payload_specific.Video.videoCodecType; | 310 rtp_header.type.Video.codec = payload_specific.Video.videoCodecType; |
| 311 rtp_header.type.Video.rotation = kVideoRotation_0; | 311 rtp_header.type.Video.rotation = kVideoRotation_0; |
| 312 if (header.extension.hasVideoRotation) { | 312 if (header.extension.hasVideoRotation) { |
| 313 rtp_header.type.Video.rotation = | 313 rtp_header.type.Video.rotation = |
| 314 ConvertCVOByteToVideoRotation(header.extension.videoRotation); | 314 ConvertCVOByteToVideoRotation(header.extension.videoRotation); |
| 315 } | 315 } |
| 316 OnReceivedPayloadData(NULL, 0, &rtp_header); | 316 OnReceivedPayloadData(nullptr, 0, &rtp_header); |
| 317 } | 317 } |
| 318 | 318 |
| 319 bool ViEReceiver::DeliverRtcp(const uint8_t* rtcp_packet, | 319 bool ViEReceiver::DeliverRtcp(const uint8_t* rtcp_packet, |
| 320 size_t rtcp_packet_length) { | 320 size_t rtcp_packet_length) { |
| 321 // Should be set by owner at construction time. | 321 // Should be set by owner at construction time. |
| 322 RTC_DCHECK(!rtp_rtcp_.empty()); | 322 RTC_DCHECK(!rtp_rtcp_.empty()); |
| 323 { | 323 { |
| 324 rtc::CritScope lock(&receive_cs_); | 324 rtc::CritScope lock(&receive_cs_); |
| 325 if (!receiving_) { | 325 if (!receiving_) { |
| 326 return false; | 326 return false; |
| 327 } | 327 } |
| 328 } | 328 } |
| 329 | 329 |
| 330 for (RtpRtcp* rtp_rtcp : rtp_rtcp_) | 330 for (RtpRtcp* rtp_rtcp : rtp_rtcp_) |
| 331 rtp_rtcp->IncomingRtcpPacket(rtcp_packet, rtcp_packet_length); | 331 rtp_rtcp->IncomingRtcpPacket(rtcp_packet, rtcp_packet_length); |
| 332 | 332 |
| 333 int64_t rtt = 0; | 333 int64_t rtt = 0; |
| 334 rtp_rtcp_[0]->RTT(rtp_receiver_->SSRC(), &rtt, NULL, NULL, NULL); | 334 rtp_rtcp_[0]->RTT(rtp_receiver_->SSRC(), &rtt, nullptr, nullptr, nullptr); |
| 335 if (rtt == 0) { | 335 if (rtt == 0) { |
| 336 // Waiting for valid rtt. | 336 // Waiting for valid rtt. |
| 337 return true; | 337 return true; |
| 338 } | 338 } |
| 339 uint32_t ntp_secs = 0; | 339 uint32_t ntp_secs = 0; |
| 340 uint32_t ntp_frac = 0; | 340 uint32_t ntp_frac = 0; |
| 341 uint32_t rtp_timestamp = 0; | 341 uint32_t rtp_timestamp = 0; |
| 342 if (rtp_rtcp_[0]->RemoteNTP(&ntp_secs, &ntp_frac, NULL, NULL, | 342 if (rtp_rtcp_[0]->RemoteNTP(&ntp_secs, &ntp_frac, nullptr, nullptr, |
| 343 &rtp_timestamp) != 0) { | 343 &rtp_timestamp) != 0) { |
| 344 // Waiting for RTCP. | 344 // Waiting for RTCP. |
| 345 return true; | 345 return true; |
| 346 } | 346 } |
| 347 ntp_estimator_.UpdateRtcpTimestamp(rtt, ntp_secs, ntp_frac, rtp_timestamp); | 347 ntp_estimator_.UpdateRtcpTimestamp(rtt, ntp_secs, ntp_frac, rtp_timestamp); |
| 348 | 348 |
| 349 return true; | 349 return true; |
| 350 } | 350 } |
| 351 | 351 |
| 352 void ViEReceiver::StartReceive() { | 352 void ViEReceiver::StartReceive() { |
| (...skipping 22 matching lines...) Expand all Loading... |
| 375 bool in_order) const { | 375 bool in_order) const { |
| 376 // Retransmissions are handled separately if RTX is enabled. | 376 // Retransmissions are handled separately if RTX is enabled. |
| 377 if (rtp_payload_registry_.RtxEnabled()) | 377 if (rtp_payload_registry_.RtxEnabled()) |
| 378 return false; | 378 return false; |
| 379 StreamStatistician* statistician = | 379 StreamStatistician* statistician = |
| 380 rtp_receive_statistics_->GetStatistician(header.ssrc); | 380 rtp_receive_statistics_->GetStatistician(header.ssrc); |
| 381 if (!statistician) | 381 if (!statistician) |
| 382 return false; | 382 return false; |
| 383 // Check if this is a retransmission. | 383 // Check if this is a retransmission. |
| 384 int64_t min_rtt = 0; | 384 int64_t min_rtt = 0; |
| 385 rtp_rtcp_[0]->RTT(rtp_receiver_->SSRC(), NULL, NULL, &min_rtt, NULL); | 385 rtp_rtcp_[0]->RTT(rtp_receiver_->SSRC(), nullptr, nullptr, &min_rtt, nullptr); |
| 386 return !in_order && | 386 return !in_order && |
| 387 statistician->IsRetransmitOfOldPacket(header, min_rtt); | 387 statistician->IsRetransmitOfOldPacket(header, min_rtt); |
| 388 } | 388 } |
| 389 } // namespace webrtc | 389 } // namespace webrtc |
| OLD | NEW |