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 |
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
47 { | 47 { |
48 OutputMixer::Destroy(_outputMixerPtr); | 48 OutputMixer::Destroy(_outputMixerPtr); |
49 TransmitMixer::Destroy(_transmitMixerPtr); | 49 TransmitMixer::Destroy(_transmitMixerPtr); |
50 if (_audioDevicePtr) { | 50 if (_audioDevicePtr) { |
51 _audioDevicePtr->Release(); | 51 _audioDevicePtr->Release(); |
52 } | 52 } |
53 _moduleProcessThreadPtr->Stop(); | 53 _moduleProcessThreadPtr->Stop(); |
54 Trace::ReturnTrace(); | 54 Trace::ReturnTrace(); |
55 } | 55 } |
56 | 56 |
57 void SharedData::set_audio_device(AudioDeviceModule* audio_device) | 57 void SharedData::set_audio_device( |
58 { | 58 const rtc::scoped_refptr<AudioDeviceModule>& audio_device) { |
59 // AddRef first in case the pointers are equal. | 59 _audioDevicePtr = audio_device; |
60 if (audio_device) | |
61 audio_device->AddRef(); | |
62 if (_audioDevicePtr) | |
63 _audioDevicePtr->Release(); | |
64 _audioDevicePtr = audio_device; | |
65 } | 60 } |
66 | 61 |
67 void SharedData::set_audio_processing(AudioProcessing* audioproc) { | 62 void SharedData::set_audio_processing(AudioProcessing* audioproc) { |
68 audioproc_.reset(audioproc); | 63 audioproc_.reset(audioproc); |
69 _transmitMixerPtr->SetAudioProcessingModule(audioproc); | 64 _transmitMixerPtr->SetAudioProcessingModule(audioproc); |
70 _outputMixerPtr->SetAudioProcessingModule(audioproc); | 65 _outputMixerPtr->SetAudioProcessingModule(audioproc); |
71 } | 66 } |
72 | 67 |
73 int SharedData::NumOfSendingChannels() { | 68 int SharedData::NumOfSendingChannels() { |
74 ChannelManager::Iterator it(&_channelManager); | 69 ChannelManager::Iterator it(&_channelManager); |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
106 } | 101 } |
107 | 102 |
108 void SharedData::SetLastError(int32_t error, TraceLevel level, | 103 void SharedData::SetLastError(int32_t error, TraceLevel level, |
109 const char* msg) const { | 104 const char* msg) const { |
110 _engineStatistics.SetLastError(error, level, msg); | 105 _engineStatistics.SetLastError(error, level, msg); |
111 } | 106 } |
112 | 107 |
113 } // namespace voe | 108 } // namespace voe |
114 | 109 |
115 } // namespace webrtc | 110 } // namespace webrtc |
OLD | NEW |