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

Side by Side Diff: webrtc/audio/audio_send_stream.cc

Issue 1479023002: Prepare the AudioSendStream to be hooked up to send-side BWE. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Magnus' comments addressed. Created 5 years 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) 2015 The WebRTC project authors. All Rights Reserved. 2 * Copyright (c) 2015 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/audio/audio_send_stream.h" 11 #include "webrtc/audio/audio_send_stream.h"
12 12
13 #include <string> 13 #include <string>
14 14
15 #include "webrtc/audio/audio_state.h" 15 #include "webrtc/audio/audio_state.h"
16 #include "webrtc/audio/conversion.h" 16 #include "webrtc/audio/conversion.h"
17 #include "webrtc/audio/scoped_voe_interface.h" 17 #include "webrtc/audio/scoped_voe_interface.h"
18 #include "webrtc/base/checks.h" 18 #include "webrtc/base/checks.h"
19 #include "webrtc/base/logging.h" 19 #include "webrtc/base/logging.h"
20 #include "webrtc/call/congestion_controller.h"
21 #include "webrtc/modules/pacing/paced_sender.h"
the sun 2015/12/03 11:10:28 I believe these 3 includes are unnecessary: paced_
stefan-webrtc 2015/12/04 10:31:42 Why do you think that? I can't remove them because
the sun 2015/12/04 12:04:48 Anything needed to make calls *on* CC should be pr
stefan-webrtc 2015/12/04 13:12:39 Ah, the problem is that I'm getting a PacedSender*
the sun 2015/12/04 14:01:57 Acknowledged.
22 #include "webrtc/modules/pacing/packet_router.h"
23 #include "webrtc/modules/rtp_rtcp/include/rtp_rtcp_defines.h"
20 #include "webrtc/voice_engine/channel_proxy.h" 24 #include "webrtc/voice_engine/channel_proxy.h"
21 #include "webrtc/voice_engine/include/voe_audio_processing.h" 25 #include "webrtc/voice_engine/include/voe_audio_processing.h"
22 #include "webrtc/voice_engine/include/voe_codec.h" 26 #include "webrtc/voice_engine/include/voe_codec.h"
23 #include "webrtc/voice_engine/include/voe_rtp_rtcp.h" 27 #include "webrtc/voice_engine/include/voe_rtp_rtcp.h"
24 #include "webrtc/voice_engine/include/voe_volume_control.h" 28 #include "webrtc/voice_engine/include/voe_volume_control.h"
25 #include "webrtc/voice_engine/voice_engine_impl.h" 29 #include "webrtc/voice_engine/voice_engine_impl.h"
26 30
27 namespace webrtc { 31 namespace webrtc {
28 std::string AudioSendStream::Config::Rtp::ToString() const { 32 std::string AudioSendStream::Config::Rtp::ToString() const {
29 std::stringstream ss; 33 std::stringstream ss;
(...skipping 18 matching lines...) Expand all
48 // TODO(solenberg): Encoder config. 52 // TODO(solenberg): Encoder config.
49 ss << ", cng_payload_type: " << cng_payload_type; 53 ss << ", cng_payload_type: " << cng_payload_type;
50 ss << ", red_payload_type: " << red_payload_type; 54 ss << ", red_payload_type: " << red_payload_type;
51 ss << '}'; 55 ss << '}';
52 return ss.str(); 56 return ss.str();
53 } 57 }
54 58
55 namespace internal { 59 namespace internal {
56 AudioSendStream::AudioSendStream( 60 AudioSendStream::AudioSendStream(
57 const webrtc::AudioSendStream::Config& config, 61 const webrtc::AudioSendStream::Config& config,
58 const rtc::scoped_refptr<webrtc::AudioState>& audio_state) 62 const rtc::scoped_refptr<webrtc::AudioState>& audio_state,
63 CongestionController* congestion_controller)
59 : config_(config), audio_state_(audio_state) { 64 : config_(config), audio_state_(audio_state) {
60 LOG(LS_INFO) << "AudioSendStream: " << config_.ToString(); 65 LOG(LS_INFO) << "AudioSendStream: " << config_.ToString();
61 RTC_DCHECK_NE(config_.voe_channel_id, -1); 66 RTC_DCHECK_NE(config_.voe_channel_id, -1);
62 RTC_DCHECK(audio_state_.get()); 67 RTC_DCHECK(audio_state_.get());
68 RTC_DCHECK(congestion_controller);
63 69
64 VoiceEngineImpl* voe_impl = static_cast<VoiceEngineImpl*>(voice_engine()); 70 VoiceEngineImpl* voe_impl = static_cast<VoiceEngineImpl*>(voice_engine());
65 channel_proxy_ = voe_impl->GetChannelProxy(config_.voe_channel_id); 71 channel_proxy_ = voe_impl->GetChannelProxy(config_.voe_channel_id);
72 channel_proxy_->SetCongestionControlObjects(
73 congestion_controller->pacer(),
74 congestion_controller->GetTransportFeedbackObserver(),
75 congestion_controller->packet_router());
66 channel_proxy_->SetRTCPStatus(true); 76 channel_proxy_->SetRTCPStatus(true);
67 channel_proxy_->SetLocalSSRC(config.rtp.ssrc); 77 channel_proxy_->SetLocalSSRC(config.rtp.ssrc);
68 channel_proxy_->SetRTCP_CNAME(config.rtp.c_name); 78 channel_proxy_->SetRTCP_CNAME(config.rtp.c_name);
79
69 for (const auto& extension : config.rtp.extensions) { 80 for (const auto& extension : config.rtp.extensions) {
70 if (extension.name == RtpExtension::kAbsSendTime) { 81 if (extension.name == RtpExtension::kAbsSendTime) {
71 channel_proxy_->SetSendAbsoluteSenderTimeStatus(true, extension.id); 82 channel_proxy_->SetSendAbsoluteSenderTimeStatus(true, extension.id);
72 } else if (extension.name == RtpExtension::kAudioLevel) { 83 } else if (extension.name == RtpExtension::kAudioLevel) {
73 channel_proxy_->SetSendAudioLevelIndicationStatus(true, extension.id); 84 channel_proxy_->SetSendAudioLevelIndicationStatus(true, extension.id);
85 } else if (extension.name == RtpExtension::kTransportSequenceNumber) {
86 channel_proxy_->EnableSendTransportSequenceNumber(extension.id);
74 } else { 87 } else {
75 RTC_NOTREACHED() << "Registering unsupported RTP extension."; 88 RTC_NOTREACHED() << "Registering unsupported RTP extension.";
76 } 89 }
77 } 90 }
78 } 91 }
79 92
80 AudioSendStream::~AudioSendStream() { 93 AudioSendStream::~AudioSendStream() {
81 RTC_DCHECK(thread_checker_.CalledOnValidThread()); 94 RTC_DCHECK(thread_checker_.CalledOnValidThread());
82 LOG(LS_INFO) << "~AudioSendStream: " << config_.ToString(); 95 LOG(LS_INFO) << "~AudioSendStream: " << config_.ToString();
96 channel_proxy_->SetCongestionControlObjects(nullptr, nullptr, nullptr);
83 } 97 }
84 98
85 void AudioSendStream::Start() { 99 void AudioSendStream::Start() {
86 RTC_DCHECK(thread_checker_.CalledOnValidThread()); 100 RTC_DCHECK(thread_checker_.CalledOnValidThread());
87 } 101 }
88 102
89 void AudioSendStream::Stop() { 103 void AudioSendStream::Stop() {
90 RTC_DCHECK(thread_checker_.CalledOnValidThread()); 104 RTC_DCHECK(thread_checker_.CalledOnValidThread());
91 } 105 }
92 106
(...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after
192 206
193 VoiceEngine* AudioSendStream::voice_engine() const { 207 VoiceEngine* AudioSendStream::voice_engine() const {
194 internal::AudioState* audio_state = 208 internal::AudioState* audio_state =
195 static_cast<internal::AudioState*>(audio_state_.get()); 209 static_cast<internal::AudioState*>(audio_state_.get());
196 VoiceEngine* voice_engine = audio_state->voice_engine(); 210 VoiceEngine* voice_engine = audio_state->voice_engine();
197 RTC_DCHECK(voice_engine); 211 RTC_DCHECK(voice_engine);
198 return voice_engine; 212 return voice_engine;
199 } 213 }
200 } // namespace internal 214 } // namespace internal
201 } // namespace webrtc 215 } // namespace webrtc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698