| 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 209 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 402 active_send_modules.push_back(rtp_rtcp); | 402 active_send_modules.push_back(rtp_rtcp); |
| 403 send_payload_router_->SetSendingRtpModules(active_send_modules); | 403 send_payload_router_->SetSendingRtpModules(active_send_modules); |
| 404 } | 404 } |
| 405 | 405 |
| 406 if (router_was_active) | 406 if (router_was_active) |
| 407 send_payload_router_->set_active(true); | 407 send_payload_router_->set_active(true); |
| 408 | 408 |
| 409 // Deregister previously registered modules. | 409 // Deregister previously registered modules. |
| 410 for (size_t i = num_active_modules; i < num_prev_active_modules; ++i) { | 410 for (size_t i = num_active_modules; i < num_prev_active_modules; ++i) { |
| 411 module_process_thread_->DeRegisterModule(rtp_rtcp_modules_[i]); | 411 module_process_thread_->DeRegisterModule(rtp_rtcp_modules_[i]); |
| 412 packet_router_->RemoveRtpModule(rtp_rtcp_modules_[i]); | 412 packet_router_->RemoveRtpModule(rtp_rtcp_modules_[i], sender_); |
| 413 } | 413 } |
| 414 // Register new active modules. | 414 // Register new active modules. |
| 415 for (size_t i = num_prev_active_modules; i < num_active_modules; ++i) { | 415 for (size_t i = num_prev_active_modules; i < num_active_modules; ++i) { |
| 416 module_process_thread_->RegisterModule(rtp_rtcp_modules_[i]); | 416 module_process_thread_->RegisterModule(rtp_rtcp_modules_[i]); |
| 417 packet_router_->AddRtpModule(rtp_rtcp_modules_[i]); | 417 packet_router_->AddRtpModule(rtp_rtcp_modules_[i], sender_); |
| 418 } | 418 } |
| 419 return 0; | 419 return 0; |
| 420 } | 420 } |
| 421 | 421 |
| 422 int32_t ViEChannel::SetReceiveCodec(const VideoCodec& video_codec) { | 422 int32_t ViEChannel::SetReceiveCodec(const VideoCodec& video_codec) { |
| 423 RTC_DCHECK(!sender_); | 423 RTC_DCHECK(!sender_); |
| 424 if (!vie_receiver_.SetReceiveCodec(video_codec)) { | 424 if (!vie_receiver_.SetReceiveCodec(video_codec)) { |
| 425 return -1; | 425 return -1; |
| 426 } | 426 } |
| 427 | 427 |
| (...skipping 778 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1206 rtc::CritScope lock(&crit_); | 1206 rtc::CritScope lock(&crit_); |
| 1207 receive_stats_callback_ = receive_statistics_proxy; | 1207 receive_stats_callback_ = receive_statistics_proxy; |
| 1208 } | 1208 } |
| 1209 | 1209 |
| 1210 void ViEChannel::SetIncomingVideoStream( | 1210 void ViEChannel::SetIncomingVideoStream( |
| 1211 IncomingVideoStream* incoming_video_stream) { | 1211 IncomingVideoStream* incoming_video_stream) { |
| 1212 rtc::CritScope lock(&crit_); | 1212 rtc::CritScope lock(&crit_); |
| 1213 incoming_video_stream_ = incoming_video_stream; | 1213 incoming_video_stream_ = incoming_video_stream; |
| 1214 } | 1214 } |
| 1215 } // namespace webrtc | 1215 } // namespace webrtc |
| OLD | NEW |