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

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

Issue 2060813002: Configure VoE NACK through AudioReceiveStream::Config. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@wvoe_config_nack
Patch Set: Created 4 years, 6 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) 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
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
43 } 43 }
44 } 44 }
45 return false; 45 return false;
46 } 46 }
47 } // namespace 47 } // namespace
48 48
49 std::string AudioReceiveStream::Config::Rtp::ToString() const { 49 std::string AudioReceiveStream::Config::Rtp::ToString() const {
50 std::stringstream ss; 50 std::stringstream ss;
51 ss << "{remote_ssrc: " << remote_ssrc; 51 ss << "{remote_ssrc: " << remote_ssrc;
52 ss << ", local_ssrc: " << local_ssrc; 52 ss << ", local_ssrc: " << local_ssrc;
53 ss << ", transport_cc: " << (transport_cc ? "on" : "off");
54 ss << ", nack: " << nack.ToString();
53 ss << ", extensions: ["; 55 ss << ", extensions: [";
54 for (size_t i = 0; i < extensions.size(); ++i) { 56 for (size_t i = 0; i < extensions.size(); ++i) {
55 ss << extensions[i].ToString(); 57 ss << extensions[i].ToString();
56 if (i != extensions.size() - 1) { 58 if (i != extensions.size() - 1) {
57 ss << ", "; 59 ss << ", ";
58 } 60 }
59 } 61 }
60 ss << ']'; 62 ss << ']';
61 ss << ", transport_cc: " << (transport_cc ? "on" : "off");
62 ss << '}'; 63 ss << '}';
63 return ss.str(); 64 return ss.str();
64 } 65 }
65 66
66 std::string AudioReceiveStream::Config::ToString() const { 67 std::string AudioReceiveStream::Config::ToString() const {
67 std::stringstream ss; 68 std::stringstream ss;
68 ss << "{rtp: " << rtp.ToString(); 69 ss << "{rtp: " << rtp.ToString();
69 ss << ", rtcp_send_transport: " 70 ss << ", rtcp_send_transport: "
70 << (rtcp_send_transport ? "(Transport)" : "nullptr"); 71 << (rtcp_send_transport ? "(Transport)" : "nullptr");
71 ss << ", voe_channel_id: " << voe_channel_id; 72 ss << ", voe_channel_id: " << voe_channel_id;
(...skipping 14 matching lines...) Expand all
86 rtp_header_parser_(RtpHeaderParser::Create()) { 87 rtp_header_parser_(RtpHeaderParser::Create()) {
87 LOG(LS_INFO) << "AudioReceiveStream: " << config_.ToString(); 88 LOG(LS_INFO) << "AudioReceiveStream: " << config_.ToString();
88 RTC_DCHECK_NE(config_.voe_channel_id, -1); 89 RTC_DCHECK_NE(config_.voe_channel_id, -1);
89 RTC_DCHECK(audio_state_.get()); 90 RTC_DCHECK(audio_state_.get());
90 RTC_DCHECK(congestion_controller); 91 RTC_DCHECK(congestion_controller);
91 RTC_DCHECK(rtp_header_parser_); 92 RTC_DCHECK(rtp_header_parser_);
92 93
93 VoiceEngineImpl* voe_impl = static_cast<VoiceEngineImpl*>(voice_engine()); 94 VoiceEngineImpl* voe_impl = static_cast<VoiceEngineImpl*>(voice_engine());
94 channel_proxy_ = voe_impl->GetChannelProxy(config_.voe_channel_id); 95 channel_proxy_ = voe_impl->GetChannelProxy(config_.voe_channel_id);
95 channel_proxy_->SetLocalSSRC(config.rtp.local_ssrc); 96 channel_proxy_->SetLocalSSRC(config.rtp.local_ssrc);
97 // TODO(solenberg): Config NACK history window (which is a packet count),
98 // using the actual packet size for the configured codec.
99 channel_proxy_->SetNACKStatus(config_.rtp.nack.rtp_history_ms != 0,
100 config_.rtp.nack.rtp_history_ms / 20);
96 101
97 channel_proxy_->RegisterExternalTransport(config.rtcp_send_transport); 102 channel_proxy_->RegisterExternalTransport(config.rtcp_send_transport);
98 103
99 for (const auto& extension : config.rtp.extensions) { 104 for (const auto& extension : config.rtp.extensions) {
100 if (extension.uri == RtpExtension::kAudioLevelUri) { 105 if (extension.uri == RtpExtension::kAudioLevelUri) {
101 channel_proxy_->SetReceiveAudioLevelIndicationStatus(true, extension.id); 106 channel_proxy_->SetReceiveAudioLevelIndicationStatus(true, extension.id);
102 bool registered = rtp_header_parser_->RegisterRtpHeaderExtension( 107 bool registered = rtp_header_parser_->RegisterRtpHeaderExtension(
103 kRtpExtensionAudioLevel, extension.id); 108 kRtpExtensionAudioLevel, extension.id);
104 RTC_DCHECK(registered); 109 RTC_DCHECK(registered);
105 } else if (extension.uri == RtpExtension::kAbsSendTimeUri) { 110 } else if (extension.uri == RtpExtension::kAbsSendTimeUri) {
(...skipping 137 matching lines...) Expand 10 before | Expand all | Expand 10 after
243 248
244 VoiceEngine* AudioReceiveStream::voice_engine() const { 249 VoiceEngine* AudioReceiveStream::voice_engine() const {
245 internal::AudioState* audio_state = 250 internal::AudioState* audio_state =
246 static_cast<internal::AudioState*>(audio_state_.get()); 251 static_cast<internal::AudioState*>(audio_state_.get());
247 VoiceEngine* voice_engine = audio_state->voice_engine(); 252 VoiceEngine* voice_engine = audio_state->voice_engine();
248 RTC_DCHECK(voice_engine); 253 RTC_DCHECK(voice_engine);
249 return voice_engine; 254 return voice_engine;
250 } 255 }
251 } // namespace internal 256 } // namespace internal
252 } // namespace webrtc 257 } // namespace webrtc
OLDNEW
« no previous file with comments | « no previous file | webrtc/audio/audio_receive_stream_unittest.cc » ('j') | webrtc/media/engine/webrtcvoiceengine_unittest.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698