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