Index: webrtc/video/video_receive_stream.cc |
diff --git a/webrtc/video/video_receive_stream.cc b/webrtc/video/video_receive_stream.cc |
index 9046cc6c26d92a60fe831efb09f6c229f8556ba8..9c631413952a842430afc4852fc77c65fbe2ca4a 100644 |
--- a/webrtc/video/video_receive_stream.cc |
+++ b/webrtc/video/video_receive_stream.cc |
@@ -158,7 +158,6 @@ VideoReceiveStream::VideoReceiveStream( |
congestion_controller_(congestion_controller), |
call_stats_(call_stats), |
remb_(remb), |
- vcm_(VideoCodingModule::Create(clock_, nullptr, nullptr)), |
incoming_video_stream_( |
0, |
config.renderer ? config.renderer->SmoothsRenderedFrames() : false), |
@@ -166,7 +165,6 @@ VideoReceiveStream::VideoReceiveStream( |
vie_channel_(&transport_adapter_, |
process_thread, |
nullptr, |
- vcm_.get(), |
nullptr, |
nullptr, |
nullptr, |
@@ -178,6 +176,7 @@ VideoReceiveStream::VideoReceiveStream( |
1, |
false), |
vie_receiver_(vie_channel_.vie_receiver()), |
+ vcm_(vie_channel_.vcm()), |
rtp_rtcp_(vie_channel_.rtp_rtcp()) { |
LOG(LS_INFO) << "VideoReceiveStream: " << config_.ToString(); |
@@ -185,7 +184,7 @@ VideoReceiveStream::VideoReceiveStream( |
RTC_DCHECK(congestion_controller_); |
RTC_DCHECK(call_stats_); |
RTC_DCHECK(remb_); |
- RTC_CHECK(vie_channel_.Init() == 0); |
+ vie_channel_.Init(); |
// Register the channel to receive stats updates. |
call_stats_->RegisterStatsObserver(vie_channel_.GetStatsObserver()); |
@@ -302,14 +301,21 @@ VideoReceiveStream::VideoReceiveStream( |
vie_channel_.SetIncomingVideoStream(&incoming_video_stream_); |
vie_channel_.RegisterPreRenderCallback(this); |
- process_thread_->RegisterModule(vcm_.get()); |
+ // Registration of VCM and callbacks here is part of splitting ViEChannel and |
+ // moving functionality to sender/receivers instead of ViEChannel. |
+ RTC_CHECK_EQ(0, vcm_->RegisterReceiveCallback(&vie_channel_)); |
+ vcm_->RegisterFrameTypeCallback(&vie_channel_); |
+ vcm_->RegisterReceiveStatisticsCallback(&vie_channel_); |
+ vcm_->RegisterDecoderTimingCallback(&vie_channel_); |
+ |
+ process_thread_->RegisterModule(vcm_); |
} |
VideoReceiveStream::~VideoReceiveStream() { |
LOG(LS_INFO) << "~VideoReceiveStream: " << config_.ToString(); |
Stop(); |
- process_thread_->DeRegisterModule(vcm_.get()); |
+ process_thread_->DeRegisterModule(vcm_); |
vie_channel_.RegisterPreRenderCallback(nullptr); |
vcm_->RegisterPreDecodeImageCallback(nullptr); |
@@ -377,10 +383,6 @@ void VideoReceiveStream::FrameCallback(VideoFrame* video_frame) { |
int VideoReceiveStream::RenderFrame(const uint32_t /*stream_id*/, |
const VideoFrame& video_frame) { |
- // TODO(pbos): Wire up config_.render->IsTextureSupported() and convert if not |
- // supported. Or provide methods for converting a texture frame in |
- // VideoFrame. |
- |
if (config_.renderer != nullptr) |
config_.renderer->RenderFrame( |
video_frame, |