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 |
11 #ifndef WEBRTC_VOICE_ENGINE_OUTPUT_MIXER_H_ | 11 #ifndef WEBRTC_VOICE_ENGINE_OUTPUT_MIXER_H_ |
12 #define WEBRTC_VOICE_ENGINE_OUTPUT_MIXER_H_ | 12 #define WEBRTC_VOICE_ENGINE_OUTPUT_MIXER_H_ |
13 | 13 |
14 #include "webrtc/base/criticalsection.h" | 14 #include "webrtc/base/criticalsection.h" |
15 #include "webrtc/common_audio/resampler/include/push_resampler.h" | 15 #include "webrtc/common_audio/resampler/include/push_resampler.h" |
16 #include "webrtc/common_types.h" | 16 #include "webrtc/common_types.h" |
17 #include "webrtc/modules/audio_conference_mixer/include/audio_conference_mixer.h " | 17 #include "webrtc/modules/audio_mixer/include/audio_conference_mixer.h" |
18 #include "webrtc/modules/audio_conference_mixer/include/audio_conference_mixer_d efines.h" | 18 #include "webrtc/modules/audio_mixer/include/audio_conference_mixer_defines.h" |
19 #include "webrtc/modules/utility/include/file_recorder.h" | 19 #include "webrtc/modules/utility/include/file_recorder.h" |
20 #include "webrtc/voice_engine/level_indicator.h" | 20 #include "webrtc/voice_engine/level_indicator.h" |
21 #include "webrtc/voice_engine/voice_engine_defines.h" | 21 #include "webrtc/voice_engine/voice_engine_defines.h" |
22 | 22 |
23 namespace webrtc { | 23 namespace webrtc { |
24 | 24 |
25 class AudioProcessing; | 25 class AudioProcessing; |
26 class FileWrapper; | 26 class FileWrapper; |
27 class VoEMediaProcess; | 27 class VoEMediaProcess; |
28 | 28 |
29 namespace voe { | 29 namespace voe { |
30 | |
31 class Statistics; | 30 class Statistics; |
32 | 31 |
33 class OutputMixer : public AudioMixerOutputReceiver, | 32 class AudioMixer : public AudioMixerOutputReceiver, |
34 public FileCallback | 33 public FileCallback |
ivoc
2016/07/01 07:56:27
You may want to rerun git cl format, I think this
| |
35 { | 34 { |
36 public: | 35 public: |
37 static int32_t Create(OutputMixer*& mixer, uint32_t instanceId); | 36 static int32_t Create(AudioMixer*& mixer, uint32_t instanceId); |
38 | 37 |
39 static void Destroy(OutputMixer*& mixer); | 38 static void Destroy(AudioMixer*& mixer); |
40 | 39 |
41 int32_t SetEngineInformation(Statistics& engineStatistics); | 40 int32_t SetEngineInformation(Statistics& engineStatistics); |
42 | 41 |
43 int32_t SetAudioProcessingModule( | 42 int32_t SetAudioProcessingModule( |
44 AudioProcessing* audioProcessingModule); | 43 AudioProcessing* audioProcessingModule); |
45 | 44 |
46 // VoEExternalMedia | 45 // VoEExternalMedia |
47 int RegisterExternalMediaProcessing( | 46 int RegisterExternalMediaProcessing( |
48 VoEMediaProcess& proccess_object); | 47 VoEMediaProcess& proccess_object); |
49 | 48 |
50 int DeRegisterExternalMediaProcessing(); | 49 int DeRegisterExternalMediaProcessing(); |
51 | 50 |
52 int32_t MixActiveChannels(); | 51 int32_t MixActiveChannels(); |
53 | 52 |
54 int32_t DoOperationsOnCombinedSignal(bool feed_data_to_apm); | 53 int32_t DoOperationsOnCombinedSignal(bool feed_data_to_apm); |
55 | 54 |
56 int32_t SetMixabilityStatus(MixerParticipant& participant, | 55 int32_t SetMixabilityStatus(MixerAudioSource& participant, |
57 bool mixable); | 56 bool mixable); |
58 | 57 |
59 int32_t SetAnonymousMixabilityStatus(MixerParticipant& participant, | 58 int32_t SetAnonymousMixabilityStatus(MixerAudioSource& participant, |
60 bool mixable); | 59 bool mixable); |
61 | 60 |
62 int GetMixedAudio(int sample_rate_hz, size_t num_channels, | 61 int GetMixedAudio(int sample_rate_hz, size_t num_channels, |
63 AudioFrame* audioFrame); | 62 AudioFrame* audioFrame); |
64 | 63 |
65 // VoEVolumeControl | 64 // VoEVolumeControl |
66 int GetSpeechOutputLevel(uint32_t& level); | 65 int GetSpeechOutputLevel(uint32_t& level); |
67 | 66 |
68 int GetSpeechOutputLevelFullRange(uint32_t& level); | 67 int GetSpeechOutputLevelFullRange(uint32_t& level); |
69 | 68 |
70 int SetOutputVolumePan(float left, float right); | 69 int SetOutputVolumePan(float left, float right); |
71 | 70 |
72 int GetOutputVolumePan(float& left, float& right); | 71 int GetOutputVolumePan(float& left, float& right); |
73 | 72 |
74 // VoEFile | 73 // VoEFile |
75 int StartRecordingPlayout(const char* fileName, | 74 int StartRecordingPlayout(const char* fileName, |
76 const CodecInst* codecInst); | 75 const CodecInst* codecInst); |
77 | 76 |
78 int StartRecordingPlayout(OutStream* stream, | 77 int StartRecordingPlayout(OutStream* stream, |
79 const CodecInst* codecInst); | 78 const CodecInst* codecInst); |
80 int StopRecordingPlayout(); | 79 int StopRecordingPlayout(); |
81 | 80 |
82 virtual ~OutputMixer(); | 81 virtual ~AudioMixer(); |
83 | 82 |
84 // from AudioMixerOutputReceiver | 83 // from AudioMixerOutputReceiver |
85 virtual void NewMixedAudio( | 84 virtual void NewMixedAudio( |
86 int32_t id, | 85 int32_t id, |
87 const AudioFrame& generalAudioFrame, | 86 const AudioFrame& generalAudioFrame, |
88 const AudioFrame** uniqueAudioFrames, | 87 const AudioFrame** uniqueAudioFrames, |
89 uint32_t size); | 88 uint32_t size); |
90 | 89 |
91 // For file recording | 90 // For file recording |
92 void PlayNotification(int32_t id, uint32_t durationMs); | 91 void PlayNotification(int32_t id, uint32_t durationMs); |
93 | 92 |
94 void RecordNotification(int32_t id, uint32_t durationMs); | 93 void RecordNotification(int32_t id, uint32_t durationMs); |
95 | 94 |
96 void PlayFileEnded(int32_t id); | 95 void PlayFileEnded(int32_t id); |
97 void RecordFileEnded(int32_t id); | 96 void RecordFileEnded(int32_t id); |
98 | 97 |
99 private: | 98 private: |
100 OutputMixer(uint32_t instanceId); | 99 AudioMixer(uint32_t instanceId); |
101 | 100 |
102 // uses | 101 // uses |
103 Statistics* _engineStatisticsPtr; | 102 Statistics* _engineStatisticsPtr; |
104 AudioProcessing* _audioProcessingModulePtr; | 103 AudioProcessing* _audioProcessingModulePtr; |
105 | 104 |
106 rtc::CriticalSection _callbackCritSect; | 105 rtc::CriticalSection _callbackCritSect; |
107 // protect the _outputFileRecorderPtr and _outputFileRecording | 106 // protect the _outputFileRecorderPtr and _outputFileRecording |
108 rtc::CriticalSection _fileCritSect; | 107 rtc::CriticalSection _fileCritSect; |
109 AudioConferenceMixer& _mixerModule; | 108 NewAudioConferenceMixer& _mixerModule; |
110 AudioFrame _audioFrame; | 109 AudioFrame _audioFrame; |
111 // Converts mixed audio to the audio device output rate. | 110 // Converts mixed audio to the audio device output rate. |
112 PushResampler<int16_t> resampler_; | 111 PushResampler<int16_t> resampler_; |
113 // Converts mixed audio to the audio processing rate. | 112 // Converts mixed audio to the audio processing rate. |
114 PushResampler<int16_t> audioproc_resampler_; | 113 PushResampler<int16_t> audioproc_resampler_; |
115 AudioLevel _audioLevel; // measures audio level for the combined signal | 114 AudioLevel _audioLevel; // measures audio level for the combined signal |
116 int _instanceId; | 115 int _instanceId; |
117 VoEMediaProcess* _externalMediaCallbackPtr; | 116 VoEMediaProcess* _externalMediaCallbackPtr; |
118 bool _externalMedia; | 117 bool _externalMedia; |
119 float _panLeft; | 118 float _panLeft; |
120 float _panRight; | 119 float _panRight; |
121 int _mixingFrequencyHz; | 120 int _mixingFrequencyHz; |
122 FileRecorder* _outputFileRecorderPtr; | 121 FileRecorder* _outputFileRecorderPtr; |
123 bool _outputFileRecording; | 122 bool _outputFileRecording; |
124 }; | 123 }; |
125 | 124 |
126 } // namespace voe | 125 } // namespace voe |
127 | 126 |
128 } // namespace werbtc | 127 } // namespace werbtc |
129 | 128 |
130 #endif // VOICE_ENGINE_OUTPUT_MIXER_H_ | 129 #endif // VOICE_ENGINE_OUTPUT_MIXER_H_ |
OLD | NEW |