| 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 110 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 121 "reserved for internal usage."; | 121 "reserved for internal usage."; |
| 122 RTC_DCHECK(config_.rtp.remote_ssrc != 0); | 122 RTC_DCHECK(config_.rtp.remote_ssrc != 0); |
| 123 // TODO(pbos): What's an appropriate local_ssrc for receive-only streams? | 123 // TODO(pbos): What's an appropriate local_ssrc for receive-only streams? |
| 124 RTC_DCHECK(config_.rtp.local_ssrc != 0); | 124 RTC_DCHECK(config_.rtp.local_ssrc != 0); |
| 125 RTC_DCHECK(config_.rtp.remote_ssrc != config_.rtp.local_ssrc); | 125 RTC_DCHECK(config_.rtp.remote_ssrc != config_.rtp.local_ssrc); |
| 126 | 126 |
| 127 rtp_rtcp_->SetRTCPStatus(config_.rtp.rtcp_mode); | 127 rtp_rtcp_->SetRTCPStatus(config_.rtp.rtcp_mode); |
| 128 rtp_rtcp_->SetSSRC(config_.rtp.local_ssrc); | 128 rtp_rtcp_->SetSSRC(config_.rtp.local_ssrc); |
| 129 rtp_rtcp_->SetKeyFrameRequestMethod(kKeyFrameReqPliRtcp); | 129 rtp_rtcp_->SetKeyFrameRequestMethod(kKeyFrameReqPliRtcp); |
| 130 | 130 |
| 131 #if 0 |
| 131 for (size_t i = 0; i < config_.rtp.extensions.size(); ++i) { | 132 for (size_t i = 0; i < config_.rtp.extensions.size(); ++i) { |
| 132 EnableReceiveRtpHeaderExtension(config_.rtp.extensions[i].uri, | 133 EnableReceiveRtpHeaderExtension(config_.rtp.extensions[i].uri, |
| 133 config_.rtp.extensions[i].id); | 134 config_.rtp.extensions[i].id); |
| 134 } | 135 } |
| 135 | 136 #endif |
| 136 static const int kMaxPacketAgeToNack = 450; | 137 static const int kMaxPacketAgeToNack = 450; |
| 137 const int max_reordering_threshold = (config_.rtp.nack.rtp_history_ms > 0) | 138 const int max_reordering_threshold = (config_.rtp.nack.rtp_history_ms > 0) |
| 138 ? kMaxPacketAgeToNack | 139 ? kMaxPacketAgeToNack |
| 139 : kDefaultMaxReorderingThreshold; | 140 : kDefaultMaxReorderingThreshold; |
| 140 rtp_receive_statistics_->SetMaxReorderingThreshold(max_reordering_threshold); | 141 rtp_receive_statistics_->SetMaxReorderingThreshold(max_reordering_threshold); |
| 141 | 142 |
| 142 if (config_.rtp.rtx_ssrc) { | 143 if (config_.rtp.rtx_ssrc) { |
| 143 rtp_payload_registry_.SetRtxSsrc(config_.rtp.rtx_ssrc); | 144 rtp_payload_registry_.SetRtxSsrc(config_.rtp.rtx_ssrc); |
| 144 | 145 |
| 145 for (const auto& kv : config_.rtp.rtx_payload_types) { | 146 for (const auto& kv : config_.rtp.rtx_payload_types) { |
| (...skipping 470 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 616 "WebRTC.Video.ReceivedFecPacketsInPercent", | 617 "WebRTC.Video.ReceivedFecPacketsInPercent", |
| 617 static_cast<int>(counter.num_fec_packets * 100 / counter.num_packets)); | 618 static_cast<int>(counter.num_fec_packets * 100 / counter.num_packets)); |
| 618 } | 619 } |
| 619 if (counter.num_fec_packets > 0) { | 620 if (counter.num_fec_packets > 0) { |
| 620 RTC_HISTOGRAM_PERCENTAGE("WebRTC.Video.RecoveredMediaPacketsInPercentOfFec", | 621 RTC_HISTOGRAM_PERCENTAGE("WebRTC.Video.RecoveredMediaPacketsInPercentOfFec", |
| 621 static_cast<int>(counter.num_recovered_packets * | 622 static_cast<int>(counter.num_recovered_packets * |
| 622 100 / counter.num_fec_packets)); | 623 100 / counter.num_fec_packets)); |
| 623 } | 624 } |
| 624 } | 625 } |
| 625 | 626 |
| 627 #if 0 |
| 626 void RtpStreamReceiver::EnableReceiveRtpHeaderExtension( | 628 void RtpStreamReceiver::EnableReceiveRtpHeaderExtension( |
| 627 const std::string& extension, int id) { | 629 const std::string& extension, int id) { |
| 628 // One-byte-extension local identifiers are in the range 1-14 inclusive. | 630 // One-byte-extension local identifiers are in the range 1-14 inclusive. |
| 629 RTC_DCHECK_GE(id, 1); | 631 RTC_DCHECK_GE(id, 1); |
| 630 RTC_DCHECK_LE(id, 14); | 632 RTC_DCHECK_LE(id, 14); |
| 631 RTC_DCHECK(RtpExtension::IsSupportedForVideo(extension)); | 633 RTC_DCHECK(RtpExtension::IsSupportedForVideo(extension)); |
| 632 RTC_CHECK(rtp_header_parser_->RegisterRtpHeaderExtension( | 634 RTC_CHECK(rtp_header_parser_->RegisterRtpHeaderExtension( |
| 633 StringToRtpExtensionType(extension), id)); | 635 StringToRtpExtensionType(extension), id)); |
| 634 } | 636 } |
| 637 #endif |
| 635 | 638 |
| 636 void RtpStreamReceiver::InsertSpsPpsIntoTracker(uint8_t payload_type) { | 639 void RtpStreamReceiver::InsertSpsPpsIntoTracker(uint8_t payload_type) { |
| 637 auto codec_params_it = pt_codec_params_.find(payload_type); | 640 auto codec_params_it = pt_codec_params_.find(payload_type); |
| 638 if (codec_params_it == pt_codec_params_.end()) | 641 if (codec_params_it == pt_codec_params_.end()) |
| 639 return; | 642 return; |
| 640 | 643 |
| 641 LOG(LS_INFO) << "Found out of band supplied codec parameters for" | 644 LOG(LS_INFO) << "Found out of band supplied codec parameters for" |
| 642 << " payload type: " << static_cast<int>(payload_type); | 645 << " payload type: " << static_cast<int>(payload_type); |
| 643 | 646 |
| 644 H264SpropParameterSets sprop_decoder; | 647 H264SpropParameterSets sprop_decoder; |
| 645 auto sprop_base64_it = | 648 auto sprop_base64_it = |
| 646 codec_params_it->second.find(cricket::kH264FmtpSpropParameterSets); | 649 codec_params_it->second.find(cricket::kH264FmtpSpropParameterSets); |
| 647 | 650 |
| 648 if (sprop_base64_it == codec_params_it->second.end()) | 651 if (sprop_base64_it == codec_params_it->second.end()) |
| 649 return; | 652 return; |
| 650 | 653 |
| 651 if (!sprop_decoder.DecodeSprop(sprop_base64_it->second.c_str())) | 654 if (!sprop_decoder.DecodeSprop(sprop_base64_it->second.c_str())) |
| 652 return; | 655 return; |
| 653 | 656 |
| 654 tracker_.InsertSpsPpsNalus(sprop_decoder.sps_nalu(), | 657 tracker_.InsertSpsPpsNalus(sprop_decoder.sps_nalu(), |
| 655 sprop_decoder.pps_nalu()); | 658 sprop_decoder.pps_nalu()); |
| 656 } | 659 } |
| 657 | 660 |
| 658 } // namespace webrtc | 661 } // namespace webrtc |
| OLD | NEW |