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/voe_hardware_impl.h" | 11 #include "webrtc/voice_engine/voe_hardware_impl.h" |
12 | 12 |
13 #include <assert.h> | 13 #include <assert.h> |
14 | 14 |
15 #include "webrtc/system_wrappers/include/trace.h" | 15 #include "webrtc/system_wrappers/include/trace.h" |
16 #include "webrtc/voice_engine/include/voe_errors.h" | 16 #include "webrtc/voice_engine/include/voe_errors.h" |
17 #include "webrtc/voice_engine/voice_engine_impl.h" | 17 #include "webrtc/voice_engine/voice_engine_impl.h" |
18 | 18 |
19 #ifndef WEBRTC_VOICE_ENGINE_HARDWARE_API | |
20 #error "Deprecated" | |
21 #endif | |
22 | |
23 namespace webrtc { | 19 namespace webrtc { |
24 | 20 |
25 VoEHardware* VoEHardware::GetInterface(VoiceEngine* voiceEngine) { | 21 VoEHardware* VoEHardware::GetInterface(VoiceEngine* voiceEngine) { |
26 #ifndef WEBRTC_VOICE_ENGINE_HARDWARE_API | |
27 return NULL; | |
28 #else | |
29 if (NULL == voiceEngine) { | 22 if (NULL == voiceEngine) { |
30 return NULL; | 23 return NULL; |
31 } | 24 } |
32 VoiceEngineImpl* s = static_cast<VoiceEngineImpl*>(voiceEngine); | 25 VoiceEngineImpl* s = static_cast<VoiceEngineImpl*>(voiceEngine); |
33 s->AddRef(); | 26 s->AddRef(); |
34 return s; | 27 return s; |
35 #endif | |
36 } | 28 } |
37 | 29 |
38 #ifdef WEBRTC_VOICE_ENGINE_HARDWARE_API | |
39 | |
40 VoEHardwareImpl::VoEHardwareImpl(voe::SharedData* shared) : _shared(shared) { | 30 VoEHardwareImpl::VoEHardwareImpl(voe::SharedData* shared) : _shared(shared) { |
41 WEBRTC_TRACE(kTraceMemory, kTraceVoice, VoEId(_shared->instance_id(), -1), | 31 WEBRTC_TRACE(kTraceMemory, kTraceVoice, VoEId(_shared->instance_id(), -1), |
42 "VoEHardwareImpl() - ctor"); | 32 "VoEHardwareImpl() - ctor"); |
43 } | 33 } |
44 | 34 |
45 VoEHardwareImpl::~VoEHardwareImpl() { | 35 VoEHardwareImpl::~VoEHardwareImpl() { |
46 WEBRTC_TRACE(kTraceMemory, kTraceVoice, VoEId(_shared->instance_id(), -1), | 36 WEBRTC_TRACE(kTraceMemory, kTraceVoice, VoEId(_shared->instance_id(), -1), |
47 "~VoEHardwareImpl() - dtor"); | 37 "~VoEHardwareImpl() - dtor"); |
48 } | 38 } |
49 | 39 |
(...skipping 458 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
508 } | 498 } |
509 | 499 |
510 int VoEHardwareImpl::EnableBuiltInNS(bool enable) { | 500 int VoEHardwareImpl::EnableBuiltInNS(bool enable) { |
511 if (!_shared->statistics().Initialized()) { | 501 if (!_shared->statistics().Initialized()) { |
512 _shared->SetLastError(VE_NOT_INITED, kTraceError); | 502 _shared->SetLastError(VE_NOT_INITED, kTraceError); |
513 return -1; | 503 return -1; |
514 } | 504 } |
515 return _shared->audio_device()->EnableBuiltInNS(enable); | 505 return _shared->audio_device()->EnableBuiltInNS(enable); |
516 } | 506 } |
517 | 507 |
518 #endif // WEBRTC_VOICE_ENGINE_HARDWARE_API | |
519 | |
520 } // namespace webrtc | 508 } // namespace webrtc |
OLD | NEW |