blob: 4ecefffb3665304d71cd5a5b1bd2ef181aa72104 [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
35
36#include "talk/base/basictypes.h"
37#include "talk/base/stringutils.h"
38#include "talk/media/base/codec.h"
39#include "talk/media/base/voiceprocessor.h"
40#include "talk/media/webrtc/fakewebrtccommon.h"
41#include "talk/media/webrtc/webrtcvoe.h"
42
43namespace cricket {
44
45// Function returning stats will return these values
46// for all values based on type.
47const int kIntStatValue = 123;
48const float kFractionLostStatValue = 0.5;
49
50static const char kFakeDefaultDeviceName[] = "Fake Default";
51static const int kFakeDefaultDeviceId = -1;
52static const char kFakeDeviceName[] = "Fake Device";
53#ifdef WIN32
54static const int kFakeDeviceId = 0;
55#else
56static const int kFakeDeviceId = 1;
57#endif
58
59
60class FakeWebRtcVoiceEngine
61 : public webrtc::VoEAudioProcessing,
62 public webrtc::VoEBase, public webrtc::VoECodec, public webrtc::VoEDtmf,
63 public webrtc::VoEFile, public webrtc::VoEHardware,
64 public webrtc::VoEExternalMedia, public webrtc::VoENetEqStats,
65 public webrtc::VoENetwork, public webrtc::VoERTP_RTCP,
66 public webrtc::VoEVideoSync, public webrtc::VoEVolumeControl {
67 public:
68 struct DtmfInfo {
69 DtmfInfo()
70 : dtmf_event_code(-1),
71 dtmf_out_of_band(false),
72 dtmf_length_ms(-1) {}
73 int dtmf_event_code;
74 bool dtmf_out_of_band;
75 int dtmf_length_ms;
76 };
77 struct Channel {
78 Channel()
79 : external_transport(false),
80 send(false),
81 playout(false),
82 volume_scale(1.0),
83 volume_pan_left(1.0),
84 volume_pan_right(1.0),
85 file(false),
86 vad(false),
87 fec(false),
88 nack(false),
89 media_processor_registered(false),
wu@webrtc.org97077a32013-10-25 21:18:33 +000090 rx_agc_enabled(false),
91 rx_agc_mode(webrtc::kAgcDefault),
henrike@webrtc.org28e20752013-07-10 00:45:36 +000092 cn8_type(13),
93 cn16_type(105),
94 dtmf_type(106),
95 fec_type(117),
96 nack_max_packets(0),
97 send_ssrc(0),
98 level_header_ext_(-1) {
99 memset(&send_codec, 0, sizeof(send_codec));
wu@webrtc.org97077a32013-10-25 21:18:33 +0000100 memset(&rx_agc_config, 0, sizeof(rx_agc_config));
henrike@webrtc.org28e20752013-07-10 00:45:36 +0000101 }
102 bool external_transport;
103 bool send;
104 bool playout;
105 float volume_scale;
106 float volume_pan_left;
107 float volume_pan_right;
108 bool file;
109 bool vad;
110 bool fec;
111 bool nack;
112 bool media_processor_registered;
wu@webrtc.org97077a32013-10-25 21:18:33 +0000113 bool rx_agc_enabled;
114 webrtc::AgcModes rx_agc_mode;
115 webrtc::AgcConfig rx_agc_config;
henrike@webrtc.org28e20752013-07-10 00:45:36 +0000116 int cn8_type;
117 int cn16_type;
118 int dtmf_type;
119 int fec_type;
120 int nack_max_packets;
121 uint32 send_ssrc;
122 int level_header_ext_;
123 DtmfInfo dtmf_info;
124 std::vector<webrtc::CodecInst> recv_codecs;
125 webrtc::CodecInst send_codec;
126 std::list<std::string> packets;
127 };
128
129 FakeWebRtcVoiceEngine(const cricket::AudioCodec* const* codecs,
130 int num_codecs)
131 : inited_(false),
132 last_channel_(-1),
133 fail_create_channel_(false),
134 codecs_(codecs),
135 num_codecs_(num_codecs),
136 ec_enabled_(false),
137 ec_metrics_enabled_(false),
138 cng_enabled_(false),
139 ns_enabled_(false),
140 agc_enabled_(false),
141 highpass_filter_enabled_(false),
142 stereo_swapping_enabled_(false),
143 typing_detection_enabled_(false),
144 ec_mode_(webrtc::kEcDefault),
145 aecm_mode_(webrtc::kAecmSpeakerphone),
146 ns_mode_(webrtc::kNsDefault),
147 agc_mode_(webrtc::kAgcDefault),
148 observer_(NULL),
149 playout_fail_channel_(-1),
150 send_fail_channel_(-1),
151 fail_start_recording_microphone_(false),
152 recording_microphone_(false),
wu@webrtc.org97077a32013-10-25 21:18:33 +0000153 recording_sample_rate_(-1),
154 playout_sample_rate_(-1),
henrike@webrtc.org28e20752013-07-10 00:45:36 +0000155 media_processor_(NULL) {
156 memset(&agc_config_, 0, sizeof(agc_config_));
157 }
158 ~FakeWebRtcVoiceEngine() {
159 // Ought to have all been deleted by the WebRtcVoiceMediaChannel
160 // destructors, but just in case ...
161 for (std::map<int, Channel*>::const_iterator i = channels_.begin();
162 i != channels_.end(); ++i) {
163 delete i->second;
164 }
165 }
166
167 bool IsExternalMediaProcessorRegistered() const {
168 return media_processor_ != NULL;
169 }
170 bool IsInited() const { return inited_; }
171 int GetLastChannel() const { return last_channel_; }
wu@webrtc.org9dba5252013-08-05 20:36:57 +0000172 int GetChannelFromLocalSsrc(uint32 local_ssrc) const {
173 for (std::map<int, Channel*>::const_iterator iter = channels_.begin();
174 iter != channels_.end(); ++iter) {
175 if (local_ssrc == iter->second->send_ssrc)
176 return iter->first;
177 }
178 return -1;
179 }
henrike@webrtc.org28e20752013-07-10 00:45:36 +0000180 int GetNumChannels() const { return channels_.size(); }
181 bool GetPlayout(int channel) {
182 return channels_[channel]->playout;
183 }
184 bool GetSend(int channel) {
185 return channels_[channel]->send;
186 }
187 bool GetRecordingMicrophone() {
188 return recording_microphone_;
189 }
190 bool GetVAD(int channel) {
191 return channels_[channel]->vad;
192 }
193 bool GetFEC(int channel) {
194 return channels_[channel]->fec;
195 }
196 bool GetNACK(int channel) {
197 return channels_[channel]->nack;
198 }
199 int GetNACKMaxPackets(int channel) {
200 return channels_[channel]->nack_max_packets;
201 }
202 int GetSendCNPayloadType(int channel, bool wideband) {
203 return (wideband) ?
204 channels_[channel]->cn16_type :
205 channels_[channel]->cn8_type;
206 }
207 int GetSendTelephoneEventPayloadType(int channel) {
208 return channels_[channel]->dtmf_type;
209 }
210 int GetSendFECPayloadType(int channel) {
211 return channels_[channel]->fec_type;
212 }
213 bool CheckPacket(int channel, const void* data, size_t len) {
214 bool result = !CheckNoPacket(channel);
215 if (result) {
216 std::string packet = channels_[channel]->packets.front();
217 result = (packet == std::string(static_cast<const char*>(data), len));
218 channels_[channel]->packets.pop_front();
219 }
220 return result;
221 }
222 bool CheckNoPacket(int channel) {
223 return channels_[channel]->packets.empty();
224 }
225 void TriggerCallbackOnError(int channel_num, int err_code) {
226 ASSERT(observer_ != NULL);
227 observer_->CallbackOnError(channel_num, err_code);
228 }
229 void set_playout_fail_channel(int channel) {
230 playout_fail_channel_ = channel;
231 }
232 void set_send_fail_channel(int channel) {
233 send_fail_channel_ = channel;
234 }
235 void set_fail_start_recording_microphone(
236 bool fail_start_recording_microphone) {
237 fail_start_recording_microphone_ = fail_start_recording_microphone;
238 }
239 void set_fail_create_channel(bool fail_create_channel) {
240 fail_create_channel_ = fail_create_channel;
241 }
242 void TriggerProcessPacket(MediaProcessorDirection direction) {
243 webrtc::ProcessingTypes pt =
244 (direction == cricket::MPD_TX) ?
245 webrtc::kRecordingPerChannel : webrtc::kPlaybackAllChannelsMixed;
246 if (media_processor_ != NULL) {
247 media_processor_->Process(0,
248 pt,
249 NULL,
250 0,
251 0,
252 true);
253 }
254 }
wu@webrtc.org364f2042013-11-20 21:49:41 +0000255 int AddChannel() {
256 if (fail_create_channel_) {
257 return -1;
258 }
259 Channel* ch = new Channel();
260 for (int i = 0; i < NumOfCodecs(); ++i) {
261 webrtc::CodecInst codec;
262 GetCodec(i, codec);
263 ch->recv_codecs.push_back(codec);
264 }
265 channels_[++last_channel_] = ch;
266 return last_channel_;
267 }
henrike@webrtc.org28e20752013-07-10 00:45:36 +0000268
269 WEBRTC_STUB(Release, ());
270
271 // webrtc::VoEBase
272 WEBRTC_FUNC(RegisterVoiceEngineObserver, (
273 webrtc::VoiceEngineObserver& observer)) {
274 observer_ = &observer;
275 return 0;
276 }
277 WEBRTC_STUB(DeRegisterVoiceEngineObserver, ());
278 WEBRTC_FUNC(Init, (webrtc::AudioDeviceModule* adm,
279 webrtc::AudioProcessing* audioproc)) {
280 inited_ = true;
281 return 0;
282 }
283 WEBRTC_FUNC(Terminate, ()) {
284 inited_ = false;
285 return 0;
286 }
287 virtual webrtc::AudioProcessing* audio_processing() OVERRIDE {
288 return NULL;
289 }
henrike@webrtc.org28e20752013-07-10 00:45:36 +0000290 WEBRTC_FUNC(CreateChannel, ()) {
wu@webrtc.org364f2042013-11-20 21:49:41 +0000291 return AddChannel();
henrike@webrtc.org28e20752013-07-10 00:45:36 +0000292 }
wu@webrtc.org364f2042013-11-20 21:49:41 +0000293#ifdef USE_WEBRTC_DEV_BRANCH
294 WEBRTC_FUNC(CreateChannel, (const webrtc::Config& /*config*/)) {
295 return AddChannel();
296 }
297#endif
henrike@webrtc.org28e20752013-07-10 00:45:36 +0000298 WEBRTC_FUNC(DeleteChannel, (int channel)) {
299 WEBRTC_CHECK_CHANNEL(channel);
300 delete channels_[channel];
301 channels_.erase(channel);
302 return 0;
303 }
304 WEBRTC_STUB(StartReceive, (int channel));
305 WEBRTC_FUNC(StartPlayout, (int channel)) {
306 if (playout_fail_channel_ != channel) {
307 WEBRTC_CHECK_CHANNEL(channel);
308 channels_[channel]->playout = true;
309 return 0;
310 } else {
311 // When playout_fail_channel_ == channel, fail the StartPlayout on this
312 // channel.
313 return -1;
314 }
315 }
316 WEBRTC_FUNC(StartSend, (int channel)) {
317 if (send_fail_channel_ != channel) {
318 WEBRTC_CHECK_CHANNEL(channel);
319 channels_[channel]->send = true;
320 return 0;
321 } else {
322 // When send_fail_channel_ == channel, fail the StartSend on this
323 // channel.
324 return -1;
325 }
326 }
327 WEBRTC_STUB(StopReceive, (int channel));
328 WEBRTC_FUNC(StopPlayout, (int channel)) {
329 WEBRTC_CHECK_CHANNEL(channel);
330 channels_[channel]->playout = false;
331 return 0;
332 }
333 WEBRTC_FUNC(StopSend, (int channel)) {
334 WEBRTC_CHECK_CHANNEL(channel);
335 channels_[channel]->send = false;
336 return 0;
337 }
338 WEBRTC_STUB(GetVersion, (char version[1024]));
339 WEBRTC_STUB(LastError, ());
340 WEBRTC_STUB(SetOnHoldStatus, (int, bool, webrtc::OnHoldModes));
341 WEBRTC_STUB(GetOnHoldStatus, (int, bool&, webrtc::OnHoldModes&));
342 WEBRTC_STUB(SetNetEQPlayoutMode, (int, webrtc::NetEqModes));
343 WEBRTC_STUB(GetNetEQPlayoutMode, (int, webrtc::NetEqModes&));
344
345 // webrtc::VoECodec
346 WEBRTC_FUNC(NumOfCodecs, ()) {
347 return num_codecs_;
348 }
349 WEBRTC_FUNC(GetCodec, (int index, webrtc::CodecInst& codec)) {
350 if (index < 0 || index >= NumOfCodecs()) {
351 return -1;
352 }
353 const cricket::AudioCodec& c(*codecs_[index]);
354 codec.pltype = c.id;
355 talk_base::strcpyn(codec.plname, sizeof(codec.plname), c.name.c_str());
356 codec.plfreq = c.clockrate;
357 codec.pacsize = 0;
358 codec.channels = c.channels;
359 codec.rate = c.bitrate;
360 return 0;
361 }
362 WEBRTC_FUNC(SetSendCodec, (int channel, const webrtc::CodecInst& codec)) {
363 WEBRTC_CHECK_CHANNEL(channel);
364 channels_[channel]->send_codec = codec;
365 return 0;
366 }
367 WEBRTC_FUNC(GetSendCodec, (int channel, webrtc::CodecInst& codec)) {
368 WEBRTC_CHECK_CHANNEL(channel);
369 codec = channels_[channel]->send_codec;
370 return 0;
371 }
372 WEBRTC_STUB(SetSecondarySendCodec, (int channel,
373 const webrtc::CodecInst& codec,
374 int red_payload_type));
375 WEBRTC_STUB(RemoveSecondarySendCodec, (int channel));
376 WEBRTC_STUB(GetSecondarySendCodec, (int channel,
377 webrtc::CodecInst& codec));
378 WEBRTC_STUB(GetRecCodec, (int channel, webrtc::CodecInst& codec));
379 WEBRTC_STUB(SetAMREncFormat, (int channel, webrtc::AmrMode mode));
380 WEBRTC_STUB(SetAMRDecFormat, (int channel, webrtc::AmrMode mode));
381 WEBRTC_STUB(SetAMRWbEncFormat, (int channel, webrtc::AmrMode mode));
382 WEBRTC_STUB(SetAMRWbDecFormat, (int channel, webrtc::AmrMode mode));
383 WEBRTC_STUB(SetISACInitTargetRate, (int channel, int rateBps,
384 bool useFixedFrameSize));
385 WEBRTC_STUB(SetISACMaxRate, (int channel, int rateBps));
386 WEBRTC_STUB(SetISACMaxPayloadSize, (int channel, int sizeBytes));
387 WEBRTC_FUNC(SetRecPayloadType, (int channel,
388 const webrtc::CodecInst& codec)) {
389 WEBRTC_CHECK_CHANNEL(channel);
390 Channel* ch = channels_[channel];
391 if (ch->playout)
392 return -1; // Channel is in use.
393 // Check if something else already has this slot.
394 if (codec.pltype != -1) {
395 for (std::vector<webrtc::CodecInst>::iterator it =
396 ch->recv_codecs.begin(); it != ch->recv_codecs.end(); ++it) {
397 if (it->pltype == codec.pltype &&
398 _stricmp(it->plname, codec.plname) != 0) {
399 return -1;
400 }
401 }
402 }
403 // Otherwise try to find this codec and update its payload type.
404 for (std::vector<webrtc::CodecInst>::iterator it = ch->recv_codecs.begin();
405 it != ch->recv_codecs.end(); ++it) {
406 if (strcmp(it->plname, codec.plname) == 0 &&
407 it->plfreq == codec.plfreq) {
408 it->pltype = codec.pltype;
409 it->channels = codec.channels;
410 return 0;
411 }
412 }
413 return -1; // not found
414 }
415 WEBRTC_FUNC(SetSendCNPayloadType, (int channel, int type,
416 webrtc::PayloadFrequencies frequency)) {
417 WEBRTC_CHECK_CHANNEL(channel);
418 if (frequency == webrtc::kFreq8000Hz) {
419 channels_[channel]->cn8_type = type;
420 } else if (frequency == webrtc::kFreq16000Hz) {
421 channels_[channel]->cn16_type = type;
422 }
423 return 0;
424 }
425 WEBRTC_FUNC(GetRecPayloadType, (int channel, webrtc::CodecInst& codec)) {
426 WEBRTC_CHECK_CHANNEL(channel);
427 Channel* ch = channels_[channel];
428 for (std::vector<webrtc::CodecInst>::iterator it = ch->recv_codecs.begin();
429 it != ch->recv_codecs.end(); ++it) {
430 if (strcmp(it->plname, codec.plname) == 0 &&
431 it->plfreq == codec.plfreq &&
432 it->channels == codec.channels &&
433 it->pltype != -1) {
434 codec.pltype = it->pltype;
435 return 0;
436 }
437 }
438 return -1; // not found
439 }
440 WEBRTC_FUNC(SetVADStatus, (int channel, bool enable, webrtc::VadModes mode,
441 bool disableDTX)) {
442 WEBRTC_CHECK_CHANNEL(channel);
443 if (channels_[channel]->send_codec.channels == 2) {
444 // Replicating VoE behavior; VAD cannot be enabled for stereo.
445 return -1;
446 }
447 channels_[channel]->vad = enable;
448 return 0;
449 }
450 WEBRTC_STUB(GetVADStatus, (int channel, bool& enabled,
451 webrtc::VadModes& mode, bool& disabledDTX));
452
453 // webrtc::VoEDtmf
454 WEBRTC_FUNC(SendTelephoneEvent, (int channel, int event_code,
455 bool out_of_band = true, int length_ms = 160, int attenuation_db = 10)) {
456 channels_[channel]->dtmf_info.dtmf_event_code = event_code;
457 channels_[channel]->dtmf_info.dtmf_out_of_band = out_of_band;
458 channels_[channel]->dtmf_info.dtmf_length_ms = length_ms;
459 return 0;
460 }
461
462 WEBRTC_FUNC(SetSendTelephoneEventPayloadType,
463 (int channel, unsigned char type)) {
464 channels_[channel]->dtmf_type = type;
465 return 0;
466 };
467 WEBRTC_STUB(GetSendTelephoneEventPayloadType,
468 (int channel, unsigned char& type));
469
470 WEBRTC_STUB(SetDtmfFeedbackStatus, (bool enable, bool directFeedback));
471 WEBRTC_STUB(GetDtmfFeedbackStatus, (bool& enabled, bool& directFeedback));
472 WEBRTC_STUB(SetDtmfPlayoutStatus, (int channel, bool enable));
473 WEBRTC_STUB(GetDtmfPlayoutStatus, (int channel, bool& enabled));
474
475
476 WEBRTC_FUNC(PlayDtmfTone,
477 (int event_code, int length_ms = 200, int attenuation_db = 10)) {
478 dtmf_info_.dtmf_event_code = event_code;
479 dtmf_info_.dtmf_length_ms = length_ms;
480 return 0;
481 }
482 WEBRTC_STUB(StartPlayingDtmfTone,
483 (int eventCode, int attenuationDb = 10));
484 WEBRTC_STUB(StopPlayingDtmfTone, ());
485
486 // webrtc::VoEFile
487 WEBRTC_FUNC(StartPlayingFileLocally, (int channel, const char* fileNameUTF8,
488 bool loop, webrtc::FileFormats format,
489 float volumeScaling, int startPointMs,
490 int stopPointMs)) {
491 WEBRTC_CHECK_CHANNEL(channel);
492 channels_[channel]->file = true;
493 return 0;
494 }
495 WEBRTC_FUNC(StartPlayingFileLocally, (int channel, webrtc::InStream* stream,
496 webrtc::FileFormats format,
497 float volumeScaling, int startPointMs,
498 int stopPointMs)) {
499 WEBRTC_CHECK_CHANNEL(channel);
500 channels_[channel]->file = true;
501 return 0;
502 }
503 WEBRTC_FUNC(StopPlayingFileLocally, (int channel)) {
504 WEBRTC_CHECK_CHANNEL(channel);
505 channels_[channel]->file = false;
506 return 0;
507 }
508 WEBRTC_FUNC(IsPlayingFileLocally, (int channel)) {
509 WEBRTC_CHECK_CHANNEL(channel);
510 return (channels_[channel]->file) ? 1 : 0;
511 }
512 WEBRTC_STUB(ScaleLocalFilePlayout, (int channel, float scale));
513 WEBRTC_STUB(StartPlayingFileAsMicrophone, (int channel,
514 const char* fileNameUTF8,
515 bool loop,
516 bool mixWithMicrophone,
517 webrtc::FileFormats format,
518 float volumeScaling));
519 WEBRTC_STUB(StartPlayingFileAsMicrophone, (int channel,
520 webrtc::InStream* stream,
521 bool mixWithMicrophone,
522 webrtc::FileFormats format,
523 float volumeScaling));
524 WEBRTC_STUB(StopPlayingFileAsMicrophone, (int channel));
525 WEBRTC_STUB(IsPlayingFileAsMicrophone, (int channel));
526 WEBRTC_STUB(ScaleFileAsMicrophonePlayout, (int channel, float scale));
527 WEBRTC_STUB(StartRecordingPlayout, (int channel, const char* fileNameUTF8,
528 webrtc::CodecInst* compression,
529 int maxSizeBytes));
530 WEBRTC_STUB(StartRecordingPlayout, (int channel, webrtc::OutStream* stream,
531 webrtc::CodecInst* compression));
532 WEBRTC_STUB(StopRecordingPlayout, (int channel));
533 WEBRTC_FUNC(StartRecordingMicrophone, (const char* fileNameUTF8,
534 webrtc::CodecInst* compression,
535 int maxSizeBytes)) {
536 if (fail_start_recording_microphone_) {
537 return -1;
538 }
539 recording_microphone_ = true;
540 return 0;
541 }
542 WEBRTC_FUNC(StartRecordingMicrophone, (webrtc::OutStream* stream,
543 webrtc::CodecInst* compression)) {
544 if (fail_start_recording_microphone_) {
545 return -1;
546 }
547 recording_microphone_ = true;
548 return 0;
549 }
550 WEBRTC_FUNC(StopRecordingMicrophone, ()) {
551 if (!recording_microphone_) {
552 return -1;
553 }
554 recording_microphone_ = false;
555 return 0;
556 }
557 WEBRTC_STUB(ConvertPCMToWAV, (const char* fileNameInUTF8,
558 const char* fileNameOutUTF8));
559 WEBRTC_STUB(ConvertPCMToWAV, (webrtc::InStream* streamIn,
560 webrtc::OutStream* streamOut));
561 WEBRTC_STUB(ConvertWAVToPCM, (const char* fileNameInUTF8,
562 const char* fileNameOutUTF8));
563 WEBRTC_STUB(ConvertWAVToPCM, (webrtc::InStream* streamIn,
564 webrtc::OutStream* streamOut));
565 WEBRTC_STUB(ConvertPCMToCompressed, (const char* fileNameInUTF8,
566 const char* fileNameOutUTF8,
567 webrtc::CodecInst* compression));
568 WEBRTC_STUB(ConvertPCMToCompressed, (webrtc::InStream* streamIn,
569 webrtc::OutStream* streamOut,
570 webrtc::CodecInst* compression));
571 WEBRTC_STUB(ConvertCompressedToPCM, (const char* fileNameInUTF8,
572 const char* fileNameOutUTF8));
573 WEBRTC_STUB(ConvertCompressedToPCM, (webrtc::InStream* streamIn,
574 webrtc::OutStream* streamOut));
575 WEBRTC_STUB(GetFileDuration, (const char* fileNameUTF8, int& durationMs,
576 webrtc::FileFormats format));
577 WEBRTC_STUB(GetPlaybackPosition, (int channel, int& positionMs));
578
579 // webrtc::VoEHardware
580 WEBRTC_STUB(GetCPULoad, (int&));
581 WEBRTC_FUNC(GetNumOfRecordingDevices, (int& num)) {
582 return GetNumDevices(num);
583 }
584 WEBRTC_FUNC(GetNumOfPlayoutDevices, (int& num)) {
585 return GetNumDevices(num);
586 }
587 WEBRTC_FUNC(GetRecordingDeviceName, (int i, char* name, char* guid)) {
588 return GetDeviceName(i, name, guid);
589 }
590 WEBRTC_FUNC(GetPlayoutDeviceName, (int i, char* name, char* guid)) {
591 return GetDeviceName(i, name, guid);
592 }
593 WEBRTC_STUB(SetRecordingDevice, (int, webrtc::StereoChannel));
594 WEBRTC_STUB(SetPlayoutDevice, (int));
595 WEBRTC_STUB(SetAudioDeviceLayer, (webrtc::AudioLayers));
596 WEBRTC_STUB(GetAudioDeviceLayer, (webrtc::AudioLayers&));
597 WEBRTC_STUB(GetPlayoutDeviceStatus, (bool&));
598 WEBRTC_STUB(GetRecordingDeviceStatus, (bool&));
599 WEBRTC_STUB(ResetAudioDevice, ());
600 WEBRTC_STUB(AudioDeviceControl, (unsigned int, unsigned int, unsigned int));
601 WEBRTC_STUB(SetLoudspeakerStatus, (bool enable));
602 WEBRTC_STUB(GetLoudspeakerStatus, (bool& enabled));
wu@webrtc.org97077a32013-10-25 21:18:33 +0000603 WEBRTC_FUNC(SetRecordingSampleRate, (unsigned int samples_per_sec)) {
604 recording_sample_rate_ = samples_per_sec;
605 return 0;
606 }
607 WEBRTC_FUNC_CONST(RecordingSampleRate, (unsigned int* samples_per_sec)) {
608 *samples_per_sec = recording_sample_rate_;
609 return 0;
610 }
611 WEBRTC_FUNC(SetPlayoutSampleRate, (unsigned int samples_per_sec)) {
612 playout_sample_rate_ = samples_per_sec;
613 return 0;
614 }
615 WEBRTC_FUNC_CONST(PlayoutSampleRate, (unsigned int* samples_per_sec)) {
616 *samples_per_sec = playout_sample_rate_;
617 return 0;
618 }
henrike@webrtc.org28e20752013-07-10 00:45:36 +0000619 WEBRTC_STUB(EnableBuiltInAEC, (bool enable));
620 virtual bool BuiltInAECIsEnabled() const { return true; }
621
622 // webrtc::VoENetEqStats
623 WEBRTC_STUB(GetNetworkStatistics, (int, webrtc::NetworkStatistics&));
624
625 // webrtc::VoENetwork
626 WEBRTC_FUNC(RegisterExternalTransport, (int channel,
627 webrtc::Transport& transport)) {
628 WEBRTC_CHECK_CHANNEL(channel);
629 channels_[channel]->external_transport = true;
630 return 0;
631 }
632 WEBRTC_FUNC(DeRegisterExternalTransport, (int channel)) {
633 WEBRTC_CHECK_CHANNEL(channel);
634 channels_[channel]->external_transport = false;
635 return 0;
636 }
637 WEBRTC_FUNC(ReceivedRTPPacket, (int channel, const void* data,
638 unsigned int length)) {
639 WEBRTC_CHECK_CHANNEL(channel);
640 if (!channels_[channel]->external_transport) return -1;
641 channels_[channel]->packets.push_back(
642 std::string(static_cast<const char*>(data), length));
643 return 0;
644 }
645 WEBRTC_STUB(ReceivedRTCPPacket, (int channel, const void* data,
646 unsigned int length));
henrike@webrtc.org28e20752013-07-10 00:45:36 +0000647
648 // webrtc::VoERTP_RTCP
649 WEBRTC_STUB(RegisterRTPObserver, (int channel,
650 webrtc::VoERTPObserver& observer));
651 WEBRTC_STUB(DeRegisterRTPObserver, (int channel));
652 WEBRTC_STUB(RegisterRTCPObserver, (int channel,
653 webrtc::VoERTCPObserver& observer));
654 WEBRTC_STUB(DeRegisterRTCPObserver, (int channel));
655 WEBRTC_FUNC(SetLocalSSRC, (int channel, unsigned int ssrc)) {
656 WEBRTC_CHECK_CHANNEL(channel);
657 channels_[channel]->send_ssrc = ssrc;
658 return 0;
659 }
660 WEBRTC_FUNC(GetLocalSSRC, (int channel, unsigned int& ssrc)) {
661 WEBRTC_CHECK_CHANNEL(channel);
662 ssrc = channels_[channel]->send_ssrc;
663 return 0;
664 }
665 WEBRTC_STUB(GetRemoteSSRC, (int channel, unsigned int& ssrc));
666 WEBRTC_FUNC(SetRTPAudioLevelIndicationStatus, (int channel, bool enable,
667 unsigned char id)) {
668 WEBRTC_CHECK_CHANNEL(channel);
669 if (enable && (id < 1 || id > 14)) {
670 // [RFC5285] The 4-bit ID is the local identifier of this element in
671 // the range 1-14 inclusive.
672 return -1;
673 }
674 channels_[channel]->level_header_ext_ = (enable) ? id : -1;
675 return 0;
676 }
677 WEBRTC_FUNC(GetRTPAudioLevelIndicationStatus, (int channel, bool& enabled,
678 unsigned char& id)) {
679 WEBRTC_CHECK_CHANNEL(channel);
680 enabled = (channels_[channel]->level_header_ext_ != -1);
681 id = channels_[channel]->level_header_ext_;
682 return 0;
683 }
684 WEBRTC_STUB(GetRemoteCSRCs, (int channel, unsigned int arrCSRC[15]));
685 WEBRTC_STUB(SetRTCPStatus, (int channel, bool enable));
686 WEBRTC_STUB(GetRTCPStatus, (int channel, bool& enabled));
687 WEBRTC_STUB(SetRTCP_CNAME, (int channel, const char cname[256]));
688 WEBRTC_STUB(GetRTCP_CNAME, (int channel, char cname[256]));
689 WEBRTC_STUB(GetRemoteRTCP_CNAME, (int channel, char* cname));
690 WEBRTC_STUB(GetRemoteRTCPData, (int channel, unsigned int& NTPHigh,
691 unsigned int& NTPLow,
692 unsigned int& timestamp,
693 unsigned int& playoutTimestamp,
694 unsigned int* jitter,
695 unsigned short* fractionLost));
696 WEBRTC_STUB(GetRemoteRTCPSenderInfo, (int channel,
697 webrtc::SenderInfo* sender_info));
698 WEBRTC_FUNC(GetRemoteRTCPReportBlocks,
699 (int channel, std::vector<webrtc::ReportBlock>* receive_blocks)) {
700 WEBRTC_CHECK_CHANNEL(channel);
701 webrtc::ReportBlock block;
702 block.source_SSRC = channels_[channel]->send_ssrc;
703 webrtc::CodecInst send_codec = channels_[channel]->send_codec;
704 if (send_codec.pltype >= 0) {
705 block.fraction_lost = (unsigned char)(kFractionLostStatValue * 256);
706 if (send_codec.plfreq / 1000 > 0) {
707 block.interarrival_jitter = kIntStatValue * (send_codec.plfreq / 1000);
708 }
709 block.cumulative_num_packets_lost = kIntStatValue;
710 block.extended_highest_sequence_number = kIntStatValue;
711 receive_blocks->push_back(block);
712 }
713 return 0;
714 }
715 WEBRTC_STUB(SendApplicationDefinedRTCPPacket, (int channel,
716 unsigned char subType,
717 unsigned int name,
718 const char* data,
719 unsigned short dataLength));
720 WEBRTC_STUB(GetRTPStatistics, (int channel, unsigned int& averageJitterMs,
721 unsigned int& maxJitterMs,
722 unsigned int& discardedPackets));
723 WEBRTC_FUNC(GetRTCPStatistics, (int channel, webrtc::CallStatistics& stats)) {
724 WEBRTC_CHECK_CHANNEL(channel);
725 stats.fractionLost = static_cast<int16>(kIntStatValue);
726 stats.cumulativeLost = kIntStatValue;
727 stats.extendedMax = kIntStatValue;
728 stats.jitterSamples = kIntStatValue;
729 stats.rttMs = kIntStatValue;
730 stats.bytesSent = kIntStatValue;
731 stats.packetsSent = kIntStatValue;
732 stats.bytesReceived = kIntStatValue;
733 stats.packetsReceived = kIntStatValue;
734 return 0;
735 }
736 WEBRTC_FUNC(SetFECStatus, (int channel, bool enable, int redPayloadtype)) {
737 WEBRTC_CHECK_CHANNEL(channel);
738 channels_[channel]->fec = enable;
739 channels_[channel]->fec_type = redPayloadtype;
740 return 0;
741 }
742 WEBRTC_FUNC(GetFECStatus, (int channel, bool& enable, int& redPayloadtype)) {
743 WEBRTC_CHECK_CHANNEL(channel);
744 enable = channels_[channel]->fec;
745 redPayloadtype = channels_[channel]->fec_type;
746 return 0;
747 }
748 WEBRTC_FUNC(SetNACKStatus, (int channel, bool enable, int maxNoPackets)) {
749 WEBRTC_CHECK_CHANNEL(channel);
750 channels_[channel]->nack = enable;
751 channels_[channel]->nack_max_packets = maxNoPackets;
752 return 0;
753 }
754 WEBRTC_STUB(StartRTPDump, (int channel, const char* fileNameUTF8,
755 webrtc::RTPDirections direction));
756 WEBRTC_STUB(StopRTPDump, (int channel, webrtc::RTPDirections direction));
757 WEBRTC_STUB(RTPDumpIsActive, (int channel, webrtc::RTPDirections direction));
758 WEBRTC_STUB(InsertExtraRTPPacket, (int channel, unsigned char payloadType,
759 bool markerBit, const char* payloadData,
760 unsigned short payloadSize));
761 WEBRTC_STUB(GetLastRemoteTimeStamp, (int channel,
762 uint32_t* lastRemoteTimeStamp));
763
764 // webrtc::VoEVideoSync
765 WEBRTC_STUB(GetPlayoutBufferSize, (int& bufferMs));
766 WEBRTC_STUB(GetPlayoutTimestamp, (int channel, unsigned int& timestamp));
wu@webrtc.org822fbd82013-08-15 23:38:54 +0000767 WEBRTC_STUB(GetRtpRtcp, (int, webrtc::RtpRtcp**, webrtc::RtpReceiver**));
henrike@webrtc.org28e20752013-07-10 00:45:36 +0000768 WEBRTC_STUB(SetInitTimestamp, (int channel, unsigned int timestamp));
769 WEBRTC_STUB(SetInitSequenceNumber, (int channel, short sequenceNumber));
770 WEBRTC_STUB(SetMinimumPlayoutDelay, (int channel, int delayMs));
771 WEBRTC_STUB(SetInitialPlayoutDelay, (int channel, int delay_ms));
772 WEBRTC_STUB(GetDelayEstimate, (int channel, int* jitter_buffer_delay_ms,
773 int* playout_buffer_delay_ms));
774 WEBRTC_STUB_CONST(GetLeastRequiredDelayMs, (int channel));
775
776 // webrtc::VoEVolumeControl
777 WEBRTC_STUB(SetSpeakerVolume, (unsigned int));
778 WEBRTC_STUB(GetSpeakerVolume, (unsigned int&));
779 WEBRTC_STUB(SetSystemOutputMute, (bool));
780 WEBRTC_STUB(GetSystemOutputMute, (bool&));
781 WEBRTC_STUB(SetMicVolume, (unsigned int));
782 WEBRTC_STUB(GetMicVolume, (unsigned int&));
783 WEBRTC_STUB(SetInputMute, (int, bool));
784 WEBRTC_STUB(GetInputMute, (int, bool&));
785 WEBRTC_STUB(SetSystemInputMute, (bool));
786 WEBRTC_STUB(GetSystemInputMute, (bool&));
787 WEBRTC_STUB(GetSpeechInputLevel, (unsigned int&));
788 WEBRTC_STUB(GetSpeechOutputLevel, (int, unsigned int&));
789 WEBRTC_STUB(GetSpeechInputLevelFullRange, (unsigned int&));
790 WEBRTC_STUB(GetSpeechOutputLevelFullRange, (int, unsigned int&));
791 WEBRTC_FUNC(SetChannelOutputVolumeScaling, (int channel, float scale)) {
792 WEBRTC_CHECK_CHANNEL(channel);
793 channels_[channel]->volume_scale= scale;
794 return 0;
795 }
796 WEBRTC_FUNC(GetChannelOutputVolumeScaling, (int channel, float& scale)) {
797 WEBRTC_CHECK_CHANNEL(channel);
798 scale = channels_[channel]->volume_scale;
799 return 0;
800 }
801 WEBRTC_FUNC(SetOutputVolumePan, (int channel, float left, float right)) {
802 WEBRTC_CHECK_CHANNEL(channel);
803 channels_[channel]->volume_pan_left = left;
804 channels_[channel]->volume_pan_right = right;
805 return 0;
806 }
807 WEBRTC_FUNC(GetOutputVolumePan, (int channel, float& left, float& right)) {
808 WEBRTC_CHECK_CHANNEL(channel);
809 left = channels_[channel]->volume_pan_left;
810 right = channels_[channel]->volume_pan_right;
811 return 0;
812 }
813
814 // webrtc::VoEAudioProcessing
815 WEBRTC_FUNC(SetNsStatus, (bool enable, webrtc::NsModes mode)) {
816 ns_enabled_ = enable;
817 ns_mode_ = mode;
818 return 0;
819 }
820 WEBRTC_FUNC(GetNsStatus, (bool& enabled, webrtc::NsModes& mode)) {
821 enabled = ns_enabled_;
822 mode = ns_mode_;
823 return 0;
824 }
825
826 WEBRTC_FUNC(SetAgcStatus, (bool enable, webrtc::AgcModes mode)) {
827 agc_enabled_ = enable;
828 agc_mode_ = mode;
829 return 0;
830 }
831 WEBRTC_FUNC(GetAgcStatus, (bool& enabled, webrtc::AgcModes& mode)) {
832 enabled = agc_enabled_;
833 mode = agc_mode_;
834 return 0;
835 }
836
837 WEBRTC_FUNC(SetAgcConfig, (webrtc::AgcConfig config)) {
838 agc_config_ = config;
839 return 0;
840 }
841 WEBRTC_FUNC(GetAgcConfig, (webrtc::AgcConfig& config)) {
842 config = agc_config_;
843 return 0;
844 }
845 WEBRTC_FUNC(SetEcStatus, (bool enable, webrtc::EcModes mode)) {
846 ec_enabled_ = enable;
847 ec_mode_ = mode;
848 return 0;
849 }
850 WEBRTC_FUNC(GetEcStatus, (bool& enabled, webrtc::EcModes& mode)) {
851 enabled = ec_enabled_;
852 mode = ec_mode_;
853 return 0;
854 }
855 WEBRTC_STUB(EnableDriftCompensation, (bool enable))
856 WEBRTC_BOOL_STUB(DriftCompensationEnabled, ())
857 WEBRTC_VOID_STUB(SetDelayOffsetMs, (int offset))
858 WEBRTC_STUB(DelayOffsetMs, ());
859 WEBRTC_FUNC(SetAecmMode, (webrtc::AecmModes mode, bool enableCNG)) {
860 aecm_mode_ = mode;
861 cng_enabled_ = enableCNG;
862 return 0;
863 }
864 WEBRTC_FUNC(GetAecmMode, (webrtc::AecmModes& mode, bool& enabledCNG)) {
865 mode = aecm_mode_;
866 enabledCNG = cng_enabled_;
867 return 0;
868 }
869 WEBRTC_STUB(SetRxNsStatus, (int channel, bool enable, webrtc::NsModes mode));
870 WEBRTC_STUB(GetRxNsStatus, (int channel, bool& enabled,
871 webrtc::NsModes& mode));
wu@webrtc.org97077a32013-10-25 21:18:33 +0000872 WEBRTC_FUNC(SetRxAgcStatus, (int channel, bool enable,
873 webrtc::AgcModes mode)) {
874 channels_[channel]->rx_agc_enabled = enable;
875 channels_[channel]->rx_agc_mode = mode;
876 return 0;
877 }
878 WEBRTC_FUNC(GetRxAgcStatus, (int channel, bool& enabled,
879 webrtc::AgcModes& mode)) {
880 enabled = channels_[channel]->rx_agc_enabled;
881 mode = channels_[channel]->rx_agc_mode;
882 return 0;
883 }
884
885 WEBRTC_FUNC(SetRxAgcConfig, (int channel, webrtc::AgcConfig config)) {
886 channels_[channel]->rx_agc_config = config;
887 return 0;
888 }
889 WEBRTC_FUNC(GetRxAgcConfig, (int channel, webrtc::AgcConfig& config)) {
890 config = channels_[channel]->rx_agc_config;
891 return 0;
892 }
henrike@webrtc.org28e20752013-07-10 00:45:36 +0000893
894 WEBRTC_STUB(RegisterRxVadObserver, (int, webrtc::VoERxVadCallback&));
895 WEBRTC_STUB(DeRegisterRxVadObserver, (int channel));
896 WEBRTC_STUB(VoiceActivityIndicator, (int channel));
897 WEBRTC_FUNC(SetEcMetricsStatus, (bool enable)) {
898 ec_metrics_enabled_ = enable;
899 return 0;
900 }
901 WEBRTC_FUNC(GetEcMetricsStatus, (bool& enabled)) {
902 enabled = ec_metrics_enabled_;
903 return 0;
904 }
905 WEBRTC_STUB(GetEchoMetrics, (int& ERL, int& ERLE, int& RERL, int& A_NLP));
906 WEBRTC_STUB(GetEcDelayMetrics, (int& delay_median, int& delay_std));
907
908 WEBRTC_STUB(StartDebugRecording, (const char* fileNameUTF8));
909 WEBRTC_STUB(StopDebugRecording, ());
910
911 WEBRTC_FUNC(SetTypingDetectionStatus, (bool enable)) {
912 typing_detection_enabled_ = enable;
913 return 0;
914 }
915 WEBRTC_FUNC(GetTypingDetectionStatus, (bool& enabled)) {
916 enabled = typing_detection_enabled_;
917 return 0;
918 }
919
920 WEBRTC_STUB(TimeSinceLastTyping, (int& seconds));
921 WEBRTC_STUB(SetTypingDetectionParameters, (int timeWindow,
922 int costPerTyping,
923 int reportingThreshold,
924 int penaltyDecay,
925 int typeEventDelay));
926 int EnableHighPassFilter(bool enable) {
927 highpass_filter_enabled_ = enable;
928 return 0;
929 }
930 bool IsHighPassFilterEnabled() {
931 return highpass_filter_enabled_;
932 }
933 bool IsStereoChannelSwappingEnabled() {
934 return stereo_swapping_enabled_;
935 }
936 void EnableStereoChannelSwapping(bool enable) {
937 stereo_swapping_enabled_ = enable;
938 }
939 bool WasSendTelephoneEventCalled(int channel, int event_code, int length_ms) {
940 return (channels_[channel]->dtmf_info.dtmf_event_code == event_code &&
941 channels_[channel]->dtmf_info.dtmf_out_of_band == true &&
942 channels_[channel]->dtmf_info.dtmf_length_ms == length_ms);
943 }
944 bool WasPlayDtmfToneCalled(int event_code, int length_ms) {
945 return (dtmf_info_.dtmf_event_code == event_code &&
946 dtmf_info_.dtmf_length_ms == length_ms);
947 }
948 // webrtc::VoEExternalMedia
949 WEBRTC_FUNC(RegisterExternalMediaProcessing,
950 (int channel, webrtc::ProcessingTypes type,
951 webrtc::VoEMediaProcess& processObject)) {
952 WEBRTC_CHECK_CHANNEL(channel);
953 if (channels_[channel]->media_processor_registered) {
954 return -1;
955 }
956 channels_[channel]->media_processor_registered = true;
957 media_processor_ = &processObject;
958 return 0;
959 }
960 WEBRTC_FUNC(DeRegisterExternalMediaProcessing,
961 (int channel, webrtc::ProcessingTypes type)) {
962 WEBRTC_CHECK_CHANNEL(channel);
963 if (!channels_[channel]->media_processor_registered) {
964 return -1;
965 }
966 channels_[channel]->media_processor_registered = false;
967 media_processor_ = NULL;
968 return 0;
969 }
970 WEBRTC_STUB(SetExternalRecordingStatus, (bool enable));
971 WEBRTC_STUB(SetExternalPlayoutStatus, (bool enable));
972 WEBRTC_STUB(ExternalRecordingInsertData,
973 (const int16_t speechData10ms[], int lengthSamples,
974 int samplingFreqHz, int current_delay_ms));
975 WEBRTC_STUB(ExternalPlayoutGetData,
976 (int16_t speechData10ms[], int samplingFreqHz,
977 int current_delay_ms, int& lengthSamples));
978 WEBRTC_STUB(GetAudioFrame, (int channel, int desired_sample_rate_hz,
979 webrtc::AudioFrame* frame));
980 WEBRTC_STUB(SetExternalMixing, (int channel, bool enable));
981
982 private:
983 int GetNumDevices(int& num) {
984#ifdef WIN32
985 num = 1;
986#else
987 // On non-Windows platforms VE adds a special entry for the default device,
988 // so if there is one physical device then there are two entries in the
989 // list.
990 num = 2;
991#endif
992 return 0;
993 }
994
995 int GetDeviceName(int i, char* name, char* guid) {
996 const char *s;
997#ifdef WIN32
998 if (0 == i) {
999 s = kFakeDeviceName;
1000 } else {
1001 return -1;
1002 }
1003#else
1004 // See comment above.
1005 if (0 == i) {
1006 s = kFakeDefaultDeviceName;
1007 } else if (1 == i) {
1008 s = kFakeDeviceName;
1009 } else {
1010 return -1;
1011 }
1012#endif
1013 strcpy(name, s);
1014 guid[0] = '\0';
1015 return 0;
1016 }
1017
1018 bool inited_;
1019 int last_channel_;
1020 std::map<int, Channel*> channels_;
1021 bool fail_create_channel_;
1022 const cricket::AudioCodec* const* codecs_;
1023 int num_codecs_;
1024 bool ec_enabled_;
1025 bool ec_metrics_enabled_;
1026 bool cng_enabled_;
1027 bool ns_enabled_;
1028 bool agc_enabled_;
1029 bool highpass_filter_enabled_;
1030 bool stereo_swapping_enabled_;
1031 bool typing_detection_enabled_;
1032 webrtc::EcModes ec_mode_;
1033 webrtc::AecmModes aecm_mode_;
1034 webrtc::NsModes ns_mode_;
1035 webrtc::AgcModes agc_mode_;
1036 webrtc::AgcConfig agc_config_;
1037 webrtc::VoiceEngineObserver* observer_;
1038 int playout_fail_channel_;
1039 int send_fail_channel_;
1040 bool fail_start_recording_microphone_;
1041 bool recording_microphone_;
wu@webrtc.org97077a32013-10-25 21:18:33 +00001042 int recording_sample_rate_;
1043 int playout_sample_rate_;
henrike@webrtc.org28e20752013-07-10 00:45:36 +00001044 DtmfInfo dtmf_info_;
1045 webrtc::VoEMediaProcess* media_processor_;
1046};
1047
1048} // namespace cricket
1049
1050#endif // TALK_SESSION_PHONE_FAKEWEBRTCVOICEENGINE_H_