| 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 13 matching lines...) Expand all Loading... |
| 24 | 24 |
| 25 namespace webrtc { | 25 namespace webrtc { |
| 26 | 26 |
| 27 // Counter to be ensure that we can add a correct ID in all static trace | 27 // Counter to be ensure that we can add a correct ID in all static trace |
| 28 // methods. It is not the nicest solution, especially not since we already | 28 // methods. It is not the nicest solution, especially not since we already |
| 29 // have a counter in VoEBaseImpl. In other words, there is room for | 29 // have a counter in VoEBaseImpl. In other words, there is room for |
| 30 // improvement here. | 30 // improvement here. |
| 31 static int32_t gVoiceEngineInstanceCounter = 0; | 31 static int32_t gVoiceEngineInstanceCounter = 0; |
| 32 | 32 |
| 33 VoiceEngine* GetVoiceEngine(const Config* config, bool owns_config) { | 33 VoiceEngine* GetVoiceEngine(const Config* config, bool owns_config) { |
| 34 #if (defined _WIN32) | |
| 35 HMODULE hmod = LoadLibrary(TEXT("VoiceEngineTestingDynamic.dll")); | |
| 36 | |
| 37 if (hmod) { | |
| 38 typedef VoiceEngine* (*PfnGetVoiceEngine)(void); | |
| 39 PfnGetVoiceEngine pfn = | |
| 40 (PfnGetVoiceEngine)GetProcAddress(hmod, "GetVoiceEngine"); | |
| 41 if (pfn) { | |
| 42 VoiceEngine* self = pfn(); | |
| 43 if (owns_config) { | |
| 44 delete config; | |
| 45 } | |
| 46 return (self); | |
| 47 } | |
| 48 } | |
| 49 #endif | |
| 50 | |
| 51 VoiceEngineImpl* self = new VoiceEngineImpl(config, owns_config); | 34 VoiceEngineImpl* self = new VoiceEngineImpl(config, owns_config); |
| 52 if (self != NULL) { | 35 if (self != NULL) { |
| 53 self->AddRef(); // First reference. Released in VoiceEngine::Delete. | 36 self->AddRef(); // First reference. Released in VoiceEngine::Delete. |
| 54 gVoiceEngineInstanceCounter++; | 37 gVoiceEngineInstanceCounter++; |
| 55 } | 38 } |
| 56 return self; | 39 return self; |
| 57 } | 40 } |
| 58 | 41 |
| 59 int VoiceEngineImpl::AddRef() { | 42 int VoiceEngineImpl::AddRef() { |
| 60 return ++_ref_count; | 43 return ++_ref_count; |
| (...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 167 | 150 |
| 168 std::string VoiceEngine::GetVersionString() { | 151 std::string VoiceEngine::GetVersionString() { |
| 169 std::string version = "VoiceEngine 4.1.0"; | 152 std::string version = "VoiceEngine 4.1.0"; |
| 170 #ifdef WEBRTC_EXTERNAL_TRANSPORT | 153 #ifdef WEBRTC_EXTERNAL_TRANSPORT |
| 171 version += " (External transport build)"; | 154 version += " (External transport build)"; |
| 172 #endif | 155 #endif |
| 173 return version; | 156 return version; |
| 174 } | 157 } |
| 175 | 158 |
| 176 } // namespace webrtc | 159 } // namespace webrtc |
| OLD | NEW |