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

Side by Side Diff: webrtc/modules/audio_mixer/audio_mixer_impl.h

Issue 2420913002: Move audio frame memory handling inside AudioMixer. (Closed)
Patch Set: Updated interface usages (I landed another CL in the wrong order...). 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 unified diff | Download patch
« no previous file with comments | « webrtc/audio/audio_receive_stream.cc ('k') | webrtc/modules/audio_mixer/audio_mixer_impl.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (c) 2012 The WebRTC project authors. All Rights Reserved. 2 * Copyright (c) 2012 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 17 matching lines...) Expand all
28 typedef std::vector<AudioFrame*> AudioFrameList; 28 typedef std::vector<AudioFrame*> AudioFrameList;
29 29
30 class AudioMixerImpl : public AudioMixer { 30 class AudioMixerImpl : public AudioMixer {
31 public: 31 public:
32 struct SourceStatus { 32 struct SourceStatus {
33 SourceStatus(Source* audio_source, bool is_mixed, float gain) 33 SourceStatus(Source* audio_source, bool is_mixed, float gain)
34 : audio_source(audio_source), is_mixed(is_mixed), gain(gain) {} 34 : audio_source(audio_source), is_mixed(is_mixed), gain(gain) {}
35 Source* audio_source = nullptr; 35 Source* audio_source = nullptr;
36 bool is_mixed = false; 36 bool is_mixed = false;
37 float gain = 0.0f; 37 float gain = 0.0f;
38
39 // A frame that will be passed to audio_source->GetAudioFrameWithInfo.
40 AudioFrame audio_frame;
38 }; 41 };
39 42
40 typedef std::vector<SourceStatus> SourceStatusList; 43 using SourceStatusList = std::vector<std::unique_ptr<SourceStatus>>;
41 44
42 // AudioProcessing only accepts 10 ms frames. 45 // AudioProcessing only accepts 10 ms frames.
43 static const int kFrameDurationInMs = 10; 46 static const int kFrameDurationInMs = 10;
44 static const int kMaximumAmountOfMixedAudioSources = 3; 47 static const int kMaximumAmountOfMixedAudioSources = 3;
45 static const int kDefaultFrequency = 48000; 48 static const int kDefaultFrequency = 48000;
46 49
47 static rtc::scoped_refptr<AudioMixerImpl> Create(); 50 static rtc::scoped_refptr<AudioMixerImpl> Create();
48 51
49 ~AudioMixerImpl() override; 52 ~AudioMixerImpl() override;
50 53
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after
103 rtc::ThreadChecker thread_checker_; 106 rtc::ThreadChecker thread_checker_;
104 107
105 // Used for inhibiting saturation in mixing. 108 // Used for inhibiting saturation in mixing.
106 std::unique_ptr<AudioProcessing> limiter_ ACCESS_ON(&thread_checker_); 109 std::unique_ptr<AudioProcessing> limiter_ ACCESS_ON(&thread_checker_);
107 110
108 RTC_DISALLOW_COPY_AND_ASSIGN(AudioMixerImpl); 111 RTC_DISALLOW_COPY_AND_ASSIGN(AudioMixerImpl);
109 }; 112 };
110 } // namespace webrtc 113 } // namespace webrtc
111 114
112 #endif // WEBRTC_MODULES_AUDIO_MIXER_AUDIO_MIXER_IMPL_H_ 115 #endif // WEBRTC_MODULES_AUDIO_MIXER_AUDIO_MIXER_IMPL_H_
OLDNEW
« no previous file with comments | « webrtc/audio/audio_receive_stream.cc ('k') | webrtc/modules/audio_mixer/audio_mixer_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698