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

Side by Side Diff: webrtc/media/engine/webrtcvoiceengine.cc

Issue 2469743002: Passed AudioMixer to AudioState::Config. (Closed)
Patch Set: Rebase. GYP removed! Created 4 years, 1 month 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
« no previous file with comments | « webrtc/media/DEPS ('k') | webrtc/modules/audio_mixer/BUILD.gn » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (c) 2004 The WebRTC project authors. All Rights Reserved. 2 * Copyright (c) 2004 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 19 matching lines...) Expand all
30 #include "webrtc/base/stringencode.h" 30 #include "webrtc/base/stringencode.h"
31 #include "webrtc/base/stringutils.h" 31 #include "webrtc/base/stringutils.h"
32 #include "webrtc/base/trace_event.h" 32 #include "webrtc/base/trace_event.h"
33 #include "webrtc/media/base/audiosource.h" 33 #include "webrtc/media/base/audiosource.h"
34 #include "webrtc/media/base/mediaconstants.h" 34 #include "webrtc/media/base/mediaconstants.h"
35 #include "webrtc/media/base/streamparams.h" 35 #include "webrtc/media/base/streamparams.h"
36 #include "webrtc/media/engine/payload_type_mapper.h" 36 #include "webrtc/media/engine/payload_type_mapper.h"
37 #include "webrtc/media/engine/webrtcmediaengine.h" 37 #include "webrtc/media/engine/webrtcmediaengine.h"
38 #include "webrtc/media/engine/webrtcvoe.h" 38 #include "webrtc/media/engine/webrtcvoe.h"
39 #include "webrtc/modules/audio_coding/acm2/rent_a_codec.h" 39 #include "webrtc/modules/audio_coding/acm2/rent_a_codec.h"
40 #include "webrtc/modules/audio_mixer/audio_mixer_impl.h"
40 #include "webrtc/modules/audio_processing/include/audio_processing.h" 41 #include "webrtc/modules/audio_processing/include/audio_processing.h"
41 #include "webrtc/system_wrappers/include/field_trial.h" 42 #include "webrtc/system_wrappers/include/field_trial.h"
42 #include "webrtc/system_wrappers/include/trace.h" 43 #include "webrtc/system_wrappers/include/trace.h"
43 44
44 namespace cricket { 45 namespace cricket {
45 namespace { 46 namespace {
46 47
47 const int kDefaultTraceFilter = webrtc::kTraceNone | webrtc::kTraceTerseInfo | 48 const int kDefaultTraceFilter = webrtc::kTraceNone | webrtc::kTraceTerseInfo |
48 webrtc::kTraceWarning | webrtc::kTraceError | 49 webrtc::kTraceWarning | webrtc::kTraceError |
49 webrtc::kTraceCritical; 50 webrtc::kTraceCritical;
(...skipping 222 matching lines...) Expand 10 before | Expand all | Expand 10 after
272 // voe_codec.channels to 2 if "stereo=1" and 1 otherwise. If 273 // voe_codec.channels to 2 if "stereo=1" and 1 otherwise. If
273 // the bitrate is not specified, i.e. is <= zero, we set it to the 274 // the bitrate is not specified, i.e. is <= zero, we set it to the
274 // appropriate default value for mono or stereo Opus. 275 // appropriate default value for mono or stereo Opus.
275 voe_codec->channels = IsCodecFeatureEnabled(codec, kCodecParamStereo) ? 2 : 1; 276 voe_codec->channels = IsCodecFeatureEnabled(codec, kCodecParamStereo) ? 2 : 1;
276 voe_codec->rate = GetOpusBitrate(codec, *max_playback_rate); 277 voe_codec->rate = GetOpusBitrate(codec, *max_playback_rate);
277 } 278 }
278 279
279 webrtc::AudioState::Config MakeAudioStateConfig(VoEWrapper* voe_wrapper) { 280 webrtc::AudioState::Config MakeAudioStateConfig(VoEWrapper* voe_wrapper) {
280 webrtc::AudioState::Config config; 281 webrtc::AudioState::Config config;
281 config.voice_engine = voe_wrapper->engine(); 282 config.voice_engine = voe_wrapper->engine();
283 config.audio_mixer = webrtc::AudioMixerImpl::Create();
282 return config; 284 return config;
283 } 285 }
284 286
285 class WebRtcVoiceCodecs final { 287 class WebRtcVoiceCodecs final {
286 public: 288 public:
287 // TODO(solenberg): Do this filtering once off-line, add a simple AudioCodec 289 // TODO(solenberg): Do this filtering once off-line, add a simple AudioCodec
288 // list and add a test which verifies VoE supports the listed codecs. 290 // list and add a test which verifies VoE supports the listed codecs.
289 static std::vector<AudioCodec> SupportedSendCodecs() { 291 static std::vector<AudioCodec> SupportedSendCodecs() {
290 std::vector<AudioCodec> result; 292 std::vector<AudioCodec> result;
291 // Iterate first over our preferred codecs list, so that the results are 293 // Iterate first over our preferred codecs list, so that the results are
(...skipping 2286 matching lines...) Expand 10 before | Expand all | Expand 10 after
2578 RTC_DCHECK(worker_thread_checker_.CalledOnValidThread()); 2580 RTC_DCHECK(worker_thread_checker_.CalledOnValidThread());
2579 const auto it = send_streams_.find(ssrc); 2581 const auto it = send_streams_.find(ssrc);
2580 if (it != send_streams_.end()) { 2582 if (it != send_streams_.end()) {
2581 return it->second->channel(); 2583 return it->second->channel();
2582 } 2584 }
2583 return -1; 2585 return -1;
2584 } 2586 }
2585 } // namespace cricket 2587 } // namespace cricket
2586 2588
2587 #endif // HAVE_WEBRTC_VOICE 2589 #endif // HAVE_WEBRTC_VOICE
OLDNEW
« no previous file with comments | « webrtc/media/DEPS ('k') | webrtc/modules/audio_mixer/BUILD.gn » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698