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

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

Issue 2249213005: Removals and renamings in the new audio mixer. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@new_tests_in_mixer
Patch Set: Created 4 years, 4 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
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
11 #ifndef WEBRTC_MODULES_AUDIO_MIXER_NEW_AUDIO_CONFERENCE_MIXER_IMPL_H_ 11 #ifndef WEBRTC_MODULES_AUDIO_MIXER_AUDIO_MIXER_IMPL_H_
12 #define WEBRTC_MODULES_AUDIO_MIXER_NEW_AUDIO_CONFERENCE_MIXER_IMPL_H_ 12 #define WEBRTC_MODULES_AUDIO_MIXER_AUDIO_MIXER_IMPL_H_
13 13
14 #include <list> 14 #include <list>
15 #include <map> 15 #include <map>
16 #include <memory> 16 #include <memory>
17 #include <vector> 17 #include <vector>
18 18
19 #include "webrtc/base/thread_checker.h" 19 #include "webrtc/base/thread_checker.h"
20 #include "webrtc/engine_configurations.h" 20 #include "webrtc/engine_configurations.h"
21 #include "webrtc/modules/audio_mixer/new_audio_conference_mixer.h" 21 #include "webrtc/modules/audio_mixer/audio_mixer.h"
22 #include "webrtc/modules/include/module_common_types.h" 22 #include "webrtc/modules/include/module_common_types.h"
23 #include "webrtc/voice_engine/level_indicator.h" 23 #include "webrtc/voice_engine/level_indicator.h"
24 24
25 namespace webrtc { 25 namespace webrtc {
26 class AudioProcessing; 26 class AudioProcessing;
27 class CriticalSectionWrapper; 27 class CriticalSectionWrapper;
28 28
29 struct FrameAndMuteInfo { 29 struct FrameAndMuteInfo {
30 FrameAndMuteInfo(AudioFrame* f, bool m) : frame(f), muted(m) {} 30 FrameAndMuteInfo(AudioFrame* f, bool m) : frame(f), muted(m) {}
31 AudioFrame* frame; 31 AudioFrame* frame;
32 bool muted; 32 bool muted;
33 }; 33 };
34 34
35 typedef std::list<FrameAndMuteInfo> AudioFrameList; 35 typedef std::list<FrameAndMuteInfo> AudioFrameList;
36 typedef std::list<MixerAudioSource*> MixerAudioSourceList; 36 typedef std::list<MixerAudioSource*> MixerAudioSourceList;
37 37
38 // Cheshire cat implementation of MixerAudioSource's non virtual functions. 38 // Cheshire cat implementation of MixerAudioSource's non virtual functions.
ivoc 2016/08/18 15:47:23 Not sure what "Cheshire cat" means here.
aleloi 2016/08/19 12:06:09 I looked it up when reading the mixer code for the
ivoc 2016/08/19 12:37:37 Okay, I'm familiar with opaque pointers, but I've
39 class NewMixHistory { 39 class NewMixHistory {
40 public: 40 public:
41 NewMixHistory(); 41 NewMixHistory();
42 ~NewMixHistory(); 42 ~NewMixHistory();
43 43
44 // Returns true if the audio source is being mixed. 44 // Returns true if the audio source is being mixed.
45 bool IsMixed() const; 45 bool IsMixed() const;
46 46
47 // Returns true if the audio source was mixed previous mix 47 // Returns true if the audio source was mixed previous mix
48 // iteration. 48 // iteration.
49 bool WasMixed() const; 49 bool WasMixed() const;
50 50
51 // Updates the mixed status. 51 // Updates the mixed status.
52 int32_t SetIsMixed(bool mixed); 52 int32_t SetIsMixed(bool mixed);
53 53
54 void ResetMixedStatus(); 54 void ResetMixedStatus();
55 55
56 private: 56 private:
57 bool is_mixed_; 57 bool is_mixed_;
58 }; 58 };
59 59
60 class NewAudioConferenceMixerImpl : public NewAudioConferenceMixer { 60 class AudioMixerImpl : public AudioMixer {
61 public: 61 public:
62 // AudioProcessing only accepts 10 ms frames. 62 // AudioProcessing only accepts 10 ms frames.
63 enum { kProcessPeriodicityInMs = 10 }; 63 enum { kProcessPeriodicityInMs = 10 };
64 64
65 explicit NewAudioConferenceMixerImpl(int id); 65 explicit AudioMixerImpl(int id);
66 66
67 ~NewAudioConferenceMixerImpl() override; 67 ~AudioMixerImpl() override;
68 68
69 // Must be called after ctor. 69 // Must be called after ctor.
70 bool Init(); 70 bool Init();
71 71
72 // NewAudioConferenceMixer functions 72 // AudioMixer functions
73 int32_t SetMixabilityStatus(MixerAudioSource* audio_source, 73 int32_t SetMixabilityStatus(MixerAudioSource* audio_source,
74 bool mixable) override; 74 bool mixable) override;
75 bool MixabilityStatus(const MixerAudioSource& audio_source) const override; 75 bool MixabilityStatus(const MixerAudioSource& audio_source) const override;
76 int32_t SetAnonymousMixabilityStatus(MixerAudioSource* audio_source, 76 int32_t SetAnonymousMixabilityStatus(MixerAudioSource* audio_source,
77 bool mixable) override; 77 bool mixable) override;
78 void Mix(int sample_rate, 78 void Mix(int sample_rate,
79 size_t number_of_channels, 79 size_t number_of_channels,
80 AudioFrame* audio_frame_for_mixing) override; 80 AudioFrame* audio_frame_for_mixing) override;
81 bool AnonymousMixabilityStatus( 81 bool AnonymousMixabilityStatus(
82 const MixerAudioSource& audio_source) const override; 82 const MixerAudioSource& audio_source) const override;
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after
157 rtc::ThreadChecker thread_checker_; 157 rtc::ThreadChecker thread_checker_;
158 158
159 // Used for inhibiting saturation in mixing. 159 // Used for inhibiting saturation in mixing.
160 std::unique_ptr<AudioProcessing> limiter_; 160 std::unique_ptr<AudioProcessing> limiter_;
161 161
162 // Measures audio level for the combined signal. 162 // Measures audio level for the combined signal.
163 voe::AudioLevel audio_level_; 163 voe::AudioLevel audio_level_;
164 }; 164 };
165 } // namespace webrtc 165 } // namespace webrtc
166 166
167 #endif // WEBRTC_MODULES_AUDIO_MIXER_NEW_AUDIO_CONFERENCE_MIXER_IMPL_H_ 167 #endif // WEBRTC_MODULES_AUDIO_MIXER_AUDIO_MIXER_IMPL_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698