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 185 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
196 return channels_[channel]->last_rtp_packet_time; | 196 return channels_[channel]->last_rtp_packet_time; |
197 } | 197 } |
198 int GetSendCNPayloadType(int channel, bool wideband) { | 198 int GetSendCNPayloadType(int channel, bool wideband) { |
199 return (wideband) ? | 199 return (wideband) ? |
200 channels_[channel]->cn16_type : | 200 channels_[channel]->cn16_type : |
201 channels_[channel]->cn8_type; | 201 channels_[channel]->cn8_type; |
202 } | 202 } |
203 int GetSendREDPayloadType(int channel) { | 203 int GetSendREDPayloadType(int channel) { |
204 return channels_[channel]->red_type; | 204 return channels_[channel]->red_type; |
205 } | 205 } |
206 bool CheckPacket(int channel, const void* data, size_t len) { | |
207 bool result = !CheckNoPacket(channel); | |
208 if (result) { | |
209 std::string packet = channels_[channel]->packets.front(); | |
210 result = (packet == std::string(static_cast<const char*>(data), len)); | |
211 channels_[channel]->packets.pop_front(); | |
212 } | |
213 return result; | |
214 } | |
215 bool CheckNoPacket(int channel) { | |
216 return channels_[channel]->packets.empty(); | |
217 } | |
218 void set_playout_fail_channel(int channel) { | 206 void set_playout_fail_channel(int channel) { |
219 playout_fail_channel_ = channel; | 207 playout_fail_channel_ = channel; |
220 } | 208 } |
221 void set_fail_create_channel(bool fail_create_channel) { | 209 void set_fail_create_channel(bool fail_create_channel) { |
222 fail_create_channel_ = fail_create_channel; | 210 fail_create_channel_ = fail_create_channel; |
223 } | 211 } |
224 int AddChannel(const webrtc::Config& config) { | 212 int AddChannel(const webrtc::Config& config) { |
225 if (fail_create_channel_) { | 213 if (fail_create_channel_) { |
226 return -1; | 214 return -1; |
227 } | 215 } |
(...skipping 488 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
716 webrtc::NsModes ns_mode_ = webrtc::kNsDefault; | 704 webrtc::NsModes ns_mode_ = webrtc::kNsDefault; |
717 webrtc::AgcModes agc_mode_ = webrtc::kAgcDefault; | 705 webrtc::AgcModes agc_mode_ = webrtc::kAgcDefault; |
718 webrtc::AgcConfig agc_config_; | 706 webrtc::AgcConfig agc_config_; |
719 int playout_fail_channel_ = -1; | 707 int playout_fail_channel_ = -1; |
720 FakeAudioProcessing audio_processing_; | 708 FakeAudioProcessing audio_processing_; |
721 }; | 709 }; |
722 | 710 |
723 } // namespace cricket | 711 } // namespace cricket |
724 | 712 |
725 #endif // WEBRTC_MEDIA_ENGINE_FAKEWEBRTCVOICEENGINE_H_ | 713 #endif // WEBRTC_MEDIA_ENGINE_FAKEWEBRTCVOICEENGINE_H_ |
OLD | NEW |