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 169 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
180 vie_receiver_.GetReceiveStatistics()); | 180 vie_receiver_.GetReceiveStatistics()); |
181 module_process_thread_->DeRegisterModule(vcm_); | 181 module_process_thread_->DeRegisterModule(vcm_); |
182 module_process_thread_->DeRegisterModule(&vie_sync_); | 182 module_process_thread_->DeRegisterModule(&vie_sync_); |
183 send_payload_router_->SetSendingRtpModules(std::list<RtpRtcp*>()); | 183 send_payload_router_->SetSendingRtpModules(std::list<RtpRtcp*>()); |
184 for (size_t i = 0; i < num_active_rtp_rtcp_modules_; ++i) | 184 for (size_t i = 0; i < num_active_rtp_rtcp_modules_; ++i) |
185 packet_router_->RemoveRtpModule(rtp_rtcp_modules_[i]); | 185 packet_router_->RemoveRtpModule(rtp_rtcp_modules_[i]); |
186 for (RtpRtcp* rtp_rtcp : rtp_rtcp_modules_) { | 186 for (RtpRtcp* rtp_rtcp : rtp_rtcp_modules_) { |
187 module_process_thread_->DeRegisterModule(rtp_rtcp); | 187 module_process_thread_->DeRegisterModule(rtp_rtcp); |
188 delete rtp_rtcp; | 188 delete rtp_rtcp; |
189 } | 189 } |
190 StopDecodeThread(); | 190 if (!sender_) |
| 191 StopDecodeThread(); |
191 // Release modules. | 192 // Release modules. |
192 VideoCodingModule::Destroy(vcm_); | 193 VideoCodingModule::Destroy(vcm_); |
193 } | 194 } |
194 | 195 |
195 void ViEChannel::UpdateHistograms() { | 196 void ViEChannel::UpdateHistograms() { |
196 int64_t now = Clock::GetRealTimeClock()->TimeInMilliseconds(); | 197 int64_t now = Clock::GetRealTimeClock()->TimeInMilliseconds(); |
197 | 198 |
198 { | 199 { |
199 CriticalSectionScoped cs(crit_.get()); | 200 CriticalSectionScoped cs(crit_.get()); |
200 int64_t elapsed_sec = (now - time_of_first_rtt_ms_) / 1000; | 201 int64_t elapsed_sec = (now - time_of_first_rtt_ms_) / 1000; |
(...skipping 231 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
432 | 433 |
433 int32_t ViEChannel::RegisterExternalDecoder(const uint8_t pl_type, | 434 int32_t ViEChannel::RegisterExternalDecoder(const uint8_t pl_type, |
434 VideoDecoder* decoder, | 435 VideoDecoder* decoder, |
435 bool buffered_rendering, | 436 bool buffered_rendering, |
436 int32_t render_delay) { | 437 int32_t render_delay) { |
437 RTC_DCHECK(!sender_); | 438 RTC_DCHECK(!sender_); |
438 vcm_->RegisterExternalDecoder(decoder, pl_type, buffered_rendering); | 439 vcm_->RegisterExternalDecoder(decoder, pl_type, buffered_rendering); |
439 return vcm_->SetRenderDelay(render_delay); | 440 return vcm_->SetRenderDelay(render_delay); |
440 } | 441 } |
441 | 442 |
442 int32_t ViEChannel::DeRegisterExternalDecoder(const uint8_t pl_type) { | |
443 RTC_DCHECK(!sender_); | |
444 VideoCodec current_receive_codec; | |
445 int32_t result = 0; | |
446 result = vcm_->ReceiveCodec(¤t_receive_codec); | |
447 vcm_->RegisterExternalDecoder(NULL, pl_type, false); | |
448 | |
449 if (result == 0 && current_receive_codec.plType == pl_type) { | |
450 result = vcm_->RegisterReceiveCodec(¤t_receive_codec, | |
451 number_of_cores_, false); | |
452 } | |
453 return result; | |
454 } | |
455 | |
456 int32_t ViEChannel::ReceiveCodecStatistics(uint32_t* num_key_frames, | 443 int32_t ViEChannel::ReceiveCodecStatistics(uint32_t* num_key_frames, |
457 uint32_t* num_delta_frames) { | 444 uint32_t* num_delta_frames) { |
458 CriticalSectionScoped cs(crit_.get()); | 445 CriticalSectionScoped cs(crit_.get()); |
459 *num_key_frames = receive_frame_counts_.key_frames; | 446 *num_key_frames = receive_frame_counts_.key_frames; |
460 *num_delta_frames = receive_frame_counts_.delta_frames; | 447 *num_delta_frames = receive_frame_counts_.delta_frames; |
461 return 0; | 448 return 0; |
462 } | 449 } |
463 | 450 |
464 uint32_t ViEChannel::DiscardedPackets() const { | 451 uint32_t ViEChannel::DiscardedPackets() const { |
465 return vcm_->DiscardedPackets(); | 452 return vcm_->DiscardedPackets(); |
(...skipping 741 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1207 CriticalSectionScoped cs(crit_.get()); | 1194 CriticalSectionScoped cs(crit_.get()); |
1208 receive_stats_callback_ = receive_statistics_proxy; | 1195 receive_stats_callback_ = receive_statistics_proxy; |
1209 } | 1196 } |
1210 | 1197 |
1211 void ViEChannel::SetIncomingVideoStream( | 1198 void ViEChannel::SetIncomingVideoStream( |
1212 IncomingVideoStream* incoming_video_stream) { | 1199 IncomingVideoStream* incoming_video_stream) { |
1213 CriticalSectionScoped cs(crit_.get()); | 1200 CriticalSectionScoped cs(crit_.get()); |
1214 incoming_video_stream_ = incoming_video_stream; | 1201 incoming_video_stream_ = incoming_video_stream; |
1215 } | 1202 } |
1216 } // namespace webrtc | 1203 } // namespace webrtc |
OLD | NEW |