Chromium Code Reviews| OLD | NEW |
|---|---|
| 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 #ifndef WEBRTC_MODULES_AUDIO_MIXER_AUDIO_MIXER_IMPL_H_ | 11 #ifndef WEBRTC_MODULES_AUDIO_MIXER_AUDIO_MIXER_IMPL_H_ |
| 12 #define WEBRTC_MODULES_AUDIO_MIXER_AUDIO_MIXER_IMPL_H_ | 12 #define WEBRTC_MODULES_AUDIO_MIXER_AUDIO_MIXER_IMPL_H_ |
| 13 | 13 |
| 14 #include <map> | 14 #include <map> |
| 15 #include <memory> | 15 #include <memory> |
| 16 #include <vector> | 16 #include <vector> |
| 17 | 17 |
| 18 #include "webrtc/base/thread_annotations.h" | 18 #include "webrtc/base/thread_annotations.h" |
| 19 #include "webrtc/base/thread_checker.h" | 19 #include "webrtc/base/thread_checker.h" |
| 20 #include "webrtc/modules/audio_mixer/audio_mixer.h" | 20 #include "webrtc/modules/audio_mixer/audio_mixer.h" |
| 21 #include "webrtc/modules/audio_mixer/audio_source_with_mix_status.h" | |
| 22 #include "webrtc/modules/audio_processing/include/audio_processing.h" | 21 #include "webrtc/modules/audio_processing/include/audio_processing.h" |
| 23 #include "webrtc/modules/include/module_common_types.h" | 22 #include "webrtc/modules/include/module_common_types.h" |
| 24 #include "webrtc/system_wrappers/include/critical_section_wrapper.h" | 23 #include "webrtc/system_wrappers/include/critical_section_wrapper.h" |
| 25 #include "webrtc/voice_engine/level_indicator.h" | 24 #include "webrtc/voice_engine/level_indicator.h" |
| 26 #include "webrtc/voice_engine_configurations.h" | 25 #include "webrtc/voice_engine_configurations.h" |
| 27 | 26 |
| 28 namespace webrtc { | 27 namespace webrtc { |
| 29 | 28 |
| 30 typedef std::vector<AudioFrame*> AudioFrameList; | 29 typedef std::vector<AudioFrame*> AudioFrameList; |
| 31 typedef std::vector<AudioSourceWithMixStatus> MixerAudioSourceList; | |
| 32 | 30 |
| 33 class AudioMixerImpl : public AudioMixer { | 31 class AudioMixerImpl : public AudioMixer { |
| 34 public: | 32 public: |
| 33 struct SourceStatus { | |
| 34 SourceStatus(Source* audio_source, bool is_mixed, float gain) | |
| 35 : audio_source_(audio_source), is_mixed_(is_mixed), gain_(gain) {} | |
| 36 Source* audio_source_ = nullptr; | |
|
hlundin-webrtc
2016/10/07 15:03:10
Structs don't have trailing underscore on the memb
aleloi
2016/10/10 10:58:17
Thanks! I think I should re-read the style guide a
| |
| 37 bool is_mixed_ = false; | |
| 38 float gain_ = 0; | |
| 39 }; | |
| 40 | |
| 41 typedef std::vector<SourceStatus> MixerAudioSourceList; | |
|
hlundin-webrtc
2016/10/07 15:03:10
How about SourceStatusList?
aleloi
2016/10/10 10:58:17
Done.
| |
| 42 | |
| 35 // AudioProcessing only accepts 10 ms frames. | 43 // AudioProcessing only accepts 10 ms frames. |
| 36 static const int kFrameDurationInMs = 10; | 44 static const int kFrameDurationInMs = 10; |
| 37 | 45 |
| 38 static std::unique_ptr<AudioMixerImpl> Create(int id); | 46 static std::unique_ptr<AudioMixerImpl> Create(int id); |
| 39 | 47 |
| 40 ~AudioMixerImpl() override; | 48 ~AudioMixerImpl() override; |
| 41 | 49 |
| 42 // AudioMixer functions | 50 // AudioMixer functions |
| 43 int32_t SetMixabilityStatus(Source* audio_source, bool mixable) override; | 51 int32_t SetMixabilityStatus(Source* audio_source, bool mixable) override; |
| 44 bool MixabilityStatus(const Source& audio_source) const override; | 52 bool MixabilityStatus(const Source& audio_source) const override; |
| (...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 112 std::unique_ptr<AudioProcessing> limiter_ ACCESS_ON(&thread_checker_); | 120 std::unique_ptr<AudioProcessing> limiter_ ACCESS_ON(&thread_checker_); |
| 113 | 121 |
| 114 // Measures audio level for the combined signal. | 122 // Measures audio level for the combined signal. |
| 115 voe::AudioLevel audio_level_ ACCESS_ON(&thread_checker_); | 123 voe::AudioLevel audio_level_ ACCESS_ON(&thread_checker_); |
| 116 | 124 |
| 117 RTC_DISALLOW_COPY_AND_ASSIGN(AudioMixerImpl); | 125 RTC_DISALLOW_COPY_AND_ASSIGN(AudioMixerImpl); |
| 118 }; | 126 }; |
| 119 } // namespace webrtc | 127 } // namespace webrtc |
| 120 | 128 |
| 121 #endif // WEBRTC_MODULES_AUDIO_MIXER_AUDIO_MIXER_IMPL_H_ | 129 #endif // WEBRTC_MODULES_AUDIO_MIXER_AUDIO_MIXER_IMPL_H_ |
| OLD | NEW |