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

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

Issue 2104363003: A simple copy of the old mixer to a new directory. I also plan to run 'git cl format'. In another C… (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Accidentally changed the old audio_conference_mixer Created 4 years, 5 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
(Empty)
1 /*
2 * Copyright (c) 2012 The WebRTC project authors. All Rights Reserved.
3 *
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
6 * tree. An additional intellectual property rights grant can be found
7 * in the file PATENTS. All contributing project authors may
8 * be found in the AUTHORS file in the root of the source tree.
9 */
10
11 #ifndef WEBRTC_MODULES_AUDIO_MIXER_AUDIO_MIXER_H_
12 #define WEBRTC_MODULES_AUDIO_MIXER_AUDIO_MIXER_H_
13
14 #include "webrtc/base/criticalsection.h"
15 #include "webrtc/common_audio/resampler/include/push_resampler.h"
16 #include "webrtc/common_types.h"
17 #include "webrtc/modules/audio_mixer/include/new_audio_conference_mixer.h"
18 #include "webrtc/modules/audio_mixer/include/audio_mixer_defines.h"
19 #include "webrtc/modules/utility/include/file_recorder.h"
20 #include "webrtc/voice_engine/level_indicator.h"
21 #include "webrtc/voice_engine/voice_engine_defines.h"
22
23 namespace webrtc {
24
25 class AudioProcessing;
26 class FileWrapper;
27 class VoEMediaProcess;
28
29 namespace voe {
30 class Statistics;
31
32 // Note: this class is in the process of being rewritten and merged
33 // with AudioConferenceMixer. Expect inheritance chains to be changed,
34 // member functions removed or renamed.
35 class AudioMixer : public OldAudioMixerOutputReceiver, public FileCallback {
36 public:
37 static int32_t Create(AudioMixer*& mixer, uint32_t instanceId);
38
39 static void Destroy(AudioMixer*& mixer);
40
41 int32_t SetEngineInformation(Statistics& engineStatistics);
42
43 int32_t SetAudioProcessingModule(AudioProcessing* audioProcessingModule);
44
45 // VoEExternalMedia
46 int RegisterExternalMediaProcessing(VoEMediaProcess& proccess_object);
47
48 int DeRegisterExternalMediaProcessing();
49
50 int32_t MixActiveChannels();
51
52 int32_t DoOperationsOnCombinedSignal(bool feed_data_to_apm);
53
54 int32_t SetMixabilityStatus(MixerAudioSource& participant, bool mixable);
55
56 int32_t SetAnonymousMixabilityStatus(MixerAudioSource& participant,
57 bool mixable);
58
59 int GetMixedAudio(int sample_rate_hz,
60 size_t num_channels,
61 AudioFrame* audioFrame);
62
63 // VoEVolumeControl
64 int GetSpeechOutputLevel(uint32_t& level);
65
66 int GetSpeechOutputLevelFullRange(uint32_t& level);
67
68 int SetOutputVolumePan(float left, float right);
69
70 int GetOutputVolumePan(float& left, float& right);
71
72 // VoEFile
73 int StartRecordingPlayout(const char* fileName, const CodecInst* codecInst);
74
75 int StartRecordingPlayout(OutStream* stream, const CodecInst* codecInst);
76 int StopRecordingPlayout();
77
78 virtual ~AudioMixer();
79
80 // from AudioMixerOutputReceiver
81 virtual void NewMixedAudio(int32_t id,
82 const AudioFrame& generalAudioFrame,
83 const AudioFrame** uniqueAudioFrames,
84 uint32_t size);
85
86 // For file recording
87 void PlayNotification(int32_t id, uint32_t durationMs);
88
89 void RecordNotification(int32_t id, uint32_t durationMs);
90
91 void PlayFileEnded(int32_t id);
92 void RecordFileEnded(int32_t id);
93
94 private:
95 AudioMixer(uint32_t instanceId);
96
97 // uses
98 Statistics* _engineStatisticsPtr;
99 AudioProcessing* _audioProcessingModulePtr;
100
101 rtc::CriticalSection _callbackCritSect;
102 // protect the _outputFileRecorderPtr and _outputFileRecording
103 rtc::CriticalSection _fileCritSect;
104 NewAudioConferenceMixer& _mixerModule;
105 AudioFrame _audioFrame;
106 // Converts mixed audio to the audio device output rate.
107 PushResampler<int16_t> resampler_;
108 // Converts mixed audio to the audio processing rate.
109 PushResampler<int16_t> audioproc_resampler_;
110 AudioLevel _audioLevel; // measures audio level for the combined signal
111 int _instanceId;
112 VoEMediaProcess* _externalMediaCallbackPtr;
113 bool _externalMedia;
114 float _panLeft;
115 float _panRight;
116 int _mixingFrequencyHz;
117 FileRecorder* _outputFileRecorderPtr;
118 bool _outputFileRecording;
119 };
120
121 } // namespace voe
122
123 } // namespace werbtc
124
125 #endif // WEBRTC_MODULES_AUDIO_MIXER_AUDIO_MIXER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698