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

Side by Side Diff: webrtc/api/audio/audio_mixer.h

Issue 2458703002: Changed mixing to be done at the minimal possible frequency. (Closed)
Patch Set: Shorter lambda expression. Created 4 years, 1 month 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 unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * Copyright (c) 2011 The WebRTC project authors. All Rights Reserved. 2 * Copyright (c) 2011 The WebRTC project authors. All Rights Reserved.
3 * 3 *
4 * Use of this source code is governed by a BSD-style license 4 * Use of this source code is governed by a BSD-style license
5 * that can be found in the LICENSE file in the root of the source 5 * that can be found in the LICENSE file in the root of the source
6 * tree. An additional intellectual property rights grant can be found 6 * tree. An additional intellectual property rights grant can be found
7 * in the file PATENTS. All contributing project authors may 7 * in the file PATENTS. All contributing project authors may
8 * be found in the AUTHORS file in the root of the source tree. 8 * be found in the AUTHORS file in the root of the source tree.
9 */ 9 */
10 10
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after
53 53
54 // Returns true if adding/removing was successful. A source is never 54 // Returns true if adding/removing was successful. A source is never
55 // added twice and removal is never attempted if a source has not 55 // added twice and removal is never attempted if a source has not
56 // been successfully added to the mixer. Addition and removal can 56 // been successfully added to the mixer. Addition and removal can
57 // happen on different threads. 57 // happen on different threads.
58 virtual bool AddSource(Source* audio_source) = 0; 58 virtual bool AddSource(Source* audio_source) = 0;
59 virtual bool RemoveSource(Source* audio_source) = 0; 59 virtual bool RemoveSource(Source* audio_source) = 0;
60 60
61 // Performs mixing by asking registered audio sources for audio. The 61 // Performs mixing by asking registered audio sources for audio. The
62 // mixed result is placed in the provided AudioFrame. This method 62 // mixed result is placed in the provided AudioFrame. This method
63 // will only be called from a single thread. The rate and channels 63 // will only be called from a single thread. The channels argument
64 // arguments specify the rate and number of channels of the mix 64 // specifies the number of channels of the mix result. The mixer
65 // result. All fields in |audio_frame_for_mixing| must be updated. 65 // should mix at a rate that doesn't cause quality loss of the
66 virtual void Mix(int sample_rate_hz, 66 // sources' audio. All fields in |audio_frame_for_mixing| must be
67 size_t number_of_channels, 67 // updated.
hlundin-webrtc 2016/10/31 14:14:56 Will the implementation have to provide the mixed
aleloi 2016/10/31 14:35:57 It must be a native rate, and it must be part of t
68 virtual void Mix(size_t number_of_channels,
68 AudioFrame* audio_frame_for_mixing) = 0; 69 AudioFrame* audio_frame_for_mixing) = 0;
69 70
70 protected: 71 protected:
71 // Since the mixer is reference counted, the destructor may be 72 // Since the mixer is reference counted, the destructor may be
72 // called from any thread. 73 // called from any thread.
73 ~AudioMixer() override {} 74 ~AudioMixer() override {}
74 }; 75 };
75 } // namespace webrtc 76 } // namespace webrtc
76 77
77 #endif // WEBRTC_API_AUDIO_AUDIO_MIXER_H_ 78 #endif // WEBRTC_API_AUDIO_AUDIO_MIXER_H_
OLDNEW
« 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