| 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 <memory> | 14 #include <memory> |
| 15 | 15 |
| 16 #include "webrtc/base/criticalsection.h" | 16 #include "webrtc/base/criticalsection.h" |
| 17 #include "webrtc/common_audio/resampler/include/push_resampler.h" | 17 #include "webrtc/common_audio/resampler/include/push_resampler.h" |
| 18 #include "webrtc/common_types.h" | 18 #include "webrtc/common_types.h" |
| 19 #include "webrtc/modules/audio_conference_mixer/include/audio_conference_mixer.h
" | 19 #include "webrtc/modules/audio_conference_mixer/include/audio_conference_mixer.h
" |
| 20 #include "webrtc/modules/audio_conference_mixer/include/audio_conference_mixer_d
efines.h" | 20 #include "webrtc/modules/audio_conference_mixer/include/audio_conference_mixer_d
efines.h" |
| 21 #include "webrtc/voice_engine/file_recorder.h" | 21 #include "webrtc/voice_engine/file_recorder.h" |
| 22 #include "webrtc/voice_engine/level_indicator.h" | 22 #include "webrtc/voice_engine/level_indicator.h" |
| 23 #include "webrtc/voice_engine/voice_engine_defines.h" | 23 #include "webrtc/voice_engine/voice_engine_defines.h" |
| 24 | 24 |
| 25 namespace webrtc { | 25 namespace webrtc { |
| 26 | 26 |
| 27 class AudioProcessing; | 27 class AudioProcessing; |
| 28 class FileWrapper; | 28 class FileWrapper; |
| 29 class VoEMediaProcess; | |
| 30 | 29 |
| 31 namespace voe { | 30 namespace voe { |
| 32 | 31 |
| 33 class Statistics; | 32 class Statistics; |
| 34 | 33 |
| 35 class OutputMixer : public AudioMixerOutputReceiver, | 34 class OutputMixer : public AudioMixerOutputReceiver, |
| 36 public FileCallback | 35 public FileCallback |
| 37 { | 36 { |
| 38 public: | 37 public: |
| 39 static int32_t Create(OutputMixer*& mixer, uint32_t instanceId); | 38 static int32_t Create(OutputMixer*& mixer, uint32_t instanceId); |
| 40 | 39 |
| 41 static void Destroy(OutputMixer*& mixer); | 40 static void Destroy(OutputMixer*& mixer); |
| 42 | 41 |
| 43 int32_t SetEngineInformation(Statistics& engineStatistics); | 42 int32_t SetEngineInformation(Statistics& engineStatistics); |
| 44 | 43 |
| 45 int32_t SetAudioProcessingModule( | 44 int32_t SetAudioProcessingModule( |
| 46 AudioProcessing* audioProcessingModule); | 45 AudioProcessing* audioProcessingModule); |
| 47 | 46 |
| 48 // VoEExternalMedia | |
| 49 int RegisterExternalMediaProcessing( | |
| 50 VoEMediaProcess& proccess_object); | |
| 51 | |
| 52 int DeRegisterExternalMediaProcessing(); | |
| 53 | |
| 54 int32_t MixActiveChannels(); | 47 int32_t MixActiveChannels(); |
| 55 | 48 |
| 56 int32_t DoOperationsOnCombinedSignal(bool feed_data_to_apm); | 49 int32_t DoOperationsOnCombinedSignal(bool feed_data_to_apm); |
| 57 | 50 |
| 58 int32_t SetMixabilityStatus(MixerParticipant& participant, | 51 int32_t SetMixabilityStatus(MixerParticipant& participant, |
| 59 bool mixable); | 52 bool mixable); |
| 60 | 53 |
| 61 int32_t SetAnonymousMixabilityStatus(MixerParticipant& participant, | 54 int32_t SetAnonymousMixabilityStatus(MixerParticipant& participant, |
| 62 bool mixable); | 55 bool mixable); |
| 63 | 56 |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 98 void PlayFileEnded(int32_t id); | 91 void PlayFileEnded(int32_t id); |
| 99 void RecordFileEnded(int32_t id); | 92 void RecordFileEnded(int32_t id); |
| 100 | 93 |
| 101 private: | 94 private: |
| 102 OutputMixer(uint32_t instanceId); | 95 OutputMixer(uint32_t instanceId); |
| 103 | 96 |
| 104 // uses | 97 // uses |
| 105 Statistics* _engineStatisticsPtr; | 98 Statistics* _engineStatisticsPtr; |
| 106 AudioProcessing* _audioProcessingModulePtr; | 99 AudioProcessing* _audioProcessingModulePtr; |
| 107 | 100 |
| 108 rtc::CriticalSection _callbackCritSect; | |
| 109 // Protects output_file_recorder_ and _outputFileRecording. | 101 // Protects output_file_recorder_ and _outputFileRecording. |
| 110 rtc::CriticalSection _fileCritSect; | 102 rtc::CriticalSection _fileCritSect; |
| 111 AudioConferenceMixer& _mixerModule; | 103 AudioConferenceMixer& _mixerModule; |
| 112 AudioFrame _audioFrame; | 104 AudioFrame _audioFrame; |
| 113 // Converts mixed audio to the audio device output rate. | 105 // Converts mixed audio to the audio device output rate. |
| 114 PushResampler<int16_t> resampler_; | 106 PushResampler<int16_t> resampler_; |
| 115 // Converts mixed audio to the audio processing rate. | 107 // Converts mixed audio to the audio processing rate. |
| 116 PushResampler<int16_t> audioproc_resampler_; | 108 PushResampler<int16_t> audioproc_resampler_; |
| 117 AudioLevel _audioLevel; // measures audio level for the combined signal | 109 AudioLevel _audioLevel; // measures audio level for the combined signal |
| 118 int _instanceId; | 110 int _instanceId; |
| 119 VoEMediaProcess* _externalMediaCallbackPtr; | |
| 120 bool _externalMedia; | |
| 121 float _panLeft; | 111 float _panLeft; |
| 122 float _panRight; | 112 float _panRight; |
| 123 int _mixingFrequencyHz; | 113 int _mixingFrequencyHz; |
| 124 std::unique_ptr<FileRecorder> output_file_recorder_; | 114 std::unique_ptr<FileRecorder> output_file_recorder_; |
| 125 bool _outputFileRecording; | 115 bool _outputFileRecording; |
| 126 }; | 116 }; |
| 127 | 117 |
| 128 } // namespace voe | 118 } // namespace voe |
| 129 | 119 |
| 130 } // namespace werbtc | 120 } // namespace werbtc |
| 131 | 121 |
| 132 #endif // VOICE_ENGINE_OUTPUT_MIXER_H_ | 122 #endif // VOICE_ENGINE_OUTPUT_MIXER_H_ |
| OLD | NEW |