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

Side by Side Diff: webrtc/voice_engine/channel.cc

Issue 2774623006: Let PacketRouter separate send and receive modules. (Closed)
Patch Set: Send feedback messages on a send module, if possible. Created 3 years, 8 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
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 2366 matching lines...) Expand 10 before | Expand all | Expand 10 after
2377 RtcpBandwidthObserver* bandwidth_observer) { 2377 RtcpBandwidthObserver* bandwidth_observer) {
2378 RTC_DCHECK(rtp_packet_sender); 2378 RTC_DCHECK(rtp_packet_sender);
2379 RTC_DCHECK(transport_feedback_observer); 2379 RTC_DCHECK(transport_feedback_observer);
2380 RTC_DCHECK(packet_router && !packet_router_); 2380 RTC_DCHECK(packet_router && !packet_router_);
2381 rtcp_observer_->SetBandwidthObserver(bandwidth_observer); 2381 rtcp_observer_->SetBandwidthObserver(bandwidth_observer);
2382 feedback_observer_proxy_->SetTransportFeedbackObserver( 2382 feedback_observer_proxy_->SetTransportFeedbackObserver(
2383 transport_feedback_observer); 2383 transport_feedback_observer);
2384 seq_num_allocator_proxy_->SetSequenceNumberAllocator(packet_router); 2384 seq_num_allocator_proxy_->SetSequenceNumberAllocator(packet_router);
2385 rtp_packet_sender_proxy_->SetPacketSender(rtp_packet_sender); 2385 rtp_packet_sender_proxy_->SetPacketSender(rtp_packet_sender);
2386 _rtpRtcpModule->SetStorePacketsStatus(true, 600); 2386 _rtpRtcpModule->SetStorePacketsStatus(true, 600);
2387 packet_router->AddRtpModule(_rtpRtcpModule.get()); 2387 packet_router->AddSendRtpModule(_rtpRtcpModule.get());
2388 packet_router_ = packet_router; 2388 packet_router_ = packet_router;
2389 } 2389 }
2390 2390
2391 void Channel::RegisterReceiverCongestionControlObjects( 2391 void Channel::RegisterReceiverCongestionControlObjects(
2392 PacketRouter* packet_router) { 2392 PacketRouter* packet_router) {
2393 RTC_DCHECK(packet_router && !packet_router_); 2393 RTC_DCHECK(packet_router && !packet_router_);
2394 packet_router->AddRtpModule(_rtpRtcpModule.get()); 2394 packet_router->AddReceiveRtpModule(_rtpRtcpModule.get());
2395 packet_router_ = packet_router; 2395 packet_router_ = packet_router;
2396 } 2396 }
2397 2397
2398 void Channel::ResetCongestionControlObjects() { 2398 void Channel::ResetSenderCongestionControlObjects() {
2399 RTC_DCHECK(packet_router_); 2399 RTC_DCHECK(packet_router_);
2400 _rtpRtcpModule->SetStorePacketsStatus(false, 600); 2400 _rtpRtcpModule->SetStorePacketsStatus(false, 600);
2401 rtcp_observer_->SetBandwidthObserver(nullptr); 2401 rtcp_observer_->SetBandwidthObserver(nullptr);
2402 feedback_observer_proxy_->SetTransportFeedbackObserver(nullptr); 2402 feedback_observer_proxy_->SetTransportFeedbackObserver(nullptr);
2403 seq_num_allocator_proxy_->SetSequenceNumberAllocator(nullptr); 2403 seq_num_allocator_proxy_->SetSequenceNumberAllocator(nullptr);
2404 packet_router_->RemoveRtpModule(_rtpRtcpModule.get()); 2404 packet_router_->RemoveSendRtpModule(_rtpRtcpModule.get());
2405 packet_router_ = nullptr; 2405 packet_router_ = nullptr;
2406 rtp_packet_sender_proxy_->SetPacketSender(nullptr); 2406 rtp_packet_sender_proxy_->SetPacketSender(nullptr);
2407 } 2407 }
2408 2408
2409 void Channel::ResetReceiverCongestionControlObjects() {
2410 RTC_DCHECK(packet_router_);
2411 packet_router_->RemoveReceiveRtpModule(_rtpRtcpModule.get());
2412 packet_router_ = nullptr;
2413 }
2414
2409 void Channel::SetRTCPStatus(bool enable) { 2415 void Channel::SetRTCPStatus(bool enable) {
2410 WEBRTC_TRACE(kTraceInfo, kTraceVoice, VoEId(_instanceId, _channelId), 2416 WEBRTC_TRACE(kTraceInfo, kTraceVoice, VoEId(_instanceId, _channelId),
2411 "Channel::SetRTCPStatus()"); 2417 "Channel::SetRTCPStatus()");
2412 _rtpRtcpModule->SetRTCPStatus(enable ? RtcpMode::kCompound : RtcpMode::kOff); 2418 _rtpRtcpModule->SetRTCPStatus(enable ? RtcpMode::kCompound : RtcpMode::kOff);
2413 } 2419 }
2414 2420
2415 int Channel::GetRTCPStatus(bool& enabled) { 2421 int Channel::GetRTCPStatus(bool& enabled) {
2416 RtcpMode method = _rtpRtcpModule->RTCP(); 2422 RtcpMode method = _rtpRtcpModule->RTCP();
2417 enabled = (method != RtcpMode::kOff); 2423 enabled = (method != RtcpMode::kOff);
2418 return 0; 2424 return 0;
(...skipping 610 matching lines...) Expand 10 before | Expand all | Expand 10 after
3029 int64_t min_rtt = 0; 3035 int64_t min_rtt = 0;
3030 if (_rtpRtcpModule->RTT(remoteSSRC, &rtt, &avg_rtt, &min_rtt, &max_rtt) != 3036 if (_rtpRtcpModule->RTT(remoteSSRC, &rtt, &avg_rtt, &min_rtt, &max_rtt) !=
3031 0) { 3037 0) {
3032 return 0; 3038 return 0;
3033 } 3039 }
3034 return rtt; 3040 return rtt;
3035 } 3041 }
3036 3042
3037 } // namespace voe 3043 } // namespace voe
3038 } // namespace webrtc 3044 } // namespace webrtc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698