Index: webrtc/video/video_receive_stream.cc |
diff --git a/webrtc/video/video_receive_stream.cc b/webrtc/video/video_receive_stream.cc |
index d0c17d649e8f668e6a47d38c45ee44a2c2ee2fc8..d7874fa0dfdd51355c9caef85c34bac424324f86 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: " |
@@ -135,8 +136,7 @@ VideoReceiveStream::VideoReceiveStream(int num_cpu_cores, |
config_(config), |
clock_(Clock::GetRealTimeClock()), |
channel_group_(channel_group), |
- channel_id_(channel_id), |
- voe_sync_interface_(nullptr) { |
+ channel_id_(channel_id) { |
CHECK(channel_group_->CreateReceiveChannel(channel_id_, 0, base_channel_id, |
&transport_adapter_, num_cpu_cores, |
true)); |
@@ -242,11 +242,6 @@ 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); |
@@ -260,10 +255,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); |
@@ -283,6 +274,17 @@ void VideoReceiveStream::Stop() { |
transport_adapter_.Disable(); |
} |
+void VideoReceiveStream::SetSyncChannel(VoiceEngine* voice_engine, |
+ int audio_channel_id) { |
+ if (voice_engine != nullptr && audio_channel_id != -1) { |
+ VoEVideoSync* voe_sync_interface = VoEVideoSync::GetInterface(voice_engine); |
+ vie_channel_->SetVoiceChannel(audio_channel_id, voe_sync_interface); |
+ voe_sync_interface->Release(); |
+ } else { |
+ vie_channel_->SetVoiceChannel(-1, nullptr); |
+ } |
+} |
+ |
VideoReceiveStream::Stats VideoReceiveStream::GetStats() const { |
return stats_proxy_->GetStats(); |
} |