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

Unified Diff: webrtc/api/audio/audio_mixer.h

Issue 2420913002: Move audio frame memory handling inside AudioMixer. (Closed)
Patch Set: Responses to reviewer comments: renamings and updated comments. 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/api/audio/audio_mixer.h
diff --git a/webrtc/api/audio/audio_mixer.h b/webrtc/api/audio/audio_mixer.h
index 960adbbd430b8cb24403a5736aa9f0d039a43a6d..f8d1d61ab7af2559579b49ff4cef8adda9d8e4e6 100644
--- a/webrtc/api/audio/audio_mixer.h
+++ b/webrtc/api/audio/audio_mixer.h
@@ -35,33 +35,18 @@ class AudioMixer : public rtc::RefCountInterface {
kError, // The audio_frame will not be used.
};
- struct AudioFrameWithInfo {
- AudioFrame* audio_frame;
- AudioFrameInfo audio_frame_info;
- };
-
- // The implementation of GetAudioFrameWithInfo should update
- // audio_frame with new audio every time it's called. Implementing
- // classes are allowed to return the same AudioFrame pointer on
- // different calls. The pointer must stay valid until the next
- // mixing call or until this audio source is disconnected from the
- // mixer. The mixer may modify the contents of the passed
- // AudioFrame pointer at any time until the next call to
- // GetAudioFrameWithInfo, or until the source is removed from the
- // mixer.
- virtual AudioFrameWithInfo GetAudioFrameWithInfo(int sample_rate_hz) = 0;
+ // Overwrites |audio_frame|. The data_ field is overwritten with
+ // 10 ms of new audio (either 1 or 2 interleaved channels) at
+ // |sample_rate_hz|.
+ virtual AudioFrameInfo GetAudioFrameWithInfo(int sample_rate_hz,
+ AudioFrame* audio_frame) = 0;
// A way for a mixer implementation to distinguish participants.
virtual int Ssrc() = 0;
- protected:
virtual ~Source() {}
};
- // Since the mixer is reference counted, the destructor may be
- // called from any thread.
- ~AudioMixer() override {}
-
// Returns true if adding/removing was successful. A source is never
// added twice and removal is never attempted if a source has not
// been successfully added to the mixer. Addition and removal can
@@ -76,6 +61,11 @@ class AudioMixer : public rtc::RefCountInterface {
virtual void Mix(int sample_rate_hz,
size_t number_of_channels,
AudioFrame* audio_frame_for_mixing) = 0;
+
+ protected:
+ // Since the mixer is reference counted, the destructor may be
+ // called from any thread.
+ ~AudioMixer() override {}
aleloi 2016/10/17 11:06:39 Unrelated change: the dtor of a refcounted class s
kwiberg-webrtc 2016/10/17 12:08:32 Acknowledged.
};
} // namespace webrtc
« no previous file with comments | « no previous file | webrtc/modules/audio_mixer/audio_mixer_impl.h » ('j') | webrtc/modules/audio_mixer/audio_mixer_impl.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698