blob: c6d39bbb223d349d92edba1ecc6682af9a84090d [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),
Minyue2013aec2015-05-13 14:14:42 +0200218 associate_send_channel(-1),
Henrik Lundin64dad832015-05-11 12:44:23 +0200219 neteq_capacity(-1) {
henrike@webrtc.org28e20752013-07-10 00:45:36 +0000220 memset(&send_codec, 0, sizeof(send_codec));
wu@webrtc.org97077a32013-10-25 21:18:33 +0000221 memset(&rx_agc_config, 0, sizeof(rx_agc_config));
henrike@webrtc.org28e20752013-07-10 00:45:36 +0000222 }
223 bool external_transport;
224 bool send;
225 bool playout;
226 float volume_scale;
227 float volume_pan_left;
228 float volume_pan_right;
229 bool file;
230 bool vad;
buildbot@webrtc.orgae740dd2014-06-17 10:56:41 +0000231 bool codec_fec;
buildbot@webrtc.org5d639b32014-09-10 07:57:12 +0000232 int max_encoding_bandwidth;
minyue@webrtc.org9b2e1142015-03-13 09:38:07 +0000233 bool opus_dtx;
buildbot@webrtc.orgae740dd2014-06-17 10:56:41 +0000234 bool red;
henrike@webrtc.org28e20752013-07-10 00:45:36 +0000235 bool nack;
236 bool media_processor_registered;
wu@webrtc.org97077a32013-10-25 21:18:33 +0000237 bool rx_agc_enabled;
238 webrtc::AgcModes rx_agc_mode;
239 webrtc::AgcConfig rx_agc_config;
henrike@webrtc.org28e20752013-07-10 00:45:36 +0000240 int cn8_type;
241 int cn16_type;
242 int dtmf_type;
buildbot@webrtc.orgae740dd2014-06-17 10:56:41 +0000243 int red_type;
henrike@webrtc.org28e20752013-07-10 00:45:36 +0000244 int nack_max_packets;
245 uint32 send_ssrc;
henrike@webrtc.org79047f92014-03-06 23:46:59 +0000246 int send_audio_level_ext_;
buildbot@webrtc.org150835e2014-05-06 15:54:38 +0000247 int receive_audio_level_ext_;
henrike@webrtc.org79047f92014-03-06 23:46:59 +0000248 int send_absolute_sender_time_ext_;
249 int receive_absolute_sender_time_ext_;
Minyue2013aec2015-05-13 14:14:42 +0200250 int associate_send_channel;
henrike@webrtc.org28e20752013-07-10 00:45:36 +0000251 DtmfInfo dtmf_info;
252 std::vector<webrtc::CodecInst> recv_codecs;
253 webrtc::CodecInst send_codec;
buildbot@webrtc.orgf875f152014-04-14 16:06:21 +0000254 webrtc::PacketTime last_rtp_packet_time;
henrike@webrtc.org28e20752013-07-10 00:45:36 +0000255 std::list<std::string> packets;
Henrik Lundin64dad832015-05-11 12:44:23 +0200256 int neteq_capacity;
henrike@webrtc.org28e20752013-07-10 00:45:36 +0000257 };
258
259 FakeWebRtcVoiceEngine(const cricket::AudioCodec* const* codecs,
260 int num_codecs)
261 : inited_(false),
262 last_channel_(-1),
263 fail_create_channel_(false),
264 codecs_(codecs),
265 num_codecs_(num_codecs),
wu@webrtc.org05e7b442014-04-01 17:44:24 +0000266 num_set_send_codecs_(0),
henrike@webrtc.org28e20752013-07-10 00:45:36 +0000267 ec_enabled_(false),
268 ec_metrics_enabled_(false),
269 cng_enabled_(false),
270 ns_enabled_(false),
271 agc_enabled_(false),
272 highpass_filter_enabled_(false),
273 stereo_swapping_enabled_(false),
274 typing_detection_enabled_(false),
275 ec_mode_(webrtc::kEcDefault),
276 aecm_mode_(webrtc::kAecmSpeakerphone),
277 ns_mode_(webrtc::kNsDefault),
278 agc_mode_(webrtc::kAgcDefault),
279 observer_(NULL),
280 playout_fail_channel_(-1),
281 send_fail_channel_(-1),
282 fail_start_recording_microphone_(false),
283 recording_microphone_(false),
wu@webrtc.org97077a32013-10-25 21:18:33 +0000284 recording_sample_rate_(-1),
285 playout_sample_rate_(-1),
henrike@webrtc.org28e20752013-07-10 00:45:36 +0000286 media_processor_(NULL) {
287 memset(&agc_config_, 0, sizeof(agc_config_));
288 }
289 ~FakeWebRtcVoiceEngine() {
290 // Ought to have all been deleted by the WebRtcVoiceMediaChannel
291 // destructors, but just in case ...
292 for (std::map<int, Channel*>::const_iterator i = channels_.begin();
293 i != channels_.end(); ++i) {
294 delete i->second;
295 }
296 }
297
298 bool IsExternalMediaProcessorRegistered() const {
299 return media_processor_ != NULL;
300 }
301 bool IsInited() const { return inited_; }
302 int GetLastChannel() const { return last_channel_; }
wu@webrtc.org9dba5252013-08-05 20:36:57 +0000303 int GetChannelFromLocalSsrc(uint32 local_ssrc) const {
304 for (std::map<int, Channel*>::const_iterator iter = channels_.begin();
305 iter != channels_.end(); ++iter) {
306 if (local_ssrc == iter->second->send_ssrc)
307 return iter->first;
308 }
309 return -1;
310 }
wu@webrtc.org9caf2762013-12-11 18:25:07 +0000311 int GetNumChannels() const { return static_cast<int>(channels_.size()); }
henrike@webrtc.org28e20752013-07-10 00:45:36 +0000312 bool GetPlayout(int channel) {
313 return channels_[channel]->playout;
314 }
315 bool GetSend(int channel) {
316 return channels_[channel]->send;
317 }
318 bool GetRecordingMicrophone() {
319 return recording_microphone_;
320 }
321 bool GetVAD(int channel) {
322 return channels_[channel]->vad;
323 }
Minyue Li7100dcd2015-03-27 05:05:59 +0100324 bool GetOpusDtx(int channel) {
325 return channels_[channel]->opus_dtx;
326 }
buildbot@webrtc.orgae740dd2014-06-17 10:56:41 +0000327 bool GetRED(int channel) {
328 return channels_[channel]->red;
329 }
330 bool GetCodecFEC(int channel) {
331 return channels_[channel]->codec_fec;
henrike@webrtc.org28e20752013-07-10 00:45:36 +0000332 }
buildbot@webrtc.org5d639b32014-09-10 07:57:12 +0000333 int GetMaxEncodingBandwidth(int channel) {
334 return channels_[channel]->max_encoding_bandwidth;
335 }
henrike@webrtc.org28e20752013-07-10 00:45:36 +0000336 bool GetNACK(int channel) {
337 return channels_[channel]->nack;
338 }
339 int GetNACKMaxPackets(int channel) {
340 return channels_[channel]->nack_max_packets;
341 }
buildbot@webrtc.orgf875f152014-04-14 16:06:21 +0000342 const webrtc::PacketTime& GetLastRtpPacketTime(int channel) {
343 WEBRTC_ASSERT_CHANNEL(channel);
344 return channels_[channel]->last_rtp_packet_time;
345 }
henrike@webrtc.org28e20752013-07-10 00:45:36 +0000346 int GetSendCNPayloadType(int channel, bool wideband) {
347 return (wideband) ?
348 channels_[channel]->cn16_type :
349 channels_[channel]->cn8_type;
350 }
351 int GetSendTelephoneEventPayloadType(int channel) {
352 return channels_[channel]->dtmf_type;
353 }
buildbot@webrtc.orgae740dd2014-06-17 10:56:41 +0000354 int GetSendREDPayloadType(int channel) {
355 return channels_[channel]->red_type;
henrike@webrtc.org28e20752013-07-10 00:45:36 +0000356 }
357 bool CheckPacket(int channel, const void* data, size_t len) {
358 bool result = !CheckNoPacket(channel);
359 if (result) {
360 std::string packet = channels_[channel]->packets.front();
361 result = (packet == std::string(static_cast<const char*>(data), len));
362 channels_[channel]->packets.pop_front();
363 }
364 return result;
365 }
366 bool CheckNoPacket(int channel) {
367 return channels_[channel]->packets.empty();
368 }
369 void TriggerCallbackOnError(int channel_num, int err_code) {
Fredrik Solenbergd3ddc1b2015-05-07 17:07:34 +0200370 DCHECK(observer_ != NULL);
henrike@webrtc.org28e20752013-07-10 00:45:36 +0000371 observer_->CallbackOnError(channel_num, err_code);
372 }
373 void set_playout_fail_channel(int channel) {
374 playout_fail_channel_ = channel;
375 }
376 void set_send_fail_channel(int channel) {
377 send_fail_channel_ = channel;
378 }
379 void set_fail_start_recording_microphone(
380 bool fail_start_recording_microphone) {
381 fail_start_recording_microphone_ = fail_start_recording_microphone;
382 }
383 void set_fail_create_channel(bool fail_create_channel) {
384 fail_create_channel_ = fail_create_channel;
385 }
386 void TriggerProcessPacket(MediaProcessorDirection direction) {
387 webrtc::ProcessingTypes pt =
388 (direction == cricket::MPD_TX) ?
389 webrtc::kRecordingPerChannel : webrtc::kPlaybackAllChannelsMixed;
390 if (media_processor_ != NULL) {
391 media_processor_->Process(0,
392 pt,
393 NULL,
394 0,
395 0,
396 true);
397 }
398 }
Henrik Lundin64dad832015-05-11 12:44:23 +0200399 int AddChannel(const webrtc::Config& config) {
wu@webrtc.org364f2042013-11-20 21:49:41 +0000400 if (fail_create_channel_) {
401 return -1;
402 }
buildbot@webrtc.orgaf6640f2014-04-28 21:31:51 +0000403 Channel* ch = new Channel();
wu@webrtc.org364f2042013-11-20 21:49:41 +0000404 for (int i = 0; i < NumOfCodecs(); ++i) {
405 webrtc::CodecInst codec;
406 GetCodec(i, codec);
407 ch->recv_codecs.push_back(codec);
408 }
Henrik Lundin64dad832015-05-11 12:44:23 +0200409 if (config.Get<webrtc::NetEqCapacityConfig>().enabled) {
410 ch->neteq_capacity = config.Get<webrtc::NetEqCapacityConfig>().capacity;
411 }
wu@webrtc.org364f2042013-11-20 21:49:41 +0000412 channels_[++last_channel_] = ch;
413 return last_channel_;
414 }
buildbot@webrtc.org150835e2014-05-06 15:54:38 +0000415 int GetSendRtpExtensionId(int channel, const std::string& extension) {
416 WEBRTC_ASSERT_CHANNEL(channel);
417 if (extension == kRtpAudioLevelHeaderExtension) {
418 return channels_[channel]->send_audio_level_ext_;
419 } else if (extension == kRtpAbsoluteSenderTimeHeaderExtension) {
420 return channels_[channel]->send_absolute_sender_time_ext_;
421 }
422 return -1;
henrike@webrtc.org79047f92014-03-06 23:46:59 +0000423 }
buildbot@webrtc.org150835e2014-05-06 15:54:38 +0000424 int GetReceiveRtpExtensionId(int channel, const std::string& extension) {
425 WEBRTC_ASSERT_CHANNEL(channel);
426 if (extension == kRtpAudioLevelHeaderExtension) {
427 return channels_[channel]->receive_audio_level_ext_;
428 } else if (extension == kRtpAbsoluteSenderTimeHeaderExtension) {
429 return channels_[channel]->receive_absolute_sender_time_ext_;
430 }
431 return -1;
henrike@webrtc.org79047f92014-03-06 23:46:59 +0000432 }
henrike@webrtc.org28e20752013-07-10 00:45:36 +0000433
wu@webrtc.org05e7b442014-04-01 17:44:24 +0000434 int GetNumSetSendCodecs() const { return num_set_send_codecs_; }
435
Minyue2013aec2015-05-13 14:14:42 +0200436 int GetAssociateSendChannel(int channel) {
437 return channels_[channel]->associate_send_channel;
438 }
439
henrike@webrtc.org28e20752013-07-10 00:45:36 +0000440 WEBRTC_STUB(Release, ());
441
442 // webrtc::VoEBase
443 WEBRTC_FUNC(RegisterVoiceEngineObserver, (
444 webrtc::VoiceEngineObserver& observer)) {
445 observer_ = &observer;
446 return 0;
447 }
448 WEBRTC_STUB(DeRegisterVoiceEngineObserver, ());
449 WEBRTC_FUNC(Init, (webrtc::AudioDeviceModule* adm,
450 webrtc::AudioProcessing* audioproc)) {
451 inited_ = true;
452 return 0;
453 }
454 WEBRTC_FUNC(Terminate, ()) {
455 inited_ = false;
456 return 0;
457 }
kjellander@webrtc.org14665ff2015-03-04 12:58:35 +0000458 webrtc::AudioProcessing* audio_processing() override {
buildbot@webrtc.orga8d8ad22014-07-16 14:23:08 +0000459 return &audio_processing_;
henrike@webrtc.org28e20752013-07-10 00:45:36 +0000460 }
henrike@webrtc.org28e20752013-07-10 00:45:36 +0000461 WEBRTC_FUNC(CreateChannel, ()) {
Henrik Lundin64dad832015-05-11 12:44:23 +0200462 webrtc::Config empty_config;
463 return AddChannel(empty_config);
henrike@webrtc.org28e20752013-07-10 00:45:36 +0000464 }
Henrik Lundin64dad832015-05-11 12:44:23 +0200465 WEBRTC_FUNC(CreateChannel, (const webrtc::Config& config)) {
466 return AddChannel(config);
wu@webrtc.org364f2042013-11-20 21:49:41 +0000467 }
henrike@webrtc.org28e20752013-07-10 00:45:36 +0000468 WEBRTC_FUNC(DeleteChannel, (int channel)) {
469 WEBRTC_CHECK_CHANNEL(channel);
Minyue2013aec2015-05-13 14:14:42 +0200470 for (const auto& ch : channels_) {
471 if (ch.second->associate_send_channel == channel) {
472 ch.second->associate_send_channel = -1;
473 }
474 }
henrike@webrtc.org28e20752013-07-10 00:45:36 +0000475 delete channels_[channel];
476 channels_.erase(channel);
477 return 0;
478 }
479 WEBRTC_STUB(StartReceive, (int channel));
480 WEBRTC_FUNC(StartPlayout, (int channel)) {
481 if (playout_fail_channel_ != channel) {
482 WEBRTC_CHECK_CHANNEL(channel);
483 channels_[channel]->playout = true;
484 return 0;
485 } else {
486 // When playout_fail_channel_ == channel, fail the StartPlayout on this
487 // channel.
488 return -1;
489 }
490 }
491 WEBRTC_FUNC(StartSend, (int channel)) {
492 if (send_fail_channel_ != channel) {
493 WEBRTC_CHECK_CHANNEL(channel);
494 channels_[channel]->send = true;
495 return 0;
496 } else {
497 // When send_fail_channel_ == channel, fail the StartSend on this
498 // channel.
499 return -1;
500 }
501 }
502 WEBRTC_STUB(StopReceive, (int channel));
503 WEBRTC_FUNC(StopPlayout, (int channel)) {
504 WEBRTC_CHECK_CHANNEL(channel);
505 channels_[channel]->playout = false;
506 return 0;
507 }
508 WEBRTC_FUNC(StopSend, (int channel)) {
509 WEBRTC_CHECK_CHANNEL(channel);
510 channels_[channel]->send = false;
511 return 0;
512 }
513 WEBRTC_STUB(GetVersion, (char version[1024]));
514 WEBRTC_STUB(LastError, ());
515 WEBRTC_STUB(SetOnHoldStatus, (int, bool, webrtc::OnHoldModes));
516 WEBRTC_STUB(GetOnHoldStatus, (int, bool&, webrtc::OnHoldModes&));
Minyue2013aec2015-05-13 14:14:42 +0200517 WEBRTC_FUNC(AssociateSendChannel, (int channel,
518 int accociate_send_channel)) {
519 WEBRTC_CHECK_CHANNEL(channel);
520 channels_[channel]->associate_send_channel = accociate_send_channel;
521 return 0;
522 }
henrike@webrtc.org28e20752013-07-10 00:45:36 +0000523
524 // webrtc::VoECodec
525 WEBRTC_FUNC(NumOfCodecs, ()) {
526 return num_codecs_;
527 }
528 WEBRTC_FUNC(GetCodec, (int index, webrtc::CodecInst& codec)) {
529 if (index < 0 || index >= NumOfCodecs()) {
530 return -1;
531 }
532 const cricket::AudioCodec& c(*codecs_[index]);
533 codec.pltype = c.id;
buildbot@webrtc.orgd4e598d2014-07-29 17:36:52 +0000534 rtc::strcpyn(codec.plname, sizeof(codec.plname), c.name.c_str());
henrike@webrtc.org28e20752013-07-10 00:45:36 +0000535 codec.plfreq = c.clockrate;
536 codec.pacsize = 0;
537 codec.channels = c.channels;
538 codec.rate = c.bitrate;
539 return 0;
540 }
541 WEBRTC_FUNC(SetSendCodec, (int channel, const webrtc::CodecInst& codec)) {
542 WEBRTC_CHECK_CHANNEL(channel);
henrike@webrtc.org704bf9e2014-02-27 17:52:04 +0000543 // To match the behavior of the real implementation.
544 if (_stricmp(codec.plname, "telephone-event") == 0 ||
545 _stricmp(codec.plname, "audio/telephone-event") == 0 ||
546 _stricmp(codec.plname, "CN") == 0 ||
547 _stricmp(codec.plname, "red") == 0 ) {
548 return -1;
549 }
henrike@webrtc.org28e20752013-07-10 00:45:36 +0000550 channels_[channel]->send_codec = codec;
wu@webrtc.org05e7b442014-04-01 17:44:24 +0000551 ++num_set_send_codecs_;
henrike@webrtc.org28e20752013-07-10 00:45:36 +0000552 return 0;
553 }
554 WEBRTC_FUNC(GetSendCodec, (int channel, webrtc::CodecInst& codec)) {
555 WEBRTC_CHECK_CHANNEL(channel);
556 codec = channels_[channel]->send_codec;
557 return 0;
558 }
Ivo Creusenadf89b72015-04-29 16:03:33 +0200559 WEBRTC_STUB(SetBitRate, (int channel, int bitrate_bps));
buildbot@webrtc.org7e71b772014-06-13 01:14:01 +0000560 WEBRTC_FUNC(GetRecCodec, (int channel, webrtc::CodecInst& codec)) {
561 WEBRTC_CHECK_CHANNEL(channel);
562 const Channel* c = channels_[channel];
563 for (std::list<std::string>::const_iterator it_packet = c->packets.begin();
564 it_packet != c->packets.end(); ++it_packet) {
565 int pltype;
566 if (!GetRtpPayloadType(it_packet->data(), it_packet->length(), &pltype)) {
567 continue;
568 }
569 for (std::vector<webrtc::CodecInst>::const_iterator it_codec =
570 c->recv_codecs.begin(); it_codec != c->recv_codecs.end();
571 ++it_codec) {
572 if (it_codec->pltype == pltype) {
573 codec = *it_codec;
574 return 0;
575 }
576 }
577 }
578 return -1;
579 }
henrike@webrtc.org28e20752013-07-10 00:45:36 +0000580 WEBRTC_STUB(SetAMREncFormat, (int channel, webrtc::AmrMode mode));
581 WEBRTC_STUB(SetAMRDecFormat, (int channel, webrtc::AmrMode mode));
582 WEBRTC_STUB(SetAMRWbEncFormat, (int channel, webrtc::AmrMode mode));
583 WEBRTC_STUB(SetAMRWbDecFormat, (int channel, webrtc::AmrMode mode));
584 WEBRTC_STUB(SetISACInitTargetRate, (int channel, int rateBps,
585 bool useFixedFrameSize));
586 WEBRTC_STUB(SetISACMaxRate, (int channel, int rateBps));
587 WEBRTC_STUB(SetISACMaxPayloadSize, (int channel, int sizeBytes));
588 WEBRTC_FUNC(SetRecPayloadType, (int channel,
589 const webrtc::CodecInst& codec)) {
590 WEBRTC_CHECK_CHANNEL(channel);
591 Channel* ch = channels_[channel];
592 if (ch->playout)
593 return -1; // Channel is in use.
594 // Check if something else already has this slot.
595 if (codec.pltype != -1) {
596 for (std::vector<webrtc::CodecInst>::iterator it =
597 ch->recv_codecs.begin(); it != ch->recv_codecs.end(); ++it) {
598 if (it->pltype == codec.pltype &&
599 _stricmp(it->plname, codec.plname) != 0) {
600 return -1;
601 }
602 }
603 }
604 // Otherwise try to find this codec and update its payload type.
605 for (std::vector<webrtc::CodecInst>::iterator it = ch->recv_codecs.begin();
606 it != ch->recv_codecs.end(); ++it) {
607 if (strcmp(it->plname, codec.plname) == 0 &&
608 it->plfreq == codec.plfreq) {
609 it->pltype = codec.pltype;
610 it->channels = codec.channels;
611 return 0;
612 }
613 }
614 return -1; // not found
615 }
616 WEBRTC_FUNC(SetSendCNPayloadType, (int channel, int type,
617 webrtc::PayloadFrequencies frequency)) {
618 WEBRTC_CHECK_CHANNEL(channel);
619 if (frequency == webrtc::kFreq8000Hz) {
620 channels_[channel]->cn8_type = type;
621 } else if (frequency == webrtc::kFreq16000Hz) {
622 channels_[channel]->cn16_type = type;
623 }
624 return 0;
625 }
626 WEBRTC_FUNC(GetRecPayloadType, (int channel, webrtc::CodecInst& codec)) {
627 WEBRTC_CHECK_CHANNEL(channel);
628 Channel* ch = channels_[channel];
629 for (std::vector<webrtc::CodecInst>::iterator it = ch->recv_codecs.begin();
630 it != ch->recv_codecs.end(); ++it) {
631 if (strcmp(it->plname, codec.plname) == 0 &&
632 it->plfreq == codec.plfreq &&
633 it->channels == codec.channels &&
634 it->pltype != -1) {
635 codec.pltype = it->pltype;
636 return 0;
637 }
638 }
639 return -1; // not found
640 }
641 WEBRTC_FUNC(SetVADStatus, (int channel, bool enable, webrtc::VadModes mode,
642 bool disableDTX)) {
643 WEBRTC_CHECK_CHANNEL(channel);
644 if (channels_[channel]->send_codec.channels == 2) {
645 // Replicating VoE behavior; VAD cannot be enabled for stereo.
646 return -1;
647 }
648 channels_[channel]->vad = enable;
649 return 0;
650 }
651 WEBRTC_STUB(GetVADStatus, (int channel, bool& enabled,
652 webrtc::VadModes& mode, bool& disabledDTX));
buildbot@webrtc.org5d639b32014-09-10 07:57:12 +0000653
buildbot@webrtc.orgae740dd2014-06-17 10:56:41 +0000654 WEBRTC_FUNC(SetFECStatus, (int channel, bool enable)) {
655 WEBRTC_CHECK_CHANNEL(channel);
buildbot@webrtc.org5d639b32014-09-10 07:57:12 +0000656 if (_stricmp(channels_[channel]->send_codec.plname, "opus") != 0) {
buildbot@webrtc.org3ffa1f92014-07-02 19:51:26 +0000657 // Return -1 if current send codec is not Opus.
658 // TODO(minyue): Excludes other codecs if they support inband FEC.
659 return -1;
660 }
buildbot@webrtc.orgae740dd2014-06-17 10:56:41 +0000661 channels_[channel]->codec_fec = enable;
662 return 0;
663 }
664 WEBRTC_FUNC(GetFECStatus, (int channel, bool& enable)) {
665 WEBRTC_CHECK_CHANNEL(channel);
666 enable = channels_[channel]->codec_fec;
667 return 0;
668 }
buildbot@webrtc.org5d639b32014-09-10 07:57:12 +0000669
670 WEBRTC_FUNC(SetOpusMaxPlaybackRate, (int channel, int frequency_hz)) {
671 WEBRTC_CHECK_CHANNEL(channel);
672 if (_stricmp(channels_[channel]->send_codec.plname, "opus") != 0) {
673 // Return -1 if current send codec is not Opus.
674 return -1;
675 }
676 if (frequency_hz <= 8000)
677 channels_[channel]->max_encoding_bandwidth = kOpusBandwidthNb;
678 else if (frequency_hz <= 12000)
679 channels_[channel]->max_encoding_bandwidth = kOpusBandwidthMb;
680 else if (frequency_hz <= 16000)
681 channels_[channel]->max_encoding_bandwidth = kOpusBandwidthWb;
682 else if (frequency_hz <= 24000)
683 channels_[channel]->max_encoding_bandwidth = kOpusBandwidthSwb;
684 else
685 channels_[channel]->max_encoding_bandwidth = kOpusBandwidthFb;
686 return 0;
687 }
henrike@webrtc.org28e20752013-07-10 00:45:36 +0000688
minyue@webrtc.org9b2e1142015-03-13 09:38:07 +0000689 WEBRTC_FUNC(SetOpusDtx, (int channel, bool enable_dtx)) {
690 WEBRTC_CHECK_CHANNEL(channel);
691 if (_stricmp(channels_[channel]->send_codec.plname, "opus") != 0) {
692 // Return -1 if current send codec is not Opus.
693 return -1;
694 }
695 channels_[channel]->opus_dtx = enable_dtx;
696 return 0;
697 }
698
henrike@webrtc.org28e20752013-07-10 00:45:36 +0000699 // webrtc::VoEDtmf
700 WEBRTC_FUNC(SendTelephoneEvent, (int channel, int event_code,
701 bool out_of_band = true, int length_ms = 160, int attenuation_db = 10)) {
702 channels_[channel]->dtmf_info.dtmf_event_code = event_code;
703 channels_[channel]->dtmf_info.dtmf_out_of_band = out_of_band;
704 channels_[channel]->dtmf_info.dtmf_length_ms = length_ms;
705 return 0;
706 }
707
708 WEBRTC_FUNC(SetSendTelephoneEventPayloadType,
709 (int channel, unsigned char type)) {
710 channels_[channel]->dtmf_type = type;
711 return 0;
712 };
713 WEBRTC_STUB(GetSendTelephoneEventPayloadType,
714 (int channel, unsigned char& type));
715
716 WEBRTC_STUB(SetDtmfFeedbackStatus, (bool enable, bool directFeedback));
717 WEBRTC_STUB(GetDtmfFeedbackStatus, (bool& enabled, bool& directFeedback));
henrike@webrtc.org28e20752013-07-10 00:45:36 +0000718
henrike@webrtc.org28e20752013-07-10 00:45:36 +0000719 WEBRTC_FUNC(PlayDtmfTone,
720 (int event_code, int length_ms = 200, int attenuation_db = 10)) {
721 dtmf_info_.dtmf_event_code = event_code;
722 dtmf_info_.dtmf_length_ms = length_ms;
723 return 0;
724 }
725 WEBRTC_STUB(StartPlayingDtmfTone,
726 (int eventCode, int attenuationDb = 10));
727 WEBRTC_STUB(StopPlayingDtmfTone, ());
728
729 // webrtc::VoEFile
730 WEBRTC_FUNC(StartPlayingFileLocally, (int channel, const char* fileNameUTF8,
731 bool loop, webrtc::FileFormats format,
732 float volumeScaling, int startPointMs,
733 int stopPointMs)) {
734 WEBRTC_CHECK_CHANNEL(channel);
735 channels_[channel]->file = true;
736 return 0;
737 }
738 WEBRTC_FUNC(StartPlayingFileLocally, (int channel, webrtc::InStream* stream,
739 webrtc::FileFormats format,
740 float volumeScaling, int startPointMs,
741 int stopPointMs)) {
742 WEBRTC_CHECK_CHANNEL(channel);
743 channels_[channel]->file = true;
744 return 0;
745 }
746 WEBRTC_FUNC(StopPlayingFileLocally, (int channel)) {
747 WEBRTC_CHECK_CHANNEL(channel);
748 channels_[channel]->file = false;
749 return 0;
750 }
751 WEBRTC_FUNC(IsPlayingFileLocally, (int channel)) {
752 WEBRTC_CHECK_CHANNEL(channel);
753 return (channels_[channel]->file) ? 1 : 0;
754 }
755 WEBRTC_STUB(ScaleLocalFilePlayout, (int channel, float scale));
756 WEBRTC_STUB(StartPlayingFileAsMicrophone, (int channel,
757 const char* fileNameUTF8,
758 bool loop,
759 bool mixWithMicrophone,
760 webrtc::FileFormats format,
761 float volumeScaling));
762 WEBRTC_STUB(StartPlayingFileAsMicrophone, (int channel,
763 webrtc::InStream* stream,
764 bool mixWithMicrophone,
765 webrtc::FileFormats format,
766 float volumeScaling));
767 WEBRTC_STUB(StopPlayingFileAsMicrophone, (int channel));
768 WEBRTC_STUB(IsPlayingFileAsMicrophone, (int channel));
769 WEBRTC_STUB(ScaleFileAsMicrophonePlayout, (int channel, float scale));
770 WEBRTC_STUB(StartRecordingPlayout, (int channel, const char* fileNameUTF8,
771 webrtc::CodecInst* compression,
772 int maxSizeBytes));
773 WEBRTC_STUB(StartRecordingPlayout, (int channel, webrtc::OutStream* stream,
774 webrtc::CodecInst* compression));
775 WEBRTC_STUB(StopRecordingPlayout, (int channel));
776 WEBRTC_FUNC(StartRecordingMicrophone, (const char* fileNameUTF8,
777 webrtc::CodecInst* compression,
778 int maxSizeBytes)) {
779 if (fail_start_recording_microphone_) {
780 return -1;
781 }
782 recording_microphone_ = true;
783 return 0;
784 }
785 WEBRTC_FUNC(StartRecordingMicrophone, (webrtc::OutStream* stream,
786 webrtc::CodecInst* compression)) {
787 if (fail_start_recording_microphone_) {
788 return -1;
789 }
790 recording_microphone_ = true;
791 return 0;
792 }
793 WEBRTC_FUNC(StopRecordingMicrophone, ()) {
794 if (!recording_microphone_) {
795 return -1;
796 }
797 recording_microphone_ = false;
798 return 0;
799 }
800 WEBRTC_STUB(ConvertPCMToWAV, (const char* fileNameInUTF8,
801 const char* fileNameOutUTF8));
802 WEBRTC_STUB(ConvertPCMToWAV, (webrtc::InStream* streamIn,
803 webrtc::OutStream* streamOut));
804 WEBRTC_STUB(ConvertWAVToPCM, (const char* fileNameInUTF8,
805 const char* fileNameOutUTF8));
806 WEBRTC_STUB(ConvertWAVToPCM, (webrtc::InStream* streamIn,
807 webrtc::OutStream* streamOut));
808 WEBRTC_STUB(ConvertPCMToCompressed, (const char* fileNameInUTF8,
809 const char* fileNameOutUTF8,
810 webrtc::CodecInst* compression));
811 WEBRTC_STUB(ConvertPCMToCompressed, (webrtc::InStream* streamIn,
812 webrtc::OutStream* streamOut,
813 webrtc::CodecInst* compression));
814 WEBRTC_STUB(ConvertCompressedToPCM, (const char* fileNameInUTF8,
815 const char* fileNameOutUTF8));
816 WEBRTC_STUB(ConvertCompressedToPCM, (webrtc::InStream* streamIn,
817 webrtc::OutStream* streamOut));
818 WEBRTC_STUB(GetFileDuration, (const char* fileNameUTF8, int& durationMs,
819 webrtc::FileFormats format));
820 WEBRTC_STUB(GetPlaybackPosition, (int channel, int& positionMs));
821
822 // webrtc::VoEHardware
823 WEBRTC_STUB(GetCPULoad, (int&));
824 WEBRTC_FUNC(GetNumOfRecordingDevices, (int& num)) {
825 return GetNumDevices(num);
826 }
827 WEBRTC_FUNC(GetNumOfPlayoutDevices, (int& num)) {
828 return GetNumDevices(num);
829 }
830 WEBRTC_FUNC(GetRecordingDeviceName, (int i, char* name, char* guid)) {
831 return GetDeviceName(i, name, guid);
832 }
833 WEBRTC_FUNC(GetPlayoutDeviceName, (int i, char* name, char* guid)) {
834 return GetDeviceName(i, name, guid);
835 }
836 WEBRTC_STUB(SetRecordingDevice, (int, webrtc::StereoChannel));
837 WEBRTC_STUB(SetPlayoutDevice, (int));
838 WEBRTC_STUB(SetAudioDeviceLayer, (webrtc::AudioLayers));
839 WEBRTC_STUB(GetAudioDeviceLayer, (webrtc::AudioLayers&));
840 WEBRTC_STUB(GetPlayoutDeviceStatus, (bool&));
841 WEBRTC_STUB(GetRecordingDeviceStatus, (bool&));
842 WEBRTC_STUB(ResetAudioDevice, ());
843 WEBRTC_STUB(AudioDeviceControl, (unsigned int, unsigned int, unsigned int));
844 WEBRTC_STUB(SetLoudspeakerStatus, (bool enable));
845 WEBRTC_STUB(GetLoudspeakerStatus, (bool& enabled));
wu@webrtc.org97077a32013-10-25 21:18:33 +0000846 WEBRTC_FUNC(SetRecordingSampleRate, (unsigned int samples_per_sec)) {
847 recording_sample_rate_ = samples_per_sec;
848 return 0;
849 }
850 WEBRTC_FUNC_CONST(RecordingSampleRate, (unsigned int* samples_per_sec)) {
851 *samples_per_sec = recording_sample_rate_;
852 return 0;
853 }
854 WEBRTC_FUNC(SetPlayoutSampleRate, (unsigned int samples_per_sec)) {
855 playout_sample_rate_ = samples_per_sec;
856 return 0;
857 }
858 WEBRTC_FUNC_CONST(PlayoutSampleRate, (unsigned int* samples_per_sec)) {
859 *samples_per_sec = playout_sample_rate_;
860 return 0;
861 }
henrike@webrtc.org28e20752013-07-10 00:45:36 +0000862 WEBRTC_STUB(EnableBuiltInAEC, (bool enable));
863 virtual bool BuiltInAECIsEnabled() const { return true; }
henrika@webrtc.orga954c072014-12-09 16:22:09 +0000864 virtual bool BuiltInAECIsAvailable() const { return false; }
henrike@webrtc.org28e20752013-07-10 00:45:36 +0000865
866 // webrtc::VoENetEqStats
minyue@webrtc.orgc0bd7be2015-02-18 15:24:13 +0000867 WEBRTC_FUNC(GetNetworkStatistics, (int channel,
868 webrtc::NetworkStatistics& ns)) {
869 WEBRTC_CHECK_CHANNEL(channel);
870 memcpy(&ns, &kNetStats, sizeof(webrtc::NetworkStatistics));
871 return 0;
872 }
873
wu@webrtc.org24301a62013-12-13 19:17:43 +0000874 WEBRTC_FUNC_CONST(GetDecodingCallStatistics, (int channel,
875 webrtc::AudioDecodingCallStats*)) {
876 WEBRTC_CHECK_CHANNEL(channel);
877 return 0;
878 }
henrike@webrtc.org28e20752013-07-10 00:45:36 +0000879
880 // webrtc::VoENetwork
881 WEBRTC_FUNC(RegisterExternalTransport, (int channel,
882 webrtc::Transport& transport)) {
883 WEBRTC_CHECK_CHANNEL(channel);
884 channels_[channel]->external_transport = true;
885 return 0;
886 }
887 WEBRTC_FUNC(DeRegisterExternalTransport, (int channel)) {
888 WEBRTC_CHECK_CHANNEL(channel);
889 channels_[channel]->external_transport = false;
890 return 0;
891 }
892 WEBRTC_FUNC(ReceivedRTPPacket, (int channel, const void* data,
pkasting@chromium.org4591fbd2014-11-20 22:28:14 +0000893 size_t length)) {
henrike@webrtc.org28e20752013-07-10 00:45:36 +0000894 WEBRTC_CHECK_CHANNEL(channel);
895 if (!channels_[channel]->external_transport) return -1;
896 channels_[channel]->packets.push_back(
897 std::string(static_cast<const char*>(data), length));
898 return 0;
899 }
buildbot@webrtc.orgf875f152014-04-14 16:06:21 +0000900 WEBRTC_FUNC(ReceivedRTPPacket, (int channel, const void* data,
pkasting@chromium.org4591fbd2014-11-20 22:28:14 +0000901 size_t length,
buildbot@webrtc.orgf875f152014-04-14 16:06:21 +0000902 const webrtc::PacketTime& packet_time)) {
903 WEBRTC_CHECK_CHANNEL(channel);
904 if (ReceivedRTPPacket(channel, data, length) == -1) {
905 return -1;
906 }
907 channels_[channel]->last_rtp_packet_time = packet_time;
908 return 0;
909 }
buildbot@webrtc.orgf875f152014-04-14 16:06:21 +0000910
henrike@webrtc.org28e20752013-07-10 00:45:36 +0000911 WEBRTC_STUB(ReceivedRTCPPacket, (int channel, const void* data,
pkasting@chromium.org4591fbd2014-11-20 22:28:14 +0000912 size_t length));
henrike@webrtc.org28e20752013-07-10 00:45:36 +0000913
914 // webrtc::VoERTP_RTCP
915 WEBRTC_STUB(RegisterRTPObserver, (int channel,
916 webrtc::VoERTPObserver& observer));
917 WEBRTC_STUB(DeRegisterRTPObserver, (int channel));
henrike@webrtc.org28e20752013-07-10 00:45:36 +0000918 WEBRTC_FUNC(SetLocalSSRC, (int channel, unsigned int ssrc)) {
919 WEBRTC_CHECK_CHANNEL(channel);
920 channels_[channel]->send_ssrc = ssrc;
921 return 0;
922 }
923 WEBRTC_FUNC(GetLocalSSRC, (int channel, unsigned int& ssrc)) {
924 WEBRTC_CHECK_CHANNEL(channel);
925 ssrc = channels_[channel]->send_ssrc;
926 return 0;
927 }
928 WEBRTC_STUB(GetRemoteSSRC, (int channel, unsigned int& ssrc));
henrike@webrtc.org79047f92014-03-06 23:46:59 +0000929 WEBRTC_FUNC(SetSendAudioLevelIndicationStatus, (int channel, bool enable,
930 unsigned char id)) {
henrike@webrtc.org28e20752013-07-10 00:45:36 +0000931 WEBRTC_CHECK_CHANNEL(channel);
henrike@webrtc.org79047f92014-03-06 23:46:59 +0000932 WEBRTC_CHECK_HEADER_EXTENSION_ID(enable, id);
933 channels_[channel]->send_audio_level_ext_ = (enable) ? id : -1;
henrike@webrtc.org28e20752013-07-10 00:45:36 +0000934 return 0;
935 }
buildbot@webrtc.org150835e2014-05-06 15:54:38 +0000936 WEBRTC_FUNC(SetReceiveAudioLevelIndicationStatus, (int channel, bool enable,
937 unsigned char id)) {
938 WEBRTC_CHECK_CHANNEL(channel);
939 WEBRTC_CHECK_HEADER_EXTENSION_ID(enable, id);
940 channels_[channel]->receive_audio_level_ext_ = (enable) ? id : -1;
941 return 0;
942 }
henrike@webrtc.org79047f92014-03-06 23:46:59 +0000943 WEBRTC_FUNC(SetSendAbsoluteSenderTimeStatus, (int channel, bool enable,
944 unsigned char id)) {
945 WEBRTC_CHECK_CHANNEL(channel);
946 WEBRTC_CHECK_HEADER_EXTENSION_ID(enable, id);
947 channels_[channel]->send_absolute_sender_time_ext_ = (enable) ? id : -1;
948 return 0;
949 }
950 WEBRTC_FUNC(SetReceiveAbsoluteSenderTimeStatus, (int channel, bool enable,
951 unsigned char id)) {
952 WEBRTC_CHECK_CHANNEL(channel);
953 WEBRTC_CHECK_HEADER_EXTENSION_ID(enable, id);
954 channels_[channel]->receive_absolute_sender_time_ext_ = (enable) ? id : -1;
955 return 0;
956 }
henrike@webrtc.org79047f92014-03-06 23:46:59 +0000957
henrike@webrtc.org28e20752013-07-10 00:45:36 +0000958 WEBRTC_STUB(GetRemoteCSRCs, (int channel, unsigned int arrCSRC[15]));
959 WEBRTC_STUB(SetRTCPStatus, (int channel, bool enable));
960 WEBRTC_STUB(GetRTCPStatus, (int channel, bool& enabled));
961 WEBRTC_STUB(SetRTCP_CNAME, (int channel, const char cname[256]));
962 WEBRTC_STUB(GetRTCP_CNAME, (int channel, char cname[256]));
963 WEBRTC_STUB(GetRemoteRTCP_CNAME, (int channel, char* cname));
964 WEBRTC_STUB(GetRemoteRTCPData, (int channel, unsigned int& NTPHigh,
965 unsigned int& NTPLow,
966 unsigned int& timestamp,
967 unsigned int& playoutTimestamp,
968 unsigned int* jitter,
969 unsigned short* fractionLost));
970 WEBRTC_STUB(GetRemoteRTCPSenderInfo, (int channel,
971 webrtc::SenderInfo* sender_info));
972 WEBRTC_FUNC(GetRemoteRTCPReportBlocks,
973 (int channel, std::vector<webrtc::ReportBlock>* receive_blocks)) {
974 WEBRTC_CHECK_CHANNEL(channel);
975 webrtc::ReportBlock block;
976 block.source_SSRC = channels_[channel]->send_ssrc;
977 webrtc::CodecInst send_codec = channels_[channel]->send_codec;
978 if (send_codec.pltype >= 0) {
979 block.fraction_lost = (unsigned char)(kFractionLostStatValue * 256);
980 if (send_codec.plfreq / 1000 > 0) {
981 block.interarrival_jitter = kIntStatValue * (send_codec.plfreq / 1000);
982 }
983 block.cumulative_num_packets_lost = kIntStatValue;
984 block.extended_highest_sequence_number = kIntStatValue;
985 receive_blocks->push_back(block);
986 }
987 return 0;
988 }
989 WEBRTC_STUB(SendApplicationDefinedRTCPPacket, (int channel,
990 unsigned char subType,
991 unsigned int name,
992 const char* data,
993 unsigned short dataLength));
994 WEBRTC_STUB(GetRTPStatistics, (int channel, unsigned int& averageJitterMs,
995 unsigned int& maxJitterMs,
996 unsigned int& discardedPackets));
997 WEBRTC_FUNC(GetRTCPStatistics, (int channel, webrtc::CallStatistics& stats)) {
998 WEBRTC_CHECK_CHANNEL(channel);
999 stats.fractionLost = static_cast<int16>(kIntStatValue);
1000 stats.cumulativeLost = kIntStatValue;
1001 stats.extendedMax = kIntStatValue;
1002 stats.jitterSamples = kIntStatValue;
1003 stats.rttMs = kIntStatValue;
1004 stats.bytesSent = kIntStatValue;
1005 stats.packetsSent = kIntStatValue;
1006 stats.bytesReceived = kIntStatValue;
1007 stats.packetsReceived = kIntStatValue;
1008 return 0;
1009 }
buildbot@webrtc.orgae740dd2014-06-17 10:56:41 +00001010 WEBRTC_FUNC(SetREDStatus, (int channel, bool enable, int redPayloadtype)) {
buildbot@webrtc.orgbfa758a2014-06-27 16:04:43 +00001011 return SetFECStatus(channel, enable, redPayloadtype);
1012 }
buildbot@webrtc.orgbfa758a2014-06-27 16:04:43 +00001013 // TODO(minyue): remove the below function when transition to SetREDStatus
1014 // is finished.
henrike@webrtc.org28e20752013-07-10 00:45:36 +00001015 WEBRTC_FUNC(SetFECStatus, (int channel, bool enable, int redPayloadtype)) {
1016 WEBRTC_CHECK_CHANNEL(channel);
buildbot@webrtc.orgae740dd2014-06-17 10:56:41 +00001017 channels_[channel]->red = enable;
1018 channels_[channel]->red_type = redPayloadtype;
henrike@webrtc.org28e20752013-07-10 00:45:36 +00001019 return 0;
1020 }
buildbot@webrtc.orgae740dd2014-06-17 10:56:41 +00001021 WEBRTC_FUNC(GetREDStatus, (int channel, bool& enable, int& redPayloadtype)) {
buildbot@webrtc.orgbfa758a2014-06-27 16:04:43 +00001022 return GetFECStatus(channel, enable, redPayloadtype);
1023 }
buildbot@webrtc.orgbfa758a2014-06-27 16:04:43 +00001024 // TODO(minyue): remove the below function when transition to GetREDStatus
1025 // is finished.
henrike@webrtc.org28e20752013-07-10 00:45:36 +00001026 WEBRTC_FUNC(GetFECStatus, (int channel, bool& enable, int& redPayloadtype)) {
1027 WEBRTC_CHECK_CHANNEL(channel);
buildbot@webrtc.orgae740dd2014-06-17 10:56:41 +00001028 enable = channels_[channel]->red;
1029 redPayloadtype = channels_[channel]->red_type;
henrike@webrtc.org28e20752013-07-10 00:45:36 +00001030 return 0;
1031 }
1032 WEBRTC_FUNC(SetNACKStatus, (int channel, bool enable, int maxNoPackets)) {
1033 WEBRTC_CHECK_CHANNEL(channel);
1034 channels_[channel]->nack = enable;
1035 channels_[channel]->nack_max_packets = maxNoPackets;
1036 return 0;
1037 }
1038 WEBRTC_STUB(StartRTPDump, (int channel, const char* fileNameUTF8,
1039 webrtc::RTPDirections direction));
1040 WEBRTC_STUB(StopRTPDump, (int channel, webrtc::RTPDirections direction));
1041 WEBRTC_STUB(RTPDumpIsActive, (int channel, webrtc::RTPDirections direction));
1042 WEBRTC_STUB(InsertExtraRTPPacket, (int channel, unsigned char payloadType,
1043 bool markerBit, const char* payloadData,
1044 unsigned short payloadSize));
1045 WEBRTC_STUB(GetLastRemoteTimeStamp, (int channel,
1046 uint32_t* lastRemoteTimeStamp));
1047
1048 // webrtc::VoEVideoSync
1049 WEBRTC_STUB(GetPlayoutBufferSize, (int& bufferMs));
1050 WEBRTC_STUB(GetPlayoutTimestamp, (int channel, unsigned int& timestamp));
wu@webrtc.org822fbd82013-08-15 23:38:54 +00001051 WEBRTC_STUB(GetRtpRtcp, (int, webrtc::RtpRtcp**, webrtc::RtpReceiver**));
henrike@webrtc.org28e20752013-07-10 00:45:36 +00001052 WEBRTC_STUB(SetInitTimestamp, (int channel, unsigned int timestamp));
1053 WEBRTC_STUB(SetInitSequenceNumber, (int channel, short sequenceNumber));
1054 WEBRTC_STUB(SetMinimumPlayoutDelay, (int channel, int delayMs));
1055 WEBRTC_STUB(SetInitialPlayoutDelay, (int channel, int delay_ms));
1056 WEBRTC_STUB(GetDelayEstimate, (int channel, int* jitter_buffer_delay_ms,
1057 int* playout_buffer_delay_ms));
1058 WEBRTC_STUB_CONST(GetLeastRequiredDelayMs, (int channel));
1059
1060 // webrtc::VoEVolumeControl
1061 WEBRTC_STUB(SetSpeakerVolume, (unsigned int));
1062 WEBRTC_STUB(GetSpeakerVolume, (unsigned int&));
1063 WEBRTC_STUB(SetSystemOutputMute, (bool));
1064 WEBRTC_STUB(GetSystemOutputMute, (bool&));
1065 WEBRTC_STUB(SetMicVolume, (unsigned int));
1066 WEBRTC_STUB(GetMicVolume, (unsigned int&));
1067 WEBRTC_STUB(SetInputMute, (int, bool));
1068 WEBRTC_STUB(GetInputMute, (int, bool&));
1069 WEBRTC_STUB(SetSystemInputMute, (bool));
1070 WEBRTC_STUB(GetSystemInputMute, (bool&));
1071 WEBRTC_STUB(GetSpeechInputLevel, (unsigned int&));
1072 WEBRTC_STUB(GetSpeechOutputLevel, (int, unsigned int&));
1073 WEBRTC_STUB(GetSpeechInputLevelFullRange, (unsigned int&));
1074 WEBRTC_STUB(GetSpeechOutputLevelFullRange, (int, unsigned int&));
1075 WEBRTC_FUNC(SetChannelOutputVolumeScaling, (int channel, float scale)) {
1076 WEBRTC_CHECK_CHANNEL(channel);
1077 channels_[channel]->volume_scale= scale;
1078 return 0;
1079 }
1080 WEBRTC_FUNC(GetChannelOutputVolumeScaling, (int channel, float& scale)) {
1081 WEBRTC_CHECK_CHANNEL(channel);
1082 scale = channels_[channel]->volume_scale;
1083 return 0;
1084 }
1085 WEBRTC_FUNC(SetOutputVolumePan, (int channel, float left, float right)) {
1086 WEBRTC_CHECK_CHANNEL(channel);
1087 channels_[channel]->volume_pan_left = left;
1088 channels_[channel]->volume_pan_right = right;
1089 return 0;
1090 }
1091 WEBRTC_FUNC(GetOutputVolumePan, (int channel, float& left, float& right)) {
1092 WEBRTC_CHECK_CHANNEL(channel);
1093 left = channels_[channel]->volume_pan_left;
1094 right = channels_[channel]->volume_pan_right;
1095 return 0;
1096 }
1097
1098 // webrtc::VoEAudioProcessing
1099 WEBRTC_FUNC(SetNsStatus, (bool enable, webrtc::NsModes mode)) {
1100 ns_enabled_ = enable;
1101 ns_mode_ = mode;
1102 return 0;
1103 }
1104 WEBRTC_FUNC(GetNsStatus, (bool& enabled, webrtc::NsModes& mode)) {
1105 enabled = ns_enabled_;
1106 mode = ns_mode_;
1107 return 0;
1108 }
1109
1110 WEBRTC_FUNC(SetAgcStatus, (bool enable, webrtc::AgcModes mode)) {
1111 agc_enabled_ = enable;
1112 agc_mode_ = mode;
1113 return 0;
1114 }
1115 WEBRTC_FUNC(GetAgcStatus, (bool& enabled, webrtc::AgcModes& mode)) {
1116 enabled = agc_enabled_;
1117 mode = agc_mode_;
1118 return 0;
1119 }
1120
1121 WEBRTC_FUNC(SetAgcConfig, (webrtc::AgcConfig config)) {
1122 agc_config_ = config;
1123 return 0;
1124 }
1125 WEBRTC_FUNC(GetAgcConfig, (webrtc::AgcConfig& config)) {
1126 config = agc_config_;
1127 return 0;
1128 }
1129 WEBRTC_FUNC(SetEcStatus, (bool enable, webrtc::EcModes mode)) {
1130 ec_enabled_ = enable;
1131 ec_mode_ = mode;
1132 return 0;
1133 }
1134 WEBRTC_FUNC(GetEcStatus, (bool& enabled, webrtc::EcModes& mode)) {
1135 enabled = ec_enabled_;
1136 mode = ec_mode_;
1137 return 0;
1138 }
1139 WEBRTC_STUB(EnableDriftCompensation, (bool enable))
1140 WEBRTC_BOOL_STUB(DriftCompensationEnabled, ())
1141 WEBRTC_VOID_STUB(SetDelayOffsetMs, (int offset))
1142 WEBRTC_STUB(DelayOffsetMs, ());
1143 WEBRTC_FUNC(SetAecmMode, (webrtc::AecmModes mode, bool enableCNG)) {
1144 aecm_mode_ = mode;
1145 cng_enabled_ = enableCNG;
1146 return 0;
1147 }
1148 WEBRTC_FUNC(GetAecmMode, (webrtc::AecmModes& mode, bool& enabledCNG)) {
1149 mode = aecm_mode_;
1150 enabledCNG = cng_enabled_;
1151 return 0;
1152 }
1153 WEBRTC_STUB(SetRxNsStatus, (int channel, bool enable, webrtc::NsModes mode));
1154 WEBRTC_STUB(GetRxNsStatus, (int channel, bool& enabled,
1155 webrtc::NsModes& mode));
wu@webrtc.org97077a32013-10-25 21:18:33 +00001156 WEBRTC_FUNC(SetRxAgcStatus, (int channel, bool enable,
1157 webrtc::AgcModes mode)) {
1158 channels_[channel]->rx_agc_enabled = enable;
1159 channels_[channel]->rx_agc_mode = mode;
1160 return 0;
1161 }
1162 WEBRTC_FUNC(GetRxAgcStatus, (int channel, bool& enabled,
1163 webrtc::AgcModes& mode)) {
1164 enabled = channels_[channel]->rx_agc_enabled;
1165 mode = channels_[channel]->rx_agc_mode;
1166 return 0;
1167 }
1168
1169 WEBRTC_FUNC(SetRxAgcConfig, (int channel, webrtc::AgcConfig config)) {
1170 channels_[channel]->rx_agc_config = config;
1171 return 0;
1172 }
1173 WEBRTC_FUNC(GetRxAgcConfig, (int channel, webrtc::AgcConfig& config)) {
1174 config = channels_[channel]->rx_agc_config;
1175 return 0;
1176 }
henrike@webrtc.org28e20752013-07-10 00:45:36 +00001177
1178 WEBRTC_STUB(RegisterRxVadObserver, (int, webrtc::VoERxVadCallback&));
1179 WEBRTC_STUB(DeRegisterRxVadObserver, (int channel));
1180 WEBRTC_STUB(VoiceActivityIndicator, (int channel));
1181 WEBRTC_FUNC(SetEcMetricsStatus, (bool enable)) {
1182 ec_metrics_enabled_ = enable;
1183 return 0;
1184 }
1185 WEBRTC_FUNC(GetEcMetricsStatus, (bool& enabled)) {
1186 enabled = ec_metrics_enabled_;
1187 return 0;
1188 }
1189 WEBRTC_STUB(GetEchoMetrics, (int& ERL, int& ERLE, int& RERL, int& A_NLP));
bjornv@webrtc.orgcc64a9c2015-02-05 12:52:44 +00001190 WEBRTC_STUB(GetEcDelayMetrics, (int& delay_median, int& delay_std,
1191 float& fraction_poor_delays));
henrike@webrtc.org28e20752013-07-10 00:45:36 +00001192
1193 WEBRTC_STUB(StartDebugRecording, (const char* fileNameUTF8));
wu@webrtc.org9caf2762013-12-11 18:25:07 +00001194 WEBRTC_STUB(StartDebugRecording, (FILE* handle));
henrike@webrtc.org28e20752013-07-10 00:45:36 +00001195 WEBRTC_STUB(StopDebugRecording, ());
1196
1197 WEBRTC_FUNC(SetTypingDetectionStatus, (bool enable)) {
1198 typing_detection_enabled_ = enable;
1199 return 0;
1200 }
1201 WEBRTC_FUNC(GetTypingDetectionStatus, (bool& enabled)) {
1202 enabled = typing_detection_enabled_;
1203 return 0;
1204 }
1205
1206 WEBRTC_STUB(TimeSinceLastTyping, (int& seconds));
1207 WEBRTC_STUB(SetTypingDetectionParameters, (int timeWindow,
1208 int costPerTyping,
1209 int reportingThreshold,
1210 int penaltyDecay,
1211 int typeEventDelay));
1212 int EnableHighPassFilter(bool enable) {
1213 highpass_filter_enabled_ = enable;
1214 return 0;
1215 }
1216 bool IsHighPassFilterEnabled() {
1217 return highpass_filter_enabled_;
1218 }
1219 bool IsStereoChannelSwappingEnabled() {
1220 return stereo_swapping_enabled_;
1221 }
1222 void EnableStereoChannelSwapping(bool enable) {
1223 stereo_swapping_enabled_ = enable;
1224 }
1225 bool WasSendTelephoneEventCalled(int channel, int event_code, int length_ms) {
1226 return (channels_[channel]->dtmf_info.dtmf_event_code == event_code &&
1227 channels_[channel]->dtmf_info.dtmf_out_of_band == true &&
1228 channels_[channel]->dtmf_info.dtmf_length_ms == length_ms);
1229 }
1230 bool WasPlayDtmfToneCalled(int event_code, int length_ms) {
1231 return (dtmf_info_.dtmf_event_code == event_code &&
1232 dtmf_info_.dtmf_length_ms == length_ms);
1233 }
1234 // webrtc::VoEExternalMedia
1235 WEBRTC_FUNC(RegisterExternalMediaProcessing,
1236 (int channel, webrtc::ProcessingTypes type,
1237 webrtc::VoEMediaProcess& processObject)) {
1238 WEBRTC_CHECK_CHANNEL(channel);
1239 if (channels_[channel]->media_processor_registered) {
1240 return -1;
1241 }
1242 channels_[channel]->media_processor_registered = true;
1243 media_processor_ = &processObject;
1244 return 0;
1245 }
1246 WEBRTC_FUNC(DeRegisterExternalMediaProcessing,
1247 (int channel, webrtc::ProcessingTypes type)) {
1248 WEBRTC_CHECK_CHANNEL(channel);
1249 if (!channels_[channel]->media_processor_registered) {
1250 return -1;
1251 }
1252 channels_[channel]->media_processor_registered = false;
1253 media_processor_ = NULL;
1254 return 0;
1255 }
1256 WEBRTC_STUB(SetExternalRecordingStatus, (bool enable));
1257 WEBRTC_STUB(SetExternalPlayoutStatus, (bool enable));
1258 WEBRTC_STUB(ExternalRecordingInsertData,
1259 (const int16_t speechData10ms[], int lengthSamples,
1260 int samplingFreqHz, int current_delay_ms));
1261 WEBRTC_STUB(ExternalPlayoutGetData,
1262 (int16_t speechData10ms[], int samplingFreqHz,
1263 int current_delay_ms, int& lengthSamples));
1264 WEBRTC_STUB(GetAudioFrame, (int channel, int desired_sample_rate_hz,
1265 webrtc::AudioFrame* frame));
1266 WEBRTC_STUB(SetExternalMixing, (int channel, bool enable));
Henrik Lundin64dad832015-05-11 12:44:23 +02001267 int GetNetEqCapacity() const {
1268 auto ch = channels_.find(last_channel_);
1269 ASSERT(ch != channels_.end());
1270 return ch->second->neteq_capacity;
1271 }
henrike@webrtc.org28e20752013-07-10 00:45:36 +00001272
1273 private:
1274 int GetNumDevices(int& num) {
1275#ifdef WIN32
1276 num = 1;
1277#else
1278 // On non-Windows platforms VE adds a special entry for the default device,
1279 // so if there is one physical device then there are two entries in the
1280 // list.
1281 num = 2;
1282#endif
1283 return 0;
1284 }
1285
1286 int GetDeviceName(int i, char* name, char* guid) {
1287 const char *s;
1288#ifdef WIN32
1289 if (0 == i) {
1290 s = kFakeDeviceName;
1291 } else {
1292 return -1;
1293 }
1294#else
1295 // See comment above.
1296 if (0 == i) {
1297 s = kFakeDefaultDeviceName;
1298 } else if (1 == i) {
1299 s = kFakeDeviceName;
1300 } else {
1301 return -1;
1302 }
1303#endif
1304 strcpy(name, s);
1305 guid[0] = '\0';
1306 return 0;
1307 }
1308
1309 bool inited_;
1310 int last_channel_;
1311 std::map<int, Channel*> channels_;
1312 bool fail_create_channel_;
1313 const cricket::AudioCodec* const* codecs_;
1314 int num_codecs_;
wu@webrtc.org05e7b442014-04-01 17:44:24 +00001315 int num_set_send_codecs_; // how many times we call SetSendCodec().
henrike@webrtc.org28e20752013-07-10 00:45:36 +00001316 bool ec_enabled_;
1317 bool ec_metrics_enabled_;
1318 bool cng_enabled_;
1319 bool ns_enabled_;
1320 bool agc_enabled_;
1321 bool highpass_filter_enabled_;
1322 bool stereo_swapping_enabled_;
1323 bool typing_detection_enabled_;
1324 webrtc::EcModes ec_mode_;
1325 webrtc::AecmModes aecm_mode_;
1326 webrtc::NsModes ns_mode_;
1327 webrtc::AgcModes agc_mode_;
1328 webrtc::AgcConfig agc_config_;
1329 webrtc::VoiceEngineObserver* observer_;
1330 int playout_fail_channel_;
1331 int send_fail_channel_;
1332 bool fail_start_recording_microphone_;
1333 bool recording_microphone_;
wu@webrtc.org97077a32013-10-25 21:18:33 +00001334 int recording_sample_rate_;
1335 int playout_sample_rate_;
henrike@webrtc.org28e20752013-07-10 00:45:36 +00001336 DtmfInfo dtmf_info_;
1337 webrtc::VoEMediaProcess* media_processor_;
buildbot@webrtc.orga8d8ad22014-07-16 14:23:08 +00001338 FakeAudioProcessing audio_processing_;
henrike@webrtc.org28e20752013-07-10 00:45:36 +00001339};
1340
henrike@webrtc.org79047f92014-03-06 23:46:59 +00001341#undef WEBRTC_CHECK_HEADER_EXTENSION_ID
1342
henrike@webrtc.org28e20752013-07-10 00:45:36 +00001343} // namespace cricket
1344
1345#endif // TALK_SESSION_PHONE_FAKEWEBRTCVOICEENGINE_H_