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

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

Issue 2420913002: Move audio frame memory handling inside AudioMixer. (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/api/audio/audio_mixer.h
diff --git a/webrtc/api/audio/audio_mixer.h b/webrtc/api/audio/audio_mixer.h
index 960adbbd430b8cb24403a5736aa9f0d039a43a6d..5e36abf73c8bea1f6256b6832cd253a362d7a7c3 100644
--- a/webrtc/api/audio/audio_mixer.h
+++ b/webrtc/api/audio/audio_mixer.h
@@ -35,21 +35,15 @@ 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;
+ // The AudioFrame pointer should be treated as only valid for the
+ // duration of this call. The passed AudioFrame is strictly an
+ // output parameter and its fields can have any values when being
+ // passed to GetAudioFrameWithInfo. Implementing classes may
+ // return sound with either one or two interleaved
+ // channels. Implementing classes are responsible for filling all
+ // fields of the provided AudioFrame with meaningful values.
+ virtual AudioFrameInfo GetAudioFrameWithInfo(int sample_rate_hz,
+ AudioFrame* audio_frame) = 0;
kwiberg-webrtc 2016/10/14 19:59:32 You never say what the method is supposed to *do*,
aleloi 2016/10/17 11:06:39 I've updated the comment. I guess that it's clear
// A way for a mixer implementation to distinguish participants.
virtual int Ssrc() = 0;
« 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