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

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

Issue 2408683002: Cleanup of the mixer interface. (Closed)
Patch Set: Rebase 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.h
diff --git a/webrtc/modules/audio_mixer/audio_mixer.h b/webrtc/modules/audio_mixer/audio_mixer.h
index 258011a330f0b761955bebc35886a1808236c01c..e62e5fd0f1ba1f265431e72e7a12444c30c6035a 100644
--- a/webrtc/modules/audio_mixer/audio_mixer.h
+++ b/webrtc/modules/audio_mixer/audio_mixer.h
@@ -13,13 +13,13 @@
#include <memory>
+#include "webrtc/base/refcount.h"
#include "webrtc/modules/include/module_common_types.h"
namespace webrtc {
-class AudioMixer {
+class AudioMixer : public rtc::RefCountInterface {
public:
- static const int kMaximumAmountOfMixedAudioSources = 3;
// A callback class that all mixer participants must inherit from/implement.
class Source {
public:
@@ -44,16 +44,20 @@ class AudioMixer {
// mixer.
virtual AudioFrameWithMuted GetAudioFrameWithMuted(int sample_rate_hz) = 0;
+ // A way for a mixer implementation do distinguish participants.
+ virtual int ssrc() = 0;
+
protected:
virtual ~Source() {}
};
- // Factory method. Constructor disabled.
- static std::unique_ptr<AudioMixer> Create();
- virtual ~AudioMixer() {}
+ ~AudioMixer() override {}
- // Add/remove audio sources as candidates for mixing.
- virtual int32_t SetMixabilityStatus(Source* audio_source, bool mixable) = 0;
+ // Returns true if adding/removing was successful. Adding the same
+ // source twice is forbidden, as is removing a source that is not
hlundin-webrtc 2016/10/11 11:50:21 Does it have to be "forbidden" in all implementati
the sun 2016/10/11 12:10:55 It's important to not mix up the interface and the
hlundin-webrtc 2016/10/11 12:49:54 OK, solenberg, your turn to have a go at formulati
aleloi 2016/10/12 10:20:53 We want to point out that Add / remove mustn't be
+ // present.
+ virtual bool AddSource(Source* audio_source) = 0;
+ virtual bool RemoveSource(Source* audio_source) = 0;
// Performs mixing by asking registered audio sources for audio. The
// mixed result is placed in the provided AudioFrame. Will only be
« no previous file with comments | « no previous file | webrtc/modules/audio_mixer/audio_mixer_impl.h » ('j') | webrtc/modules/audio_mixer/audio_mixer_impl.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698