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 18 matching lines...) Expand all Loading... |
29 // base->DeleteChannel(ch); | 29 // base->DeleteChannel(ch); |
30 // base->Terminate(); | 30 // base->Terminate(); |
31 // base->Release(); | 31 // base->Release(); |
32 // VoiceEngine::Delete(voe); | 32 // VoiceEngine::Delete(voe); |
33 // | 33 // |
34 #ifndef WEBRTC_VOICE_ENGINE_VOE_BASE_H | 34 #ifndef WEBRTC_VOICE_ENGINE_VOE_BASE_H |
35 #define WEBRTC_VOICE_ENGINE_VOE_BASE_H | 35 #define WEBRTC_VOICE_ENGINE_VOE_BASE_H |
36 | 36 |
37 #include "webrtc/base/scoped_ref_ptr.h" | 37 #include "webrtc/base/scoped_ref_ptr.h" |
38 #include "webrtc/modules/audio_coding/codecs/audio_decoder_factory.h" | 38 #include "webrtc/modules/audio_coding/codecs/audio_decoder_factory.h" |
| 39 #include "webrtc/modules/audio_coding/include/audio_coding_module.h" |
39 #include "webrtc/common_types.h" | 40 #include "webrtc/common_types.h" |
40 | 41 |
41 namespace webrtc { | 42 namespace webrtc { |
42 | 43 |
43 class AudioDeviceModule; | 44 class AudioDeviceModule; |
44 class AudioProcessing; | 45 class AudioProcessing; |
45 class AudioTransport; | 46 class AudioTransport; |
46 class Config; | |
47 | 47 |
48 const int kVoEDefault = -1; | 48 const int kVoEDefault = -1; |
49 | 49 |
50 // VoiceEngineObserver | 50 // VoiceEngineObserver |
51 class WEBRTC_DLLEXPORT VoiceEngineObserver { | 51 class WEBRTC_DLLEXPORT VoiceEngineObserver { |
52 public: | 52 public: |
53 // This method will be called after the occurrence of any runtime error | 53 // This method will be called after the occurrence of any runtime error |
54 // code, or warning notification, when the observer interface has been | 54 // code, or warning notification, when the observer interface has been |
55 // installed using VoEBase::RegisterVoiceEngineObserver(). | 55 // installed using VoEBase::RegisterVoiceEngineObserver(). |
56 virtual void CallbackOnError(int channel, int errCode) = 0; | 56 virtual void CallbackOnError(int channel, int errCode) = 0; |
57 | 57 |
58 protected: | 58 protected: |
59 virtual ~VoiceEngineObserver() {} | 59 virtual ~VoiceEngineObserver() {} |
60 }; | 60 }; |
61 | 61 |
62 // VoiceEngine | 62 // VoiceEngine |
63 class WEBRTC_DLLEXPORT VoiceEngine { | 63 class WEBRTC_DLLEXPORT VoiceEngine { |
64 public: | 64 public: |
65 // Creates a VoiceEngine object, which can then be used to acquire | 65 // Creates a VoiceEngine object, which can then be used to acquire |
66 // sub-APIs. Returns NULL on failure. | 66 // sub-APIs. Returns NULL on failure. |
67 static VoiceEngine* Create(); | 67 static VoiceEngine* Create(); |
68 static VoiceEngine* Create(const Config& config); | |
69 | 68 |
70 // Deletes a created VoiceEngine object and releases the utilized resources. | 69 // Deletes a created VoiceEngine object and releases the utilized resources. |
71 // Note that if there are outstanding references held via other interfaces, | 70 // Note that if there are outstanding references held via other interfaces, |
72 // the voice engine instance will not actually be deleted until those | 71 // the voice engine instance will not actually be deleted until those |
73 // references have been released. | 72 // references have been released. |
74 static bool Delete(VoiceEngine*& voiceEngine); | 73 static bool Delete(VoiceEngine*& voiceEngine); |
75 | 74 |
76 // Specifies the amount and type of trace information which will be | 75 // Specifies the amount and type of trace information which will be |
77 // created by the VoiceEngine. | 76 // created by the VoiceEngine. |
78 static int SetTraceFilter(unsigned int filter); | 77 static int SetTraceFilter(unsigned int filter); |
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
139 | 138 |
140 // This method is WIP - DO NOT USE! | 139 // This method is WIP - DO NOT USE! |
141 // Returns NULL before Init() is called. | 140 // Returns NULL before Init() is called. |
142 virtual AudioDeviceModule* audio_device_module() = 0; | 141 virtual AudioDeviceModule* audio_device_module() = 0; |
143 | 142 |
144 // Terminates all VoiceEngine functions and releases allocated resources. | 143 // Terminates all VoiceEngine functions and releases allocated resources. |
145 // Returns 0. | 144 // Returns 0. |
146 virtual int Terminate() = 0; | 145 virtual int Terminate() = 0; |
147 | 146 |
148 // Creates a new channel and allocates the required resources for it. | 147 // Creates a new channel and allocates the required resources for it. |
149 // One can use |config| to configure the channel. Currently that is used for | 148 // One can use |acm_config| to configure the channel. |
150 // choosing between ACM1 and ACM2, when creating Audio Coding Module. | |
151 // Returns channel ID or -1 in case of an error. | 149 // Returns channel ID or -1 in case of an error. |
152 virtual int CreateChannel() = 0; | 150 virtual int CreateChannel() = 0; |
153 virtual int CreateChannel(const Config& config) = 0; | 151 virtual int CreateChannel(const AudioCodingModule::Config& acm_config) = 0; |
154 | 152 |
155 // Deletes an existing channel and releases the utilized resources. | 153 // Deletes an existing channel and releases the utilized resources. |
156 // Returns -1 in case of an error, 0 otherwise. | 154 // Returns -1 in case of an error, 0 otherwise. |
157 virtual int DeleteChannel(int channel) = 0; | 155 virtual int DeleteChannel(int channel) = 0; |
158 | 156 |
159 // Prepares and initiates the VoiceEngine for reception of | 157 // Prepares and initiates the VoiceEngine for reception of |
160 // incoming RTP/RTCP packets on the specified |channel|. | 158 // incoming RTP/RTCP packets on the specified |channel|. |
161 virtual int StartReceive(int channel) = 0; | 159 virtual int StartReceive(int channel) = 0; |
162 | 160 |
163 // Stops receiving incoming RTP/RTCP packets on the specified |channel|. | 161 // Stops receiving incoming RTP/RTCP packets on the specified |channel|. |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
195 virtual int AssociateSendChannel(int channel, int accociate_send_channel) = 0; | 193 virtual int AssociateSendChannel(int channel, int accociate_send_channel) = 0; |
196 | 194 |
197 protected: | 195 protected: |
198 VoEBase() {} | 196 VoEBase() {} |
199 virtual ~VoEBase() {} | 197 virtual ~VoEBase() {} |
200 }; | 198 }; |
201 | 199 |
202 } // namespace webrtc | 200 } // namespace webrtc |
203 | 201 |
204 #endif // WEBRTC_VOICE_ENGINE_VOE_BASE_H | 202 #endif // WEBRTC_VOICE_ENGINE_VOE_BASE_H |
OLD | NEW |