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 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
66 // Creates a VoiceEngine object, which can then be used to acquire | 66 // Creates a VoiceEngine object, which can then be used to acquire |
67 // sub-APIs. Returns NULL on failure. | 67 // sub-APIs. Returns NULL on failure. |
68 static VoiceEngine* Create(); | 68 static VoiceEngine* Create(); |
69 | 69 |
70 // Deletes a created VoiceEngine object and releases the utilized resources. | 70 // Deletes a created VoiceEngine object and releases the utilized resources. |
71 // Note that if there are outstanding references held via other interfaces, | 71 // Note that if there are outstanding references held via other interfaces, |
72 // the voice engine instance will not actually be deleted until those | 72 // the voice engine instance will not actually be deleted until those |
73 // references have been released. | 73 // references have been released. |
74 static bool Delete(VoiceEngine*& voiceEngine); | 74 static bool Delete(VoiceEngine*& voiceEngine); |
75 | 75 |
76 // Specifies the amount and type of trace information which will be | |
77 // created by the VoiceEngine. | |
78 static int SetTraceFilter(unsigned int filter); | |
79 | |
80 // Sets the name of the trace file and enables non-encrypted trace messages. | |
81 static int SetTraceFile(const char* fileNameUTF8, | |
82 bool addFileCounter = false); | |
83 | |
84 // Installs the TraceCallback implementation to ensure that the user | |
85 // receives callbacks for generated trace messages. | |
86 static int SetTraceCallback(TraceCallback* callback); | |
87 | |
88 static std::string GetVersionString(); | |
89 | |
90 protected: | 76 protected: |
91 VoiceEngine() {} | 77 VoiceEngine() {} |
92 ~VoiceEngine() {} | 78 ~VoiceEngine() {} |
93 }; | 79 }; |
94 | 80 |
95 // VoEBase | 81 // VoEBase |
96 class WEBRTC_DLLEXPORT VoEBase { | 82 class WEBRTC_DLLEXPORT VoEBase { |
97 public: | 83 public: |
98 struct ChannelConfig { | 84 struct ChannelConfig { |
99 AudioCodingModule::Config acm_config; | 85 AudioCodingModule::Config acm_config; |
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
151 // decoder_factory member of the ACM config will be ignored (the decoder | 137 // decoder_factory member of the ACM config will be ignored (the decoder |
152 // factory set through Init() will always be used). | 138 // factory set through Init() will always be used). |
153 // Returns channel ID or -1 in case of an error. | 139 // Returns channel ID or -1 in case of an error. |
154 virtual int CreateChannel() = 0; | 140 virtual int CreateChannel() = 0; |
155 virtual int CreateChannel(const ChannelConfig& config) = 0; | 141 virtual int CreateChannel(const ChannelConfig& config) = 0; |
156 | 142 |
157 // Deletes an existing channel and releases the utilized resources. | 143 // Deletes an existing channel and releases the utilized resources. |
158 // Returns -1 in case of an error, 0 otherwise. | 144 // Returns -1 in case of an error, 0 otherwise. |
159 virtual int DeleteChannel(int channel) = 0; | 145 virtual int DeleteChannel(int channel) = 0; |
160 | 146 |
161 // Prepares and initiates the VoiceEngine for reception of | |
162 // incoming RTP/RTCP packets on the specified |channel|. | |
163 virtual int StartReceive(int channel) = 0; | |
164 | |
165 // Stops receiving incoming RTP/RTCP packets on the specified |channel|. | |
166 virtual int StopReceive(int channel) { return 0; } | |
167 | |
168 // Starts forwarding the packets to the mixer/soundcard for a | 147 // Starts forwarding the packets to the mixer/soundcard for a |
169 // specified |channel|. | 148 // specified |channel|. |
170 virtual int StartPlayout(int channel) = 0; | 149 virtual int StartPlayout(int channel) = 0; |
171 | 150 |
172 // Stops forwarding the packets to the mixer/soundcard for a | 151 // Stops forwarding the packets to the mixer/soundcard for a |
173 // specified |channel|. | 152 // specified |channel|. |
174 virtual int StopPlayout(int channel) = 0; | 153 virtual int StopPlayout(int channel) = 0; |
175 | 154 |
176 // Starts sending packets to an already specified IP address and | 155 // Starts sending packets to an already specified IP address and |
177 // port number for a specified |channel|. | 156 // port number for a specified |channel|. |
178 virtual int StartSend(int channel) = 0; | 157 virtual int StartSend(int channel) = 0; |
179 | 158 |
180 // Stops sending packets from a specified |channel|. | 159 // Stops sending packets from a specified |channel|. |
181 virtual int StopSend(int channel) = 0; | 160 virtual int StopSend(int channel) = 0; |
182 | 161 |
183 // Gets the version information for VoiceEngine and its components. | |
184 virtual int GetVersion(char version[1024]) = 0; | |
185 | |
186 // Gets the last VoiceEngine error code. | |
187 virtual int LastError() = 0; | |
188 | |
189 // TODO(xians): Make the interface pure virtual after libjingle | 162 // TODO(xians): Make the interface pure virtual after libjingle |
190 // implements the interface in its FakeWebRtcVoiceEngine. | 163 // implements the interface in its FakeWebRtcVoiceEngine. |
191 virtual AudioTransport* audio_transport() { return NULL; } | 164 virtual AudioTransport* audio_transport() { return NULL; } |
192 | 165 |
193 // Associate a send channel to a receive channel. | |
194 // Used for obtaining RTT for a receive-only channel. | |
195 // One should be careful not to crate a circular association, e.g., | |
196 // 1 <- 2 <- 1. | |
197 virtual int AssociateSendChannel(int channel, int accociate_send_channel) = 0; | |
198 | |
199 protected: | 166 protected: |
200 VoEBase() {} | 167 VoEBase() {} |
201 virtual ~VoEBase() {} | 168 virtual ~VoEBase() {} |
202 }; | 169 }; |
203 | 170 |
204 } // namespace webrtc | 171 } // namespace webrtc |
205 | 172 |
206 #endif // VOICE_ENGINE_VOE_BASE_H_ | 173 #endif // VOICE_ENGINE_VOE_BASE_H_ |
OLD | NEW |