Chromium Code Reviews| 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 140 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 151 VieRemb* remb) | 151 VieRemb* remb) |
| 152 : transport_adapter_(config.rtcp_send_transport), | 152 : transport_adapter_(config.rtcp_send_transport), |
| 153 encoded_frame_proxy_(config.pre_decode_callback), | 153 encoded_frame_proxy_(config.pre_decode_callback), |
| 154 config_(config), | 154 config_(config), |
| 155 process_thread_(process_thread), | 155 process_thread_(process_thread), |
| 156 clock_(Clock::GetRealTimeClock()), | 156 clock_(Clock::GetRealTimeClock()), |
| 157 decode_thread_(DecodeThreadFunction, this, "DecodingThread"), | 157 decode_thread_(DecodeThreadFunction, this, "DecodingThread"), |
| 158 congestion_controller_(congestion_controller), | 158 congestion_controller_(congestion_controller), |
| 159 call_stats_(call_stats), | 159 call_stats_(call_stats), |
| 160 remb_(remb), | 160 remb_(remb), |
| 161 vcm_(VideoCodingModule::Create(clock_, nullptr, nullptr)), | |
| 162 incoming_video_stream_( | 161 incoming_video_stream_( |
| 163 0, | 162 0, |
| 164 config.renderer ? config.renderer->SmoothsRenderedFrames() : false), | 163 config.renderer ? config.renderer->SmoothsRenderedFrames() : false), |
| 165 stats_proxy_(config_.rtp.remote_ssrc, clock_), | 164 stats_proxy_(config_.rtp.remote_ssrc, clock_), |
| 166 vie_channel_(&transport_adapter_, | 165 vie_channel_(&transport_adapter_, |
| 167 process_thread, | 166 process_thread, |
| 168 nullptr, | 167 nullptr, |
| 169 vcm_.get(), | |
| 170 nullptr, | 168 nullptr, |
| 171 nullptr, | 169 nullptr, |
| 172 nullptr, | 170 nullptr, |
| 173 congestion_controller_->GetRemoteBitrateEstimator( | 171 congestion_controller_->GetRemoteBitrateEstimator( |
| 174 UseSendSideBwe(config_)), | 172 UseSendSideBwe(config_)), |
| 175 call_stats_->rtcp_rtt_stats(), | 173 call_stats_->rtcp_rtt_stats(), |
| 176 congestion_controller_->pacer(), | 174 congestion_controller_->pacer(), |
| 177 congestion_controller_->packet_router(), | 175 congestion_controller_->packet_router(), |
| 178 1, | 176 1, |
| 179 false), | 177 false), |
| 180 vie_receiver_(vie_channel_.vie_receiver()), | 178 vie_receiver_(vie_channel_.vie_receiver()), |
| 179 vcm_(vie_channel_.vcm()), | |
| 181 rtp_rtcp_(vie_channel_.rtp_rtcp()) { | 180 rtp_rtcp_(vie_channel_.rtp_rtcp()) { |
| 182 LOG(LS_INFO) << "VideoReceiveStream: " << config_.ToString(); | 181 LOG(LS_INFO) << "VideoReceiveStream: " << config_.ToString(); |
| 183 | 182 |
| 184 RTC_DCHECK(process_thread_); | 183 RTC_DCHECK(process_thread_); |
| 185 RTC_DCHECK(congestion_controller_); | 184 RTC_DCHECK(congestion_controller_); |
| 186 RTC_DCHECK(call_stats_); | 185 RTC_DCHECK(call_stats_); |
| 187 RTC_DCHECK(remb_); | 186 RTC_DCHECK(remb_); |
| 188 RTC_CHECK(vie_channel_.Init() == 0); | 187 RTC_CHECK(vie_channel_.Init() == 0); |
| 189 | 188 |
| 190 // Register the channel to receive stats updates. | 189 // Register the channel to receive stats updates. |
| (...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 295 vcm_->RegisterReceiveCodec(&codec, num_cpu_cores, false)); | 294 vcm_->RegisterReceiveCodec(&codec, num_cpu_cores, false)); |
| 296 } | 295 } |
| 297 | 296 |
| 298 vcm_->SetRenderDelay(config.render_delay_ms); | 297 vcm_->SetRenderDelay(config.render_delay_ms); |
| 299 incoming_video_stream_.SetExpectedRenderDelay(config.render_delay_ms); | 298 incoming_video_stream_.SetExpectedRenderDelay(config.render_delay_ms); |
| 300 vcm_->RegisterPreDecodeImageCallback(this); | 299 vcm_->RegisterPreDecodeImageCallback(this); |
| 301 incoming_video_stream_.SetExternalCallback(this); | 300 incoming_video_stream_.SetExternalCallback(this); |
| 302 vie_channel_.SetIncomingVideoStream(&incoming_video_stream_); | 301 vie_channel_.SetIncomingVideoStream(&incoming_video_stream_); |
| 303 vie_channel_.RegisterPreRenderCallback(this); | 302 vie_channel_.RegisterPreRenderCallback(this); |
| 304 | 303 |
| 305 process_thread_->RegisterModule(vcm_.get()); | 304 process_thread_->RegisterModule(vcm_); |
|
danilchap
2016/02/15 12:25:09
Looks strange that a non-owner object configure an
pbos-webrtc
2016/02/15 13:04:24
Done.
| |
| 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_); |
| 313 vie_channel_.RegisterPreRenderCallback(nullptr); | 312 vie_channel_.RegisterPreRenderCallback(nullptr); |
| 314 vcm_->RegisterPreDecodeImageCallback(nullptr); | 313 vcm_->RegisterPreDecodeImageCallback(nullptr); |
| 315 | 314 |
| 316 call_stats_->DeregisterStatsObserver(vie_channel_.GetStatsObserver()); | 315 call_stats_->DeregisterStatsObserver(vie_channel_.GetStatsObserver()); |
| 317 rtp_rtcp_->SetREMBStatus(false); | 316 rtp_rtcp_->SetREMBStatus(false); |
| 318 remb_->RemoveReceiveChannel(rtp_rtcp_); | 317 remb_->RemoveReceiveChannel(rtp_rtcp_); |
| 319 | 318 |
| 320 congestion_controller_->GetRemoteBitrateEstimator(UseSendSideBwe(config_)) | 319 congestion_controller_->GetRemoteBitrateEstimator(UseSendSideBwe(config_)) |
| 321 ->RemoveStream(vie_receiver_->GetRemoteSsrc()); | 320 ->RemoveStream(vie_receiver_->GetRemoteSsrc()); |
| 322 } | 321 } |
| (...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 370 | 369 |
| 371 // Post processing is not supported if the frame is backed by a texture. | 370 // Post processing is not supported if the frame is backed by a texture. |
| 372 if (video_frame->native_handle() == NULL) { | 371 if (video_frame->native_handle() == NULL) { |
| 373 if (config_.pre_render_callback) | 372 if (config_.pre_render_callback) |
| 374 config_.pre_render_callback->FrameCallback(video_frame); | 373 config_.pre_render_callback->FrameCallback(video_frame); |
| 375 } | 374 } |
| 376 } | 375 } |
| 377 | 376 |
| 378 int VideoReceiveStream::RenderFrame(const uint32_t /*stream_id*/, | 377 int VideoReceiveStream::RenderFrame(const uint32_t /*stream_id*/, |
| 379 const VideoFrame& video_frame) { | 378 const VideoFrame& video_frame) { |
| 380 // TODO(pbos): Wire up config_.render->IsTextureSupported() and convert if not | |
|
danilchap
2016/02/15 12:25:09
is it related to this change or rogue cleanup?
pbos-webrtc
2016/02/15 13:04:24
Rogue, added years ago I think.
| |
| 381 // supported. Or provide methods for converting a texture frame in | |
| 382 // VideoFrame. | |
| 383 | |
| 384 if (config_.renderer != nullptr) | 379 if (config_.renderer != nullptr) |
| 385 config_.renderer->RenderFrame( | 380 config_.renderer->RenderFrame( |
| 386 video_frame, | 381 video_frame, |
| 387 video_frame.render_time_ms() - clock_->TimeInMilliseconds()); | 382 video_frame.render_time_ms() - clock_->TimeInMilliseconds()); |
| 388 | 383 |
| 389 stats_proxy_.OnRenderedFrame(video_frame.width(), video_frame.height()); | 384 stats_proxy_.OnRenderedFrame(video_frame.width(), video_frame.height()); |
| 390 | 385 |
| 391 return 0; | 386 return 0; |
| 392 } | 387 } |
| 393 | 388 |
| (...skipping 22 matching lines...) Expand all Loading... | |
| 416 return true; | 411 return true; |
| 417 } | 412 } |
| 418 | 413 |
| 419 void VideoReceiveStream::Decode() { | 414 void VideoReceiveStream::Decode() { |
| 420 static const int kMaxDecodeWaitTimeMs = 50; | 415 static const int kMaxDecodeWaitTimeMs = 50; |
| 421 vcm_->Decode(kMaxDecodeWaitTimeMs); | 416 vcm_->Decode(kMaxDecodeWaitTimeMs); |
| 422 } | 417 } |
| 423 | 418 |
| 424 } // namespace internal | 419 } // namespace internal |
| 425 } // namespace webrtc | 420 } // namespace webrtc |
| OLD | NEW |