OLD | NEW |
1 /* | 1 /* |
2 * Copyright (c) 2010 The WebRTC project authors. All Rights Reserved. | 2 * Copyright (c) 2010 The WebRTC project authors. All Rights Reserved. |
3 * | 3 * |
4 * Use of this source code is governed by a BSD-style license | 4 * Use of this source code is governed by a BSD-style license |
5 * that can be found in the LICENSE file in the root of the source | 5 * that can be found in the LICENSE file in the root of the source |
6 * tree. An additional intellectual property rights grant can be found | 6 * tree. An additional intellectual property rights grant can be found |
7 * in the file PATENTS. All contributing project authors may | 7 * in the file PATENTS. All contributing project authors may |
8 * be found in the AUTHORS file in the root of the source tree. | 8 * be found in the AUTHORS file in the root of the source tree. |
9 */ | 9 */ |
10 | 10 |
(...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
127 struct Channel { | 127 struct Channel { |
128 Channel() { | 128 Channel() { |
129 memset(&send_codec, 0, sizeof(send_codec)); | 129 memset(&send_codec, 0, sizeof(send_codec)); |
130 } | 130 } |
131 bool playout = false; | 131 bool playout = false; |
132 float volume_scale = 1.0f; | 132 float volume_scale = 1.0f; |
133 bool vad = false; | 133 bool vad = false; |
134 bool codec_fec = false; | 134 bool codec_fec = false; |
135 int max_encoding_bandwidth = 0; | 135 int max_encoding_bandwidth = 0; |
136 bool opus_dtx = false; | 136 bool opus_dtx = false; |
137 bool red = false; | |
138 bool nack = false; | 137 bool nack = false; |
139 int cn8_type = 13; | 138 int cn8_type = 13; |
140 int cn16_type = 105; | 139 int cn16_type = 105; |
141 int red_type = 117; | |
142 int nack_max_packets = 0; | 140 int nack_max_packets = 0; |
143 uint32_t send_ssrc = 0; | 141 uint32_t send_ssrc = 0; |
144 int associate_send_channel = -1; | 142 int associate_send_channel = -1; |
145 std::vector<webrtc::CodecInst> recv_codecs; | 143 std::vector<webrtc::CodecInst> recv_codecs; |
146 webrtc::CodecInst send_codec; | 144 webrtc::CodecInst send_codec; |
147 int neteq_capacity = -1; | 145 int neteq_capacity = -1; |
148 bool neteq_fast_accelerate = false; | 146 bool neteq_fast_accelerate = false; |
149 }; | 147 }; |
150 | 148 |
151 FakeWebRtcVoiceEngine() { | 149 FakeWebRtcVoiceEngine() { |
(...skipping 13 matching lines...) Expand all Loading... |
165 } | 163 } |
166 bool GetPlayout(int channel) { | 164 bool GetPlayout(int channel) { |
167 return channels_[channel]->playout; | 165 return channels_[channel]->playout; |
168 } | 166 } |
169 bool GetVAD(int channel) { | 167 bool GetVAD(int channel) { |
170 return channels_[channel]->vad; | 168 return channels_[channel]->vad; |
171 } | 169 } |
172 bool GetOpusDtx(int channel) { | 170 bool GetOpusDtx(int channel) { |
173 return channels_[channel]->opus_dtx; | 171 return channels_[channel]->opus_dtx; |
174 } | 172 } |
175 bool GetRED(int channel) { | |
176 return channels_[channel]->red; | |
177 } | |
178 bool GetCodecFEC(int channel) { | 173 bool GetCodecFEC(int channel) { |
179 return channels_[channel]->codec_fec; | 174 return channels_[channel]->codec_fec; |
180 } | 175 } |
181 int GetMaxEncodingBandwidth(int channel) { | 176 int GetMaxEncodingBandwidth(int channel) { |
182 return channels_[channel]->max_encoding_bandwidth; | 177 return channels_[channel]->max_encoding_bandwidth; |
183 } | 178 } |
184 bool GetNACK(int channel) { | 179 bool GetNACK(int channel) { |
185 return channels_[channel]->nack; | 180 return channels_[channel]->nack; |
186 } | 181 } |
187 int GetNACKMaxPackets(int channel) { | 182 int GetNACKMaxPackets(int channel) { |
188 return channels_[channel]->nack_max_packets; | 183 return channels_[channel]->nack_max_packets; |
189 } | 184 } |
190 int GetSendCNPayloadType(int channel, bool wideband) { | 185 int GetSendCNPayloadType(int channel, bool wideband) { |
191 return (wideband) ? | 186 return (wideband) ? |
192 channels_[channel]->cn16_type : | 187 channels_[channel]->cn16_type : |
193 channels_[channel]->cn8_type; | 188 channels_[channel]->cn8_type; |
194 } | 189 } |
195 int GetSendREDPayloadType(int channel) { | |
196 return channels_[channel]->red_type; | |
197 } | |
198 void set_playout_fail_channel(int channel) { | 190 void set_playout_fail_channel(int channel) { |
199 playout_fail_channel_ = channel; | 191 playout_fail_channel_ = channel; |
200 } | 192 } |
201 void set_fail_create_channel(bool fail_create_channel) { | 193 void set_fail_create_channel(bool fail_create_channel) { |
202 fail_create_channel_ = fail_create_channel; | 194 fail_create_channel_ = fail_create_channel; |
203 } | 195 } |
204 int AddChannel(const webrtc::Config& config) { | 196 int AddChannel(const webrtc::Config& config) { |
205 if (fail_create_channel_) { | 197 if (fail_create_channel_) { |
206 return -1; | 198 return -1; |
207 } | 199 } |
(...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
297 | 289 |
298 // webrtc::VoECodec | 290 // webrtc::VoECodec |
299 WEBRTC_STUB(NumOfCodecs, ()); | 291 WEBRTC_STUB(NumOfCodecs, ()); |
300 WEBRTC_STUB(GetCodec, (int index, webrtc::CodecInst& codec)); | 292 WEBRTC_STUB(GetCodec, (int index, webrtc::CodecInst& codec)); |
301 WEBRTC_FUNC(SetSendCodec, (int channel, const webrtc::CodecInst& codec)) { | 293 WEBRTC_FUNC(SetSendCodec, (int channel, const webrtc::CodecInst& codec)) { |
302 WEBRTC_CHECK_CHANNEL(channel); | 294 WEBRTC_CHECK_CHANNEL(channel); |
303 // To match the behavior of the real implementation. | 295 // To match the behavior of the real implementation. |
304 if (_stricmp(codec.plname, "telephone-event") == 0 || | 296 if (_stricmp(codec.plname, "telephone-event") == 0 || |
305 _stricmp(codec.plname, "audio/telephone-event") == 0 || | 297 _stricmp(codec.plname, "audio/telephone-event") == 0 || |
306 _stricmp(codec.plname, "CN") == 0 || | 298 _stricmp(codec.plname, "CN") == 0 || |
307 _stricmp(codec.plname, "red") == 0 ) { | 299 _stricmp(codec.plname, "red") == 0) { |
308 return -1; | 300 return -1; |
309 } | 301 } |
310 channels_[channel]->send_codec = codec; | 302 channels_[channel]->send_codec = codec; |
311 ++num_set_send_codecs_; | 303 ++num_set_send_codecs_; |
312 return 0; | 304 return 0; |
313 } | 305 } |
314 WEBRTC_FUNC(GetSendCodec, (int channel, webrtc::CodecInst& codec)) { | 306 WEBRTC_FUNC(GetSendCodec, (int channel, webrtc::CodecInst& codec)) { |
315 WEBRTC_CHECK_CHANNEL(channel); | 307 WEBRTC_CHECK_CHANNEL(channel); |
316 codec = channels_[channel]->send_codec; | 308 codec = channels_[channel]->send_codec; |
317 return 0; | 309 return 0; |
(...skipping 158 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
476 unsigned int& timestamp, | 468 unsigned int& timestamp, |
477 unsigned int& playoutTimestamp, | 469 unsigned int& playoutTimestamp, |
478 unsigned int* jitter, | 470 unsigned int* jitter, |
479 unsigned short* fractionLost)); | 471 unsigned short* fractionLost)); |
480 WEBRTC_STUB(GetRemoteRTCPReportBlocks, | 472 WEBRTC_STUB(GetRemoteRTCPReportBlocks, |
481 (int channel, std::vector<webrtc::ReportBlock>* receive_blocks)); | 473 (int channel, std::vector<webrtc::ReportBlock>* receive_blocks)); |
482 WEBRTC_STUB(GetRTPStatistics, (int channel, unsigned int& averageJitterMs, | 474 WEBRTC_STUB(GetRTPStatistics, (int channel, unsigned int& averageJitterMs, |
483 unsigned int& maxJitterMs, | 475 unsigned int& maxJitterMs, |
484 unsigned int& discardedPackets)); | 476 unsigned int& discardedPackets)); |
485 WEBRTC_STUB(GetRTCPStatistics, (int channel, webrtc::CallStatistics& stats)); | 477 WEBRTC_STUB(GetRTCPStatistics, (int channel, webrtc::CallStatistics& stats)); |
486 WEBRTC_FUNC(SetREDStatus, (int channel, bool enable, int redPayloadtype)) { | 478 WEBRTC_STUB(SetREDStatus, (int channel, bool enable, int redPayloadtype)); |
487 WEBRTC_CHECK_CHANNEL(channel); | 479 WEBRTC_STUB(GetREDStatus, (int channel, bool& enable, int& redPayloadtype)); |
488 channels_[channel]->red = enable; | |
489 channels_[channel]->red_type = redPayloadtype; | |
490 return 0; | |
491 } | |
492 WEBRTC_FUNC(GetREDStatus, (int channel, bool& enable, int& redPayloadtype)) { | |
493 WEBRTC_CHECK_CHANNEL(channel); | |
494 enable = channels_[channel]->red; | |
495 redPayloadtype = channels_[channel]->red_type; | |
496 return 0; | |
497 } | |
498 WEBRTC_FUNC(SetNACKStatus, (int channel, bool enable, int maxNoPackets)) { | 480 WEBRTC_FUNC(SetNACKStatus, (int channel, bool enable, int maxNoPackets)) { |
499 WEBRTC_CHECK_CHANNEL(channel); | 481 WEBRTC_CHECK_CHANNEL(channel); |
500 channels_[channel]->nack = enable; | 482 channels_[channel]->nack = enable; |
501 channels_[channel]->nack_max_packets = maxNoPackets; | 483 channels_[channel]->nack_max_packets = maxNoPackets; |
502 return 0; | 484 return 0; |
503 } | 485 } |
504 | 486 |
505 // webrtc::VoEVolumeControl | 487 // webrtc::VoEVolumeControl |
506 WEBRTC_STUB(SetSpeakerVolume, (unsigned int)); | 488 WEBRTC_STUB(SetSpeakerVolume, (unsigned int)); |
507 WEBRTC_STUB(GetSpeakerVolume, (unsigned int&)); | 489 WEBRTC_STUB(GetSpeakerVolume, (unsigned int&)); |
(...skipping 157 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
665 webrtc::NsModes ns_mode_ = webrtc::kNsDefault; | 647 webrtc::NsModes ns_mode_ = webrtc::kNsDefault; |
666 webrtc::AgcModes agc_mode_ = webrtc::kAgcDefault; | 648 webrtc::AgcModes agc_mode_ = webrtc::kAgcDefault; |
667 webrtc::AgcConfig agc_config_; | 649 webrtc::AgcConfig agc_config_; |
668 int playout_fail_channel_ = -1; | 650 int playout_fail_channel_ = -1; |
669 FakeAudioProcessing audio_processing_; | 651 FakeAudioProcessing audio_processing_; |
670 }; | 652 }; |
671 | 653 |
672 } // namespace cricket | 654 } // namespace cricket |
673 | 655 |
674 #endif // WEBRTC_MEDIA_ENGINE_FAKEWEBRTCVOICEENGINE_H_ | 656 #endif // WEBRTC_MEDIA_ENGINE_FAKEWEBRTCVOICEENGINE_H_ |
OLD | NEW |