OLD | NEW |
1 /* | 1 /* |
2 * libjingle | 2 * libjingle |
3 * Copyright 2015 Google Inc. | 3 * Copyright 2015 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 183 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
194 } | 194 } |
195 | 195 |
196 void FakeVideoReceiveStream::SetStats( | 196 void FakeVideoReceiveStream::SetStats( |
197 const webrtc::VideoReceiveStream::Stats& stats) { | 197 const webrtc::VideoReceiveStream::Stats& stats) { |
198 stats_ = stats; | 198 stats_ = stats; |
199 } | 199 } |
200 | 200 |
201 FakeCall::FakeCall(const webrtc::Call::Config& config) | 201 FakeCall::FakeCall(const webrtc::Call::Config& config) |
202 : config_(config), | 202 : config_(config), |
203 network_state_(webrtc::kNetworkUp), | 203 network_state_(webrtc::kNetworkUp), |
| 204 on_packet_sent_called_(false), |
204 num_created_send_streams_(0), | 205 num_created_send_streams_(0), |
205 num_created_receive_streams_(0) { | 206 num_created_receive_streams_(0) {} |
206 } | |
207 | 207 |
208 FakeCall::~FakeCall() { | 208 FakeCall::~FakeCall() { |
209 EXPECT_EQ(0u, video_send_streams_.size()); | 209 EXPECT_EQ(0u, video_send_streams_.size()); |
210 EXPECT_EQ(0u, video_receive_streams_.size()); | 210 EXPECT_EQ(0u, video_receive_streams_.size()); |
211 EXPECT_EQ(0u, audio_receive_streams_.size()); | 211 EXPECT_EQ(0u, audio_receive_streams_.size()); |
212 } | 212 } |
213 | 213 |
214 webrtc::Call::Config FakeCall::GetConfig() const { | 214 webrtc::Call::Config FakeCall::GetConfig() const { |
215 return config_; | 215 return config_; |
216 } | 216 } |
(...skipping 12 matching lines...) Expand all Loading... |
229 | 229 |
230 const FakeAudioReceiveStream* FakeCall::GetAudioReceiveStream(uint32_t ssrc) { | 230 const FakeAudioReceiveStream* FakeCall::GetAudioReceiveStream(uint32_t ssrc) { |
231 for (const auto p : GetAudioReceiveStreams()) { | 231 for (const auto p : GetAudioReceiveStreams()) { |
232 if (p->GetConfig().rtp.remote_ssrc == ssrc) { | 232 if (p->GetConfig().rtp.remote_ssrc == ssrc) { |
233 return p; | 233 return p; |
234 } | 234 } |
235 } | 235 } |
236 return nullptr; | 236 return nullptr; |
237 } | 237 } |
238 | 238 |
| 239 bool FakeCall::on_packet_sent_called() const { |
| 240 return on_packet_sent_called_; |
| 241 } |
| 242 |
239 webrtc::NetworkState FakeCall::GetNetworkState() const { | 243 webrtc::NetworkState FakeCall::GetNetworkState() const { |
240 return network_state_; | 244 return network_state_; |
241 } | 245 } |
242 | 246 |
243 webrtc::AudioSendStream* FakeCall::CreateAudioSendStream( | 247 webrtc::AudioSendStream* FakeCall::CreateAudioSendStream( |
244 const webrtc::AudioSendStream::Config& config) { | 248 const webrtc::AudioSendStream::Config& config) { |
245 return nullptr; | 249 return nullptr; |
246 } | 250 } |
247 | 251 |
248 void FakeCall::DestroyAudioSendStream(webrtc::AudioSendStream* send_stream) { | 252 void FakeCall::DestroyAudioSendStream(webrtc::AudioSendStream* send_stream) { |
(...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
360 } | 364 } |
361 | 365 |
362 void FakeCall::SetBitrateConfig( | 366 void FakeCall::SetBitrateConfig( |
363 const webrtc::Call::Config::BitrateConfig& bitrate_config) { | 367 const webrtc::Call::Config::BitrateConfig& bitrate_config) { |
364 config_.bitrate_config = bitrate_config; | 368 config_.bitrate_config = bitrate_config; |
365 } | 369 } |
366 | 370 |
367 void FakeCall::SignalNetworkState(webrtc::NetworkState state) { | 371 void FakeCall::SignalNetworkState(webrtc::NetworkState state) { |
368 network_state_ = state; | 372 network_state_ = state; |
369 } | 373 } |
| 374 |
| 375 void FakeCall::OnPacketSent(const webrtc::SentPacket& sent_packet) { |
| 376 on_packet_sent_called_ = true; |
| 377 } |
370 } // namespace cricket | 378 } // namespace cricket |
OLD | NEW |