Chromium Code Reviews| 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 "modules/audio_device/include/audio_device_defines.h" | 14 #include "modules/audio_device/include/audio_device_defines.h" |
| 15 #include "modules/include/module.h" | 15 #include "modules/include/module.h" |
| 16 #include "rtc_base/scoped_ref_ptr.h" | 16 #include "rtc_base/scoped_ref_ptr.h" |
| 17 #include "rtc_base/refcount.h" | |
| 17 | 18 |
| 18 namespace webrtc { | 19 namespace webrtc { |
| 19 | 20 |
| 20 class AudioDeviceModule : public RefCountedModule { | 21 class AudioDeviceModule : public rtc::RefCountInterface { |
|
henrika_webrtc
2017/09/25 10:42:57
Me like ;-)
| |
| 21 public: | 22 public: |
| 22 enum ErrorCode { | 23 enum ErrorCode { |
| 23 kAdmErrNone = 0, | 24 kAdmErrNone = 0, |
| 24 kAdmErrArgument = 1 | 25 kAdmErrArgument = 1 |
| 25 }; | 26 }; |
| 26 | 27 |
| 27 enum AudioLayer { | 28 enum AudioLayer { |
| 28 kPlatformDefaultAudio = 0, | 29 kPlatformDefaultAudio = 0, |
| 29 kWindowsCoreAudio = 2, | 30 kWindowsCoreAudio = 2, |
| 30 kLinuxAlsaAudio = 3, | 31 kLinuxAlsaAudio = 3, |
| (...skipping 19 matching lines...) Expand all Loading... | |
| 50 // Create an ADM. | 51 // Create an ADM. |
| 51 static rtc::scoped_refptr<AudioDeviceModule> Create( | 52 static rtc::scoped_refptr<AudioDeviceModule> Create( |
| 52 const int32_t id, | 53 const int32_t id, |
| 53 const AudioLayer audio_layer); | 54 const AudioLayer audio_layer); |
| 54 | 55 |
| 55 // Retrieve the currently utilized audio layer | 56 // Retrieve the currently utilized audio layer |
| 56 virtual int32_t ActiveAudioLayer(AudioLayer* audioLayer) const = 0; | 57 virtual int32_t ActiveAudioLayer(AudioLayer* audioLayer) const = 0; |
| 57 | 58 |
| 58 // Error handling | 59 // Error handling |
| 59 virtual ErrorCode LastError() const = 0; | 60 virtual ErrorCode LastError() const = 0; |
| 60 virtual int32_t RegisterEventObserver(AudioDeviceObserver* eventCallback) = 0; | |
| 61 | 61 |
| 62 // Full-duplex transportation of PCM audio | 62 // Full-duplex transportation of PCM audio |
| 63 virtual int32_t RegisterAudioCallback(AudioTransport* audioCallback) = 0; | 63 virtual int32_t RegisterAudioCallback(AudioTransport* audioCallback) = 0; |
| 64 | 64 |
| 65 // Main initialization and termination | 65 // Main initialization and termination |
| 66 virtual int32_t Init() = 0; | 66 virtual int32_t Init() = 0; |
| 67 virtual int32_t Terminate() = 0; | 67 virtual int32_t Terminate() = 0; |
| 68 virtual bool Initialized() const = 0; | 68 virtual bool Initialized() const = 0; |
| 69 | 69 |
| 70 // Device enumeration | 70 // Device enumeration |
| (...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 173 virtual int GetRecordAudioParameters(AudioParameters* params) const = 0; | 173 virtual int GetRecordAudioParameters(AudioParameters* params) const = 0; |
| 174 #endif // WEBRTC_IOS | 174 #endif // WEBRTC_IOS |
| 175 | 175 |
| 176 protected: | 176 protected: |
| 177 ~AudioDeviceModule() override {} | 177 ~AudioDeviceModule() override {} |
| 178 }; | 178 }; |
| 179 | 179 |
| 180 } // namespace webrtc | 180 } // namespace webrtc |
| 181 | 181 |
| 182 #endif // MODULES_AUDIO_DEVICE_INCLUDE_AUDIO_DEVICE_H_ | 182 #endif // MODULES_AUDIO_DEVICE_INCLUDE_AUDIO_DEVICE_H_ |
| OLD | NEW |