blob: 5b86b538beb5c8a7fb8548905b52b27053471989 [file] [log] [blame]
henrike@webrtc.org28e20752013-07-10 00:45:36 +00001/*
2 * libjingle
3 * Copyright 2010 Google Inc.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions are met:
7 *
8 * 1. Redistributions of source code must retain the above copyright notice,
9 * this list of conditions and the following disclaimer.
10 * 2. Redistributions in binary form must reproduce the above copyright notice,
11 * this list of conditions and the following disclaimer in the documentation
12 * and/or other materials provided with the distribution.
13 * 3. The name of the author may not be used to endorse or promote products
14 * derived from this software without specific prior written permission.
15 *
16 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED
17 * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
18 * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
19 * EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
20 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
21 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
22 * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
23 * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
24 * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
25 * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26 */
27
28#ifndef TALK_SESSION_PHONE_FAKEWEBRTCVOICEENGINE_H_
29#define TALK_SESSION_PHONE_FAKEWEBRTCVOICEENGINE_H_
30
31#include <list>
32#include <map>
33#include <vector>
34
henrike@webrtc.org28e20752013-07-10 00:45:36 +000035#include "talk/media/base/codec.h"
buildbot@webrtc.org7e71b772014-06-13 01:14:01 +000036#include "talk/media/base/rtputils.h"
henrike@webrtc.org28e20752013-07-10 00:45:36 +000037#include "talk/media/base/voiceprocessor.h"
38#include "talk/media/webrtc/fakewebrtccommon.h"
39#include "talk/media/webrtc/webrtcvoe.h"
buildbot@webrtc.orga09a9992014-08-13 17:26:08 +000040#include "webrtc/base/basictypes.h"
Fredrik Solenbergd3ddc1b2015-05-07 17:07:34 +020041#include "webrtc/base/checks.h"
buildbot@webrtc.orga09a9992014-08-13 17:26:08 +000042#include "webrtc/base/gunit.h"
43#include "webrtc/base/stringutils.h"
Henrik Lundin64dad832015-05-11 12:44:23 +020044#include "webrtc/config.h"
buildbot@webrtc.orga8d8ad22014-07-16 14:23:08 +000045#include "webrtc/modules/audio_processing/include/audio_processing.h"
buildbot@webrtc.orgf875f152014-04-14 16:06:21 +000046
henrike@webrtc.org28e20752013-07-10 00:45:36 +000047namespace cricket {
48
49// Function returning stats will return these values
50// for all values based on type.
51const int kIntStatValue = 123;
52const float kFractionLostStatValue = 0.5;
53
54static const char kFakeDefaultDeviceName[] = "Fake Default";
55static const int kFakeDefaultDeviceId = -1;
56static const char kFakeDeviceName[] = "Fake Device";
57#ifdef WIN32
58static const int kFakeDeviceId = 0;
59#else
60static const int kFakeDeviceId = 1;
61#endif
62
buildbot@webrtc.org5d639b32014-09-10 07:57:12 +000063static const int kOpusBandwidthNb = 4000;
64static const int kOpusBandwidthMb = 6000;
65static const int kOpusBandwidthWb = 8000;
66static const int kOpusBandwidthSwb = 12000;
67static const int kOpusBandwidthFb = 20000;
68
minyue@webrtc.orgc0bd7be2015-02-18 15:24:13 +000069static const webrtc::NetworkStatistics kNetStats = {
70 1, // uint16_t currentBufferSize;
71 2, // uint16_t preferredBufferSize;
72 true, // bool jitterPeaksFound;
73 1234, // uint16_t currentPacketLossRate;
74 567, // uint16_t currentDiscardRate;
75 8901, // uint16_t currentExpandRate;
76 234, // uint16_t currentSpeechExpandRate;
77 5678, // uint16_t currentPreemptiveRate;
78 9012, // uint16_t currentAccelerateRate;
79 3456, // uint16_t currentSecondaryDecodedRate;
80 7890, // int32_t clockDriftPPM;
81 54, // meanWaitingTimeMs;
82 32, // int medianWaitingTimeMs;
83 1, // int minWaitingTimeMs;
84 98, // int maxWaitingTimeMs;
85 7654, // int addedSamples;
86}; // These random but non-trivial numbers are used for testing.
87
Fredrik Solenbergd3ddc1b2015-05-07 17:07:34 +020088#define WEBRTC_CHECK_CHANNEL(channel) \
89 if (channels_.find(channel) == channels_.end()) return -1;
90
91#define WEBRTC_ASSERT_CHANNEL(channel) \
92 DCHECK(channels_.find(channel) != channels_.end());
93
henrike@webrtc.org79047f92014-03-06 23:46:59 +000094// Verify the header extension ID, if enabled, is within the bounds specified in
95// [RFC5285]: 1-14 inclusive.
96#define WEBRTC_CHECK_HEADER_EXTENSION_ID(enable, id) \
97 do { \
98 if (enable && (id < 1 || id > 14)) { \
99 return -1; \
100 } \
101 } while (0);
102
buildbot@webrtc.orga8d8ad22014-07-16 14:23:08 +0000103class FakeAudioProcessing : public webrtc::AudioProcessing {
104 public:
105 FakeAudioProcessing() : experimental_ns_enabled_(false) {}
106
107 WEBRTC_STUB(Initialize, ())
108 WEBRTC_STUB(Initialize, (
109 int input_sample_rate_hz,
110 int output_sample_rate_hz,
111 int reverse_sample_rate_hz,
112 webrtc::AudioProcessing::ChannelLayout input_layout,
113 webrtc::AudioProcessing::ChannelLayout output_layout,
114 webrtc::AudioProcessing::ChannelLayout reverse_layout));
115
116 WEBRTC_VOID_FUNC(SetExtraOptions, (const webrtc::Config& config)) {
117 experimental_ns_enabled_ = config.Get<webrtc::ExperimentalNs>().enabled;
118 }
119
120 WEBRTC_STUB(set_sample_rate_hz, (int rate));
121 WEBRTC_STUB_CONST(input_sample_rate_hz, ());
122 WEBRTC_STUB_CONST(sample_rate_hz, ());
123 WEBRTC_STUB_CONST(proc_sample_rate_hz, ());
124 WEBRTC_STUB_CONST(proc_split_sample_rate_hz, ());
125 WEBRTC_STUB_CONST(num_input_channels, ());
126 WEBRTC_STUB_CONST(num_output_channels, ());
127 WEBRTC_STUB_CONST(num_reverse_channels, ());
128 WEBRTC_VOID_STUB(set_output_will_be_muted, (bool muted));
129 WEBRTC_BOOL_STUB_CONST(output_will_be_muted, ());
130 WEBRTC_STUB(ProcessStream, (webrtc::AudioFrame* frame));
131 WEBRTC_STUB(ProcessStream, (
132 const float* const* src,
133 int samples_per_channel,
134 int input_sample_rate_hz,
135 webrtc::AudioProcessing::ChannelLayout input_layout,
136 int output_sample_rate_hz,
137 webrtc::AudioProcessing::ChannelLayout output_layout,
138 float* const* dest));
139 WEBRTC_STUB(AnalyzeReverseStream, (webrtc::AudioFrame* frame));
140 WEBRTC_STUB(AnalyzeReverseStream, (
141 const float* const* data,
142 int samples_per_channel,
143 int sample_rate_hz,
144 webrtc::AudioProcessing::ChannelLayout layout));
145 WEBRTC_STUB(set_stream_delay_ms, (int delay));
146 WEBRTC_STUB_CONST(stream_delay_ms, ());
147 WEBRTC_BOOL_STUB_CONST(was_stream_delay_set, ());
148 WEBRTC_VOID_STUB(set_stream_key_pressed, (bool key_pressed));
149 WEBRTC_BOOL_STUB_CONST(stream_key_pressed, ());
150 WEBRTC_VOID_STUB(set_delay_offset_ms, (int offset));
151 WEBRTC_STUB_CONST(delay_offset_ms, ());
152 WEBRTC_STUB(StartDebugRecording, (const char filename[kMaxFilenameSize]));
153 WEBRTC_STUB(StartDebugRecording, (FILE* handle));
154 WEBRTC_STUB(StopDebugRecording, ());
kjellander@webrtc.org14665ff2015-03-04 12:58:35 +0000155 webrtc::EchoCancellation* echo_cancellation() const override { return NULL; }
156 webrtc::EchoControlMobile* echo_control_mobile() const override {
buildbot@webrtc.orga8d8ad22014-07-16 14:23:08 +0000157 return NULL;
158 }
kjellander@webrtc.org14665ff2015-03-04 12:58:35 +0000159 webrtc::GainControl* gain_control() const override { return NULL; }
160 webrtc::HighPassFilter* high_pass_filter() const override { return NULL; }
161 webrtc::LevelEstimator* level_estimator() const override { return NULL; }
162 webrtc::NoiseSuppression* noise_suppression() const override { return NULL; }
163 webrtc::VoiceDetection* voice_detection() const override { return NULL; }
buildbot@webrtc.orga8d8ad22014-07-16 14:23:08 +0000164
165 bool experimental_ns_enabled() {
166 return experimental_ns_enabled_;
167 }
168
169 private:
170 bool experimental_ns_enabled_;
171};
buildbot@webrtc.orga8d8ad22014-07-16 14:23:08 +0000172
henrike@webrtc.org28e20752013-07-10 00:45:36 +0000173class FakeWebRtcVoiceEngine
174 : public webrtc::VoEAudioProcessing,
175 public webrtc::VoEBase, public webrtc::VoECodec, public webrtc::VoEDtmf,
176 public webrtc::VoEFile, public webrtc::VoEHardware,
177 public webrtc::VoEExternalMedia, public webrtc::VoENetEqStats,
178 public webrtc::VoENetwork, public webrtc::VoERTP_RTCP,
179 public webrtc::VoEVideoSync, public webrtc::VoEVolumeControl {
180 public:
181 struct DtmfInfo {
182 DtmfInfo()
183 : dtmf_event_code(-1),
184 dtmf_out_of_band(false),
185 dtmf_length_ms(-1) {}
186 int dtmf_event_code;
187 bool dtmf_out_of_band;
188 int dtmf_length_ms;
189 };
190 struct Channel {
buildbot@webrtc.orgaf6640f2014-04-28 21:31:51 +0000191 explicit Channel()
henrike@webrtc.org28e20752013-07-10 00:45:36 +0000192 : external_transport(false),
193 send(false),
194 playout(false),
195 volume_scale(1.0),
196 volume_pan_left(1.0),
197 volume_pan_right(1.0),
198 file(false),
199 vad(false),
buildbot@webrtc.orgae740dd2014-06-17 10:56:41 +0000200 codec_fec(false),
buildbot@webrtc.org5d639b32014-09-10 07:57:12 +0000201 max_encoding_bandwidth(0),
minyue@webrtc.org9b2e1142015-03-13 09:38:07 +0000202 opus_dtx(false),
buildbot@webrtc.orgae740dd2014-06-17 10:56:41 +0000203 red(false),
henrike@webrtc.org28e20752013-07-10 00:45:36 +0000204 nack(false),
205 media_processor_registered(false),
wu@webrtc.org97077a32013-10-25 21:18:33 +0000206 rx_agc_enabled(false),
207 rx_agc_mode(webrtc::kAgcDefault),
henrike@webrtc.org28e20752013-07-10 00:45:36 +0000208 cn8_type(13),
209 cn16_type(105),
210 dtmf_type(106),
buildbot@webrtc.orgae740dd2014-06-17 10:56:41 +0000211 red_type(117),
henrike@webrtc.org28e20752013-07-10 00:45:36 +0000212 nack_max_packets(0),
213 send_ssrc(0),
henrike@webrtc.org79047f92014-03-06 23:46:59 +0000214 send_audio_level_ext_(-1),
buildbot@webrtc.org150835e2014-05-06 15:54:38 +0000215 receive_audio_level_ext_(-1),
henrike@webrtc.org79047f92014-03-06 23:46:59 +0000216 send_absolute_sender_time_ext_(-1),
Henrik Lundin64dad832015-05-11 12:44:23 +0200217 receive_absolute_sender_time_ext_(-1),
218 neteq_capacity(-1) {
henrike@webrtc.org28e20752013-07-10 00:45:36 +0000219 memset(&send_codec, 0, sizeof(send_codec));
wu@webrtc.org97077a32013-10-25 21:18:33 +0000220 memset(&rx_agc_config, 0, sizeof(rx_agc_config));
henrike@webrtc.org28e20752013-07-10 00:45:36 +0000221 }
222 bool external_transport;
223 bool send;
224 bool playout;
225 float volume_scale;
226 float volume_pan_left;
227 float volume_pan_right;
228 bool file;
229 bool vad;
buildbot@webrtc.orgae740dd2014-06-17 10:56:41 +0000230 bool codec_fec;
buildbot@webrtc.org5d639b32014-09-10 07:57:12 +0000231 int max_encoding_bandwidth;
minyue@webrtc.org9b2e1142015-03-13 09:38:07 +0000232 bool opus_dtx;
buildbot@webrtc.orgae740dd2014-06-17 10:56:41 +0000233 bool red;
henrike@webrtc.org28e20752013-07-10 00:45:36 +0000234 bool nack;
235 bool media_processor_registered;
wu@webrtc.org97077a32013-10-25 21:18:33 +0000236 bool rx_agc_enabled;
237 webrtc::AgcModes rx_agc_mode;
238 webrtc::AgcConfig rx_agc_config;
henrike@webrtc.org28e20752013-07-10 00:45:36 +0000239 int cn8_type;
240 int cn16_type;
241 int dtmf_type;
buildbot@webrtc.orgae740dd2014-06-17 10:56:41 +0000242 int red_type;
henrike@webrtc.org28e20752013-07-10 00:45:36 +0000243 int nack_max_packets;
244 uint32 send_ssrc;
henrike@webrtc.org79047f92014-03-06 23:46:59 +0000245 int send_audio_level_ext_;
buildbot@webrtc.org150835e2014-05-06 15:54:38 +0000246 int receive_audio_level_ext_;
henrike@webrtc.org79047f92014-03-06 23:46:59 +0000247 int send_absolute_sender_time_ext_;
248 int receive_absolute_sender_time_ext_;
henrike@webrtc.org28e20752013-07-10 00:45:36 +0000249 DtmfInfo dtmf_info;
250 std::vector<webrtc::CodecInst> recv_codecs;
251 webrtc::CodecInst send_codec;
buildbot@webrtc.orgf875f152014-04-14 16:06:21 +0000252 webrtc::PacketTime last_rtp_packet_time;
henrike@webrtc.org28e20752013-07-10 00:45:36 +0000253 std::list<std::string> packets;
Henrik Lundin64dad832015-05-11 12:44:23 +0200254 int neteq_capacity;
henrike@webrtc.org28e20752013-07-10 00:45:36 +0000255 };
256
257 FakeWebRtcVoiceEngine(const cricket::AudioCodec* const* codecs,
258 int num_codecs)
259 : inited_(false),
260 last_channel_(-1),
261 fail_create_channel_(false),
262 codecs_(codecs),
263 num_codecs_(num_codecs),
wu@webrtc.org05e7b442014-04-01 17:44:24 +0000264 num_set_send_codecs_(0),
henrike@webrtc.org28e20752013-07-10 00:45:36 +0000265 ec_enabled_(false),
266 ec_metrics_enabled_(false),
267 cng_enabled_(false),
268 ns_enabled_(false),
269 agc_enabled_(false),
270 highpass_filter_enabled_(false),
271 stereo_swapping_enabled_(false),
272 typing_detection_enabled_(false),
273 ec_mode_(webrtc::kEcDefault),
274 aecm_mode_(webrtc::kAecmSpeakerphone),
275 ns_mode_(webrtc::kNsDefault),
276 agc_mode_(webrtc::kAgcDefault),
277 observer_(NULL),
278 playout_fail_channel_(-1),
279 send_fail_channel_(-1),
280 fail_start_recording_microphone_(false),
281 recording_microphone_(false),
wu@webrtc.org97077a32013-10-25 21:18:33 +0000282 recording_sample_rate_(-1),
283 playout_sample_rate_(-1),
henrike@webrtc.org28e20752013-07-10 00:45:36 +0000284 media_processor_(NULL) {
285 memset(&agc_config_, 0, sizeof(agc_config_));
286 }
287 ~FakeWebRtcVoiceEngine() {
288 // Ought to have all been deleted by the WebRtcVoiceMediaChannel
289 // destructors, but just in case ...
290 for (std::map<int, Channel*>::const_iterator i = channels_.begin();
291 i != channels_.end(); ++i) {
292 delete i->second;
293 }
294 }
295
296 bool IsExternalMediaProcessorRegistered() const {
297 return media_processor_ != NULL;
298 }
299 bool IsInited() const { return inited_; }
300 int GetLastChannel() const { return last_channel_; }
wu@webrtc.org9dba5252013-08-05 20:36:57 +0000301 int GetChannelFromLocalSsrc(uint32 local_ssrc) const {
302 for (std::map<int, Channel*>::const_iterator iter = channels_.begin();
303 iter != channels_.end(); ++iter) {
304 if (local_ssrc == iter->second->send_ssrc)
305 return iter->first;
306 }
307 return -1;
308 }
wu@webrtc.org9caf2762013-12-11 18:25:07 +0000309 int GetNumChannels() const { return static_cast<int>(channels_.size()); }
henrike@webrtc.org28e20752013-07-10 00:45:36 +0000310 bool GetPlayout(int channel) {
311 return channels_[channel]->playout;
312 }
313 bool GetSend(int channel) {
314 return channels_[channel]->send;
315 }
316 bool GetRecordingMicrophone() {
317 return recording_microphone_;
318 }
319 bool GetVAD(int channel) {
320 return channels_[channel]->vad;
321 }
Minyue Li7100dcd2015-03-27 05:05:59 +0100322 bool GetOpusDtx(int channel) {
323 return channels_[channel]->opus_dtx;
324 }
buildbot@webrtc.orgae740dd2014-06-17 10:56:41 +0000325 bool GetRED(int channel) {
326 return channels_[channel]->red;
327 }
328 bool GetCodecFEC(int channel) {
329 return channels_[channel]->codec_fec;
henrike@webrtc.org28e20752013-07-10 00:45:36 +0000330 }
buildbot@webrtc.org5d639b32014-09-10 07:57:12 +0000331 int GetMaxEncodingBandwidth(int channel) {
332 return channels_[channel]->max_encoding_bandwidth;
333 }
henrike@webrtc.org28e20752013-07-10 00:45:36 +0000334 bool GetNACK(int channel) {
335 return channels_[channel]->nack;
336 }
337 int GetNACKMaxPackets(int channel) {
338 return channels_[channel]->nack_max_packets;
339 }
buildbot@webrtc.orgf875f152014-04-14 16:06:21 +0000340 const webrtc::PacketTime& GetLastRtpPacketTime(int channel) {
341 WEBRTC_ASSERT_CHANNEL(channel);
342 return channels_[channel]->last_rtp_packet_time;
343 }
henrike@webrtc.org28e20752013-07-10 00:45:36 +0000344 int GetSendCNPayloadType(int channel, bool wideband) {
345 return (wideband) ?
346 channels_[channel]->cn16_type :
347 channels_[channel]->cn8_type;
348 }
349 int GetSendTelephoneEventPayloadType(int channel) {
350 return channels_[channel]->dtmf_type;
351 }
buildbot@webrtc.orgae740dd2014-06-17 10:56:41 +0000352 int GetSendREDPayloadType(int channel) {
353 return channels_[channel]->red_type;
henrike@webrtc.org28e20752013-07-10 00:45:36 +0000354 }
355 bool CheckPacket(int channel, const void* data, size_t len) {
356 bool result = !CheckNoPacket(channel);
357 if (result) {
358 std::string packet = channels_[channel]->packets.front();
359 result = (packet == std::string(static_cast<const char*>(data), len));
360 channels_[channel]->packets.pop_front();
361 }
362 return result;
363 }
364 bool CheckNoPacket(int channel) {
365 return channels_[channel]->packets.empty();
366 }
367 void TriggerCallbackOnError(int channel_num, int err_code) {
Fredrik Solenbergd3ddc1b2015-05-07 17:07:34 +0200368 DCHECK(observer_ != NULL);
henrike@webrtc.org28e20752013-07-10 00:45:36 +0000369 observer_->CallbackOnError(channel_num, err_code);
370 }
371 void set_playout_fail_channel(int channel) {
372 playout_fail_channel_ = channel;
373 }
374 void set_send_fail_channel(int channel) {
375 send_fail_channel_ = channel;
376 }
377 void set_fail_start_recording_microphone(
378 bool fail_start_recording_microphone) {
379 fail_start_recording_microphone_ = fail_start_recording_microphone;
380 }
381 void set_fail_create_channel(bool fail_create_channel) {
382 fail_create_channel_ = fail_create_channel;
383 }
384 void TriggerProcessPacket(MediaProcessorDirection direction) {
385 webrtc::ProcessingTypes pt =
386 (direction == cricket::MPD_TX) ?
387 webrtc::kRecordingPerChannel : webrtc::kPlaybackAllChannelsMixed;
388 if (media_processor_ != NULL) {
389 media_processor_->Process(0,
390 pt,
391 NULL,
392 0,
393 0,
394 true);
395 }
396 }
Henrik Lundin64dad832015-05-11 12:44:23 +0200397 int AddChannel(const webrtc::Config& config) {
wu@webrtc.org364f2042013-11-20 21:49:41 +0000398 if (fail_create_channel_) {
399 return -1;
400 }
buildbot@webrtc.orgaf6640f2014-04-28 21:31:51 +0000401 Channel* ch = new Channel();
wu@webrtc.org364f2042013-11-20 21:49:41 +0000402 for (int i = 0; i < NumOfCodecs(); ++i) {
403 webrtc::CodecInst codec;
404 GetCodec(i, codec);
405 ch->recv_codecs.push_back(codec);
406 }
Henrik Lundin64dad832015-05-11 12:44:23 +0200407 if (config.Get<webrtc::NetEqCapacityConfig>().enabled) {
408 ch->neteq_capacity = config.Get<webrtc::NetEqCapacityConfig>().capacity;
409 }
wu@webrtc.org364f2042013-11-20 21:49:41 +0000410 channels_[++last_channel_] = ch;
411 return last_channel_;
412 }
buildbot@webrtc.org150835e2014-05-06 15:54:38 +0000413 int GetSendRtpExtensionId(int channel, const std::string& extension) {
414 WEBRTC_ASSERT_CHANNEL(channel);
415 if (extension == kRtpAudioLevelHeaderExtension) {
416 return channels_[channel]->send_audio_level_ext_;
417 } else if (extension == kRtpAbsoluteSenderTimeHeaderExtension) {
418 return channels_[channel]->send_absolute_sender_time_ext_;
419 }
420 return -1;
henrike@webrtc.org79047f92014-03-06 23:46:59 +0000421 }
buildbot@webrtc.org150835e2014-05-06 15:54:38 +0000422 int GetReceiveRtpExtensionId(int channel, const std::string& extension) {
423 WEBRTC_ASSERT_CHANNEL(channel);
424 if (extension == kRtpAudioLevelHeaderExtension) {
425 return channels_[channel]->receive_audio_level_ext_;
426 } else if (extension == kRtpAbsoluteSenderTimeHeaderExtension) {
427 return channels_[channel]->receive_absolute_sender_time_ext_;
428 }
429 return -1;
henrike@webrtc.org79047f92014-03-06 23:46:59 +0000430 }
henrike@webrtc.org28e20752013-07-10 00:45:36 +0000431
wu@webrtc.org05e7b442014-04-01 17:44:24 +0000432 int GetNumSetSendCodecs() const { return num_set_send_codecs_; }
433
henrike@webrtc.org28e20752013-07-10 00:45:36 +0000434 WEBRTC_STUB(Release, ());
435
436 // webrtc::VoEBase
437 WEBRTC_FUNC(RegisterVoiceEngineObserver, (
438 webrtc::VoiceEngineObserver& observer)) {
439 observer_ = &observer;
440 return 0;
441 }
442 WEBRTC_STUB(DeRegisterVoiceEngineObserver, ());
443 WEBRTC_FUNC(Init, (webrtc::AudioDeviceModule* adm,
444 webrtc::AudioProcessing* audioproc)) {
445 inited_ = true;
446 return 0;
447 }
448 WEBRTC_FUNC(Terminate, ()) {
449 inited_ = false;
450 return 0;
451 }
kjellander@webrtc.org14665ff2015-03-04 12:58:35 +0000452 webrtc::AudioProcessing* audio_processing() override {
buildbot@webrtc.orga8d8ad22014-07-16 14:23:08 +0000453 return &audio_processing_;
henrike@webrtc.org28e20752013-07-10 00:45:36 +0000454 }
henrike@webrtc.org28e20752013-07-10 00:45:36 +0000455 WEBRTC_FUNC(CreateChannel, ()) {
Henrik Lundin64dad832015-05-11 12:44:23 +0200456 webrtc::Config empty_config;
457 return AddChannel(empty_config);
henrike@webrtc.org28e20752013-07-10 00:45:36 +0000458 }
Henrik Lundin64dad832015-05-11 12:44:23 +0200459 WEBRTC_FUNC(CreateChannel, (const webrtc::Config& config)) {
460 return AddChannel(config);
wu@webrtc.org364f2042013-11-20 21:49:41 +0000461 }
henrike@webrtc.org28e20752013-07-10 00:45:36 +0000462 WEBRTC_FUNC(DeleteChannel, (int channel)) {
463 WEBRTC_CHECK_CHANNEL(channel);
464 delete channels_[channel];
465 channels_.erase(channel);
466 return 0;
467 }
468 WEBRTC_STUB(StartReceive, (int channel));
469 WEBRTC_FUNC(StartPlayout, (int channel)) {
470 if (playout_fail_channel_ != channel) {
471 WEBRTC_CHECK_CHANNEL(channel);
472 channels_[channel]->playout = true;
473 return 0;
474 } else {
475 // When playout_fail_channel_ == channel, fail the StartPlayout on this
476 // channel.
477 return -1;
478 }
479 }
480 WEBRTC_FUNC(StartSend, (int channel)) {
481 if (send_fail_channel_ != channel) {
482 WEBRTC_CHECK_CHANNEL(channel);
483 channels_[channel]->send = true;
484 return 0;
485 } else {
486 // When send_fail_channel_ == channel, fail the StartSend on this
487 // channel.
488 return -1;
489 }
490 }
491 WEBRTC_STUB(StopReceive, (int channel));
492 WEBRTC_FUNC(StopPlayout, (int channel)) {
493 WEBRTC_CHECK_CHANNEL(channel);
494 channels_[channel]->playout = false;
495 return 0;
496 }
497 WEBRTC_FUNC(StopSend, (int channel)) {
498 WEBRTC_CHECK_CHANNEL(channel);
499 channels_[channel]->send = false;
500 return 0;
501 }
502 WEBRTC_STUB(GetVersion, (char version[1024]));
503 WEBRTC_STUB(LastError, ());
504 WEBRTC_STUB(SetOnHoldStatus, (int, bool, webrtc::OnHoldModes));
505 WEBRTC_STUB(GetOnHoldStatus, (int, bool&, webrtc::OnHoldModes&));
henrike@webrtc.org28e20752013-07-10 00:45:36 +0000506
507 // webrtc::VoECodec
508 WEBRTC_FUNC(NumOfCodecs, ()) {
509 return num_codecs_;
510 }
511 WEBRTC_FUNC(GetCodec, (int index, webrtc::CodecInst& codec)) {
512 if (index < 0 || index >= NumOfCodecs()) {
513 return -1;
514 }
515 const cricket::AudioCodec& c(*codecs_[index]);
516 codec.pltype = c.id;
buildbot@webrtc.orgd4e598d2014-07-29 17:36:52 +0000517 rtc::strcpyn(codec.plname, sizeof(codec.plname), c.name.c_str());
henrike@webrtc.org28e20752013-07-10 00:45:36 +0000518 codec.plfreq = c.clockrate;
519 codec.pacsize = 0;
520 codec.channels = c.channels;
521 codec.rate = c.bitrate;
522 return 0;
523 }
524 WEBRTC_FUNC(SetSendCodec, (int channel, const webrtc::CodecInst& codec)) {
525 WEBRTC_CHECK_CHANNEL(channel);
henrike@webrtc.org704bf9e2014-02-27 17:52:04 +0000526 // To match the behavior of the real implementation.
527 if (_stricmp(codec.plname, "telephone-event") == 0 ||
528 _stricmp(codec.plname, "audio/telephone-event") == 0 ||
529 _stricmp(codec.plname, "CN") == 0 ||
530 _stricmp(codec.plname, "red") == 0 ) {
531 return -1;
532 }
henrike@webrtc.org28e20752013-07-10 00:45:36 +0000533 channels_[channel]->send_codec = codec;
wu@webrtc.org05e7b442014-04-01 17:44:24 +0000534 ++num_set_send_codecs_;
henrike@webrtc.org28e20752013-07-10 00:45:36 +0000535 return 0;
536 }
537 WEBRTC_FUNC(GetSendCodec, (int channel, webrtc::CodecInst& codec)) {
538 WEBRTC_CHECK_CHANNEL(channel);
539 codec = channels_[channel]->send_codec;
540 return 0;
541 }
Ivo Creusenadf89b72015-04-29 16:03:33 +0200542 WEBRTC_STUB(SetBitRate, (int channel, int bitrate_bps));
buildbot@webrtc.org7e71b772014-06-13 01:14:01 +0000543 WEBRTC_FUNC(GetRecCodec, (int channel, webrtc::CodecInst& codec)) {
544 WEBRTC_CHECK_CHANNEL(channel);
545 const Channel* c = channels_[channel];
546 for (std::list<std::string>::const_iterator it_packet = c->packets.begin();
547 it_packet != c->packets.end(); ++it_packet) {
548 int pltype;
549 if (!GetRtpPayloadType(it_packet->data(), it_packet->length(), &pltype)) {
550 continue;
551 }
552 for (std::vector<webrtc::CodecInst>::const_iterator it_codec =
553 c->recv_codecs.begin(); it_codec != c->recv_codecs.end();
554 ++it_codec) {
555 if (it_codec->pltype == pltype) {
556 codec = *it_codec;
557 return 0;
558 }
559 }
560 }
561 return -1;
562 }
henrike@webrtc.org28e20752013-07-10 00:45:36 +0000563 WEBRTC_STUB(SetAMREncFormat, (int channel, webrtc::AmrMode mode));
564 WEBRTC_STUB(SetAMRDecFormat, (int channel, webrtc::AmrMode mode));
565 WEBRTC_STUB(SetAMRWbEncFormat, (int channel, webrtc::AmrMode mode));
566 WEBRTC_STUB(SetAMRWbDecFormat, (int channel, webrtc::AmrMode mode));
567 WEBRTC_STUB(SetISACInitTargetRate, (int channel, int rateBps,
568 bool useFixedFrameSize));
569 WEBRTC_STUB(SetISACMaxRate, (int channel, int rateBps));
570 WEBRTC_STUB(SetISACMaxPayloadSize, (int channel, int sizeBytes));
571 WEBRTC_FUNC(SetRecPayloadType, (int channel,
572 const webrtc::CodecInst& codec)) {
573 WEBRTC_CHECK_CHANNEL(channel);
574 Channel* ch = channels_[channel];
575 if (ch->playout)
576 return -1; // Channel is in use.
577 // Check if something else already has this slot.
578 if (codec.pltype != -1) {
579 for (std::vector<webrtc::CodecInst>::iterator it =
580 ch->recv_codecs.begin(); it != ch->recv_codecs.end(); ++it) {
581 if (it->pltype == codec.pltype &&
582 _stricmp(it->plname, codec.plname) != 0) {
583 return -1;
584 }
585 }
586 }
587 // Otherwise try to find this codec and update its payload type.
588 for (std::vector<webrtc::CodecInst>::iterator it = ch->recv_codecs.begin();
589 it != ch->recv_codecs.end(); ++it) {
590 if (strcmp(it->plname, codec.plname) == 0 &&
591 it->plfreq == codec.plfreq) {
592 it->pltype = codec.pltype;
593 it->channels = codec.channels;
594 return 0;
595 }
596 }
597 return -1; // not found
598 }
599 WEBRTC_FUNC(SetSendCNPayloadType, (int channel, int type,
600 webrtc::PayloadFrequencies frequency)) {
601 WEBRTC_CHECK_CHANNEL(channel);
602 if (frequency == webrtc::kFreq8000Hz) {
603 channels_[channel]->cn8_type = type;
604 } else if (frequency == webrtc::kFreq16000Hz) {
605 channels_[channel]->cn16_type = type;
606 }
607 return 0;
608 }
609 WEBRTC_FUNC(GetRecPayloadType, (int channel, webrtc::CodecInst& codec)) {
610 WEBRTC_CHECK_CHANNEL(channel);
611 Channel* ch = channels_[channel];
612 for (std::vector<webrtc::CodecInst>::iterator it = ch->recv_codecs.begin();
613 it != ch->recv_codecs.end(); ++it) {
614 if (strcmp(it->plname, codec.plname) == 0 &&
615 it->plfreq == codec.plfreq &&
616 it->channels == codec.channels &&
617 it->pltype != -1) {
618 codec.pltype = it->pltype;
619 return 0;
620 }
621 }
622 return -1; // not found
623 }
624 WEBRTC_FUNC(SetVADStatus, (int channel, bool enable, webrtc::VadModes mode,
625 bool disableDTX)) {
626 WEBRTC_CHECK_CHANNEL(channel);
627 if (channels_[channel]->send_codec.channels == 2) {
628 // Replicating VoE behavior; VAD cannot be enabled for stereo.
629 return -1;
630 }
631 channels_[channel]->vad = enable;
632 return 0;
633 }
634 WEBRTC_STUB(GetVADStatus, (int channel, bool& enabled,
635 webrtc::VadModes& mode, bool& disabledDTX));
buildbot@webrtc.org5d639b32014-09-10 07:57:12 +0000636
buildbot@webrtc.orgae740dd2014-06-17 10:56:41 +0000637 WEBRTC_FUNC(SetFECStatus, (int channel, bool enable)) {
638 WEBRTC_CHECK_CHANNEL(channel);
buildbot@webrtc.org5d639b32014-09-10 07:57:12 +0000639 if (_stricmp(channels_[channel]->send_codec.plname, "opus") != 0) {
buildbot@webrtc.org3ffa1f92014-07-02 19:51:26 +0000640 // Return -1 if current send codec is not Opus.
641 // TODO(minyue): Excludes other codecs if they support inband FEC.
642 return -1;
643 }
buildbot@webrtc.orgae740dd2014-06-17 10:56:41 +0000644 channels_[channel]->codec_fec = enable;
645 return 0;
646 }
647 WEBRTC_FUNC(GetFECStatus, (int channel, bool& enable)) {
648 WEBRTC_CHECK_CHANNEL(channel);
649 enable = channels_[channel]->codec_fec;
650 return 0;
651 }
buildbot@webrtc.org5d639b32014-09-10 07:57:12 +0000652
653 WEBRTC_FUNC(SetOpusMaxPlaybackRate, (int channel, int frequency_hz)) {
654 WEBRTC_CHECK_CHANNEL(channel);
655 if (_stricmp(channels_[channel]->send_codec.plname, "opus") != 0) {
656 // Return -1 if current send codec is not Opus.
657 return -1;
658 }
659 if (frequency_hz <= 8000)
660 channels_[channel]->max_encoding_bandwidth = kOpusBandwidthNb;
661 else if (frequency_hz <= 12000)
662 channels_[channel]->max_encoding_bandwidth = kOpusBandwidthMb;
663 else if (frequency_hz <= 16000)
664 channels_[channel]->max_encoding_bandwidth = kOpusBandwidthWb;
665 else if (frequency_hz <= 24000)
666 channels_[channel]->max_encoding_bandwidth = kOpusBandwidthSwb;
667 else
668 channels_[channel]->max_encoding_bandwidth = kOpusBandwidthFb;
669 return 0;
670 }
henrike@webrtc.org28e20752013-07-10 00:45:36 +0000671
minyue@webrtc.org9b2e1142015-03-13 09:38:07 +0000672 WEBRTC_FUNC(SetOpusDtx, (int channel, bool enable_dtx)) {
673 WEBRTC_CHECK_CHANNEL(channel);
674 if (_stricmp(channels_[channel]->send_codec.plname, "opus") != 0) {
675 // Return -1 if current send codec is not Opus.
676 return -1;
677 }
678 channels_[channel]->opus_dtx = enable_dtx;
679 return 0;
680 }
681
henrike@webrtc.org28e20752013-07-10 00:45:36 +0000682 // webrtc::VoEDtmf
683 WEBRTC_FUNC(SendTelephoneEvent, (int channel, int event_code,
684 bool out_of_band = true, int length_ms = 160, int attenuation_db = 10)) {
685 channels_[channel]->dtmf_info.dtmf_event_code = event_code;
686 channels_[channel]->dtmf_info.dtmf_out_of_band = out_of_band;
687 channels_[channel]->dtmf_info.dtmf_length_ms = length_ms;
688 return 0;
689 }
690
691 WEBRTC_FUNC(SetSendTelephoneEventPayloadType,
692 (int channel, unsigned char type)) {
693 channels_[channel]->dtmf_type = type;
694 return 0;
695 };
696 WEBRTC_STUB(GetSendTelephoneEventPayloadType,
697 (int channel, unsigned char& type));
698
699 WEBRTC_STUB(SetDtmfFeedbackStatus, (bool enable, bool directFeedback));
700 WEBRTC_STUB(GetDtmfFeedbackStatus, (bool& enabled, bool& directFeedback));
henrike@webrtc.org28e20752013-07-10 00:45:36 +0000701
henrike@webrtc.org28e20752013-07-10 00:45:36 +0000702 WEBRTC_FUNC(PlayDtmfTone,
703 (int event_code, int length_ms = 200, int attenuation_db = 10)) {
704 dtmf_info_.dtmf_event_code = event_code;
705 dtmf_info_.dtmf_length_ms = length_ms;
706 return 0;
707 }
708 WEBRTC_STUB(StartPlayingDtmfTone,
709 (int eventCode, int attenuationDb = 10));
710 WEBRTC_STUB(StopPlayingDtmfTone, ());
711
712 // webrtc::VoEFile
713 WEBRTC_FUNC(StartPlayingFileLocally, (int channel, const char* fileNameUTF8,
714 bool loop, webrtc::FileFormats format,
715 float volumeScaling, int startPointMs,
716 int stopPointMs)) {
717 WEBRTC_CHECK_CHANNEL(channel);
718 channels_[channel]->file = true;
719 return 0;
720 }
721 WEBRTC_FUNC(StartPlayingFileLocally, (int channel, webrtc::InStream* stream,
722 webrtc::FileFormats format,
723 float volumeScaling, int startPointMs,
724 int stopPointMs)) {
725 WEBRTC_CHECK_CHANNEL(channel);
726 channels_[channel]->file = true;
727 return 0;
728 }
729 WEBRTC_FUNC(StopPlayingFileLocally, (int channel)) {
730 WEBRTC_CHECK_CHANNEL(channel);
731 channels_[channel]->file = false;
732 return 0;
733 }
734 WEBRTC_FUNC(IsPlayingFileLocally, (int channel)) {
735 WEBRTC_CHECK_CHANNEL(channel);
736 return (channels_[channel]->file) ? 1 : 0;
737 }
738 WEBRTC_STUB(ScaleLocalFilePlayout, (int channel, float scale));
739 WEBRTC_STUB(StartPlayingFileAsMicrophone, (int channel,
740 const char* fileNameUTF8,
741 bool loop,
742 bool mixWithMicrophone,
743 webrtc::FileFormats format,
744 float volumeScaling));
745 WEBRTC_STUB(StartPlayingFileAsMicrophone, (int channel,
746 webrtc::InStream* stream,
747 bool mixWithMicrophone,
748 webrtc::FileFormats format,
749 float volumeScaling));
750 WEBRTC_STUB(StopPlayingFileAsMicrophone, (int channel));
751 WEBRTC_STUB(IsPlayingFileAsMicrophone, (int channel));
752 WEBRTC_STUB(ScaleFileAsMicrophonePlayout, (int channel, float scale));
753 WEBRTC_STUB(StartRecordingPlayout, (int channel, const char* fileNameUTF8,
754 webrtc::CodecInst* compression,
755 int maxSizeBytes));
756 WEBRTC_STUB(StartRecordingPlayout, (int channel, webrtc::OutStream* stream,
757 webrtc::CodecInst* compression));
758 WEBRTC_STUB(StopRecordingPlayout, (int channel));
759 WEBRTC_FUNC(StartRecordingMicrophone, (const char* fileNameUTF8,
760 webrtc::CodecInst* compression,
761 int maxSizeBytes)) {
762 if (fail_start_recording_microphone_) {
763 return -1;
764 }
765 recording_microphone_ = true;
766 return 0;
767 }
768 WEBRTC_FUNC(StartRecordingMicrophone, (webrtc::OutStream* stream,
769 webrtc::CodecInst* compression)) {
770 if (fail_start_recording_microphone_) {
771 return -1;
772 }
773 recording_microphone_ = true;
774 return 0;
775 }
776 WEBRTC_FUNC(StopRecordingMicrophone, ()) {
777 if (!recording_microphone_) {
778 return -1;
779 }
780 recording_microphone_ = false;
781 return 0;
782 }
783 WEBRTC_STUB(ConvertPCMToWAV, (const char* fileNameInUTF8,
784 const char* fileNameOutUTF8));
785 WEBRTC_STUB(ConvertPCMToWAV, (webrtc::InStream* streamIn,
786 webrtc::OutStream* streamOut));
787 WEBRTC_STUB(ConvertWAVToPCM, (const char* fileNameInUTF8,
788 const char* fileNameOutUTF8));
789 WEBRTC_STUB(ConvertWAVToPCM, (webrtc::InStream* streamIn,
790 webrtc::OutStream* streamOut));
791 WEBRTC_STUB(ConvertPCMToCompressed, (const char* fileNameInUTF8,
792 const char* fileNameOutUTF8,
793 webrtc::CodecInst* compression));
794 WEBRTC_STUB(ConvertPCMToCompressed, (webrtc::InStream* streamIn,
795 webrtc::OutStream* streamOut,
796 webrtc::CodecInst* compression));
797 WEBRTC_STUB(ConvertCompressedToPCM, (const char* fileNameInUTF8,
798 const char* fileNameOutUTF8));
799 WEBRTC_STUB(ConvertCompressedToPCM, (webrtc::InStream* streamIn,
800 webrtc::OutStream* streamOut));
801 WEBRTC_STUB(GetFileDuration, (const char* fileNameUTF8, int& durationMs,
802 webrtc::FileFormats format));
803 WEBRTC_STUB(GetPlaybackPosition, (int channel, int& positionMs));
804
805 // webrtc::VoEHardware
806 WEBRTC_STUB(GetCPULoad, (int&));
807 WEBRTC_FUNC(GetNumOfRecordingDevices, (int& num)) {
808 return GetNumDevices(num);
809 }
810 WEBRTC_FUNC(GetNumOfPlayoutDevices, (int& num)) {
811 return GetNumDevices(num);
812 }
813 WEBRTC_FUNC(GetRecordingDeviceName, (int i, char* name, char* guid)) {
814 return GetDeviceName(i, name, guid);
815 }
816 WEBRTC_FUNC(GetPlayoutDeviceName, (int i, char* name, char* guid)) {
817 return GetDeviceName(i, name, guid);
818 }
819 WEBRTC_STUB(SetRecordingDevice, (int, webrtc::StereoChannel));
820 WEBRTC_STUB(SetPlayoutDevice, (int));
821 WEBRTC_STUB(SetAudioDeviceLayer, (webrtc::AudioLayers));
822 WEBRTC_STUB(GetAudioDeviceLayer, (webrtc::AudioLayers&));
823 WEBRTC_STUB(GetPlayoutDeviceStatus, (bool&));
824 WEBRTC_STUB(GetRecordingDeviceStatus, (bool&));
825 WEBRTC_STUB(ResetAudioDevice, ());
826 WEBRTC_STUB(AudioDeviceControl, (unsigned int, unsigned int, unsigned int));
827 WEBRTC_STUB(SetLoudspeakerStatus, (bool enable));
828 WEBRTC_STUB(GetLoudspeakerStatus, (bool& enabled));
wu@webrtc.org97077a32013-10-25 21:18:33 +0000829 WEBRTC_FUNC(SetRecordingSampleRate, (unsigned int samples_per_sec)) {
830 recording_sample_rate_ = samples_per_sec;
831 return 0;
832 }
833 WEBRTC_FUNC_CONST(RecordingSampleRate, (unsigned int* samples_per_sec)) {
834 *samples_per_sec = recording_sample_rate_;
835 return 0;
836 }
837 WEBRTC_FUNC(SetPlayoutSampleRate, (unsigned int samples_per_sec)) {
838 playout_sample_rate_ = samples_per_sec;
839 return 0;
840 }
841 WEBRTC_FUNC_CONST(PlayoutSampleRate, (unsigned int* samples_per_sec)) {
842 *samples_per_sec = playout_sample_rate_;
843 return 0;
844 }
henrike@webrtc.org28e20752013-07-10 00:45:36 +0000845 WEBRTC_STUB(EnableBuiltInAEC, (bool enable));
846 virtual bool BuiltInAECIsEnabled() const { return true; }
henrika@webrtc.orga954c072014-12-09 16:22:09 +0000847 virtual bool BuiltInAECIsAvailable() const { return false; }
henrike@webrtc.org28e20752013-07-10 00:45:36 +0000848
849 // webrtc::VoENetEqStats
minyue@webrtc.orgc0bd7be2015-02-18 15:24:13 +0000850 WEBRTC_FUNC(GetNetworkStatistics, (int channel,
851 webrtc::NetworkStatistics& ns)) {
852 WEBRTC_CHECK_CHANNEL(channel);
853 memcpy(&ns, &kNetStats, sizeof(webrtc::NetworkStatistics));
854 return 0;
855 }
856
wu@webrtc.org24301a62013-12-13 19:17:43 +0000857 WEBRTC_FUNC_CONST(GetDecodingCallStatistics, (int channel,
858 webrtc::AudioDecodingCallStats*)) {
859 WEBRTC_CHECK_CHANNEL(channel);
860 return 0;
861 }
henrike@webrtc.org28e20752013-07-10 00:45:36 +0000862
863 // webrtc::VoENetwork
864 WEBRTC_FUNC(RegisterExternalTransport, (int channel,
865 webrtc::Transport& transport)) {
866 WEBRTC_CHECK_CHANNEL(channel);
867 channels_[channel]->external_transport = true;
868 return 0;
869 }
870 WEBRTC_FUNC(DeRegisterExternalTransport, (int channel)) {
871 WEBRTC_CHECK_CHANNEL(channel);
872 channels_[channel]->external_transport = false;
873 return 0;
874 }
875 WEBRTC_FUNC(ReceivedRTPPacket, (int channel, const void* data,
pkasting@chromium.org4591fbd2014-11-20 22:28:14 +0000876 size_t length)) {
henrike@webrtc.org28e20752013-07-10 00:45:36 +0000877 WEBRTC_CHECK_CHANNEL(channel);
878 if (!channels_[channel]->external_transport) return -1;
879 channels_[channel]->packets.push_back(
880 std::string(static_cast<const char*>(data), length));
881 return 0;
882 }
buildbot@webrtc.orgf875f152014-04-14 16:06:21 +0000883 WEBRTC_FUNC(ReceivedRTPPacket, (int channel, const void* data,
pkasting@chromium.org4591fbd2014-11-20 22:28:14 +0000884 size_t length,
buildbot@webrtc.orgf875f152014-04-14 16:06:21 +0000885 const webrtc::PacketTime& packet_time)) {
886 WEBRTC_CHECK_CHANNEL(channel);
887 if (ReceivedRTPPacket(channel, data, length) == -1) {
888 return -1;
889 }
890 channels_[channel]->last_rtp_packet_time = packet_time;
891 return 0;
892 }
buildbot@webrtc.orgf875f152014-04-14 16:06:21 +0000893
henrike@webrtc.org28e20752013-07-10 00:45:36 +0000894 WEBRTC_STUB(ReceivedRTCPPacket, (int channel, const void* data,
pkasting@chromium.org4591fbd2014-11-20 22:28:14 +0000895 size_t length));
henrike@webrtc.org28e20752013-07-10 00:45:36 +0000896
897 // webrtc::VoERTP_RTCP
898 WEBRTC_STUB(RegisterRTPObserver, (int channel,
899 webrtc::VoERTPObserver& observer));
900 WEBRTC_STUB(DeRegisterRTPObserver, (int channel));
henrike@webrtc.org28e20752013-07-10 00:45:36 +0000901 WEBRTC_FUNC(SetLocalSSRC, (int channel, unsigned int ssrc)) {
902 WEBRTC_CHECK_CHANNEL(channel);
903 channels_[channel]->send_ssrc = ssrc;
904 return 0;
905 }
906 WEBRTC_FUNC(GetLocalSSRC, (int channel, unsigned int& ssrc)) {
907 WEBRTC_CHECK_CHANNEL(channel);
908 ssrc = channels_[channel]->send_ssrc;
909 return 0;
910 }
911 WEBRTC_STUB(GetRemoteSSRC, (int channel, unsigned int& ssrc));
henrike@webrtc.org79047f92014-03-06 23:46:59 +0000912 WEBRTC_FUNC(SetSendAudioLevelIndicationStatus, (int channel, bool enable,
913 unsigned char id)) {
henrike@webrtc.org28e20752013-07-10 00:45:36 +0000914 WEBRTC_CHECK_CHANNEL(channel);
henrike@webrtc.org79047f92014-03-06 23:46:59 +0000915 WEBRTC_CHECK_HEADER_EXTENSION_ID(enable, id);
916 channels_[channel]->send_audio_level_ext_ = (enable) ? id : -1;
henrike@webrtc.org28e20752013-07-10 00:45:36 +0000917 return 0;
918 }
buildbot@webrtc.org150835e2014-05-06 15:54:38 +0000919 WEBRTC_FUNC(SetReceiveAudioLevelIndicationStatus, (int channel, bool enable,
920 unsigned char id)) {
921 WEBRTC_CHECK_CHANNEL(channel);
922 WEBRTC_CHECK_HEADER_EXTENSION_ID(enable, id);
923 channels_[channel]->receive_audio_level_ext_ = (enable) ? id : -1;
924 return 0;
925 }
henrike@webrtc.org79047f92014-03-06 23:46:59 +0000926 WEBRTC_FUNC(SetSendAbsoluteSenderTimeStatus, (int channel, bool enable,
927 unsigned char id)) {
928 WEBRTC_CHECK_CHANNEL(channel);
929 WEBRTC_CHECK_HEADER_EXTENSION_ID(enable, id);
930 channels_[channel]->send_absolute_sender_time_ext_ = (enable) ? id : -1;
931 return 0;
932 }
933 WEBRTC_FUNC(SetReceiveAbsoluteSenderTimeStatus, (int channel, bool enable,
934 unsigned char id)) {
935 WEBRTC_CHECK_CHANNEL(channel);
936 WEBRTC_CHECK_HEADER_EXTENSION_ID(enable, id);
937 channels_[channel]->receive_absolute_sender_time_ext_ = (enable) ? id : -1;
938 return 0;
939 }
henrike@webrtc.org79047f92014-03-06 23:46:59 +0000940
henrike@webrtc.org28e20752013-07-10 00:45:36 +0000941 WEBRTC_STUB(GetRemoteCSRCs, (int channel, unsigned int arrCSRC[15]));
942 WEBRTC_STUB(SetRTCPStatus, (int channel, bool enable));
943 WEBRTC_STUB(GetRTCPStatus, (int channel, bool& enabled));
944 WEBRTC_STUB(SetRTCP_CNAME, (int channel, const char cname[256]));
945 WEBRTC_STUB(GetRTCP_CNAME, (int channel, char cname[256]));
946 WEBRTC_STUB(GetRemoteRTCP_CNAME, (int channel, char* cname));
947 WEBRTC_STUB(GetRemoteRTCPData, (int channel, unsigned int& NTPHigh,
948 unsigned int& NTPLow,
949 unsigned int& timestamp,
950 unsigned int& playoutTimestamp,
951 unsigned int* jitter,
952 unsigned short* fractionLost));
953 WEBRTC_STUB(GetRemoteRTCPSenderInfo, (int channel,
954 webrtc::SenderInfo* sender_info));
955 WEBRTC_FUNC(GetRemoteRTCPReportBlocks,
956 (int channel, std::vector<webrtc::ReportBlock>* receive_blocks)) {
957 WEBRTC_CHECK_CHANNEL(channel);
958 webrtc::ReportBlock block;
959 block.source_SSRC = channels_[channel]->send_ssrc;
960 webrtc::CodecInst send_codec = channels_[channel]->send_codec;
961 if (send_codec.pltype >= 0) {
962 block.fraction_lost = (unsigned char)(kFractionLostStatValue * 256);
963 if (send_codec.plfreq / 1000 > 0) {
964 block.interarrival_jitter = kIntStatValue * (send_codec.plfreq / 1000);
965 }
966 block.cumulative_num_packets_lost = kIntStatValue;
967 block.extended_highest_sequence_number = kIntStatValue;
968 receive_blocks->push_back(block);
969 }
970 return 0;
971 }
972 WEBRTC_STUB(SendApplicationDefinedRTCPPacket, (int channel,
973 unsigned char subType,
974 unsigned int name,
975 const char* data,
976 unsigned short dataLength));
977 WEBRTC_STUB(GetRTPStatistics, (int channel, unsigned int& averageJitterMs,
978 unsigned int& maxJitterMs,
979 unsigned int& discardedPackets));
980 WEBRTC_FUNC(GetRTCPStatistics, (int channel, webrtc::CallStatistics& stats)) {
981 WEBRTC_CHECK_CHANNEL(channel);
982 stats.fractionLost = static_cast<int16>(kIntStatValue);
983 stats.cumulativeLost = kIntStatValue;
984 stats.extendedMax = kIntStatValue;
985 stats.jitterSamples = kIntStatValue;
986 stats.rttMs = kIntStatValue;
987 stats.bytesSent = kIntStatValue;
988 stats.packetsSent = kIntStatValue;
989 stats.bytesReceived = kIntStatValue;
990 stats.packetsReceived = kIntStatValue;
991 return 0;
992 }
buildbot@webrtc.orgae740dd2014-06-17 10:56:41 +0000993 WEBRTC_FUNC(SetREDStatus, (int channel, bool enable, int redPayloadtype)) {
buildbot@webrtc.orgbfa758a2014-06-27 16:04:43 +0000994 return SetFECStatus(channel, enable, redPayloadtype);
995 }
buildbot@webrtc.orgbfa758a2014-06-27 16:04:43 +0000996 // TODO(minyue): remove the below function when transition to SetREDStatus
997 // is finished.
henrike@webrtc.org28e20752013-07-10 00:45:36 +0000998 WEBRTC_FUNC(SetFECStatus, (int channel, bool enable, int redPayloadtype)) {
999 WEBRTC_CHECK_CHANNEL(channel);
buildbot@webrtc.orgae740dd2014-06-17 10:56:41 +00001000 channels_[channel]->red = enable;
1001 channels_[channel]->red_type = redPayloadtype;
henrike@webrtc.org28e20752013-07-10 00:45:36 +00001002 return 0;
1003 }
buildbot@webrtc.orgae740dd2014-06-17 10:56:41 +00001004 WEBRTC_FUNC(GetREDStatus, (int channel, bool& enable, int& redPayloadtype)) {
buildbot@webrtc.orgbfa758a2014-06-27 16:04:43 +00001005 return GetFECStatus(channel, enable, redPayloadtype);
1006 }
buildbot@webrtc.orgbfa758a2014-06-27 16:04:43 +00001007 // TODO(minyue): remove the below function when transition to GetREDStatus
1008 // is finished.
henrike@webrtc.org28e20752013-07-10 00:45:36 +00001009 WEBRTC_FUNC(GetFECStatus, (int channel, bool& enable, int& redPayloadtype)) {
1010 WEBRTC_CHECK_CHANNEL(channel);
buildbot@webrtc.orgae740dd2014-06-17 10:56:41 +00001011 enable = channels_[channel]->red;
1012 redPayloadtype = channels_[channel]->red_type;
henrike@webrtc.org28e20752013-07-10 00:45:36 +00001013 return 0;
1014 }
1015 WEBRTC_FUNC(SetNACKStatus, (int channel, bool enable, int maxNoPackets)) {
1016 WEBRTC_CHECK_CHANNEL(channel);
1017 channels_[channel]->nack = enable;
1018 channels_[channel]->nack_max_packets = maxNoPackets;
1019 return 0;
1020 }
1021 WEBRTC_STUB(StartRTPDump, (int channel, const char* fileNameUTF8,
1022 webrtc::RTPDirections direction));
1023 WEBRTC_STUB(StopRTPDump, (int channel, webrtc::RTPDirections direction));
1024 WEBRTC_STUB(RTPDumpIsActive, (int channel, webrtc::RTPDirections direction));
1025 WEBRTC_STUB(InsertExtraRTPPacket, (int channel, unsigned char payloadType,
1026 bool markerBit, const char* payloadData,
1027 unsigned short payloadSize));
1028 WEBRTC_STUB(GetLastRemoteTimeStamp, (int channel,
1029 uint32_t* lastRemoteTimeStamp));
Fredrik Solenberg6179b892015-05-07 16:01:26 +02001030 WEBRTC_STUB(SetVideoEngineBWETarget, (int channel,
buildbot@webrtc.orgf875f152014-04-14 16:06:21 +00001031 webrtc::ViENetwork* vie_network,
Fredrik Solenberg6179b892015-05-07 16:01:26 +02001032 int video_channel));
henrike@webrtc.org28e20752013-07-10 00:45:36 +00001033
1034 // webrtc::VoEVideoSync
1035 WEBRTC_STUB(GetPlayoutBufferSize, (int& bufferMs));
1036 WEBRTC_STUB(GetPlayoutTimestamp, (int channel, unsigned int& timestamp));
wu@webrtc.org822fbd82013-08-15 23:38:54 +00001037 WEBRTC_STUB(GetRtpRtcp, (int, webrtc::RtpRtcp**, webrtc::RtpReceiver**));
henrike@webrtc.org28e20752013-07-10 00:45:36 +00001038 WEBRTC_STUB(SetInitTimestamp, (int channel, unsigned int timestamp));
1039 WEBRTC_STUB(SetInitSequenceNumber, (int channel, short sequenceNumber));
1040 WEBRTC_STUB(SetMinimumPlayoutDelay, (int channel, int delayMs));
1041 WEBRTC_STUB(SetInitialPlayoutDelay, (int channel, int delay_ms));
1042 WEBRTC_STUB(GetDelayEstimate, (int channel, int* jitter_buffer_delay_ms,
1043 int* playout_buffer_delay_ms));
1044 WEBRTC_STUB_CONST(GetLeastRequiredDelayMs, (int channel));
1045
1046 // webrtc::VoEVolumeControl
1047 WEBRTC_STUB(SetSpeakerVolume, (unsigned int));
1048 WEBRTC_STUB(GetSpeakerVolume, (unsigned int&));
1049 WEBRTC_STUB(SetSystemOutputMute, (bool));
1050 WEBRTC_STUB(GetSystemOutputMute, (bool&));
1051 WEBRTC_STUB(SetMicVolume, (unsigned int));
1052 WEBRTC_STUB(GetMicVolume, (unsigned int&));
1053 WEBRTC_STUB(SetInputMute, (int, bool));
1054 WEBRTC_STUB(GetInputMute, (int, bool&));
1055 WEBRTC_STUB(SetSystemInputMute, (bool));
1056 WEBRTC_STUB(GetSystemInputMute, (bool&));
1057 WEBRTC_STUB(GetSpeechInputLevel, (unsigned int&));
1058 WEBRTC_STUB(GetSpeechOutputLevel, (int, unsigned int&));
1059 WEBRTC_STUB(GetSpeechInputLevelFullRange, (unsigned int&));
1060 WEBRTC_STUB(GetSpeechOutputLevelFullRange, (int, unsigned int&));
1061 WEBRTC_FUNC(SetChannelOutputVolumeScaling, (int channel, float scale)) {
1062 WEBRTC_CHECK_CHANNEL(channel);
1063 channels_[channel]->volume_scale= scale;
1064 return 0;
1065 }
1066 WEBRTC_FUNC(GetChannelOutputVolumeScaling, (int channel, float& scale)) {
1067 WEBRTC_CHECK_CHANNEL(channel);
1068 scale = channels_[channel]->volume_scale;
1069 return 0;
1070 }
1071 WEBRTC_FUNC(SetOutputVolumePan, (int channel, float left, float right)) {
1072 WEBRTC_CHECK_CHANNEL(channel);
1073 channels_[channel]->volume_pan_left = left;
1074 channels_[channel]->volume_pan_right = right;
1075 return 0;
1076 }
1077 WEBRTC_FUNC(GetOutputVolumePan, (int channel, float& left, float& right)) {
1078 WEBRTC_CHECK_CHANNEL(channel);
1079 left = channels_[channel]->volume_pan_left;
1080 right = channels_[channel]->volume_pan_right;
1081 return 0;
1082 }
1083
1084 // webrtc::VoEAudioProcessing
1085 WEBRTC_FUNC(SetNsStatus, (bool enable, webrtc::NsModes mode)) {
1086 ns_enabled_ = enable;
1087 ns_mode_ = mode;
1088 return 0;
1089 }
1090 WEBRTC_FUNC(GetNsStatus, (bool& enabled, webrtc::NsModes& mode)) {
1091 enabled = ns_enabled_;
1092 mode = ns_mode_;
1093 return 0;
1094 }
1095
1096 WEBRTC_FUNC(SetAgcStatus, (bool enable, webrtc::AgcModes mode)) {
1097 agc_enabled_ = enable;
1098 agc_mode_ = mode;
1099 return 0;
1100 }
1101 WEBRTC_FUNC(GetAgcStatus, (bool& enabled, webrtc::AgcModes& mode)) {
1102 enabled = agc_enabled_;
1103 mode = agc_mode_;
1104 return 0;
1105 }
1106
1107 WEBRTC_FUNC(SetAgcConfig, (webrtc::AgcConfig config)) {
1108 agc_config_ = config;
1109 return 0;
1110 }
1111 WEBRTC_FUNC(GetAgcConfig, (webrtc::AgcConfig& config)) {
1112 config = agc_config_;
1113 return 0;
1114 }
1115 WEBRTC_FUNC(SetEcStatus, (bool enable, webrtc::EcModes mode)) {
1116 ec_enabled_ = enable;
1117 ec_mode_ = mode;
1118 return 0;
1119 }
1120 WEBRTC_FUNC(GetEcStatus, (bool& enabled, webrtc::EcModes& mode)) {
1121 enabled = ec_enabled_;
1122 mode = ec_mode_;
1123 return 0;
1124 }
1125 WEBRTC_STUB(EnableDriftCompensation, (bool enable))
1126 WEBRTC_BOOL_STUB(DriftCompensationEnabled, ())
1127 WEBRTC_VOID_STUB(SetDelayOffsetMs, (int offset))
1128 WEBRTC_STUB(DelayOffsetMs, ());
1129 WEBRTC_FUNC(SetAecmMode, (webrtc::AecmModes mode, bool enableCNG)) {
1130 aecm_mode_ = mode;
1131 cng_enabled_ = enableCNG;
1132 return 0;
1133 }
1134 WEBRTC_FUNC(GetAecmMode, (webrtc::AecmModes& mode, bool& enabledCNG)) {
1135 mode = aecm_mode_;
1136 enabledCNG = cng_enabled_;
1137 return 0;
1138 }
1139 WEBRTC_STUB(SetRxNsStatus, (int channel, bool enable, webrtc::NsModes mode));
1140 WEBRTC_STUB(GetRxNsStatus, (int channel, bool& enabled,
1141 webrtc::NsModes& mode));
wu@webrtc.org97077a32013-10-25 21:18:33 +00001142 WEBRTC_FUNC(SetRxAgcStatus, (int channel, bool enable,
1143 webrtc::AgcModes mode)) {
1144 channels_[channel]->rx_agc_enabled = enable;
1145 channels_[channel]->rx_agc_mode = mode;
1146 return 0;
1147 }
1148 WEBRTC_FUNC(GetRxAgcStatus, (int channel, bool& enabled,
1149 webrtc::AgcModes& mode)) {
1150 enabled = channels_[channel]->rx_agc_enabled;
1151 mode = channels_[channel]->rx_agc_mode;
1152 return 0;
1153 }
1154
1155 WEBRTC_FUNC(SetRxAgcConfig, (int channel, webrtc::AgcConfig config)) {
1156 channels_[channel]->rx_agc_config = config;
1157 return 0;
1158 }
1159 WEBRTC_FUNC(GetRxAgcConfig, (int channel, webrtc::AgcConfig& config)) {
1160 config = channels_[channel]->rx_agc_config;
1161 return 0;
1162 }
henrike@webrtc.org28e20752013-07-10 00:45:36 +00001163
1164 WEBRTC_STUB(RegisterRxVadObserver, (int, webrtc::VoERxVadCallback&));
1165 WEBRTC_STUB(DeRegisterRxVadObserver, (int channel));
1166 WEBRTC_STUB(VoiceActivityIndicator, (int channel));
1167 WEBRTC_FUNC(SetEcMetricsStatus, (bool enable)) {
1168 ec_metrics_enabled_ = enable;
1169 return 0;
1170 }
1171 WEBRTC_FUNC(GetEcMetricsStatus, (bool& enabled)) {
1172 enabled = ec_metrics_enabled_;
1173 return 0;
1174 }
1175 WEBRTC_STUB(GetEchoMetrics, (int& ERL, int& ERLE, int& RERL, int& A_NLP));
bjornv@webrtc.orgcc64a9c2015-02-05 12:52:44 +00001176 WEBRTC_STUB(GetEcDelayMetrics, (int& delay_median, int& delay_std,
1177 float& fraction_poor_delays));
henrike@webrtc.org28e20752013-07-10 00:45:36 +00001178
1179 WEBRTC_STUB(StartDebugRecording, (const char* fileNameUTF8));
wu@webrtc.org9caf2762013-12-11 18:25:07 +00001180 WEBRTC_STUB(StartDebugRecording, (FILE* handle));
henrike@webrtc.org28e20752013-07-10 00:45:36 +00001181 WEBRTC_STUB(StopDebugRecording, ());
1182
1183 WEBRTC_FUNC(SetTypingDetectionStatus, (bool enable)) {
1184 typing_detection_enabled_ = enable;
1185 return 0;
1186 }
1187 WEBRTC_FUNC(GetTypingDetectionStatus, (bool& enabled)) {
1188 enabled = typing_detection_enabled_;
1189 return 0;
1190 }
1191
1192 WEBRTC_STUB(TimeSinceLastTyping, (int& seconds));
1193 WEBRTC_STUB(SetTypingDetectionParameters, (int timeWindow,
1194 int costPerTyping,
1195 int reportingThreshold,
1196 int penaltyDecay,
1197 int typeEventDelay));
1198 int EnableHighPassFilter(bool enable) {
1199 highpass_filter_enabled_ = enable;
1200 return 0;
1201 }
1202 bool IsHighPassFilterEnabled() {
1203 return highpass_filter_enabled_;
1204 }
1205 bool IsStereoChannelSwappingEnabled() {
1206 return stereo_swapping_enabled_;
1207 }
1208 void EnableStereoChannelSwapping(bool enable) {
1209 stereo_swapping_enabled_ = enable;
1210 }
1211 bool WasSendTelephoneEventCalled(int channel, int event_code, int length_ms) {
1212 return (channels_[channel]->dtmf_info.dtmf_event_code == event_code &&
1213 channels_[channel]->dtmf_info.dtmf_out_of_band == true &&
1214 channels_[channel]->dtmf_info.dtmf_length_ms == length_ms);
1215 }
1216 bool WasPlayDtmfToneCalled(int event_code, int length_ms) {
1217 return (dtmf_info_.dtmf_event_code == event_code &&
1218 dtmf_info_.dtmf_length_ms == length_ms);
1219 }
1220 // webrtc::VoEExternalMedia
1221 WEBRTC_FUNC(RegisterExternalMediaProcessing,
1222 (int channel, webrtc::ProcessingTypes type,
1223 webrtc::VoEMediaProcess& processObject)) {
1224 WEBRTC_CHECK_CHANNEL(channel);
1225 if (channels_[channel]->media_processor_registered) {
1226 return -1;
1227 }
1228 channels_[channel]->media_processor_registered = true;
1229 media_processor_ = &processObject;
1230 return 0;
1231 }
1232 WEBRTC_FUNC(DeRegisterExternalMediaProcessing,
1233 (int channel, webrtc::ProcessingTypes type)) {
1234 WEBRTC_CHECK_CHANNEL(channel);
1235 if (!channels_[channel]->media_processor_registered) {
1236 return -1;
1237 }
1238 channels_[channel]->media_processor_registered = false;
1239 media_processor_ = NULL;
1240 return 0;
1241 }
1242 WEBRTC_STUB(SetExternalRecordingStatus, (bool enable));
1243 WEBRTC_STUB(SetExternalPlayoutStatus, (bool enable));
1244 WEBRTC_STUB(ExternalRecordingInsertData,
1245 (const int16_t speechData10ms[], int lengthSamples,
1246 int samplingFreqHz, int current_delay_ms));
1247 WEBRTC_STUB(ExternalPlayoutGetData,
1248 (int16_t speechData10ms[], int samplingFreqHz,
1249 int current_delay_ms, int& lengthSamples));
1250 WEBRTC_STUB(GetAudioFrame, (int channel, int desired_sample_rate_hz,
1251 webrtc::AudioFrame* frame));
1252 WEBRTC_STUB(SetExternalMixing, (int channel, bool enable));
Henrik Lundin64dad832015-05-11 12:44:23 +02001253 int GetNetEqCapacity() const {
1254 auto ch = channels_.find(last_channel_);
1255 ASSERT(ch != channels_.end());
1256 return ch->second->neteq_capacity;
1257 }
henrike@webrtc.org28e20752013-07-10 00:45:36 +00001258
1259 private:
1260 int GetNumDevices(int& num) {
1261#ifdef WIN32
1262 num = 1;
1263#else
1264 // On non-Windows platforms VE adds a special entry for the default device,
1265 // so if there is one physical device then there are two entries in the
1266 // list.
1267 num = 2;
1268#endif
1269 return 0;
1270 }
1271
1272 int GetDeviceName(int i, char* name, char* guid) {
1273 const char *s;
1274#ifdef WIN32
1275 if (0 == i) {
1276 s = kFakeDeviceName;
1277 } else {
1278 return -1;
1279 }
1280#else
1281 // See comment above.
1282 if (0 == i) {
1283 s = kFakeDefaultDeviceName;
1284 } else if (1 == i) {
1285 s = kFakeDeviceName;
1286 } else {
1287 return -1;
1288 }
1289#endif
1290 strcpy(name, s);
1291 guid[0] = '\0';
1292 return 0;
1293 }
1294
1295 bool inited_;
1296 int last_channel_;
1297 std::map<int, Channel*> channels_;
1298 bool fail_create_channel_;
1299 const cricket::AudioCodec* const* codecs_;
1300 int num_codecs_;
wu@webrtc.org05e7b442014-04-01 17:44:24 +00001301 int num_set_send_codecs_; // how many times we call SetSendCodec().
henrike@webrtc.org28e20752013-07-10 00:45:36 +00001302 bool ec_enabled_;
1303 bool ec_metrics_enabled_;
1304 bool cng_enabled_;
1305 bool ns_enabled_;
1306 bool agc_enabled_;
1307 bool highpass_filter_enabled_;
1308 bool stereo_swapping_enabled_;
1309 bool typing_detection_enabled_;
1310 webrtc::EcModes ec_mode_;
1311 webrtc::AecmModes aecm_mode_;
1312 webrtc::NsModes ns_mode_;
1313 webrtc::AgcModes agc_mode_;
1314 webrtc::AgcConfig agc_config_;
1315 webrtc::VoiceEngineObserver* observer_;
1316 int playout_fail_channel_;
1317 int send_fail_channel_;
1318 bool fail_start_recording_microphone_;
1319 bool recording_microphone_;
wu@webrtc.org97077a32013-10-25 21:18:33 +00001320 int recording_sample_rate_;
1321 int playout_sample_rate_;
henrike@webrtc.org28e20752013-07-10 00:45:36 +00001322 DtmfInfo dtmf_info_;
1323 webrtc::VoEMediaProcess* media_processor_;
buildbot@webrtc.orga8d8ad22014-07-16 14:23:08 +00001324 FakeAudioProcessing audio_processing_;
henrike@webrtc.org28e20752013-07-10 00:45:36 +00001325};
1326
henrike@webrtc.org79047f92014-03-06 23:46:59 +00001327#undef WEBRTC_CHECK_HEADER_EXTENSION_ID
1328
henrike@webrtc.org28e20752013-07-10 00:45:36 +00001329} // namespace cricket
1330
1331#endif // TALK_SESSION_PHONE_FAKEWEBRTCVOICEENGINE_H_