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

Side by Side Diff: webrtc/modules/audio_mixer/source/new_audio_conference_mixer_impl.h

Issue 2132563002: Rewrote UpdateToMix in the audio mixer. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@remove_memory_pool
Patch Set: Created 4 years, 5 months 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
OLDNEW
1 /* 1 /*
2 * Copyright (c) 2016 The WebRTC project authors. All Rights Reserved. 2 * Copyright (c) 2016 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
77 int32_t SetAnonymousMixabilityStatus(MixerAudioSource* participant, 77 int32_t SetAnonymousMixabilityStatus(MixerAudioSource* participant,
78 bool mixable) override; 78 bool mixable) override;
79 bool AnonymousMixabilityStatus( 79 bool AnonymousMixabilityStatus(
80 const MixerAudioSource& participant) const override; 80 const MixerAudioSource& participant) 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 participants to mix from _participantList. 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*>* mixParticipantList,
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. mixedParticipantsList
109 // should contain a map of MixerAudioSources that have been mixed.
110 void UpdateMixedStatus(
111 const std::map<int, MixerAudioSource*>& mixedParticipantsList) 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 IsParticipantInList(const MixerAudioSource& participant, 106 bool IsParticipantInList(const MixerAudioSource& participant,
119 const MixerAudioSourceList& participantList) const; 107 const MixerAudioSourceList& participantList) 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 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
164 152
165 // Ensures that Mix is called from the same thread. 153 // Ensures that Mix is called from the same thread.
166 rtc::ThreadChecker thread_checker_; 154 rtc::ThreadChecker thread_checker_;
167 155
168 // Used for inhibiting saturation in mixing. 156 // Used for inhibiting saturation in mixing.
169 std::unique_ptr<AudioProcessing> _limiter; 157 std::unique_ptr<AudioProcessing> _limiter;
170 }; 158 };
171 } // namespace webrtc 159 } // namespace webrtc
172 160
173 #endif // WEBRTC_MODULES_AUDIO_MIXER_SOURCE_NEW_AUDIO_CONFERENCE_MIXER_IMPL_H_ 161 #endif // WEBRTC_MODULES_AUDIO_MIXER_SOURCE_NEW_AUDIO_CONFERENCE_MIXER_IMPL_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698