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 |
| (...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 78 private: | 78 private: |
| 79 // Set/get mix frequency | 79 // Set/get mix frequency |
| 80 int32_t SetOutputFrequency(const Frequency& frequency); | 80 int32_t SetOutputFrequency(const Frequency& frequency); |
| 81 Frequency OutputFrequency() const; | 81 Frequency OutputFrequency() const; |
| 82 | 82 |
| 83 // Compute what audio sources to mix from audio_source_list_. Ramp | 83 // Compute what audio sources to mix from audio_source_list_. Ramp |
| 84 // in and out. Update mixed status. Mixes up to | 84 // in and out. Update mixed status. Mixes up to |
| 85 // kMaximumAmountOfMixedAudioSources audio sources. | 85 // kMaximumAmountOfMixedAudioSources audio sources. |
| 86 AudioFrameList GetNonAnonymousAudio() const EXCLUSIVE_LOCKS_REQUIRED(crit_); | 86 AudioFrameList GetNonAnonymousAudio() const EXCLUSIVE_LOCKS_REQUIRED(crit_); |
| 87 | 87 |
| 88 // Return the lowest mixing frequency that can be used without having to | |
| 89 // downsample any audio. | |
| 90 int32_t GetLowestMixingFrequency() const; | |
| 91 int32_t GetLowestMixingFrequencyFromList( | |
| 92 const MixerAudioSourceList& mixList) const; | |
| 93 | |
|
aleloi
2016/08/31 12:35:05
These two have not been used for the last 5-6 mixe
| |
| 94 // Return the AudioFrames that should be mixed anonymously. Ramp in | 88 // Return the AudioFrames that should be mixed anonymously. Ramp in |
| 95 // and out. Update mixed status. | 89 // and out. Update mixed status. |
| 96 AudioFrameList GetAnonymousAudio() const EXCLUSIVE_LOCKS_REQUIRED(crit_); | 90 AudioFrameList GetAnonymousAudio() const EXCLUSIVE_LOCKS_REQUIRED(crit_); |
| 97 | 91 |
| 98 // This function returns true if it finds the MixerAudioSource in the | 92 // This function returns true if it finds the MixerAudioSource in the |
| 99 // specified list of MixerAudioSources. | 93 // specified list of MixerAudioSources. |
| 100 bool IsAudioSourceInList(const MixerAudioSource& audio_source, | 94 bool IsAudioSourceInList(const MixerAudioSource& audio_source, |
| 101 const MixerAudioSourceList& audioSourceList) const; | 95 const MixerAudioSourceList& audio_source_list) const; |
| 102 | 96 |
| 103 // Add/remove the MixerAudioSource to the specified | 97 // Add/remove the MixerAudioSource to the specified |
| 104 // MixerAudioSource list. | 98 // MixerAudioSource list. |
| 105 bool AddAudioSourceToList(MixerAudioSource* audio_source, | 99 bool AddAudioSourceToList(MixerAudioSource* audio_source, |
| 106 MixerAudioSourceList* audioSourceList) const; | 100 MixerAudioSourceList* audio_source_list) const; |
| 107 bool RemoveAudioSourceFromList(MixerAudioSource* removeAudioSource, | 101 bool RemoveAudioSourceFromList(MixerAudioSource* remove_audio_source, |
| 108 MixerAudioSourceList* audioSourceList) const; | 102 MixerAudioSourceList* audio_source_list) const; |
| 109 | 103 |
| 110 // Mix the AudioFrames stored in audioFrameList into mixedAudio. | 104 // Mix the AudioFrames stored in audioFrameList into mixed_audio. |
| 111 static int32_t MixFromList(AudioFrame* mixedAudio, | 105 static int32_t MixFromList(AudioFrame* mixed_audio, |
| 112 const AudioFrameList& audioFrameList, | 106 const AudioFrameList& audio_frame_list, |
| 113 int32_t id, | 107 int32_t id, |
| 114 bool use_limiter); | 108 bool use_limiter); |
| 115 | 109 |
| 116 bool LimitMixedAudio(AudioFrame* mixedAudio) const; | 110 bool LimitMixedAudio(AudioFrame* mixed_audio) const; |
| 117 | 111 |
| 118 // Output level functions for VoEVolumeControl. | 112 // Output level functions for VoEVolumeControl. |
| 119 int GetOutputAudioLevel() override; | 113 int GetOutputAudioLevel() override; |
| 120 | 114 |
| 121 int GetOutputAudioLevelFullRange() override; | 115 int GetOutputAudioLevelFullRange() override; |
| 122 | 116 |
| 123 std::unique_ptr<CriticalSectionWrapper> crit_; | 117 std::unique_ptr<CriticalSectionWrapper> crit_; |
| 124 | 118 |
| 125 int32_t id_; | 119 int32_t id_; |
| 126 | 120 |
| 127 // The current sample frequency and sample size when mixing. | 121 // The current sample frequency and sample size when mixing. |
| 128 Frequency output_frequency_; | 122 Frequency output_frequency_; |
| 129 size_t sample_size_; | 123 size_t sample_size_; |
| 130 | 124 |
| 131 // List of all audio sources. Note all lists are disjunct | 125 // List of all audio sources. Note all lists are disjunct |
| 132 MixerAudioSourceList audio_source_list_; // May be mixed. | 126 MixerAudioSourceList audio_source_list_; // May be mixed. |
| 133 | 127 |
| 134 // Always mixed, anonomously. | 128 // Always mixed, anonymously. |
| 135 MixerAudioSourceList additional_audio_source_list_; | 129 MixerAudioSourceList additional_audio_source_list_; |
| 136 | 130 |
| 137 size_t num_mixed_audio_sources_; | 131 size_t num_mixed_audio_sources_; |
| 138 // Determines if we will use a limiter for clipping protection during | 132 // Determines if we will use a limiter for clipping protection during |
| 139 // mixing. | 133 // mixing. |
| 140 bool use_limiter_; | 134 bool use_limiter_; |
| 141 | 135 |
| 142 uint32_t time_stamp_; | 136 uint32_t time_stamp_; |
| 143 | 137 |
| 144 // Ensures that Mix is called from the same thread. | 138 // Ensures that Mix is called from the same thread. |
| 145 rtc::ThreadChecker thread_checker_; | 139 rtc::ThreadChecker thread_checker_; |
| 146 | 140 |
| 147 // Used for inhibiting saturation in mixing. | 141 // Used for inhibiting saturation in mixing. |
| 148 std::unique_ptr<AudioProcessing> limiter_; | 142 std::unique_ptr<AudioProcessing> limiter_; |
| 149 | 143 |
| 150 // Measures audio level for the combined signal. | 144 // Measures audio level for the combined signal. |
| 151 voe::AudioLevel audio_level_; | 145 voe::AudioLevel audio_level_; |
| 146 | |
| 147 RTC_DISALLOW_COPY_AND_ASSIGN(AudioMixerImpl); | |
| 152 }; | 148 }; |
| 153 } // namespace webrtc | 149 } // namespace webrtc |
| 154 | 150 |
| 155 #endif // WEBRTC_MODULES_AUDIO_MIXER_AUDIO_MIXER_IMPL_H_ | 151 #endif // WEBRTC_MODULES_AUDIO_MIXER_AUDIO_MIXER_IMPL_H_ |
| OLD | NEW |