Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(66)

Side by Side Diff: modules/audio_device/include/audio_device.h

Issue 3020493002: Remove AudioDeviceObserver and make ADM not inherit from the Module interface.
Patch Set: linux build error Created 3 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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
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_
OLDNEW
« no previous file with comments | « modules/audio_device/dummy/file_audio_device.cc ('k') | modules/audio_device/include/audio_device_defines.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698