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

Unified Diff: webrtc/modules/audio_mixer/audio_mixer_impl.h

Issue 2408683002: Cleanup of the mixer interface. (Closed)
Patch Set: Created 4 years, 2 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 side-by-side diff with in-line comments
Download patch
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 5aa697865ff61e43fad1372d69196fadf184b3a3..5dff58d67573756dbec8dc7295c509e808daff3b 100644
--- a/webrtc/modules/audio_mixer/audio_mixer_impl.h
+++ b/webrtc/modules/audio_mixer/audio_mixer_impl.h
@@ -16,6 +16,7 @@
#include "webrtc/base/thread_annotations.h"
#include "webrtc/base/thread_checker.h"
+#include "webrtc/base/scoped_ref_ptr.h"
the sun 2016/10/10 13:35:49 nit: s comes before t in western european alphabet
aleloi 2016/10/10 14:02:27 Done.
#include "webrtc/modules/audio_mixer/audio_mixer.h"
#include "webrtc/modules/audio_processing/include/audio_processing.h"
#include "webrtc/modules/include/module_common_types.h"
@@ -41,15 +42,20 @@ class AudioMixerImpl : public AudioMixer {
// AudioProcessing only accepts 10 ms frames.
static const int kFrameDurationInMs = 10;
+ static const int kMaximumAmountOfMixedAudioSources = 3;
static const int kDefaultFrequency = 48000;
- static std::unique_ptr<AudioMixerImpl> Create();
+ static rtc::scoped_refptr<AudioMixerImpl> Create();
aleloi 2016/10/10 13:06:31 When we move the interface to webrtc/api, we can a
the sun 2016/10/10 13:35:49 It's ok to do it separately. Once you get around t
aleloi 2016/10/10 14:02:27 Acknowledged.
+
+ explicit AudioMixerImpl(std::unique_ptr<AudioProcessing> limiter);
aleloi 2016/10/10 13:06:31 A refcounted object must have a public constructor
the sun 2016/10/10 13:35:49 No, protected should be enough if you're using rtc
aleloi 2016/10/10 14:02:27 Done.
~AudioMixerImpl() override;
// AudioMixer functions
- int32_t SetMixabilityStatus(Source* audio_source, bool mixable) override;
- void Mix(int sample_rate,
+ bool AddSource(Source* audio_source) override;
+ bool RemoveSource(Source* audio_source) override;
+
+ void Mix(int sample_rate_hz,
size_t number_of_channels,
AudioFrame* audio_frame_for_mixing) override;
@@ -59,8 +65,6 @@ class AudioMixerImpl : public AudioMixer {
bool GetAudioSourceMixabilityStatusForTest(Source* audio_source) const;
private:
- explicit AudioMixerImpl(std::unique_ptr<AudioProcessing> limiter);
-
// Set/get mix frequency
void SetOutputFrequency(int frequency);
int OutputFrequency() const;
@@ -68,8 +72,7 @@ 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() EXCLUSIVE_LOCKS_REQUIRED(crit_);
-
+ AudioFrameList GetAudioFromSources() EXCLUSIVE_LOCKS_REQUIRED(crit_);
// Add/remove the MixerAudioSource to the specified
// MixerAudioSource list.
@@ -90,7 +93,6 @@ class AudioMixerImpl : public AudioMixer {
// List of all audio sources. Note all lists are disjunct
SourceStatusList audio_source_list_ GUARDED_BY(crit_); // May be mixed.
- size_t num_mixed_audio_sources_ GUARDED_BY(crit_);
// Determines if we will use a limiter for clipping protection during
// mixing.
bool use_limiter_ ACCESS_ON(&thread_checker_);

Powered by Google App Engine
This is Rietveld 408576698