OLD | NEW |
1 /* | 1 /* |
2 * libjingle | 2 * libjingle |
3 * Copyright 2010 Google Inc. | 3 * Copyright 2010 Google Inc. |
4 * | 4 * |
5 * Redistribution and use in source and binary forms, with or without | 5 * Redistribution and use in source and binary forms, with or without |
6 * modification, are permitted provided that the following conditions are met: | 6 * modification, are permitted provided that the following conditions are met: |
7 * | 7 * |
8 * 1. Redistributions of source code must retain the above copyright notice, | 8 * 1. Redistributions of source code must retain the above copyright notice, |
9 * this list of conditions and the following disclaimer. | 9 * this list of conditions and the following disclaimer. |
10 * 2. Redistributions in binary form must reproduce the above copyright notice, | 10 * 2. Redistributions in binary form must reproduce the above copyright notice, |
(...skipping 169 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
180 return experimental_ns_enabled_; | 180 return experimental_ns_enabled_; |
181 } | 181 } |
182 | 182 |
183 private: | 183 private: |
184 bool experimental_ns_enabled_; | 184 bool experimental_ns_enabled_; |
185 }; | 185 }; |
186 | 186 |
187 class FakeWebRtcVoiceEngine | 187 class FakeWebRtcVoiceEngine |
188 : public webrtc::VoEAudioProcessing, | 188 : public webrtc::VoEAudioProcessing, |
189 public webrtc::VoEBase, public webrtc::VoECodec, public webrtc::VoEDtmf, | 189 public webrtc::VoEBase, public webrtc::VoECodec, public webrtc::VoEDtmf, |
190 public webrtc::VoEFile, public webrtc::VoEHardware, | 190 public webrtc::VoEHardware, |
191 public webrtc::VoEExternalMedia, public webrtc::VoENetEqStats, | 191 public webrtc::VoEExternalMedia, public webrtc::VoENetEqStats, |
192 public webrtc::VoENetwork, public webrtc::VoERTP_RTCP, | 192 public webrtc::VoENetwork, public webrtc::VoERTP_RTCP, |
193 public webrtc::VoEVideoSync, public webrtc::VoEVolumeControl { | 193 public webrtc::VoEVideoSync, public webrtc::VoEVolumeControl { |
194 public: | 194 public: |
195 struct DtmfInfo { | 195 struct DtmfInfo { |
196 DtmfInfo() | 196 DtmfInfo() |
197 : dtmf_event_code(-1), | 197 : dtmf_event_code(-1), |
198 dtmf_out_of_band(false), | 198 dtmf_out_of_band(false), |
199 dtmf_length_ms(-1) {} | 199 dtmf_length_ms(-1) {} |
200 int dtmf_event_code; | 200 int dtmf_event_code; |
201 bool dtmf_out_of_band; | 201 bool dtmf_out_of_band; |
202 int dtmf_length_ms; | 202 int dtmf_length_ms; |
203 }; | 203 }; |
204 struct Channel { | 204 struct Channel { |
205 explicit Channel() | 205 explicit Channel() |
206 : external_transport(false), | 206 : external_transport(false), |
207 send(false), | 207 send(false), |
208 playout(false), | 208 playout(false), |
209 volume_scale(1.0), | 209 volume_scale(1.0), |
210 volume_pan_left(1.0), | 210 volume_pan_left(1.0), |
211 volume_pan_right(1.0), | 211 volume_pan_right(1.0), |
212 file(false), | |
213 vad(false), | 212 vad(false), |
214 codec_fec(false), | 213 codec_fec(false), |
215 max_encoding_bandwidth(0), | 214 max_encoding_bandwidth(0), |
216 opus_dtx(false), | 215 opus_dtx(false), |
217 red(false), | 216 red(false), |
218 nack(false), | 217 nack(false), |
219 media_processor_registered(false), | 218 media_processor_registered(false), |
220 rx_agc_enabled(false), | 219 rx_agc_enabled(false), |
221 rx_agc_mode(webrtc::kAgcDefault), | 220 rx_agc_mode(webrtc::kAgcDefault), |
222 cn8_type(13), | 221 cn8_type(13), |
(...skipping 11 matching lines...) Expand all Loading... |
234 neteq_fast_accelerate(false) { | 233 neteq_fast_accelerate(false) { |
235 memset(&send_codec, 0, sizeof(send_codec)); | 234 memset(&send_codec, 0, sizeof(send_codec)); |
236 memset(&rx_agc_config, 0, sizeof(rx_agc_config)); | 235 memset(&rx_agc_config, 0, sizeof(rx_agc_config)); |
237 } | 236 } |
238 bool external_transport; | 237 bool external_transport; |
239 bool send; | 238 bool send; |
240 bool playout; | 239 bool playout; |
241 float volume_scale; | 240 float volume_scale; |
242 float volume_pan_left; | 241 float volume_pan_left; |
243 float volume_pan_right; | 242 float volume_pan_right; |
244 bool file; | |
245 bool vad; | 243 bool vad; |
246 bool codec_fec; | 244 bool codec_fec; |
247 int max_encoding_bandwidth; | 245 int max_encoding_bandwidth; |
248 bool opus_dtx; | 246 bool opus_dtx; |
249 bool red; | 247 bool red; |
250 bool nack; | 248 bool nack; |
251 bool media_processor_registered; | 249 bool media_processor_registered; |
252 bool rx_agc_enabled; | 250 bool rx_agc_enabled; |
253 webrtc::AgcModes rx_agc_mode; | 251 webrtc::AgcModes rx_agc_mode; |
254 webrtc::AgcConfig rx_agc_config; | 252 webrtc::AgcConfig rx_agc_config; |
(...skipping 461 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
716 WEBRTC_STUB(SetDtmfFeedbackStatus, (bool enable, bool directFeedback)); | 714 WEBRTC_STUB(SetDtmfFeedbackStatus, (bool enable, bool directFeedback)); |
717 WEBRTC_STUB(GetDtmfFeedbackStatus, (bool& enabled, bool& directFeedback)); | 715 WEBRTC_STUB(GetDtmfFeedbackStatus, (bool& enabled, bool& directFeedback)); |
718 | 716 |
719 WEBRTC_FUNC(PlayDtmfTone, | 717 WEBRTC_FUNC(PlayDtmfTone, |
720 (int event_code, int length_ms = 200, int attenuation_db = 10)) { | 718 (int event_code, int length_ms = 200, int attenuation_db = 10)) { |
721 dtmf_info_.dtmf_event_code = event_code; | 719 dtmf_info_.dtmf_event_code = event_code; |
722 dtmf_info_.dtmf_length_ms = length_ms; | 720 dtmf_info_.dtmf_length_ms = length_ms; |
723 return 0; | 721 return 0; |
724 } | 722 } |
725 | 723 |
726 // webrtc::VoEFile | |
727 WEBRTC_FUNC(StartPlayingFileLocally, (int channel, const char* fileNameUTF8, | |
728 bool loop, webrtc::FileFormats format, | |
729 float volumeScaling, int startPointMs, | |
730 int stopPointMs)) { | |
731 WEBRTC_CHECK_CHANNEL(channel); | |
732 channels_[channel]->file = true; | |
733 return 0; | |
734 } | |
735 WEBRTC_FUNC(StartPlayingFileLocally, (int channel, webrtc::InStream* stream, | |
736 webrtc::FileFormats format, | |
737 float volumeScaling, int startPointMs, | |
738 int stopPointMs)) { | |
739 WEBRTC_CHECK_CHANNEL(channel); | |
740 channels_[channel]->file = true; | |
741 return 0; | |
742 } | |
743 WEBRTC_FUNC(StopPlayingFileLocally, (int channel)) { | |
744 WEBRTC_CHECK_CHANNEL(channel); | |
745 channels_[channel]->file = false; | |
746 return 0; | |
747 } | |
748 WEBRTC_FUNC(IsPlayingFileLocally, (int channel)) { | |
749 WEBRTC_CHECK_CHANNEL(channel); | |
750 return (channels_[channel]->file) ? 1 : 0; | |
751 } | |
752 WEBRTC_STUB(StartPlayingFileAsMicrophone, (int channel, | |
753 const char* fileNameUTF8, | |
754 bool loop, | |
755 bool mixWithMicrophone, | |
756 webrtc::FileFormats format, | |
757 float volumeScaling)); | |
758 WEBRTC_STUB(StartPlayingFileAsMicrophone, (int channel, | |
759 webrtc::InStream* stream, | |
760 bool mixWithMicrophone, | |
761 webrtc::FileFormats format, | |
762 float volumeScaling)); | |
763 WEBRTC_STUB(StopPlayingFileAsMicrophone, (int channel)); | |
764 WEBRTC_STUB(IsPlayingFileAsMicrophone, (int channel)); | |
765 WEBRTC_STUB(StartRecordingPlayout, (int channel, const char* fileNameUTF8, | |
766 webrtc::CodecInst* compression, | |
767 int maxSizeBytes)); | |
768 WEBRTC_STUB(StartRecordingPlayout, (int channel, webrtc::OutStream* stream, | |
769 webrtc::CodecInst* compression)); | |
770 WEBRTC_STUB(StopRecordingPlayout, (int channel)); | |
771 WEBRTC_FUNC(StartRecordingMicrophone, (const char* fileNameUTF8, | |
772 webrtc::CodecInst* compression, | |
773 int maxSizeBytes)) { | |
774 return 0; | |
775 } | |
776 WEBRTC_FUNC(StartRecordingMicrophone, (webrtc::OutStream* stream, | |
777 webrtc::CodecInst* compression)) { | |
778 return 0; | |
779 } | |
780 WEBRTC_FUNC(StopRecordingMicrophone, ()) { | |
781 return 0; | |
782 } | |
783 | |
784 // webrtc::VoEHardware | 724 // webrtc::VoEHardware |
785 WEBRTC_FUNC(GetNumOfRecordingDevices, (int& num)) { | 725 WEBRTC_FUNC(GetNumOfRecordingDevices, (int& num)) { |
786 return GetNumDevices(num); | 726 return GetNumDevices(num); |
787 } | 727 } |
788 WEBRTC_FUNC(GetNumOfPlayoutDevices, (int& num)) { | 728 WEBRTC_FUNC(GetNumOfPlayoutDevices, (int& num)) { |
789 return GetNumDevices(num); | 729 return GetNumDevices(num); |
790 } | 730 } |
791 WEBRTC_FUNC(GetRecordingDeviceName, (int i, char* name, char* guid)) { | 731 WEBRTC_FUNC(GetRecordingDeviceName, (int i, char* name, char* guid)) { |
792 return GetDeviceName(i, name, guid); | 732 return GetDeviceName(i, name, guid); |
793 } | 733 } |
(...skipping 467 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1261 DtmfInfo dtmf_info_; | 1201 DtmfInfo dtmf_info_; |
1262 webrtc::VoEMediaProcess* media_processor_; | 1202 webrtc::VoEMediaProcess* media_processor_; |
1263 FakeAudioProcessing audio_processing_; | 1203 FakeAudioProcessing audio_processing_; |
1264 }; | 1204 }; |
1265 | 1205 |
1266 #undef WEBRTC_CHECK_HEADER_EXTENSION_ID | 1206 #undef WEBRTC_CHECK_HEADER_EXTENSION_ID |
1267 | 1207 |
1268 } // namespace cricket | 1208 } // namespace cricket |
1269 | 1209 |
1270 #endif // TALK_SESSION_PHONE_FAKEWEBRTCVOICEENGINE_H_ | 1210 #endif // TALK_SESSION_PHONE_FAKEWEBRTCVOICEENGINE_H_ |
OLD | NEW |