Index: webrtc/video/vie_channel.cc |
diff --git a/webrtc/video/vie_channel.cc b/webrtc/video/vie_channel.cc |
index b41e21b380cc8841d19dcaae90502a249148aed6..19ce648062c4571d17b9d8554da49cad3d14622a 100644 |
--- a/webrtc/video/vie_channel.cc |
+++ b/webrtc/video/vie_channel.cc |
@@ -79,7 +79,6 @@ class ViEChannelProtectionCallback : public VCMProtectionCallback { |
ViEChannel::ViEChannel(Transport* transport, |
ProcessThread* module_process_thread, |
PayloadRouter* send_payload_router, |
- VideoCodingModule* vcm, |
RtcpIntraFrameObserver* intra_frame_observer, |
RtcpBandwidthObserver* bandwidth_observer, |
TransportFeedbackObserver* transport_feedback_observer, |
@@ -93,9 +92,12 @@ ViEChannel::ViEChannel(Transport* transport, |
module_process_thread_(module_process_thread), |
send_payload_router_(send_payload_router), |
vcm_protection_callback_(new ViEChannelProtectionCallback(this)), |
- vcm_(vcm), |
- vie_receiver_(vcm_, remote_bitrate_estimator, this), |
- vie_sync_(vcm_), |
+ vcm_(sender_ ? nullptr |
+ : VideoCodingModule::Create(Clock::GetRealTimeClock(), |
+ nullptr, |
+ nullptr)), |
+ vie_receiver_(vcm_.get(), remote_bitrate_estimator, this), |
+ vie_sync_(vcm_.get()), |
stats_observer_(new ChannelStatsObserver(this)), |
receive_stats_callback_(nullptr), |
incoming_video_stream_(nullptr), |
@@ -141,8 +143,7 @@ ViEChannel::ViEChannel(Transport* transport, |
} |
} |
-int32_t ViEChannel::Init() { |
- static const int kDefaultRenderDelayMs = 10; |
+void ViEChannel::Init() { |
module_process_thread_->RegisterModule(vie_receiver_.GetReceiveStatistics()); |
// RTP/RTCP initialization. |
@@ -159,16 +160,8 @@ int32_t ViEChannel::Init() { |
std::vector<RtpRtcp*>(1, rtp_rtcp_modules_[0])); |
RTC_DCHECK(!send_payload_router_->active()); |
} else { |
- if (vcm_->RegisterReceiveCallback(this) != 0) { |
- return -1; |
- } |
- vcm_->RegisterFrameTypeCallback(this); |
- vcm_->RegisterReceiveStatisticsCallback(this); |
- vcm_->RegisterDecoderTimingCallback(this); |
- vcm_->SetRenderDelay(kDefaultRenderDelayMs); |
module_process_thread_->RegisterModule(&vie_sync_); |
} |
- return 0; |
} |
ViEChannel::~ViEChannel() { |
@@ -817,6 +810,10 @@ int32_t ViEChannel::SetMTU(uint16_t mtu) { |
return 0; |
} |
+VideoCodingModule* ViEChannel::vcm() { |
+ return vcm_.get(); |
+} |
+ |
RtpRtcp* ViEChannel::rtp_rtcp() { |
return rtp_rtcp_modules_[0]; |
} |