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

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

Issue 2685673003: Define RtpTransportControllerSendInterface. (Closed)
Patch Set: Created 3 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
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
11 #include "webrtc/voice_engine/channel.h" 11 #include "webrtc/voice_engine/channel.h"
12 12
13 #include <algorithm> 13 #include <algorithm>
14 #include <utility> 14 #include <utility>
15 15
16 #include "webrtc/audio/utility/audio_frame_operations.h" 16 #include "webrtc/audio/utility/audio_frame_operations.h"
17 #include "webrtc/base/array_view.h" 17 #include "webrtc/base/array_view.h"
18 #include "webrtc/base/checks.h" 18 #include "webrtc/base/checks.h"
19 #include "webrtc/base/criticalsection.h" 19 #include "webrtc/base/criticalsection.h"
20 #include "webrtc/base/format_macros.h" 20 #include "webrtc/base/format_macros.h"
21 #include "webrtc/base/logging.h" 21 #include "webrtc/base/logging.h"
22 #include "webrtc/base/rate_limiter.h" 22 #include "webrtc/base/rate_limiter.h"
23 #include "webrtc/base/thread_checker.h" 23 #include "webrtc/base/thread_checker.h"
24 #include "webrtc/base/timeutils.h" 24 #include "webrtc/base/timeutils.h"
25 #include "webrtc/call/rtp_transport_controller.h"
25 #include "webrtc/config.h" 26 #include "webrtc/config.h"
26 #include "webrtc/logging/rtc_event_log/rtc_event_log.h" 27 #include "webrtc/logging/rtc_event_log/rtc_event_log.h"
27 #include "webrtc/modules/audio_coding/codecs/audio_format_conversion.h" 28 #include "webrtc/modules/audio_coding/codecs/audio_format_conversion.h"
28 #include "webrtc/modules/audio_device/include/audio_device.h" 29 #include "webrtc/modules/audio_device/include/audio_device.h"
29 #include "webrtc/modules/audio_processing/include/audio_processing.h" 30 #include "webrtc/modules/audio_processing/include/audio_processing.h"
30 #include "webrtc/modules/include/module_common_types.h" 31 #include "webrtc/modules/include/module_common_types.h"
31 #include "webrtc/modules/pacing/packet_router.h" 32 #include "webrtc/modules/pacing/packet_router.h"
32 #include "webrtc/modules/rtp_rtcp/include/receive_statistics.h" 33 #include "webrtc/modules/rtp_rtcp/include/receive_statistics.h"
33 #include "webrtc/modules/rtp_rtcp/include/rtp_payload_registry.h" 34 #include "webrtc/modules/rtp_rtcp/include/rtp_payload_registry.h"
34 #include "webrtc/modules/rtp_rtcp/include/rtp_receiver.h" 35 #include "webrtc/modules/rtp_rtcp/include/rtp_receiver.h"
(...skipping 2380 matching lines...) Expand 10 before | Expand all | Expand 10 after
2415 2416
2416 void Channel::EnableReceiveTransportSequenceNumber(int id) { 2417 void Channel::EnableReceiveTransportSequenceNumber(int id) {
2417 rtp_header_parser_->DeregisterRtpHeaderExtension( 2418 rtp_header_parser_->DeregisterRtpHeaderExtension(
2418 kRtpExtensionTransportSequenceNumber); 2419 kRtpExtensionTransportSequenceNumber);
2419 bool ret = rtp_header_parser_->RegisterRtpHeaderExtension( 2420 bool ret = rtp_header_parser_->RegisterRtpHeaderExtension(
2420 kRtpExtensionTransportSequenceNumber, id); 2421 kRtpExtensionTransportSequenceNumber, id);
2421 RTC_DCHECK(ret); 2422 RTC_DCHECK(ret);
2422 } 2423 }
2423 2424
2424 void Channel::RegisterSenderCongestionControlObjects( 2425 void Channel::RegisterSenderCongestionControlObjects(
2425 RtpPacketSender* rtp_packet_sender, 2426 RtpTransportControllerSenderInterface* transport) {
2426 TransportFeedbackObserver* transport_feedback_observer, 2427 RtpPacketSender* rtp_packet_sender =
2427 PacketRouter* packet_router) { 2428 transport->congestion_controller()->pacer();
2429 TransportFeedbackObserver* transport_feedback_observer =
2430 transport->congestion_controller()->GetTransportFeedbackObserver();
2431 PacketRouter* packet_router = transport->packet_router();
2432
2428 RTC_DCHECK(rtp_packet_sender); 2433 RTC_DCHECK(rtp_packet_sender);
2429 RTC_DCHECK(transport_feedback_observer); 2434 RTC_DCHECK(transport_feedback_observer);
2430 RTC_DCHECK(packet_router && !packet_router_); 2435 RTC_DCHECK(packet_router && !packet_router_);
2431 feedback_observer_proxy_->SetTransportFeedbackObserver( 2436 feedback_observer_proxy_->SetTransportFeedbackObserver(
2432 transport_feedback_observer); 2437 transport_feedback_observer);
2433 seq_num_allocator_proxy_->SetSequenceNumberAllocator(packet_router); 2438 seq_num_allocator_proxy_->SetSequenceNumberAllocator(packet_router);
2434 rtp_packet_sender_proxy_->SetPacketSender(rtp_packet_sender); 2439 rtp_packet_sender_proxy_->SetPacketSender(rtp_packet_sender);
2435 _rtpRtcpModule->SetStorePacketsStatus(true, 600); 2440 _rtpRtcpModule->SetStorePacketsStatus(true, 600);
2436 packet_router->AddRtpModule(_rtpRtcpModule.get()); 2441 packet_router->AddRtpModule(_rtpRtcpModule.get());
2437 packet_router_ = packet_router; 2442 packet_router_ = packet_router;
(...skipping 865 matching lines...) Expand 10 before | Expand all | Expand 10 after
3303 int64_t min_rtt = 0; 3308 int64_t min_rtt = 0;
3304 if (_rtpRtcpModule->RTT(remoteSSRC, &rtt, &avg_rtt, &min_rtt, &max_rtt) != 3309 if (_rtpRtcpModule->RTT(remoteSSRC, &rtt, &avg_rtt, &min_rtt, &max_rtt) !=
3305 0) { 3310 0) {
3306 return 0; 3311 return 0;
3307 } 3312 }
3308 return rtt; 3313 return rtt;
3309 } 3314 }
3310 3315
3311 } // namespace voe 3316 } // namespace voe
3312 } // namespace webrtc 3317 } // namespace webrtc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698