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 132 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
143 module_process_thread_->RegisterModule(vie_receiver_.GetReceiveStatistics()); | 143 module_process_thread_->RegisterModule(vie_receiver_.GetReceiveStatistics()); |
144 | 144 |
145 // RTP/RTCP initialization. | 145 // RTP/RTCP initialization. |
146 module_process_thread_->RegisterModule(rtp_rtcp_modules_[0]); | 146 module_process_thread_->RegisterModule(rtp_rtcp_modules_[0]); |
147 | 147 |
148 rtp_rtcp_modules_[0]->SetKeyFrameRequestMethod(kKeyFrameReqPliRtcp); | 148 rtp_rtcp_modules_[0]->SetKeyFrameRequestMethod(kKeyFrameReqPliRtcp); |
149 if (paced_sender_) { | 149 if (paced_sender_) { |
150 for (RtpRtcp* rtp_rtcp : rtp_rtcp_modules_) | 150 for (RtpRtcp* rtp_rtcp : rtp_rtcp_modules_) |
151 rtp_rtcp->SetStorePacketsStatus(true, nack_history_size_sender_); | 151 rtp_rtcp->SetStorePacketsStatus(true, nack_history_size_sender_); |
152 } | 152 } |
153 packet_router_->AddRtpModule(rtp_rtcp_modules_[0]); | 153 packet_router_->AddRtpModule(rtp_rtcp_modules_[0], sender_); |
154 if (sender_) { | 154 if (sender_) { |
155 std::list<RtpRtcp*> send_rtp_modules(1, rtp_rtcp_modules_[0]); | 155 std::list<RtpRtcp*> send_rtp_modules(1, rtp_rtcp_modules_[0]); |
156 send_payload_router_->SetSendingRtpModules(send_rtp_modules); | 156 send_payload_router_->SetSendingRtpModules(send_rtp_modules); |
157 RTC_DCHECK(!send_payload_router_->active()); | 157 RTC_DCHECK(!send_payload_router_->active()); |
158 } | 158 } |
159 if (vcm_->RegisterReceiveCallback(this) != 0) { | 159 if (vcm_->RegisterReceiveCallback(this) != 0) { |
160 return -1; | 160 return -1; |
161 } | 161 } |
162 vcm_->RegisterFrameTypeCallback(this); | 162 vcm_->RegisterFrameTypeCallback(this); |
163 vcm_->RegisterReceiveStatisticsCallback(this); | 163 vcm_->RegisterReceiveStatisticsCallback(this); |
164 vcm_->RegisterDecoderTimingCallback(this); | 164 vcm_->RegisterDecoderTimingCallback(this); |
165 vcm_->SetRenderDelay(kDefaultRenderDelayMs); | 165 vcm_->SetRenderDelay(kDefaultRenderDelayMs); |
166 | 166 |
167 module_process_thread_->RegisterModule(vcm_); | 167 module_process_thread_->RegisterModule(vcm_); |
168 module_process_thread_->RegisterModule(&vie_sync_); | 168 module_process_thread_->RegisterModule(&vie_sync_); |
169 | 169 |
170 return 0; | 170 return 0; |
171 } | 171 } |
172 | 172 |
173 ViEChannel::~ViEChannel() { | 173 ViEChannel::~ViEChannel() { |
174 UpdateHistograms(); | 174 UpdateHistograms(); |
175 // Make sure we don't get more callbacks from the RTP module. | 175 // Make sure we don't get more callbacks from the RTP module. |
176 module_process_thread_->DeRegisterModule( | 176 module_process_thread_->DeRegisterModule( |
177 vie_receiver_.GetReceiveStatistics()); | 177 vie_receiver_.GetReceiveStatistics()); |
178 module_process_thread_->DeRegisterModule(vcm_); | 178 module_process_thread_->DeRegisterModule(vcm_); |
179 module_process_thread_->DeRegisterModule(&vie_sync_); | 179 module_process_thread_->DeRegisterModule(&vie_sync_); |
180 send_payload_router_->SetSendingRtpModules(std::list<RtpRtcp*>()); | 180 send_payload_router_->SetSendingRtpModules(std::list<RtpRtcp*>()); |
181 for (size_t i = 0; i < num_active_rtp_rtcp_modules_; ++i) | 181 for (size_t i = 0; i < num_active_rtp_rtcp_modules_; ++i) |
182 packet_router_->RemoveRtpModule(rtp_rtcp_modules_[i]); | 182 packet_router_->RemoveRtpModule(rtp_rtcp_modules_[i], sender_); |
183 for (RtpRtcp* rtp_rtcp : rtp_rtcp_modules_) { | 183 for (RtpRtcp* rtp_rtcp : rtp_rtcp_modules_) { |
184 module_process_thread_->DeRegisterModule(rtp_rtcp); | 184 module_process_thread_->DeRegisterModule(rtp_rtcp); |
185 delete rtp_rtcp; | 185 delete rtp_rtcp; |
186 } | 186 } |
187 if (!sender_) | 187 if (!sender_) |
188 StopDecodeThread(); | 188 StopDecodeThread(); |
189 // Release modules. | 189 // Release modules. |
190 VideoCodingModule::Destroy(vcm_); | 190 VideoCodingModule::Destroy(vcm_); |
191 } | 191 } |
192 | 192 |
(...skipping 200 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
393 active_send_modules.push_back(rtp_rtcp); | 393 active_send_modules.push_back(rtp_rtcp); |
394 send_payload_router_->SetSendingRtpModules(active_send_modules); | 394 send_payload_router_->SetSendingRtpModules(active_send_modules); |
395 } | 395 } |
396 | 396 |
397 if (router_was_active) | 397 if (router_was_active) |
398 send_payload_router_->set_active(true); | 398 send_payload_router_->set_active(true); |
399 | 399 |
400 // Deregister previously registered modules. | 400 // Deregister previously registered modules. |
401 for (size_t i = num_active_modules; i < num_prev_active_modules; ++i) { | 401 for (size_t i = num_active_modules; i < num_prev_active_modules; ++i) { |
402 module_process_thread_->DeRegisterModule(rtp_rtcp_modules_[i]); | 402 module_process_thread_->DeRegisterModule(rtp_rtcp_modules_[i]); |
403 packet_router_->RemoveRtpModule(rtp_rtcp_modules_[i]); | 403 packet_router_->RemoveRtpModule(rtp_rtcp_modules_[i], sender_); |
404 } | 404 } |
405 // Register new active modules. | 405 // Register new active modules. |
406 for (size_t i = num_prev_active_modules; i < num_active_modules; ++i) { | 406 for (size_t i = num_prev_active_modules; i < num_active_modules; ++i) { |
407 module_process_thread_->RegisterModule(rtp_rtcp_modules_[i]); | 407 module_process_thread_->RegisterModule(rtp_rtcp_modules_[i]); |
408 packet_router_->AddRtpModule(rtp_rtcp_modules_[i]); | 408 packet_router_->AddRtpModule(rtp_rtcp_modules_[i], sender_); |
409 } | 409 } |
410 return 0; | 410 return 0; |
411 } | 411 } |
412 | 412 |
413 int32_t ViEChannel::SetReceiveCodec(const VideoCodec& video_codec) { | 413 int32_t ViEChannel::SetReceiveCodec(const VideoCodec& video_codec) { |
414 RTC_DCHECK(!sender_); | 414 RTC_DCHECK(!sender_); |
415 if (!vie_receiver_.SetReceiveCodec(video_codec)) { | 415 if (!vie_receiver_.SetReceiveCodec(video_codec)) { |
416 return -1; | 416 return -1; |
417 } | 417 } |
418 | 418 |
(...skipping 778 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1197 rtc::CritScope lock(&crit_); | 1197 rtc::CritScope lock(&crit_); |
1198 receive_stats_callback_ = receive_statistics_proxy; | 1198 receive_stats_callback_ = receive_statistics_proxy; |
1199 } | 1199 } |
1200 | 1200 |
1201 void ViEChannel::SetIncomingVideoStream( | 1201 void ViEChannel::SetIncomingVideoStream( |
1202 IncomingVideoStream* incoming_video_stream) { | 1202 IncomingVideoStream* incoming_video_stream) { |
1203 rtc::CritScope lock(&crit_); | 1203 rtc::CritScope lock(&crit_); |
1204 incoming_video_stream_ = incoming_video_stream; | 1204 incoming_video_stream_ = incoming_video_stream; |
1205 } | 1205 } |
1206 } // namespace webrtc | 1206 } // namespace webrtc |
OLD | NEW |