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