| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (c) 2013 The WebRTC project authors. All Rights Reserved. | 2 * Copyright (c) 2013 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 260 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 271 vie_receiver_->GetReceiveStatistics()->RegisterRtpStatisticsCallback( | 271 vie_receiver_->GetReceiveStatistics()->RegisterRtpStatisticsCallback( |
| 272 &stats_proxy_); | 272 &stats_proxy_); |
| 273 vie_receiver_->GetReceiveStatistics()->RegisterRtcpStatisticsCallback( | 273 vie_receiver_->GetReceiveStatistics()->RegisterRtcpStatisticsCallback( |
| 274 &stats_proxy_); | 274 &stats_proxy_); |
| 275 // Stats callback for CNAME changes. | 275 // Stats callback for CNAME changes. |
| 276 rtp_rtcp_->RegisterRtcpStatisticsCallback(&stats_proxy_); | 276 rtp_rtcp_->RegisterRtcpStatisticsCallback(&stats_proxy_); |
| 277 vie_channel_.RegisterRtcpPacketTypeCounterObserver(&stats_proxy_); | 277 vie_channel_.RegisterRtcpPacketTypeCounterObserver(&stats_proxy_); |
| 278 | 278 |
| 279 RTC_DCHECK(!config_.decoders.empty()); | 279 RTC_DCHECK(!config_.decoders.empty()); |
| 280 std::set<int> decoder_payload_types; | 280 std::set<int> decoder_payload_types; |
| 281 for (size_t i = 0; i < config_.decoders.size(); ++i) { | 281 for (const Decoder& decoder : config_.decoders) { |
| 282 const Decoder& decoder = config_.decoders[i]; | |
| 283 RTC_CHECK(decoder.decoder); | 282 RTC_CHECK(decoder.decoder); |
| 284 RTC_CHECK(decoder_payload_types.find(decoder.payload_type) == | 283 RTC_CHECK(decoder_payload_types.find(decoder.payload_type) == |
| 285 decoder_payload_types.end()) | 284 decoder_payload_types.end()) |
| 286 << "Duplicate payload type (" << decoder.payload_type | 285 << "Duplicate payload type (" << decoder.payload_type |
| 287 << ") for different decoders."; | 286 << ") for different decoders."; |
| 288 decoder_payload_types.insert(decoder.payload_type); | 287 decoder_payload_types.insert(decoder.payload_type); |
| 289 vcm_->RegisterExternalDecoder(decoder.decoder, decoder.payload_type); | 288 vcm_->RegisterExternalDecoder(decoder.decoder, decoder.payload_type); |
| 290 | 289 |
| 291 VideoCodec codec = CreateDecoderVideoCodec(decoder); | 290 VideoCodec codec = CreateDecoderVideoCodec(decoder); |
| 292 | 291 |
| (...skipping 10 matching lines...) Expand all Loading... |
| 303 vie_channel_.RegisterPreRenderCallback(this); | 302 vie_channel_.RegisterPreRenderCallback(this); |
| 304 | 303 |
| 305 process_thread_->RegisterModule(vcm_.get()); | 304 process_thread_->RegisterModule(vcm_.get()); |
| 306 } | 305 } |
| 307 | 306 |
| 308 VideoReceiveStream::~VideoReceiveStream() { | 307 VideoReceiveStream::~VideoReceiveStream() { |
| 309 LOG(LS_INFO) << "~VideoReceiveStream: " << config_.ToString(); | 308 LOG(LS_INFO) << "~VideoReceiveStream: " << config_.ToString(); |
| 310 Stop(); | 309 Stop(); |
| 311 | 310 |
| 312 process_thread_->DeRegisterModule(vcm_.get()); | 311 process_thread_->DeRegisterModule(vcm_.get()); |
| 312 |
| 313 // Deregister external decoders so that they are no longer running during |
| 314 // destruction. This effectively stops the VCM since the decoder thread is |
| 315 // stopped, the VCM is deregistered and no asynchronous decoder threads are |
| 316 // running. |
| 317 for (const Decoder& decoder : config_.decoders) |
| 318 vcm_->RegisterExternalDecoder(nullptr, decoder.payload_type); |
| 319 |
| 313 vie_channel_.RegisterPreRenderCallback(nullptr); | 320 vie_channel_.RegisterPreRenderCallback(nullptr); |
| 314 vcm_->RegisterPreDecodeImageCallback(nullptr); | 321 vcm_->RegisterPreDecodeImageCallback(nullptr); |
| 315 | 322 |
| 316 call_stats_->DeregisterStatsObserver(vie_channel_.GetStatsObserver()); | 323 call_stats_->DeregisterStatsObserver(vie_channel_.GetStatsObserver()); |
| 317 rtp_rtcp_->SetREMBStatus(false); | 324 rtp_rtcp_->SetREMBStatus(false); |
| 318 remb_->RemoveReceiveChannel(rtp_rtcp_); | 325 remb_->RemoveReceiveChannel(rtp_rtcp_); |
| 319 | 326 |
| 320 congestion_controller_->GetRemoteBitrateEstimator(UseSendSideBwe(config_)) | 327 congestion_controller_->GetRemoteBitrateEstimator(UseSendSideBwe(config_)) |
| 321 ->RemoveStream(vie_receiver_->GetRemoteSsrc()); | 328 ->RemoveStream(vie_receiver_->GetRemoteSsrc()); |
| 322 } | 329 } |
| (...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 416 return true; | 423 return true; |
| 417 } | 424 } |
| 418 | 425 |
| 419 void VideoReceiveStream::Decode() { | 426 void VideoReceiveStream::Decode() { |
| 420 static const int kMaxDecodeWaitTimeMs = 50; | 427 static const int kMaxDecodeWaitTimeMs = 50; |
| 421 vcm_->Decode(kMaxDecodeWaitTimeMs); | 428 vcm_->Decode(kMaxDecodeWaitTimeMs); |
| 422 } | 429 } |
| 423 | 430 |
| 424 } // namespace internal | 431 } // namespace internal |
| 425 } // namespace webrtc | 432 } // namespace webrtc |
| OLD | NEW |