| 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 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 77 void Mix(AudioFrame* audio_frame_for_mixing) override; | 77 void Mix(AudioFrame* audio_frame_for_mixing) override; |
| 78 int32_t SetMinimumMixingFrequency(Frequency freq) override; | 78 int32_t SetMinimumMixingFrequency(Frequency freq) override; |
| 79 bool AnonymousMixabilityStatus( | 79 bool AnonymousMixabilityStatus( |
| 80 const MixerAudioSource& audio_source) const override; | 80 const MixerAudioSource& audio_source) const override; |
| 81 | 81 |
| 82 private: | 82 private: |
| 83 // Set/get mix frequency | 83 // Set/get mix frequency |
| 84 int32_t SetOutputFrequency(const Frequency& frequency); | 84 int32_t SetOutputFrequency(const Frequency& frequency); |
| 85 Frequency OutputFrequency() const; | 85 Frequency OutputFrequency() const; |
| 86 | 86 |
| 87 // Fills mixList with the AudioFrames pointers that should be used when | 87 // Compute what audio sources to mix from audio_source_list_. Ramp in |
| 88 // mixing. | 88 // and out. Update mixed status. maxAudioFrameCounter specifies how |
| 89 // maxAudioFrameCounter both input and output specifies how many more | 89 // many participants are allowed to be mixed. |
| 90 // AudioFrames that are allowed to be mixed. | 90 AudioFrameList UpdateToMix(size_t maxAudioFrameCounter) const; |
| 91 // rampOutList contain AudioFrames corresponding to an audio stream that | |
| 92 // used to be mixed but shouldn't be mixed any longer. These AudioFrames | |
| 93 // should be ramped out over this AudioFrame to avoid audio discontinuities. | |
| 94 void UpdateToMix(AudioFrameList* mixList, | |
| 95 AudioFrameList* rampOutList, | |
| 96 std::map<int, MixerAudioSource*>* mixAudioSourceList, | |
| 97 size_t* maxAudioFrameCounter) const; | |
| 98 | 91 |
| 99 // Return the lowest mixing frequency that can be used without having to | 92 // Return the lowest mixing frequency that can be used without having to |
| 100 // downsample any audio. | 93 // downsample any audio. |
| 101 int32_t GetLowestMixingFrequency() const; | 94 int32_t GetLowestMixingFrequency() const; |
| 102 int32_t GetLowestMixingFrequencyFromList( | 95 int32_t GetLowestMixingFrequencyFromList( |
| 103 const MixerAudioSourceList& mixList) const; | 96 const MixerAudioSourceList& mixList) const; |
| 104 | 97 |
| 105 // Return the AudioFrames that should be mixed anonymously. | 98 // Return the AudioFrames that should be mixed anonymously. |
| 106 void GetAdditionalAudio(AudioFrameList* additionalFramesList) const; | 99 void GetAdditionalAudio(AudioFrameList* additionalFramesList) const; |
| 107 | 100 |
| 108 // Update the NewMixHistory of all MixerAudioSources. mixedAudioSourcesList | |
| 109 // should contain a map of MixerAudioSources that have been mixed. | |
| 110 void UpdateMixedStatus( | |
| 111 const std::map<int, MixerAudioSource*>& mixedAudioSourcesList) const; | |
| 112 | |
| 113 // Clears audioFrameList and reclaims all memory associated with it. | 101 // Clears audioFrameList and reclaims all memory associated with it. |
| 114 void ClearAudioFrameList(AudioFrameList* audioFrameList) const; | 102 void ClearAudioFrameList(AudioFrameList* audioFrameList) const; |
| 115 | 103 |
| 116 // This function returns true if it finds the MixerAudioSource in the | 104 // This function returns true if it finds the MixerAudioSource in the |
| 117 // specified list of MixerAudioSources. | 105 // specified list of MixerAudioSources. |
| 118 bool IsAudioSourceInList(const MixerAudioSource& audio_source, | 106 bool IsAudioSourceInList(const MixerAudioSource& audio_source, |
| 119 const MixerAudioSourceList& audioSourceList) const; | 107 const MixerAudioSourceList& audioSourceList) const; |
| 120 | 108 |
| 121 // Add/remove the MixerAudioSource to the specified | 109 // Add/remove the MixerAudioSource to the specified |
| 122 // MixerAudioSource list. | 110 // MixerAudioSource list. |
| (...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 165 | 153 |
| 166 // Ensures that Mix is called from the same thread. | 154 // Ensures that Mix is called from the same thread. |
| 167 rtc::ThreadChecker thread_checker_; | 155 rtc::ThreadChecker thread_checker_; |
| 168 | 156 |
| 169 // Used for inhibiting saturation in mixing. | 157 // Used for inhibiting saturation in mixing. |
| 170 std::unique_ptr<AudioProcessing> _limiter; | 158 std::unique_ptr<AudioProcessing> _limiter; |
| 171 }; | 159 }; |
| 172 } // namespace webrtc | 160 } // namespace webrtc |
| 173 | 161 |
| 174 #endif // WEBRTC_MODULES_AUDIO_MIXER_SOURCE_NEW_AUDIO_CONFERENCE_MIXER_IMPL_H_ | 162 #endif // WEBRTC_MODULES_AUDIO_MIXER_SOURCE_NEW_AUDIO_CONFERENCE_MIXER_IMPL_H_ |
| OLD | NEW |