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 30 matching lines...) Expand all Loading... |
41 | 41 |
42 namespace webrtc { | 42 namespace webrtc { |
43 | 43 |
44 class AudioDeviceModule; | 44 class AudioDeviceModule; |
45 class AudioProcessing; | 45 class AudioProcessing; |
46 class AudioTransport; | 46 class AudioTransport; |
47 namespace voe { | 47 namespace voe { |
48 class TransmitMixer; | 48 class TransmitMixer; |
49 } // namespace voe | 49 } // namespace voe |
50 | 50 |
51 // VoiceEngineObserver | |
52 class WEBRTC_DLLEXPORT VoiceEngineObserver { | |
53 public: | |
54 // This method will be called after the occurrence of any runtime error | |
55 // code, or warning notification, when the observer interface has been | |
56 // installed using VoEBase::RegisterVoiceEngineObserver(). | |
57 virtual void CallbackOnError(int channel, int errCode) = 0; | |
58 | |
59 protected: | |
60 virtual ~VoiceEngineObserver() {} | |
61 }; | |
62 | |
63 // VoiceEngine | 51 // VoiceEngine |
64 class WEBRTC_DLLEXPORT VoiceEngine { | 52 class WEBRTC_DLLEXPORT VoiceEngine { |
65 public: | 53 public: |
66 // Creates a VoiceEngine object, which can then be used to acquire | 54 // Creates a VoiceEngine object, which can then be used to acquire |
67 // sub-APIs. Returns NULL on failure. | 55 // sub-APIs. Returns NULL on failure. |
68 static VoiceEngine* Create(); | 56 static VoiceEngine* Create(); |
69 | 57 |
70 // Deletes a created VoiceEngine object and releases the utilized resources. | 58 // Deletes a created VoiceEngine object and releases the utilized resources. |
71 // Note that if there are outstanding references held via other interfaces, | 59 // Note that if there are outstanding references held via other interfaces, |
72 // the voice engine instance will not actually be deleted until those | 60 // the voice engine instance will not actually be deleted until those |
(...skipping 16 matching lines...) Expand all Loading... |
89 // Factory for the VoEBase sub-API. Increases an internal reference | 77 // Factory for the VoEBase sub-API. Increases an internal reference |
90 // counter if successful. Returns NULL if the API is not supported or if | 78 // counter if successful. Returns NULL if the API is not supported or if |
91 // construction fails. | 79 // construction fails. |
92 static VoEBase* GetInterface(VoiceEngine* voiceEngine); | 80 static VoEBase* GetInterface(VoiceEngine* voiceEngine); |
93 | 81 |
94 // Releases the VoEBase sub-API and decreases an internal reference | 82 // Releases the VoEBase sub-API and decreases an internal reference |
95 // counter. Returns the new reference count. This value should be zero | 83 // counter. Returns the new reference count. This value should be zero |
96 // for all sub-APIs before the VoiceEngine object can be safely deleted. | 84 // for all sub-APIs before the VoiceEngine object can be safely deleted. |
97 virtual int Release() = 0; | 85 virtual int Release() = 0; |
98 | 86 |
99 // Installs the observer class to enable runtime error control and | |
100 // warning notifications. Returns -1 in case of an error, 0 otherwise. | |
101 virtual int RegisterVoiceEngineObserver(VoiceEngineObserver& observer) = 0; | |
102 | |
103 // Removes and disables the observer class for runtime error control | |
104 // and warning notifications. Returns 0. | |
105 virtual int DeRegisterVoiceEngineObserver() = 0; | |
106 | |
107 // Initializes all common parts of the VoiceEngine; e.g. all | 87 // Initializes all common parts of the VoiceEngine; e.g. all |
108 // encoders/decoders, the sound card and core receiving components. | 88 // encoders/decoders, the sound card and core receiving components. |
109 // This method also makes it possible to install some user-defined external | 89 // This method also makes it possible to install some user-defined external |
110 // modules: | 90 // modules: |
111 // - The Audio Device Module (ADM) which implements all the audio layer | 91 // - The Audio Device Module (ADM) which implements all the audio layer |
112 // functionality in a separate (reference counted) module. | 92 // functionality in a separate (reference counted) module. |
113 // - The AudioProcessing module handles capture-side processing. | 93 // - The AudioProcessing module handles capture-side processing. |
114 // - An AudioDecoderFactory - used to create audio decoders. | 94 // - An AudioDecoderFactory - used to create audio decoders. |
115 // If NULL is passed for either of ADM or AudioDecoderFactory, VoiceEngine | 95 // If NULL is passed for either of ADM or AudioDecoderFactory, VoiceEngine |
116 // will create its own. Returns -1 in case of an error, 0 otherwise. | 96 // will create its own. Returns -1 in case of an error, 0 otherwise. |
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
164 virtual AudioTransport* audio_transport() { return NULL; } | 144 virtual AudioTransport* audio_transport() { return NULL; } |
165 | 145 |
166 protected: | 146 protected: |
167 VoEBase() {} | 147 VoEBase() {} |
168 virtual ~VoEBase() {} | 148 virtual ~VoEBase() {} |
169 }; | 149 }; |
170 | 150 |
171 } // namespace webrtc | 151 } // namespace webrtc |
172 | 152 |
173 #endif // VOICE_ENGINE_VOE_BASE_H_ | 153 #endif // VOICE_ENGINE_VOE_BASE_H_ |
OLD | NEW |