Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(250)

Side by Side Diff: webrtc/video/rtp_stream_receiver.cc

Issue 2789843002: Delete VieRemb class, move functionality to PacketRouter. (Closed)
Patch Set: Delete obsolete suppression for PacketRouterTest.SendTransportFeedback. Created 3 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « webrtc/video/rtp_stream_receiver.h ('k') | webrtc/video/rtp_stream_receiver_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
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) {
134 rtp_rtcp_->SetREMBStatus(true);
135 remb_->AddReceiveChannel(rtp_rtcp_.get());
136 }
137 130
138 for (size_t i = 0; i < config_.rtp.extensions.size(); ++i) { 131 for (size_t i = 0; i < config_.rtp.extensions.size(); ++i) {
139 EnableReceiveRtpHeaderExtension(config_.rtp.extensions[i].uri, 132 EnableReceiveRtpHeaderExtension(config_.rtp.extensions[i].uri,
140 config_.rtp.extensions[i].id); 133 config_.rtp.extensions[i].id);
141 } 134 }
142 135
143 static const int kMaxPacketAgeToNack = 450; 136 static const int kMaxPacketAgeToNack = 450;
144 const int max_reordering_threshold = (config_.rtp.nack.rtp_history_ms > 0) 137 const int max_reordering_threshold = (config_.rtp.nack.rtp_history_ms > 0)
145 ? kMaxPacketAgeToNack 138 ? kMaxPacketAgeToNack
146 : kDefaultMaxReorderingThreshold; 139 : kDefaultMaxReorderingThreshold;
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after
196 } 189 }
197 190
198 RtpStreamReceiver::~RtpStreamReceiver() { 191 RtpStreamReceiver::~RtpStreamReceiver() {
199 if (nack_module_) { 192 if (nack_module_) {
200 process_thread_->DeRegisterModule(nack_module_.get()); 193 process_thread_->DeRegisterModule(nack_module_.get());
201 } 194 }
202 195
203 process_thread_->DeRegisterModule(rtp_rtcp_.get()); 196 process_thread_->DeRegisterModule(rtp_rtcp_.get());
204 197
205 packet_router_->RemoveReceiveRtpModule(rtp_rtcp_.get()); 198 packet_router_->RemoveReceiveRtpModule(rtp_rtcp_.get());
206 rtp_rtcp_->SetREMBStatus(false);
207 if (config_.rtp.remb) {
208 remb_->RemoveReceiveChannel(rtp_rtcp_.get());
209 }
210 UpdateHistograms(); 199 UpdateHistograms();
211 } 200 }
212 201
213 bool RtpStreamReceiver::AddReceiveCodec( 202 bool RtpStreamReceiver::AddReceiveCodec(
214 const VideoCodec& video_codec, 203 const VideoCodec& video_codec,
215 const std::map<std::string, std::string>& codec_params) { 204 const std::map<std::string, std::string>& codec_params) {
216 pt_codec_params_.insert(make_pair(video_codec.plType, codec_params)); 205 pt_codec_params_.insert(make_pair(video_codec.plType, codec_params));
217 return AddReceiveCodec(video_codec); 206 return AddReceiveCodec(video_codec);
218 } 207 }
219 208
(...skipping 436 matching lines...) Expand 10 before | Expand all | Expand 10 after
656 return; 645 return;
657 646
658 if (!sprop_decoder.DecodeSprop(sprop_base64_it->second.c_str())) 647 if (!sprop_decoder.DecodeSprop(sprop_base64_it->second.c_str()))
659 return; 648 return;
660 649
661 tracker_.InsertSpsPpsNalus(sprop_decoder.sps_nalu(), 650 tracker_.InsertSpsPpsNalus(sprop_decoder.sps_nalu(),
662 sprop_decoder.pps_nalu()); 651 sprop_decoder.pps_nalu());
663 } 652 }
664 653
665 } // namespace webrtc 654 } // namespace webrtc
OLDNEW
« no previous file with comments | « webrtc/video/rtp_stream_receiver.h ('k') | webrtc/video/rtp_stream_receiver_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698