| 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 MODULES_AUDIO_DEVICE_INCLUDE_AUDIO_DEVICE_H_ | 11 #ifndef MODULES_AUDIO_DEVICE_INCLUDE_AUDIO_DEVICE_H_ |
| 12 #define MODULES_AUDIO_DEVICE_INCLUDE_AUDIO_DEVICE_H_ | 12 #define MODULES_AUDIO_DEVICE_INCLUDE_AUDIO_DEVICE_H_ |
| 13 | 13 |
| 14 #include "webrtc/base/scoped_ref_ptr.h" |
| 14 #include "webrtc/modules/audio_device/include/audio_device_defines.h" | 15 #include "webrtc/modules/audio_device/include/audio_device_defines.h" |
| 15 #include "webrtc/modules/include/module.h" | 16 #include "webrtc/modules/include/module.h" |
| 16 | 17 |
| 17 namespace webrtc { | 18 namespace webrtc { |
| 18 | 19 |
| 19 class AudioDeviceModule : public RefCountedModule { | 20 class AudioDeviceModule : public RefCountedModule { |
| 20 public: | 21 public: |
| 21 enum ErrorCode { | 22 enum ErrorCode { |
| 22 kAdmErrNone = 0, | 23 kAdmErrNone = 0, |
| 23 kAdmErrArgument = 1 | 24 kAdmErrArgument = 1 |
| (...skipping 20 matching lines...) Expand all Loading... |
| 44 kAdaptiveBufferSize = 1 | 45 kAdaptiveBufferSize = 1 |
| 45 }; | 46 }; |
| 46 | 47 |
| 47 enum ChannelType { | 48 enum ChannelType { |
| 48 kChannelLeft = 0, | 49 kChannelLeft = 0, |
| 49 kChannelRight = 1, | 50 kChannelRight = 1, |
| 50 kChannelBoth = 2 | 51 kChannelBoth = 2 |
| 51 }; | 52 }; |
| 52 | 53 |
| 53 public: | 54 public: |
| 55 // Create an ADM. |
| 56 static rtc::scoped_refptr<AudioDeviceModule> Create( |
| 57 const int32_t id, |
| 58 const AudioLayer audio_layer); |
| 59 |
| 54 // Retrieve the currently utilized audio layer | 60 // Retrieve the currently utilized audio layer |
| 55 virtual int32_t ActiveAudioLayer(AudioLayer* audioLayer) const = 0; | 61 virtual int32_t ActiveAudioLayer(AudioLayer* audioLayer) const = 0; |
| 56 | 62 |
| 57 // Error handling | 63 // Error handling |
| 58 virtual ErrorCode LastError() const = 0; | 64 virtual ErrorCode LastError() const = 0; |
| 59 virtual int32_t RegisterEventObserver(AudioDeviceObserver* eventCallback) = 0; | 65 virtual int32_t RegisterEventObserver(AudioDeviceObserver* eventCallback) = 0; |
| 60 | 66 |
| 61 // Full-duplex transportation of PCM audio | 67 // Full-duplex transportation of PCM audio |
| 62 virtual int32_t RegisterAudioCallback(AudioTransport* audioCallback) = 0; | 68 virtual int32_t RegisterAudioCallback(AudioTransport* audioCallback) = 0; |
| 63 | 69 |
| (...skipping 143 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 207 return -1; | 213 return -1; |
| 208 } | 214 } |
| 209 | 215 |
| 210 protected: | 216 protected: |
| 211 virtual ~AudioDeviceModule() {} | 217 virtual ~AudioDeviceModule() {} |
| 212 }; | 218 }; |
| 213 | 219 |
| 214 } // namespace webrtc | 220 } // namespace webrtc |
| 215 | 221 |
| 216 #endif // MODULES_AUDIO_DEVICE_INCLUDE_AUDIO_DEVICE_H_ | 222 #endif // MODULES_AUDIO_DEVICE_INCLUDE_AUDIO_DEVICE_H_ |
| OLD | NEW |