| 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 #include "webrtc/voice_engine/shared_data.h" | 11 #include "webrtc/voice_engine/shared_data.h" | 
| 12 | 12 | 
| 13 #include "webrtc/modules/audio_processing/include/audio_processing.h" | 13 #include "webrtc/modules/audio_processing/include/audio_processing.h" | 
| 14 #include "webrtc/system_wrappers/include/trace.h" | 14 #include "webrtc/system_wrappers/include/trace.h" | 
| 15 #include "webrtc/voice_engine/channel.h" | 15 #include "webrtc/voice_engine/channel.h" | 
| 16 #include "webrtc/voice_engine/output_mixer.h" | 16 #include "webrtc/voice_engine/output_mixer.h" | 
| 17 #include "webrtc/voice_engine/transmit_mixer.h" | 17 #include "webrtc/voice_engine/transmit_mixer.h" | 
| 18 | 18 | 
| 19 namespace webrtc { | 19 namespace webrtc { | 
| 20 | 20 | 
| 21 namespace voe { | 21 namespace voe { | 
| 22 | 22 | 
| 23 static int32_t _gInstanceCounter = 0; | 23 static int32_t _gInstanceCounter = 0; | 
| 24 | 24 | 
| 25 SharedData::SharedData() | 25 SharedData::SharedData() | 
| 26     : _instanceId(++_gInstanceCounter), | 26     : _instanceId(++_gInstanceCounter), | 
| 27       _channelManager(_gInstanceCounter), | 27       _channelManager(_gInstanceCounter), | 
| 28       _engineStatistics(_gInstanceCounter), | 28       _engineStatistics(_gInstanceCounter), | 
| 29       _audioDevicePtr(NULL), | 29       _audioDevicePtr(NULL), | 
| 30       _moduleProcessThreadPtr( | 30       _moduleProcessThreadPtr(ProcessThread::Create("VoiceProcessThread")), | 
| 31           ProcessThread::Create("VoiceProcessThread")) { | 31       encoder_queue_("AudioEncoderQueue") { | 
| 32     Trace::CreateTrace(); | 32   Trace::CreateTrace(); | 
| 33     if (OutputMixer::Create(_outputMixerPtr, _gInstanceCounter) == 0) | 33   if (OutputMixer::Create(_outputMixerPtr, _gInstanceCounter) == 0) { | 
| 34     { | 34     _outputMixerPtr->SetEngineInformation(_engineStatistics); | 
| 35         _outputMixerPtr->SetEngineInformation(_engineStatistics); | 35   } | 
| 36     } | 36   if (TransmitMixer::Create(_transmitMixerPtr, _gInstanceCounter) == 0) { | 
| 37     if (TransmitMixer::Create(_transmitMixerPtr, _gInstanceCounter) == 0) | 37     _transmitMixerPtr->SetEngineInformation(*_moduleProcessThreadPtr, | 
| 38     { | 38                                             _engineStatistics, _channelManager); | 
| 39         _transmitMixerPtr->SetEngineInformation(*_moduleProcessThreadPtr, | 39   } | 
| 40                                                 _engineStatistics, | 40   _audioDeviceLayer = AudioDeviceModule::kPlatformDefaultAudio; | 
| 41                                                 _channelManager); |  | 
| 42     } |  | 
| 43     _audioDeviceLayer = AudioDeviceModule::kPlatformDefaultAudio; |  | 
| 44 } | 41 } | 
| 45 | 42 | 
| 46 SharedData::~SharedData() | 43 SharedData::~SharedData() | 
| 47 { | 44 { | 
| 48     OutputMixer::Destroy(_outputMixerPtr); | 45     OutputMixer::Destroy(_outputMixerPtr); | 
| 49     TransmitMixer::Destroy(_transmitMixerPtr); | 46     TransmitMixer::Destroy(_transmitMixerPtr); | 
| 50     if (_audioDevicePtr) { | 47     if (_audioDevicePtr) { | 
| 51         _audioDevicePtr->Release(); | 48         _audioDevicePtr->Release(); | 
| 52     } | 49     } | 
| 53     _moduleProcessThreadPtr->Stop(); | 50     _moduleProcessThreadPtr->Stop(); | 
| (...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 101 } | 98 } | 
| 102 | 99 | 
| 103 void SharedData::SetLastError(int32_t error, TraceLevel level, | 100 void SharedData::SetLastError(int32_t error, TraceLevel level, | 
| 104                               const char* msg) const { | 101                               const char* msg) const { | 
| 105   _engineStatistics.SetLastError(error, level, msg); | 102   _engineStatistics.SetLastError(error, level, msg); | 
| 106 } | 103 } | 
| 107 | 104 | 
| 108 }  // namespace voe | 105 }  // namespace voe | 
| 109 | 106 | 
| 110 }  // namespace webrtc | 107 }  // namespace webrtc | 
| OLD | NEW | 
|---|