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

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

Issue 1991233004: Moved creation of AudioDecoderFactory to inside PeerConnectionFactory. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@audio-decoder-factory-injections-3
Patch Set: Removed explicit constructor qualifier. Fixed comment grammar. 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 76 matching lines...) Expand 10 before | Expand all | Expand 10 after
87 LOG(LS_INFO) << "AudioReceiveStream: " << config_.ToString(); 87 LOG(LS_INFO) << "AudioReceiveStream: " << config_.ToString();
88 RTC_DCHECK_NE(config_.voe_channel_id, -1); 88 RTC_DCHECK_NE(config_.voe_channel_id, -1);
89 RTC_DCHECK(audio_state_.get()); 89 RTC_DCHECK(audio_state_.get());
90 RTC_DCHECK(congestion_controller); 90 RTC_DCHECK(congestion_controller);
91 RTC_DCHECK(rtp_header_parser_); 91 RTC_DCHECK(rtp_header_parser_);
92 92
93 VoiceEngineImpl* voe_impl = static_cast<VoiceEngineImpl*>(voice_engine()); 93 VoiceEngineImpl* voe_impl = static_cast<VoiceEngineImpl*>(voice_engine());
94 channel_proxy_ = voe_impl->GetChannelProxy(config_.voe_channel_id); 94 channel_proxy_ = voe_impl->GetChannelProxy(config_.voe_channel_id);
95 channel_proxy_->SetLocalSSRC(config.rtp.local_ssrc); 95 channel_proxy_->SetLocalSSRC(config.rtp.local_ssrc);
96 96
97 // This is where we'd like to set the decoder factory to use. However, since
the sun 2016/05/30 19:09:53 A TODO(ossu) seems appropriate here I think.
ossu 2016/06/02 15:47:47 Acknowledged.
98 // it needs to be included when constructing Channel, we cannot do that until
99 // we're able to move Channel ownership into the Audio{Send,Receive}Streams.
100 // The best we can do is check that we're not trying to use two different
101 // factories using the different interfaces.
102 RTC_CHECK(config.decoder_factory);
103 RTC_CHECK(config.decoder_factory == channel_proxy_->GetAudioDecoderFactory());
the sun 2016/05/30 19:09:53 RTC_CHECK_EQ
ossu 2016/06/02 15:47:47 Acknowledged.
104
97 channel_proxy_->RegisterExternalTransport(config.rtcp_send_transport); 105 channel_proxy_->RegisterExternalTransport(config.rtcp_send_transport);
98 106
99 for (const auto& extension : config.rtp.extensions) { 107 for (const auto& extension : config.rtp.extensions) {
100 if (extension.name == RtpExtension::kAudioLevel) { 108 if (extension.name == RtpExtension::kAudioLevel) {
101 channel_proxy_->SetReceiveAudioLevelIndicationStatus(true, extension.id); 109 channel_proxy_->SetReceiveAudioLevelIndicationStatus(true, extension.id);
102 bool registered = rtp_header_parser_->RegisterRtpHeaderExtension( 110 bool registered = rtp_header_parser_->RegisterRtpHeaderExtension(
103 kRtpExtensionAudioLevel, extension.id); 111 kRtpExtensionAudioLevel, extension.id);
104 RTC_DCHECK(registered); 112 RTC_DCHECK(registered);
105 } else if (extension.name == RtpExtension::kAbsSendTime) { 113 } else if (extension.name == RtpExtension::kAbsSendTime) {
106 channel_proxy_->SetReceiveAbsoluteSenderTimeStatus(true, extension.id); 114 channel_proxy_->SetReceiveAbsoluteSenderTimeStatus(true, extension.id);
(...skipping 136 matching lines...) Expand 10 before | Expand all | Expand 10 after
243 251
244 VoiceEngine* AudioReceiveStream::voice_engine() const { 252 VoiceEngine* AudioReceiveStream::voice_engine() const {
245 internal::AudioState* audio_state = 253 internal::AudioState* audio_state =
246 static_cast<internal::AudioState*>(audio_state_.get()); 254 static_cast<internal::AudioState*>(audio_state_.get());
247 VoiceEngine* voice_engine = audio_state->voice_engine(); 255 VoiceEngine* voice_engine = audio_state->voice_engine();
248 RTC_DCHECK(voice_engine); 256 RTC_DCHECK(voice_engine);
249 return voice_engine; 257 return voice_engine;
250 } 258 }
251 } // namespace internal 259 } // namespace internal
252 } // namespace webrtc 260 } // namespace webrtc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698