| 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 10 matching lines...) Expand all Loading... |
| 21 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; | 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, | 22 * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, |
| 23 * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR | 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 | 24 * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF |
| 25 * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 25 * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
| 26 */ | 26 */ |
| 27 | 27 |
| 28 #include "talk/media/webrtc/fakewebrtccall.h" | 28 #include "talk/media/webrtc/fakewebrtccall.h" |
| 29 | 29 |
| 30 #include <algorithm> | 30 #include <algorithm> |
| 31 #include <utility> |
| 31 | 32 |
| 32 #include "talk/media/base/rtputils.h" | 33 #include "talk/media/base/rtputils.h" |
| 33 #include "webrtc/base/checks.h" | 34 #include "webrtc/base/checks.h" |
| 34 #include "webrtc/base/gunit.h" | 35 #include "webrtc/base/gunit.h" |
| 36 #include "webrtc/audio/audio_sink.h" |
| 35 | 37 |
| 36 namespace cricket { | 38 namespace cricket { |
| 37 FakeAudioSendStream::FakeAudioSendStream( | 39 FakeAudioSendStream::FakeAudioSendStream( |
| 38 const webrtc::AudioSendStream::Config& config) : config_(config) { | 40 const webrtc::AudioSendStream::Config& config) : config_(config) { |
| 39 RTC_DCHECK(config.voe_channel_id != -1); | 41 RTC_DCHECK(config.voe_channel_id != -1); |
| 40 } | 42 } |
| 41 | 43 |
| 42 const webrtc::AudioSendStream::Config& | 44 const webrtc::AudioSendStream::Config& |
| 43 FakeAudioSendStream::GetConfig() const { | 45 FakeAudioSendStream::GetConfig() const { |
| 44 return config_; | 46 return config_; |
| (...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 83 } | 85 } |
| 84 | 86 |
| 85 void FakeAudioReceiveStream::IncrementReceivedPackets() { | 87 void FakeAudioReceiveStream::IncrementReceivedPackets() { |
| 86 received_packets_++; | 88 received_packets_++; |
| 87 } | 89 } |
| 88 | 90 |
| 89 webrtc::AudioReceiveStream::Stats FakeAudioReceiveStream::GetStats() const { | 91 webrtc::AudioReceiveStream::Stats FakeAudioReceiveStream::GetStats() const { |
| 90 return stats_; | 92 return stats_; |
| 91 } | 93 } |
| 92 | 94 |
| 95 void FakeAudioReceiveStream::SetSink( |
| 96 rtc::scoped_ptr<webrtc::AudioSinkInterface> sink) { |
| 97 sink_ = std::move(sink); |
| 98 } |
| 99 |
| 93 FakeVideoSendStream::FakeVideoSendStream( | 100 FakeVideoSendStream::FakeVideoSendStream( |
| 94 const webrtc::VideoSendStream::Config& config, | 101 const webrtc::VideoSendStream::Config& config, |
| 95 const webrtc::VideoEncoderConfig& encoder_config) | 102 const webrtc::VideoEncoderConfig& encoder_config) |
| 96 : sending_(false), | 103 : sending_(false), |
| 97 config_(config), | 104 config_(config), |
| 98 codec_settings_set_(false), | 105 codec_settings_set_(false), |
| 99 num_swapped_frames_(0) { | 106 num_swapped_frames_(0) { |
| 100 RTC_DCHECK(config.encoder_settings.encoder != NULL); | 107 RTC_DCHECK(config.encoder_settings.encoder != NULL); |
| 101 ReconfigureVideoEncoder(encoder_config); | 108 ReconfigureVideoEncoder(encoder_config); |
| 102 } | 109 } |
| (...skipping 324 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 427 } | 434 } |
| 428 | 435 |
| 429 void FakeCall::SignalNetworkState(webrtc::NetworkState state) { | 436 void FakeCall::SignalNetworkState(webrtc::NetworkState state) { |
| 430 network_state_ = state; | 437 network_state_ = state; |
| 431 } | 438 } |
| 432 | 439 |
| 433 void FakeCall::OnSentPacket(const rtc::SentPacket& sent_packet) { | 440 void FakeCall::OnSentPacket(const rtc::SentPacket& sent_packet) { |
| 434 last_sent_packet_ = sent_packet; | 441 last_sent_packet_ = sent_packet; |
| 435 } | 442 } |
| 436 } // namespace cricket | 443 } // namespace cricket |
| OLD | NEW |