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 20 matching lines...) Expand all Loading... | |
| 31 #include "webrtc/modules/rtp_rtcp/source/rtp_packet_received.h" | 31 #include "webrtc/modules/rtp_rtcp/source/rtp_packet_received.h" |
| 32 #include "webrtc/modules/video_coding/frame_object.h" | 32 #include "webrtc/modules/video_coding/frame_object.h" |
| 33 #include "webrtc/modules/video_coding/h264_sprop_parameter_sets.h" | 33 #include "webrtc/modules/video_coding/h264_sprop_parameter_sets.h" |
| 34 #include "webrtc/modules/video_coding/h264_sps_pps_tracker.h" | 34 #include "webrtc/modules/video_coding/h264_sps_pps_tracker.h" |
| 35 #include "webrtc/modules/video_coding/packet_buffer.h" | 35 #include "webrtc/modules/video_coding/packet_buffer.h" |
| 36 #include "webrtc/modules/video_coding/video_coding_impl.h" | 36 #include "webrtc/modules/video_coding/video_coding_impl.h" |
| 37 #include "webrtc/system_wrappers/include/field_trial.h" | 37 #include "webrtc/system_wrappers/include/field_trial.h" |
| 38 #include "webrtc/system_wrappers/include/metrics.h" | 38 #include "webrtc/system_wrappers/include/metrics.h" |
| 39 #include "webrtc/system_wrappers/include/timestamp_extrapolator.h" | 39 #include "webrtc/system_wrappers/include/timestamp_extrapolator.h" |
| 40 #include "webrtc/video/receive_statistics_proxy.h" | 40 #include "webrtc/video/receive_statistics_proxy.h" |
| 41 #include "webrtc/video/vie_remb.h" | |
| 42 | 41 |
| 43 namespace webrtc { | 42 namespace webrtc { |
| 44 | 43 |
| 45 namespace { | 44 namespace { |
| 46 constexpr int kPacketBufferStartSize = 32; | 45 constexpr int kPacketBufferStartSize = 32; |
| 47 constexpr int kPacketBufferMaxSixe = 2048; | 46 constexpr int kPacketBufferMaxSixe = 2048; |
| 48 } | 47 } |
| 49 | 48 |
| 50 std::unique_ptr<RtpRtcp> CreateRtpRtcpModule( | 49 std::unique_ptr<RtpRtcp> CreateRtpRtcpModule( |
| 51 ReceiveStatistics* receive_statistics, | 50 ReceiveStatistics* receive_statistics, |
| (...skipping 24 matching lines...) Expand all Loading... | |
| 76 | 75 |
| 77 return rtp_rtcp; | 76 return rtp_rtcp; |
| 78 } | 77 } |
| 79 | 78 |
| 80 static const int kPacketLogIntervalMs = 10000; | 79 static const int kPacketLogIntervalMs = 10000; |
| 81 | 80 |
| 82 RtpStreamReceiver::RtpStreamReceiver( | 81 RtpStreamReceiver::RtpStreamReceiver( |
| 83 Transport* transport, | 82 Transport* transport, |
| 84 RtcpRttStats* rtt_stats, | 83 RtcpRttStats* rtt_stats, |
| 85 PacketRouter* packet_router, | 84 PacketRouter* packet_router, |
| 86 VieRemb* remb, | |
| 87 const VideoReceiveStream::Config* config, | 85 const VideoReceiveStream::Config* config, |
| 88 ReceiveStatisticsProxy* receive_stats_proxy, | 86 ReceiveStatisticsProxy* receive_stats_proxy, |
| 89 ProcessThread* process_thread, | 87 ProcessThread* process_thread, |
| 90 NackSender* nack_sender, | 88 NackSender* nack_sender, |
| 91 KeyFrameRequestSender* keyframe_request_sender, | 89 KeyFrameRequestSender* keyframe_request_sender, |
| 92 video_coding::OnCompleteFrameCallback* complete_frame_callback, | 90 video_coding::OnCompleteFrameCallback* complete_frame_callback, |
| 93 VCMTiming* timing) | 91 VCMTiming* timing) |
| 94 : clock_(Clock::GetRealTimeClock()), | 92 : clock_(Clock::GetRealTimeClock()), |
| 95 config_(*config), | 93 config_(*config), |
| 96 packet_router_(packet_router), | 94 packet_router_(packet_router), |
| 97 remb_(remb), | |
| 98 process_thread_(process_thread), | 95 process_thread_(process_thread), |
| 99 ntp_estimator_(clock_), | 96 ntp_estimator_(clock_), |
| 100 rtp_header_parser_(RtpHeaderParser::Create()), | 97 rtp_header_parser_(RtpHeaderParser::Create()), |
| 101 rtp_receiver_(RtpReceiver::CreateVideoReceiver(clock_, | 98 rtp_receiver_(RtpReceiver::CreateVideoReceiver(clock_, |
| 102 this, | 99 this, |
| 103 this, | 100 this, |
| 104 &rtp_payload_registry_)), | 101 &rtp_payload_registry_)), |
| 105 rtp_receive_statistics_(ReceiveStatistics::Create(clock_)), | 102 rtp_receive_statistics_(ReceiveStatistics::Create(clock_)), |
| 106 ulpfec_receiver_(UlpfecReceiver::Create(this)), | 103 ulpfec_receiver_(UlpfecReceiver::Create(this)), |
| 107 receiving_(false), | 104 receiving_(false), |
| (...skipping 15 matching lines...) Expand all Loading... | |
| 123 << "A stream should not be configured with RTCP disabled. This value is " | 120 << "A stream should not be configured with RTCP disabled. This value is " |
| 124 "reserved for internal usage."; | 121 "reserved for internal usage."; |
| 125 RTC_DCHECK(config_.rtp.remote_ssrc != 0); | 122 RTC_DCHECK(config_.rtp.remote_ssrc != 0); |
| 126 // 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? |
| 127 RTC_DCHECK(config_.rtp.local_ssrc != 0); | 124 RTC_DCHECK(config_.rtp.local_ssrc != 0); |
| 128 RTC_DCHECK(config_.rtp.remote_ssrc != config_.rtp.local_ssrc); | 125 RTC_DCHECK(config_.rtp.remote_ssrc != config_.rtp.local_ssrc); |
| 129 | 126 |
| 130 rtp_rtcp_->SetRTCPStatus(config_.rtp.rtcp_mode); | 127 rtp_rtcp_->SetRTCPStatus(config_.rtp.rtcp_mode); |
| 131 rtp_rtcp_->SetSSRC(config_.rtp.local_ssrc); | 128 rtp_rtcp_->SetSSRC(config_.rtp.local_ssrc); |
| 132 rtp_rtcp_->SetKeyFrameRequestMethod(kKeyFrameReqPliRtcp); | 129 rtp_rtcp_->SetKeyFrameRequestMethod(kKeyFrameReqPliRtcp); |
| 133 if (config_.rtp.remb) { | 130 if (config_.rtp.remb) { |
|
nisse-webrtc
2017/04/04 12:31:46
Can I delete the config_.rtp.remb flag? Not sure h
danilchap
2017/04/07 07:37:40
Since you now control remb in PacketRouter, this f
nisse-webrtc
2017/04/07 08:21:44
I'll try deleting it then, we can add configurabil
nisse-webrtc
2017/04/07 08:32:18
What about this HasRemb method?
https://cs.chromi
nisse-webrtc
2017/04/07 09:14:31
I'll leave the code setting config.rtp.remb for no
| |
| 134 rtp_rtcp_->SetREMBStatus(true); | 131 rtp_rtcp_->SetREMBStatus(true); |
| 135 remb_->AddReceiveChannel(rtp_rtcp_.get()); | |
| 136 } | 132 } |
| 137 | 133 |
| 138 for (size_t i = 0; i < config_.rtp.extensions.size(); ++i) { | 134 for (size_t i = 0; i < config_.rtp.extensions.size(); ++i) { |
| 139 EnableReceiveRtpHeaderExtension(config_.rtp.extensions[i].uri, | 135 EnableReceiveRtpHeaderExtension(config_.rtp.extensions[i].uri, |
| 140 config_.rtp.extensions[i].id); | 136 config_.rtp.extensions[i].id); |
| 141 } | 137 } |
| 142 | 138 |
| 143 static const int kMaxPacketAgeToNack = 450; | 139 static const int kMaxPacketAgeToNack = 450; |
| 144 const int max_reordering_threshold = (config_.rtp.nack.rtp_history_ms > 0) | 140 const int max_reordering_threshold = (config_.rtp.nack.rtp_history_ms > 0) |
| 145 ? kMaxPacketAgeToNack | 141 ? kMaxPacketAgeToNack |
| (...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 197 | 193 |
| 198 RtpStreamReceiver::~RtpStreamReceiver() { | 194 RtpStreamReceiver::~RtpStreamReceiver() { |
| 199 if (nack_module_) { | 195 if (nack_module_) { |
| 200 process_thread_->DeRegisterModule(nack_module_.get()); | 196 process_thread_->DeRegisterModule(nack_module_.get()); |
| 201 } | 197 } |
| 202 | 198 |
| 203 process_thread_->DeRegisterModule(rtp_rtcp_.get()); | 199 process_thread_->DeRegisterModule(rtp_rtcp_.get()); |
| 204 | 200 |
| 205 packet_router_->RemoveReceiveRtpModule(rtp_rtcp_.get()); | 201 packet_router_->RemoveReceiveRtpModule(rtp_rtcp_.get()); |
| 206 rtp_rtcp_->SetREMBStatus(false); | 202 rtp_rtcp_->SetREMBStatus(false); |
| 207 if (config_.rtp.remb) { | |
| 208 remb_->RemoveReceiveChannel(rtp_rtcp_.get()); | |
| 209 } | |
| 210 UpdateHistograms(); | 203 UpdateHistograms(); |
| 211 } | 204 } |
| 212 | 205 |
| 213 bool RtpStreamReceiver::AddReceiveCodec( | 206 bool RtpStreamReceiver::AddReceiveCodec( |
| 214 const VideoCodec& video_codec, | 207 const VideoCodec& video_codec, |
| 215 const std::map<std::string, std::string>& codec_params) { | 208 const std::map<std::string, std::string>& codec_params) { |
| 216 pt_codec_params_.insert(make_pair(video_codec.plType, codec_params)); | 209 pt_codec_params_.insert(make_pair(video_codec.plType, codec_params)); |
| 217 return AddReceiveCodec(video_codec); | 210 return AddReceiveCodec(video_codec); |
| 218 } | 211 } |
| 219 | 212 |
| (...skipping 436 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 656 return; | 649 return; |
| 657 | 650 |
| 658 if (!sprop_decoder.DecodeSprop(sprop_base64_it->second.c_str())) | 651 if (!sprop_decoder.DecodeSprop(sprop_base64_it->second.c_str())) |
| 659 return; | 652 return; |
| 660 | 653 |
| 661 tracker_.InsertSpsPpsNalus(sprop_decoder.sps_nalu(), | 654 tracker_.InsertSpsPpsNalus(sprop_decoder.sps_nalu(), |
| 662 sprop_decoder.pps_nalu()); | 655 sprop_decoder.pps_nalu()); |
| 663 } | 656 } |
| 664 | 657 |
| 665 } // namespace webrtc | 658 } // namespace webrtc |
| OLD | NEW |