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 134 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
145 module_process_thread_->RegisterModule(vie_receiver_.GetReceiveStatistics()); | 145 module_process_thread_->RegisterModule(vie_receiver_.GetReceiveStatistics()); |
146 | 146 |
147 // RTP/RTCP initialization. | 147 // RTP/RTCP initialization. |
148 module_process_thread_->RegisterModule(rtp_rtcp_modules_[0]); | 148 module_process_thread_->RegisterModule(rtp_rtcp_modules_[0]); |
149 | 149 |
150 rtp_rtcp_modules_[0]->SetKeyFrameRequestMethod(kKeyFrameReqPliRtcp); | 150 rtp_rtcp_modules_[0]->SetKeyFrameRequestMethod(kKeyFrameReqPliRtcp); |
151 if (paced_sender_) { | 151 if (paced_sender_) { |
152 for (RtpRtcp* rtp_rtcp : rtp_rtcp_modules_) | 152 for (RtpRtcp* rtp_rtcp : rtp_rtcp_modules_) |
153 rtp_rtcp->SetStorePacketsStatus(true, nack_history_size_sender_); | 153 rtp_rtcp->SetStorePacketsStatus(true, nack_history_size_sender_); |
154 } | 154 } |
155 packet_router_->AddRtpModule(rtp_rtcp_modules_[0], sender_); | 155 packet_router_->AddRtpModule(rtp_rtcp_modules_[0]); |
156 if (sender_) { | 156 if (sender_) { |
157 send_payload_router_->SetSendingRtpModules( | 157 send_payload_router_->SetSendingRtpModules( |
158 std::vector<RtpRtcp*>(1, rtp_rtcp_modules_[0])); | 158 std::vector<RtpRtcp*>(1, rtp_rtcp_modules_[0])); |
159 RTC_DCHECK(!send_payload_router_->active()); | 159 RTC_DCHECK(!send_payload_router_->active()); |
160 } else { | 160 } else { |
161 if (vcm_->RegisterReceiveCallback(this) != 0) { | 161 if (vcm_->RegisterReceiveCallback(this) != 0) { |
162 return -1; | 162 return -1; |
163 } | 163 } |
164 vcm_->RegisterFrameTypeCallback(this); | 164 vcm_->RegisterFrameTypeCallback(this); |
165 vcm_->RegisterReceiveStatisticsCallback(this); | 165 vcm_->RegisterReceiveStatisticsCallback(this); |
166 vcm_->RegisterDecoderTimingCallback(this); | 166 vcm_->RegisterDecoderTimingCallback(this); |
167 vcm_->SetRenderDelay(kDefaultRenderDelayMs); | 167 vcm_->SetRenderDelay(kDefaultRenderDelayMs); |
168 } | 168 } |
169 return 0; | 169 return 0; |
170 } | 170 } |
171 | 171 |
172 ViEChannel::~ViEChannel() { | 172 ViEChannel::~ViEChannel() { |
173 UpdateHistograms(); | 173 UpdateHistograms(); |
174 // Make sure we don't get more callbacks from the RTP module. | 174 // Make sure we don't get more callbacks from the RTP module. |
175 module_process_thread_->DeRegisterModule( | 175 module_process_thread_->DeRegisterModule( |
176 vie_receiver_.GetReceiveStatistics()); | 176 vie_receiver_.GetReceiveStatistics()); |
177 if (sender_) { | 177 if (sender_) { |
178 send_payload_router_->SetSendingRtpModules(std::vector<RtpRtcp*>()); | 178 send_payload_router_->SetSendingRtpModules(std::vector<RtpRtcp*>()); |
179 } | 179 } |
180 for (size_t i = 0; i < num_active_rtp_rtcp_modules_; ++i) | 180 for (size_t i = 0; i < num_active_rtp_rtcp_modules_; ++i) |
181 packet_router_->RemoveRtpModule(rtp_rtcp_modules_[i], sender_); | 181 packet_router_->RemoveRtpModule(rtp_rtcp_modules_[i]); |
182 for (RtpRtcp* rtp_rtcp : rtp_rtcp_modules_) { | 182 for (RtpRtcp* rtp_rtcp : rtp_rtcp_modules_) { |
183 module_process_thread_->DeRegisterModule(rtp_rtcp); | 183 module_process_thread_->DeRegisterModule(rtp_rtcp); |
184 delete rtp_rtcp; | 184 delete rtp_rtcp; |
185 } | 185 } |
186 } | 186 } |
187 | 187 |
188 void ViEChannel::UpdateHistograms() { | 188 void ViEChannel::UpdateHistograms() { |
189 int64_t now = Clock::GetRealTimeClock()->TimeInMilliseconds(); | 189 int64_t now = Clock::GetRealTimeClock()->TimeInMilliseconds(); |
190 | 190 |
191 { | 191 { |
(...skipping 191 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
383 | 383 |
384 // Update the packet and payload routers with the sending RtpRtcp modules. | 384 // Update the packet and payload routers with the sending RtpRtcp modules. |
385 send_payload_router_->SetSendingRtpModules(registered_modules); | 385 send_payload_router_->SetSendingRtpModules(registered_modules); |
386 | 386 |
387 if (router_was_active) | 387 if (router_was_active) |
388 send_payload_router_->set_active(true); | 388 send_payload_router_->set_active(true); |
389 | 389 |
390 // Deregister previously registered modules. | 390 // Deregister previously registered modules. |
391 for (size_t i = num_active_modules; i < num_prev_active_modules; ++i) { | 391 for (size_t i = num_active_modules; i < num_prev_active_modules; ++i) { |
392 module_process_thread_->DeRegisterModule(rtp_rtcp_modules_[i]); | 392 module_process_thread_->DeRegisterModule(rtp_rtcp_modules_[i]); |
393 packet_router_->RemoveRtpModule(rtp_rtcp_modules_[i], sender_); | 393 packet_router_->RemoveRtpModule(rtp_rtcp_modules_[i]); |
394 } | 394 } |
395 // Register new active modules. | 395 // Register new active modules. |
396 for (size_t i = num_prev_active_modules; i < num_active_modules; ++i) { | 396 for (size_t i = num_prev_active_modules; i < num_active_modules; ++i) { |
397 module_process_thread_->RegisterModule(rtp_rtcp_modules_[i]); | 397 module_process_thread_->RegisterModule(rtp_rtcp_modules_[i]); |
398 packet_router_->AddRtpModule(rtp_rtcp_modules_[i], sender_); | 398 packet_router_->AddRtpModule(rtp_rtcp_modules_[i]); |
399 } | 399 } |
400 return 0; | 400 return 0; |
401 } | 401 } |
402 | 402 |
403 void ViEChannel::SetRTCPMode(const RtcpMode rtcp_mode) { | 403 void ViEChannel::SetRTCPMode(const RtcpMode rtcp_mode) { |
404 RTC_DCHECK(sender_); | 404 RTC_DCHECK(sender_); |
405 for (RtpRtcp* rtp_rtcp : rtp_rtcp_modules_) | 405 for (RtpRtcp* rtp_rtcp : rtp_rtcp_modules_) |
406 rtp_rtcp->SetRTCPStatus(rtcp_mode); | 406 rtp_rtcp->SetRTCPStatus(rtcp_mode); |
407 } | 407 } |
408 | 408 |
(...skipping 622 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1031 rtc::CritScope lock(&crit_); | 1031 rtc::CritScope lock(&crit_); |
1032 receive_stats_callback_ = receive_statistics_proxy; | 1032 receive_stats_callback_ = receive_statistics_proxy; |
1033 } | 1033 } |
1034 | 1034 |
1035 void ViEChannel::SetIncomingVideoStream( | 1035 void ViEChannel::SetIncomingVideoStream( |
1036 IncomingVideoStream* incoming_video_stream) { | 1036 IncomingVideoStream* incoming_video_stream) { |
1037 rtc::CritScope lock(&crit_); | 1037 rtc::CritScope lock(&crit_); |
1038 incoming_video_stream_ = incoming_video_stream; | 1038 incoming_video_stream_ = incoming_video_stream; |
1039 } | 1039 } |
1040 } // namespace webrtc | 1040 } // namespace webrtc |
OLD | NEW |