Chromium Code Reviews| 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 13 matching lines...) Expand all Loading... | |
| 24 #ifdef _WIN32 | 24 #ifdef _WIN32 |
| 25 // Disable warning C4355: 'this' : used in base member initializer list. | 25 // Disable warning C4355: 'this' : used in base member initializer list. |
| 26 #pragma warning(disable : 4355) | 26 #pragma warning(disable : 4355) |
| 27 #endif | 27 #endif |
| 28 | 28 |
| 29 namespace webrtc { | 29 namespace webrtc { |
| 30 namespace { | 30 namespace { |
| 31 const int64_t kRtpRtcpMaxIdleTimeProcessMs = 5; | 31 const int64_t kRtpRtcpMaxIdleTimeProcessMs = 5; |
| 32 const int64_t kRtpRtcpRttProcessTimeMs = 1000; | 32 const int64_t kRtpRtcpRttProcessTimeMs = 1000; |
| 33 const int64_t kRtpRtcpBitrateProcessTimeMs = 10; | 33 const int64_t kRtpRtcpBitrateProcessTimeMs = 10; |
| 34 const int64_t kDefaultExpectedRetransmissionTimeMs = 125; | |
| 34 } // namespace | 35 } // namespace |
| 35 | 36 |
| 36 RTPExtensionType StringToRtpExtensionType(const std::string& extension) { | 37 RTPExtensionType StringToRtpExtensionType(const std::string& extension) { |
| 37 if (extension == RtpExtension::kTimestampOffsetUri) | 38 if (extension == RtpExtension::kTimestampOffsetUri) |
| 38 return kRtpExtensionTransmissionTimeOffset; | 39 return kRtpExtensionTransmissionTimeOffset; |
| 39 if (extension == RtpExtension::kAudioLevelUri) | 40 if (extension == RtpExtension::kAudioLevelUri) |
| 40 return kRtpExtensionAudioLevel; | 41 return kRtpExtensionAudioLevel; |
| 41 if (extension == RtpExtension::kAbsSendTimeUri) | 42 if (extension == RtpExtension::kAbsSendTimeUri) |
| 42 return kRtpExtensionAbsoluteSendTime; | 43 return kRtpExtensionAbsoluteSendTime; |
| 43 if (extension == RtpExtension::kVideoRotationUri) | 44 if (extension == RtpExtension::kVideoRotationUri) |
| (...skipping 379 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 423 const uint8_t* payload_data, | 424 const uint8_t* payload_data, |
| 424 size_t payload_size, | 425 size_t payload_size, |
| 425 const RTPFragmentationHeader* fragmentation, | 426 const RTPFragmentationHeader* fragmentation, |
| 426 const RTPVideoHeader* rtp_video_header, | 427 const RTPVideoHeader* rtp_video_header, |
| 427 uint32_t* transport_frame_id_out) { | 428 uint32_t* transport_frame_id_out) { |
| 428 rtcp_sender_.SetLastRtpTime(time_stamp, capture_time_ms); | 429 rtcp_sender_.SetLastRtpTime(time_stamp, capture_time_ms); |
| 429 // Make sure an RTCP report isn't queued behind a key frame. | 430 // Make sure an RTCP report isn't queued behind a key frame. |
| 430 if (rtcp_sender_.TimeToSendRTCPReport(kVideoFrameKey == frame_type)) { | 431 if (rtcp_sender_.TimeToSendRTCPReport(kVideoFrameKey == frame_type)) { |
| 431 rtcp_sender_.SendRTCP(GetFeedbackState(), kRtcpReport); | 432 rtcp_sender_.SendRTCP(GetFeedbackState(), kRtcpReport); |
| 432 } | 433 } |
| 434 int64_t expected_retransmission_time_ms = rtt_ms(); | |
| 435 if (expected_retransmission_time_ms == 0) { | |
| 436 if (rtcp_receiver_.RTT(rtcp_receiver_.RemoteSSRC(), nullptr, | |
| 437 &expected_retransmission_time_ms, nullptr, | |
|
danilchap
2017/08/30 13:52:29
can add comment which of many rtts you are taking
sprang_webrtc
2017/08/31 15:54:28
Done.
| |
| 438 nullptr) == -1) { | |
| 439 expected_retransmission_time_ms = kDefaultExpectedRetransmissionTimeMs; | |
| 440 } | |
| 441 } | |
| 433 return rtp_sender_->SendOutgoingData( | 442 return rtp_sender_->SendOutgoingData( |
| 434 frame_type, payload_type, time_stamp, capture_time_ms, payload_data, | 443 frame_type, payload_type, time_stamp, capture_time_ms, payload_data, |
| 435 payload_size, fragmentation, rtp_video_header, transport_frame_id_out); | 444 payload_size, fragmentation, rtp_video_header, transport_frame_id_out, |
| 445 expected_retransmission_time_ms); | |
| 436 } | 446 } |
| 437 | 447 |
| 438 bool ModuleRtpRtcpImpl::TimeToSendPacket(uint32_t ssrc, | 448 bool ModuleRtpRtcpImpl::TimeToSendPacket(uint32_t ssrc, |
| 439 uint16_t sequence_number, | 449 uint16_t sequence_number, |
| 440 int64_t capture_time_ms, | 450 int64_t capture_time_ms, |
| 441 bool retransmission, | 451 bool retransmission, |
| 442 const PacedPacketInfo& pacing_info) { | 452 const PacedPacketInfo& pacing_info) { |
| 443 return rtp_sender_->TimeToSendPacket(ssrc, sequence_number, capture_time_ms, | 453 return rtp_sender_->TimeToSendPacket(ssrc, sequence_number, capture_time_ms, |
| 444 retransmission, pacing_info); | 454 retransmission, pacing_info); |
| 445 } | 455 } |
| (...skipping 465 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 911 StreamDataCountersCallback* | 921 StreamDataCountersCallback* |
| 912 ModuleRtpRtcpImpl::GetSendChannelRtpStatisticsCallback() const { | 922 ModuleRtpRtcpImpl::GetSendChannelRtpStatisticsCallback() const { |
| 913 return rtp_sender_->GetRtpStatisticsCallback(); | 923 return rtp_sender_->GetRtpStatisticsCallback(); |
| 914 } | 924 } |
| 915 | 925 |
| 916 void ModuleRtpRtcpImpl::SetVideoBitrateAllocation( | 926 void ModuleRtpRtcpImpl::SetVideoBitrateAllocation( |
| 917 const BitrateAllocation& bitrate) { | 927 const BitrateAllocation& bitrate) { |
| 918 rtcp_sender_.SetVideoBitrateAllocation(bitrate); | 928 rtcp_sender_.SetVideoBitrateAllocation(bitrate); |
| 919 } | 929 } |
| 920 } // namespace webrtc | 930 } // namespace webrtc |
| OLD | NEW |