Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(11)

Side by Side Diff: webrtc/video/vie_channel.cc

Issue 1698183002: Extract ViESyncModule outside ViEChannel. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: feedback Created 4 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « webrtc/video/vie_channel.h ('k') | webrtc/video/vie_sync_module.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (c) 2012 The WebRTC project authors. All Rights Reserved. 2 * Copyright (c) 2012 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 77 matching lines...) Expand 10 before | Expand all | Expand 10 after
88 PacedSender* paced_sender, 88 PacedSender* paced_sender,
89 PacketRouter* packet_router, 89 PacketRouter* packet_router,
90 size_t max_rtp_streams, 90 size_t max_rtp_streams,
91 bool sender) 91 bool sender)
92 : sender_(sender), 92 : sender_(sender),
93 module_process_thread_(module_process_thread), 93 module_process_thread_(module_process_thread),
94 send_payload_router_(send_payload_router), 94 send_payload_router_(send_payload_router),
95 vcm_protection_callback_(new ViEChannelProtectionCallback(this)), 95 vcm_protection_callback_(new ViEChannelProtectionCallback(this)),
96 vcm_(vcm), 96 vcm_(vcm),
97 vie_receiver_(vcm_, remote_bitrate_estimator, this), 97 vie_receiver_(vcm_, remote_bitrate_estimator, this),
98 vie_sync_(vcm_),
99 stats_observer_(new ChannelStatsObserver(this)), 98 stats_observer_(new ChannelStatsObserver(this)),
100 receive_stats_callback_(nullptr), 99 receive_stats_callback_(nullptr),
101 incoming_video_stream_(nullptr), 100 incoming_video_stream_(nullptr),
102 intra_frame_observer_(intra_frame_observer), 101 intra_frame_observer_(intra_frame_observer),
103 rtt_stats_(rtt_stats), 102 rtt_stats_(rtt_stats),
104 paced_sender_(paced_sender), 103 paced_sender_(paced_sender),
105 packet_router_(packet_router), 104 packet_router_(packet_router),
106 bandwidth_observer_(bandwidth_observer), 105 bandwidth_observer_(bandwidth_observer),
107 transport_feedback_observer_(transport_feedback_observer), 106 transport_feedback_observer_(transport_feedback_observer),
108 nack_history_size_sender_(kMinSendSidePacketHistorySize), 107 nack_history_size_sender_(kMinSendSidePacketHistorySize),
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after
159 std::vector<RtpRtcp*>(1, rtp_rtcp_modules_[0])); 158 std::vector<RtpRtcp*>(1, rtp_rtcp_modules_[0]));
160 RTC_DCHECK(!send_payload_router_->active()); 159 RTC_DCHECK(!send_payload_router_->active());
161 } else { 160 } else {
162 if (vcm_->RegisterReceiveCallback(this) != 0) { 161 if (vcm_->RegisterReceiveCallback(this) != 0) {
163 return -1; 162 return -1;
164 } 163 }
165 vcm_->RegisterFrameTypeCallback(this); 164 vcm_->RegisterFrameTypeCallback(this);
166 vcm_->RegisterReceiveStatisticsCallback(this); 165 vcm_->RegisterReceiveStatisticsCallback(this);
167 vcm_->RegisterDecoderTimingCallback(this); 166 vcm_->RegisterDecoderTimingCallback(this);
168 vcm_->SetRenderDelay(kDefaultRenderDelayMs); 167 vcm_->SetRenderDelay(kDefaultRenderDelayMs);
169 module_process_thread_->RegisterModule(&vie_sync_);
170 } 168 }
171 return 0; 169 return 0;
172 } 170 }
173 171
174 ViEChannel::~ViEChannel() { 172 ViEChannel::~ViEChannel() {
175 UpdateHistograms(); 173 UpdateHistograms();
176 // Make sure we don't get more callbacks from the RTP module. 174 // Make sure we don't get more callbacks from the RTP module.
177 module_process_thread_->DeRegisterModule( 175 module_process_thread_->DeRegisterModule(
178 vie_receiver_.GetReceiveStatistics()); 176 vie_receiver_.GetReceiveStatistics());
179 if (sender_) { 177 if (sender_) {
180 send_payload_router_->SetSendingRtpModules(std::vector<RtpRtcp*>()); 178 send_payload_router_->SetSendingRtpModules(std::vector<RtpRtcp*>());
181 } else {
182 module_process_thread_->DeRegisterModule(&vie_sync_);
183 } 179 }
184 for (size_t i = 0; i < num_active_rtp_rtcp_modules_; ++i) 180 for (size_t i = 0; i < num_active_rtp_rtcp_modules_; ++i)
185 packet_router_->RemoveRtpModule(rtp_rtcp_modules_[i], sender_); 181 packet_router_->RemoveRtpModule(rtp_rtcp_modules_[i], sender_);
186 for (RtpRtcp* rtp_rtcp : rtp_rtcp_modules_) { 182 for (RtpRtcp* rtp_rtcp : rtp_rtcp_modules_) {
187 module_process_thread_->DeRegisterModule(rtp_rtcp); 183 module_process_thread_->DeRegisterModule(rtp_rtcp);
188 delete rtp_rtcp; 184 delete rtp_rtcp;
189 } 185 }
190 } 186 }
191 187
192 void ViEChannel::UpdateHistograms() { 188 void ViEChannel::UpdateHistograms() {
(...skipping 800 matching lines...) Expand 10 before | Expand all | Expand 10 after
993 rtp_rtcp->SetRTCPStatus(RtcpMode::kCompound); 989 rtp_rtcp->SetRTCPStatus(RtcpMode::kCompound);
994 modules.push_back(rtp_rtcp); 990 modules.push_back(rtp_rtcp);
995 // Receive statistics and remote bitrate estimator should only be set for 991 // Receive statistics and remote bitrate estimator should only be set for
996 // the primary (first) module. 992 // the primary (first) module.
997 configuration.receive_statistics = null_receive_statistics; 993 configuration.receive_statistics = null_receive_statistics;
998 configuration.remote_bitrate_estimator = nullptr; 994 configuration.remote_bitrate_estimator = nullptr;
999 } 995 }
1000 return modules; 996 return modules;
1001 } 997 }
1002 998
1003 int32_t ViEChannel::SetVoiceChannel(int32_t ve_channel_id,
1004 VoEVideoSync* ve_sync_interface) {
1005 RTC_DCHECK(!sender_);
1006 return vie_sync_.ConfigureSync(ve_channel_id, ve_sync_interface,
1007 rtp_rtcp_modules_[0],
1008 vie_receiver_.GetRtpReceiver());
1009 }
1010
1011 int32_t ViEChannel::VoiceChannel() {
1012 RTC_DCHECK(!sender_);
1013 return vie_sync_.VoiceChannel();
1014 }
1015
1016 void ViEChannel::RegisterPreRenderCallback( 999 void ViEChannel::RegisterPreRenderCallback(
1017 I420FrameCallback* pre_render_callback) { 1000 I420FrameCallback* pre_render_callback) {
1018 RTC_DCHECK(!sender_); 1001 RTC_DCHECK(!sender_);
1019 rtc::CritScope lock(&crit_); 1002 rtc::CritScope lock(&crit_);
1020 pre_render_callback_ = pre_render_callback; 1003 pre_render_callback_ = pre_render_callback;
1021 } 1004 }
1022 1005
1023 // TODO(pbos): Remove as soon as audio can handle a changing payload type 1006 // TODO(pbos): Remove as soon as audio can handle a changing payload type
1024 // without this callback. 1007 // without this callback.
1025 int32_t ViEChannel::OnInitializeDecoder( 1008 int32_t ViEChannel::OnInitializeDecoder(
(...skipping 22 matching lines...) Expand all
1048 rtc::CritScope lock(&crit_); 1031 rtc::CritScope lock(&crit_);
1049 receive_stats_callback_ = receive_statistics_proxy; 1032 receive_stats_callback_ = receive_statistics_proxy;
1050 } 1033 }
1051 1034
1052 void ViEChannel::SetIncomingVideoStream( 1035 void ViEChannel::SetIncomingVideoStream(
1053 IncomingVideoStream* incoming_video_stream) { 1036 IncomingVideoStream* incoming_video_stream) {
1054 rtc::CritScope lock(&crit_); 1037 rtc::CritScope lock(&crit_);
1055 incoming_video_stream_ = incoming_video_stream; 1038 incoming_video_stream_ = incoming_video_stream;
1056 } 1039 }
1057 } // namespace webrtc 1040 } // namespace webrtc
OLDNEW
« no previous file with comments | « webrtc/video/vie_channel.h ('k') | webrtc/video/vie_sync_module.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698