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

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

Issue 2420913002: Move audio frame memory handling inside AudioMixer. (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/api/audio/audio_mixer.h
diff --git a/webrtc/api/audio/audio_mixer.h b/webrtc/api/audio/audio_mixer.h
index eea79ae6535e316397b76da13c0bfb778a0767fa..895e18cc8ec931c37dca0ddfaa791389bd38629d 100644
--- a/webrtc/api/audio/audio_mixer.h
+++ b/webrtc/api/audio/audio_mixer.h
@@ -32,21 +32,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;
// 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.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698