Index: webrtc/modules/audio_mixer/audio_mixer_impl.h |
diff --git a/webrtc/modules/audio_mixer/audio_mixer_impl.h b/webrtc/modules/audio_mixer/audio_mixer_impl.h |
index ecfcbfa621d1d2213c719a23cc1331d90237c0b8..409dcc91f32014153bfe274535116dd1e380a620 100644 |
--- a/webrtc/modules/audio_mixer/audio_mixer_impl.h |
+++ b/webrtc/modules/audio_mixer/audio_mixer_impl.h |
@@ -15,11 +15,13 @@ |
#include <memory> |
#include <vector> |
+#include "webrtc/base/gtest_prod_util.h" |
#include "webrtc/base/thread_annotations.h" |
#include "webrtc/base/thread_checker.h" |
#include "webrtc/engine_configurations.h" |
#include "webrtc/modules/audio_mixer/audio_mixer.h" |
#include "webrtc/modules/audio_mixer/audio_mixer_defines.h" |
+#include "webrtc/modules/audio_mixer/audio_source_with_mix_status.h" |
#include "webrtc/modules/audio_processing/include/audio_processing.h" |
#include "webrtc/modules/include/module_common_types.h" |
#include "webrtc/system_wrappers/include/critical_section_wrapper.h" |
@@ -28,14 +30,14 @@ |
namespace webrtc { |
typedef std::vector<AudioFrame*> AudioFrameList; |
-typedef std::vector<MixerAudioSource*> MixerAudioSourceList; |
+typedef std::vector<AudioSourceWithMixStatus> MixerAudioSourceList; |
class AudioMixerImpl : public AudioMixer { |
public: |
// AudioProcessing only accepts 10 ms frames. |
static const int kFrameDurationInMs = 10; |
- static std::unique_ptr<AudioMixer> Create(int id); |
+ static std::unique_ptr<AudioMixerImpl> Create(int id); |
ivoc
2016/10/04 20:39:29
Don't you need the old Create function as well?
aleloi
2016/10/05 15:18:19
There are two Create functions defined in the impl
|
~AudioMixerImpl() override; |
@@ -51,6 +53,11 @@ class AudioMixerImpl : public AudioMixer { |
bool AnonymousMixabilityStatus( |
const MixerAudioSource& audio_source) const override; |
+ // Returns true if the participant was mixed last round. Returns |
+ // false and logs an error if the participant was never added to the |
+ // mixer. |
+ bool GetAudioSourceMixabilityStatus(MixerAudioSource* participant); |
the sun
2016/10/04 20:36:10
Source or participant? Make thy mind up! :)
aleloi
2016/10/05 15:18:19
Done.
|
+ |
private: |
AudioMixerImpl(int id, std::unique_ptr<AudioProcessing> limiter); |
@@ -61,11 +68,11 @@ class AudioMixerImpl : public AudioMixer { |
// Compute what audio sources to mix from audio_source_list_. Ramp |
// in and out. Update mixed status. Mixes up to |
// kMaximumAmountOfMixedAudioSources audio sources. |
- AudioFrameList GetNonAnonymousAudio() const EXCLUSIVE_LOCKS_REQUIRED(crit_); |
+ AudioFrameList GetNonAnonymousAudio() EXCLUSIVE_LOCKS_REQUIRED(crit_); |
// Return the AudioFrames that should be mixed anonymously. Ramp in |
// and out. Update mixed status. |
- AudioFrameList GetAnonymousAudio() const EXCLUSIVE_LOCKS_REQUIRED(crit_); |
+ AudioFrameList GetAnonymousAudio() EXCLUSIVE_LOCKS_REQUIRED(crit_); |
// This function returns true if it finds the MixerAudioSource in the |
// specified list of MixerAudioSources. |
@@ -86,6 +93,11 @@ class AudioMixerImpl : public AudioMixer { |
int GetOutputAudioLevelFullRange() override; |
+ // Searches for the AudioSourceWithMixStatus object corresponding to |
+ // an audio source. If the audio source was never added with |
+ // Set*MixabilityStatus, this returns nullptr. |
+ AudioSourceWithMixStatus* GetSourceWithStatus(MixerAudioSource* audio_source); |
+ |
rtc::CriticalSection crit_; |
const int32_t id_; |
@@ -117,6 +129,7 @@ class AudioMixerImpl : public AudioMixer { |
voe::AudioLevel audio_level_ ACCESS_ON(&thread_checker_); |
RTC_DISALLOW_COPY_AND_ASSIGN(AudioMixerImpl); |
+ FRIEND_TEST_ALL_PREFIXES(AudioMixerTest, Create); |
the sun
2016/10/04 20:36:10
Can we test without creating a circular relationsh
aleloi
2016/10/05 15:18:19
MixerImpl::Create is public now. When we split the
the sun
2016/10/05 19:32:11
I don't understand. Why can't we make the test dep
aleloi
2016/10/06 09:26:12
That was confusing, sorry. We can depend only on t
|
}; |
} // namespace webrtc |