 Chromium Code Reviews
 Chromium Code Reviews Issue 2420913002:
  Move audio frame memory handling inside AudioMixer.  (Closed)
    
  
    Issue 2420913002:
  Move audio frame memory handling inside AudioMixer.  (Closed) 
  | OLD | NEW | 
|---|---|
| 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 Loading... | |
| 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{}; | |
| 
the sun
2016/10/18 14:06:17
Do you really need the {} ?
Also, I thought this t
 
aleloi
2016/10/18 14:17:48
It's a (brace) default member initializer (http://
 
the sun
2016/10/18 14:21:45
The default ctor will be called without the {}.
 
aleloi
2016/10/18 14:30:41
Right, because it is a class and then the default
 | |
| 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 Loading... | |
| 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_ | 
| OLD | NEW |