| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (c) 2011 The WebRTC project authors. All Rights Reserved. | 2 * Copyright (c) 2011 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_INCLUDE_NEW_AUDIO_CONFERENCE_MIXER_H_ | 11 #ifndef WEBRTC_MODULES_AUDIO_MIXER_INCLUDE_NEW_AUDIO_CONFERENCE_MIXER_H_ |
| 12 #define WEBRTC_MODULES_AUDIO_MIXER_INCLUDE_NEW_AUDIO_CONFERENCE_MIXER_H_ | 12 #define WEBRTC_MODULES_AUDIO_MIXER_INCLUDE_NEW_AUDIO_CONFERENCE_MIXER_H_ |
| 13 | 13 |
| 14 #include "webrtc/modules/audio_mixer/include/audio_mixer_defines.h" | 14 #include "webrtc/modules/audio_mixer/include/audio_mixer_defines.h" |
| 15 #include "webrtc/modules/include/module.h" | 15 #include "webrtc/modules/include/module.h" |
| 16 #include "webrtc/modules/include/module_common_types.h" | 16 #include "webrtc/modules/include/module_common_types.h" |
| 17 | 17 |
| 18 namespace webrtc { | 18 namespace webrtc { |
| 19 class MixerAudioSource; | 19 class MixerAudioSource; |
| 20 | 20 |
| 21 class NewAudioConferenceMixer : public Module { | 21 class NewAudioConferenceMixer { |
| 22 public: | 22 public: |
| 23 enum { kMaximumAmountOfMixedParticipants = 3 }; | 23 enum { kMaximumAmountOfMixedParticipants = 3 }; |
| 24 enum Frequency { | 24 enum Frequency { |
| 25 kNbInHz = 8000, | 25 kNbInHz = 8000, |
| 26 kWbInHz = 16000, | 26 kWbInHz = 16000, |
| 27 kSwbInHz = 32000, | 27 kSwbInHz = 32000, |
| 28 kFbInHz = 48000, | 28 kFbInHz = 48000, |
| 29 kLowestPossible = -1, | 29 kLowestPossible = -1, |
| 30 kDefaultFrequency = kWbInHz | 30 kDefaultFrequency = kWbInHz |
| 31 }; | 31 }; |
| 32 | 32 |
| 33 // Factory method. Constructor disabled. | 33 // Factory method. Constructor disabled. |
| 34 static NewAudioConferenceMixer* Create(int id); | 34 static NewAudioConferenceMixer* Create(int id); |
| 35 virtual ~NewAudioConferenceMixer() {} | 35 virtual ~NewAudioConferenceMixer() {} |
| 36 | 36 |
| 37 // Module functions | |
| 38 int64_t TimeUntilNextProcess() override = 0; | |
| 39 void Process() override = 0; | |
| 40 | |
| 41 // Add/remove participants as candidates for mixing. | 37 // Add/remove participants as candidates for mixing. |
| 42 virtual int32_t SetMixabilityStatus(MixerAudioSource* participant, | 38 virtual int32_t SetMixabilityStatus(MixerAudioSource* participant, |
| 43 bool mixable) = 0; | 39 bool mixable) = 0; |
| 44 // Returns true if a participant is a candidate for mixing. | 40 // Returns true if a participant is a candidate for mixing. |
| 45 virtual bool MixabilityStatus(const MixerAudioSource& participant) const = 0; | 41 virtual bool MixabilityStatus(const MixerAudioSource& participant) const = 0; |
| 46 | 42 |
| 47 // Inform the mixer that the participant should always be mixed and not | 43 // Inform the mixer that the participant should always be mixed and not |
| 48 // count toward the number of mixed participants. Note that a participant | 44 // count toward the number of mixed participants. Note that a participant |
| 49 // must have been added to the mixer (by calling SetMixabilityStatus()) | 45 // must have been added to the mixer (by calling SetMixabilityStatus()) |
| 50 // before this function can be successfully called. | 46 // before this function can be successfully called. |
| 51 virtual int32_t SetAnonymousMixabilityStatus(MixerAudioSource* participant, | 47 virtual int32_t SetAnonymousMixabilityStatus(MixerAudioSource* participant, |
| 52 bool mixable) = 0; | 48 bool mixable) = 0; |
| 53 // Returns true if the participant is mixed anonymously. | 49 // Returns true if the participant is mixed anonymously. |
| 54 virtual bool AnonymousMixabilityStatus( | 50 virtual bool AnonymousMixabilityStatus( |
| 55 const MixerAudioSource& participant) const = 0; | 51 const MixerAudioSource& participant) const = 0; |
| 56 | 52 |
| 57 // Performs mixing by asking registered participants for audio. | 53 // Performs mixing by asking registered participants for audio. |
| 58 // The mixed result is placed in the provided AudioFrame. | 54 // The mixed result is placed in the provided AudioFrame. |
| 59 virtual void Mix(AudioFrame*) = 0; | 55 virtual void Mix(AudioFrame* audio_frame_for_mixing) = 0; |
| 60 | 56 |
| 61 // Set the minimum sampling frequency at which to mix. The mixing algorithm | 57 // Set the minimum sampling frequency at which to mix. The mixing algorithm |
| 62 // may still choose to mix at a higher samling frequency to avoid | 58 // may still choose to mix at a higher samling frequency to avoid |
| 63 // downsampling of audio contributing to the mixed audio. | 59 // downsampling of audio contributing to the mixed audio. |
| 64 virtual int32_t SetMinimumMixingFrequency(Frequency freq) = 0; | 60 virtual int32_t SetMinimumMixingFrequency(Frequency freq) = 0; |
| 65 | 61 |
| 66 protected: | 62 protected: |
| 67 NewAudioConferenceMixer() {} | 63 NewAudioConferenceMixer() {} |
| 68 }; | 64 }; |
| 69 } // namespace webrtc | 65 } // namespace webrtc |
| 70 | 66 |
| 71 #endif // WEBRTC_MODULES_AUDIO_MIXER_INCLUDE_NEW_AUDIO_CONFERENCE_MIXER_H_ | 67 #endif // WEBRTC_MODULES_AUDIO_MIXER_INCLUDE_NEW_AUDIO_CONFERENCE_MIXER_H_ |
| OLD | NEW |