Index: webrtc/video/video_receive_stream.cc |
diff --git a/webrtc/video/video_receive_stream.cc b/webrtc/video/video_receive_stream.cc |
index 91a37076f320cf4dab9858851d788b464d6d6738..b00c269e4c8f38729e0306486c95e3ee56482476 100644 |
--- a/webrtc/video/video_receive_stream.cc |
+++ b/webrtc/video/video_receive_stream.cc |
@@ -47,7 +47,8 @@ std::string VideoReceiveStream::Config::ToString() const { |
ss << ", rtp: " << rtp.ToString(); |
ss << ", renderer: " << (renderer != nullptr ? "(renderer)" : "nullptr"); |
ss << ", render_delay_ms: " << render_delay_ms; |
- ss << ", audio_channel_id: " << audio_channel_id; |
+ if (!sync_group.empty()) |
+ ss << ", sync_group: " << sync_group; |
ss << ", pre_decode_callback: " |
<< (pre_decode_callback != nullptr ? "(EncodedFrameObserver)" : "nullptr"); |
ss << ", pre_render_callback: " |
@@ -241,17 +242,13 @@ VideoReceiveStream::VideoReceiveStream(int num_cpu_cores, |
incoming_video_stream_->SetExternalCallback(this); |
vie_channel_->SetIncomingVideoStream(incoming_video_stream_.get()); |
- if (voice_engine && config_.audio_channel_id != -1) { |
- voe_sync_interface_ = VoEVideoSync::GetInterface(voice_engine); |
- vie_channel_->SetVoiceChannel(config.audio_channel_id, voe_sync_interface_); |
- } |
- |
if (config.pre_decode_callback) |
vie_channel_->RegisterPreDecodeImageCallback(&encoded_frame_proxy_); |
vie_channel_->RegisterPreRenderCallback(this); |
} |
VideoReceiveStream::~VideoReceiveStream() { |
+ DCHECK(voe_sync_interface_ == nullptr); |
incoming_video_stream_->Stop(); |
vie_channel_->RegisterPreRenderCallback(nullptr); |
vie_channel_->RegisterPreDecodeImageCallback(nullptr); |
@@ -259,10 +256,6 @@ VideoReceiveStream::~VideoReceiveStream() { |
for (size_t i = 0; i < config_.decoders.size(); ++i) |
vie_channel_->DeRegisterExternalDecoder(config_.decoders[i].payload_type); |
- if (voe_sync_interface_ != nullptr) { |
- vie_channel_->SetVoiceChannel(-1, nullptr); |
- voe_sync_interface_->Release(); |
- } |
vie_channel_->RegisterCodecObserver(nullptr); |
vie_channel_->RegisterReceiveChannelRtpStatisticsCallback(nullptr); |
vie_channel_->RegisterReceiveChannelRtcpStatisticsCallback(nullptr); |
@@ -282,6 +275,19 @@ void VideoReceiveStream::Stop() { |
transport_adapter_.Disable(); |
} |
+void VideoReceiveStream::SetSyncChannel(VoiceEngine* voice_engine, |
+ int audio_channel_id) { |
+ DCHECK(voice_engine != nullptr); |
+ if (audio_channel_id != -1) { |
+ voe_sync_interface_ = VoEVideoSync::GetInterface(voice_engine); |
+ vie_channel_->SetVoiceChannel(audio_channel_id, voe_sync_interface_); |
+ } else { |
+ vie_channel_->SetVoiceChannel(-1, nullptr); |
+ voe_sync_interface_->Release(); |
+ voe_sync_interface_ = nullptr; |
+ } |
+} |
+ |
VideoReceiveStream::Stats VideoReceiveStream::GetStats() const { |
return stats_proxy_->GetStats(); |
} |