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_checker.h" | 18 #include "webrtc/base/thread_checker.h" |
| 19 #include "webrtc/engine_configurations.h" | 19 #include "webrtc/engine_configurations.h" |
| 20 #include "webrtc/modules/audio_mixer/audio_mixer.h" | 20 #include "webrtc/modules/audio_mixer/audio_mixer.h" |
| 21 #include "webrtc/modules/audio_processing/include/audio_processing.h" | |
| 21 #include "webrtc/modules/include/module_common_types.h" | 22 #include "webrtc/modules/include/module_common_types.h" |
| 23 #include "webrtc/system_wrappers/include/critical_section_wrapper.h" | |
| 22 #include "webrtc/voice_engine/level_indicator.h" | 24 #include "webrtc/voice_engine/level_indicator.h" |
| 23 | 25 |
| 24 namespace webrtc { | 26 namespace webrtc { |
| 25 class AudioProcessing; | |
| 26 class CriticalSectionWrapper; | |
|
aleloi
2016/09/01 14:12:22
Forward declaration replaced by imports.
| |
| 27 | 27 |
| 28 typedef std::vector<AudioFrame*> AudioFrameList; | 28 typedef std::vector<AudioFrame*> AudioFrameList; |
| 29 typedef std::vector<MixerAudioSource*> MixerAudioSourceList; | 29 typedef std::vector<MixerAudioSource*> MixerAudioSourceList; |
| 30 | 30 |
| 31 // Cheshire cat implementation of MixerAudioSource's non virtual functions. | |
| 32 class NewMixHistory { | |
| 33 public: | |
| 34 NewMixHistory(); | |
| 35 ~NewMixHistory(); | |
| 36 | |
| 37 // Returns true if the audio source is being mixed. | |
| 38 bool IsMixed() const; | |
| 39 | |
| 40 // Returns true if the audio source was mixed previous mix | |
| 41 // iteration. | |
| 42 bool WasMixed() const; | |
| 43 | |
| 44 // Updates the mixed status. | |
| 45 int32_t SetIsMixed(bool mixed); | |
| 46 | |
| 47 void ResetMixedStatus(); | |
| 48 | |
| 49 private: | |
| 50 bool is_mixed_; | |
| 51 }; | |
| 52 | |
| 53 class AudioMixerImpl : public AudioMixer { | 31 class AudioMixerImpl : public AudioMixer { |
| 54 public: | 32 public: |
| 55 // AudioProcessing only accepts 10 ms frames. | 33 // AudioProcessing only accepts 10 ms frames. |
| 56 static const int kFrameDurationInMs = 10; | 34 static const int kFrameDurationInMs = 10; |
| 57 | 35 |
| 58 explicit AudioMixerImpl(int id); | 36 explicit AudioMixerImpl(int id); |
| 59 | 37 |
| 60 ~AudioMixerImpl() override; | 38 ~AudioMixerImpl() override; |
| 61 | 39 |
| 62 // Must be called after ctor. | 40 // Must be called after ctor. |
| (...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 141 std::unique_ptr<AudioProcessing> limiter_; | 119 std::unique_ptr<AudioProcessing> limiter_; |
| 142 | 120 |
| 143 // Measures audio level for the combined signal. | 121 // Measures audio level for the combined signal. |
| 144 voe::AudioLevel audio_level_ ACCESS_ON(&thread_checker_); | 122 voe::AudioLevel audio_level_ ACCESS_ON(&thread_checker_); |
| 145 | 123 |
| 146 RTC_DISALLOW_COPY_AND_ASSIGN(AudioMixerImpl); | 124 RTC_DISALLOW_COPY_AND_ASSIGN(AudioMixerImpl); |
| 147 }; | 125 }; |
| 148 } // namespace webrtc | 126 } // namespace webrtc |
| 149 | 127 |
| 150 #endif // WEBRTC_MODULES_AUDIO_MIXER_AUDIO_MIXER_IMPL_H_ | 128 #endif // WEBRTC_MODULES_AUDIO_MIXER_AUDIO_MIXER_IMPL_H_ |
| OLD | NEW |