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 121 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
132 ChannelGroup* channel_group, | 132 ChannelGroup* channel_group, |
133 int channel_id, | 133 int channel_id, |
134 const VideoReceiveStream::Config& config, | 134 const VideoReceiveStream::Config& config, |
135 webrtc::VoiceEngine* voice_engine) | 135 webrtc::VoiceEngine* voice_engine) |
136 : transport_adapter_(config.rtcp_send_transport), | 136 : transport_adapter_(config.rtcp_send_transport), |
137 encoded_frame_proxy_(config.pre_decode_callback), | 137 encoded_frame_proxy_(config.pre_decode_callback), |
138 config_(config), | 138 config_(config), |
139 clock_(Clock::GetRealTimeClock()), | 139 clock_(Clock::GetRealTimeClock()), |
140 channel_group_(channel_group), | 140 channel_group_(channel_group), |
141 channel_id_(channel_id) { | 141 channel_id_(channel_id) { |
| 142 LOG(LS_INFO) << "VideoReceiveStream: " << config_.ToString(); |
142 RTC_CHECK(channel_group_->CreateReceiveChannel( | 143 RTC_CHECK(channel_group_->CreateReceiveChannel( |
143 channel_id_, &transport_adapter_, num_cpu_cores, config)); | 144 channel_id_, &transport_adapter_, num_cpu_cores, config)); |
144 | 145 |
145 vie_channel_ = channel_group_->GetChannel(channel_id_); | 146 vie_channel_ = channel_group_->GetChannel(channel_id_); |
146 | 147 |
147 // TODO(pbos): This is not fine grained enough... | 148 // TODO(pbos): This is not fine grained enough... |
148 vie_channel_->SetProtectionMode(config_.rtp.nack.rtp_history_ms > 0, false, | 149 vie_channel_->SetProtectionMode(config_.rtp.nack.rtp_history_ms > 0, false, |
149 -1, -1); | 150 -1, -1); |
150 RTC_DCHECK(config_.rtp.rtcp_mode != RtcpMode::kOff) | 151 RTC_DCHECK(config_.rtp.rtcp_mode != RtcpMode::kOff) |
151 << "A stream should not be configured with RTCP disabled. This value is " | 152 << "A stream should not be configured with RTCP disabled. This value is " |
(...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
246 incoming_video_stream_->SetExpectedRenderDelay(config.render_delay_ms); | 247 incoming_video_stream_->SetExpectedRenderDelay(config.render_delay_ms); |
247 incoming_video_stream_->SetExternalCallback(this); | 248 incoming_video_stream_->SetExternalCallback(this); |
248 vie_channel_->SetIncomingVideoStream(incoming_video_stream_.get()); | 249 vie_channel_->SetIncomingVideoStream(incoming_video_stream_.get()); |
249 | 250 |
250 if (config.pre_decode_callback) | 251 if (config.pre_decode_callback) |
251 vie_channel_->RegisterPreDecodeImageCallback(&encoded_frame_proxy_); | 252 vie_channel_->RegisterPreDecodeImageCallback(&encoded_frame_proxy_); |
252 vie_channel_->RegisterPreRenderCallback(this); | 253 vie_channel_->RegisterPreRenderCallback(this); |
253 } | 254 } |
254 | 255 |
255 VideoReceiveStream::~VideoReceiveStream() { | 256 VideoReceiveStream::~VideoReceiveStream() { |
| 257 LOG(LS_INFO) << "~VideoReceiveStream: " << config_.ToString(); |
256 incoming_video_stream_->Stop(); | 258 incoming_video_stream_->Stop(); |
257 vie_channel_->RegisterPreRenderCallback(nullptr); | 259 vie_channel_->RegisterPreRenderCallback(nullptr); |
258 vie_channel_->RegisterPreDecodeImageCallback(nullptr); | 260 vie_channel_->RegisterPreDecodeImageCallback(nullptr); |
259 | 261 |
260 for (size_t i = 0; i < config_.decoders.size(); ++i) | 262 for (size_t i = 0; i < config_.decoders.size(); ++i) |
261 vie_channel_->DeRegisterExternalDecoder(config_.decoders[i].payload_type); | 263 vie_channel_->DeRegisterExternalDecoder(config_.decoders[i].payload_type); |
262 | 264 |
263 channel_group_->DeleteChannel(channel_id_); | 265 channel_group_->DeleteChannel(channel_id_); |
264 } | 266 } |
265 | 267 |
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
326 return 0; | 328 return 0; |
327 } | 329 } |
328 | 330 |
329 void VideoReceiveStream::SignalNetworkState(NetworkState state) { | 331 void VideoReceiveStream::SignalNetworkState(NetworkState state) { |
330 vie_channel_->SetRTCPMode(state == kNetworkUp ? config_.rtp.rtcp_mode | 332 vie_channel_->SetRTCPMode(state == kNetworkUp ? config_.rtp.rtcp_mode |
331 : RtcpMode::kOff); | 333 : RtcpMode::kOff); |
332 } | 334 } |
333 | 335 |
334 } // namespace internal | 336 } // namespace internal |
335 } // namespace webrtc | 337 } // namespace webrtc |
OLD | NEW |