| OLD | NEW |
| (Empty) |
| 1 /* | |
| 2 * Copyright (c) 2011 The WebRTC project authors. All Rights Reserved. | |
| 3 * | |
| 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 | |
| 6 * tree. An additional intellectual property rights grant can be found | |
| 7 * in the file PATENTS. All contributing project authors may | |
| 8 * be found in the AUTHORS file in the root of the source tree. | |
| 9 */ | |
| 10 | |
| 11 #ifndef WEBRTC_MODULES_AUDIO_MIXER_NEW_AUDIO_CONFERENCE_MIXER_H_ | |
| 12 #define WEBRTC_MODULES_AUDIO_MIXER_NEW_AUDIO_CONFERENCE_MIXER_H_ | |
| 13 | |
| 14 #include "webrtc/modules/audio_mixer/audio_mixer_defines.h" | |
| 15 #include "webrtc/modules/include/module.h" | |
| 16 #include "webrtc/modules/include/module_common_types.h" | |
| 17 | |
| 18 namespace webrtc { | |
| 19 class MixerAudioSource; | |
| 20 | |
| 21 class NewAudioConferenceMixer { | |
| 22 public: | |
| 23 enum { kMaximumAmountOfMixedAudioSources = 3 }; | |
| 24 enum Frequency { | |
| 25 kNbInHz = 8000, | |
| 26 kWbInHz = 16000, | |
| 27 kSwbInHz = 32000, | |
| 28 kFbInHz = 48000, | |
| 29 kLowestPossible = -1, | |
| 30 kDefaultFrequency = kWbInHz | |
| 31 }; | |
| 32 | |
| 33 // Factory method. Constructor disabled. | |
| 34 static NewAudioConferenceMixer* Create(int id); | |
| 35 virtual ~NewAudioConferenceMixer() {} | |
| 36 | |
| 37 // Add/remove audio sources as candidates for mixing. | |
| 38 virtual int32_t SetMixabilityStatus(MixerAudioSource* audio_source, | |
| 39 bool mixable) = 0; | |
| 40 // Returns true if an audio source is a candidate for mixing. | |
| 41 virtual bool MixabilityStatus(const MixerAudioSource& audio_source) const = 0; | |
| 42 | |
| 43 // Inform the mixer that the audio source should always be mixed and not | |
| 44 // count toward the number of mixed audio sources. Note that an audio source | |
| 45 // must have been added to the mixer (by calling SetMixabilityStatus()) | |
| 46 // before this function can be successfully called. | |
| 47 virtual int32_t SetAnonymousMixabilityStatus(MixerAudioSource* audio_source, | |
| 48 bool mixable) = 0; | |
| 49 | |
| 50 // Performs mixing by asking registered audio sources for audio. The | |
| 51 // mixed result is placed in the provided AudioFrame. Can only be | |
| 52 // called from a single thread. The rate and channels arguments | |
| 53 // specify the rate and number of channels of the mix result. | |
| 54 virtual void Mix(int sample_rate, | |
| 55 size_t number_of_channels, | |
| 56 AudioFrame* audio_frame_for_mixing) = 0; | |
| 57 | |
| 58 // Returns true if the audio source is mixed anonymously. | |
| 59 virtual bool AnonymousMixabilityStatus( | |
| 60 const MixerAudioSource& audio_source) const = 0; | |
| 61 | |
| 62 // Output level functions for VoEVolumeControl. Return value | |
| 63 // between 0 and 9 is returned by voe::AudioLevel. | |
| 64 virtual uint32_t GetOutputAudioLevel() = 0; | |
| 65 | |
| 66 // Return value between 0 and 0x7fff is returned by voe::AudioLevel. | |
| 67 virtual uint32_t GetOutputAudioLevelFullRange() = 0; | |
| 68 | |
| 69 protected: | |
| 70 NewAudioConferenceMixer() {} | |
| 71 }; | |
| 72 } // namespace webrtc | |
| 73 | |
| 74 #endif // WEBRTC_MODULES_AUDIO_MIXER_NEW_AUDIO_CONFERENCE_MIXER_H_ | |
| OLD | NEW |