| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (c) 2015 The WebRTC project authors. All Rights Reserved. | 2 * Copyright (c) 2015 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 17 matching lines...) Expand all Loading... |
| 28 #include "webrtc/call.h" | 28 #include "webrtc/call.h" |
| 29 #include "webrtc/video_frame.h" | 29 #include "webrtc/video_frame.h" |
| 30 #include "webrtc/video_receive_stream.h" | 30 #include "webrtc/video_receive_stream.h" |
| 31 #include "webrtc/video_send_stream.h" | 31 #include "webrtc/video_send_stream.h" |
| 32 | 32 |
| 33 namespace cricket { | 33 namespace cricket { |
| 34 class FakeAudioSendStream final : public webrtc::AudioSendStream { | 34 class FakeAudioSendStream final : public webrtc::AudioSendStream { |
| 35 public: | 35 public: |
| 36 struct TelephoneEvent { | 36 struct TelephoneEvent { |
| 37 int payload_type = -1; | 37 int payload_type = -1; |
| 38 uint8_t event_code = 0; | 38 int event_code = 0; |
| 39 uint32_t duration_ms = 0; | 39 int duration_ms = 0; |
| 40 }; | 40 }; |
| 41 | 41 |
| 42 explicit FakeAudioSendStream(const webrtc::AudioSendStream::Config& config); | 42 explicit FakeAudioSendStream(const webrtc::AudioSendStream::Config& config); |
| 43 | 43 |
| 44 const webrtc::AudioSendStream::Config& GetConfig() const; | 44 const webrtc::AudioSendStream::Config& GetConfig() const; |
| 45 void SetStats(const webrtc::AudioSendStream::Stats& stats); | 45 void SetStats(const webrtc::AudioSendStream::Stats& stats); |
| 46 TelephoneEvent GetLatestTelephoneEvent() const; | 46 TelephoneEvent GetLatestTelephoneEvent() const; |
| 47 bool IsSending() const { return sending_; } | 47 bool IsSending() const { return sending_; } |
| 48 | 48 |
| 49 private: | 49 private: |
| 50 // webrtc::SendStream implementation. | 50 // webrtc::SendStream implementation. |
| 51 void Start() override { sending_ = true; } | 51 void Start() override { sending_ = true; } |
| 52 void Stop() override { sending_ = false; } | 52 void Stop() override { sending_ = false; } |
| 53 void SignalNetworkState(webrtc::NetworkState state) override {} | 53 void SignalNetworkState(webrtc::NetworkState state) override {} |
| 54 bool DeliverRtcp(const uint8_t* packet, size_t length) override { | 54 bool DeliverRtcp(const uint8_t* packet, size_t length) override { |
| 55 return true; | 55 return true; |
| 56 } | 56 } |
| 57 | 57 |
| 58 // webrtc::AudioSendStream implementation. | 58 // webrtc::AudioSendStream implementation. |
| 59 bool SendTelephoneEvent(int payload_type, uint8_t event, | 59 bool SendTelephoneEvent(int payload_type, int event, |
| 60 uint32_t duration_ms) override; | 60 int duration_ms) override; |
| 61 webrtc::AudioSendStream::Stats GetStats() const override; | 61 webrtc::AudioSendStream::Stats GetStats() const override; |
| 62 | 62 |
| 63 TelephoneEvent latest_telephone_event_; | 63 TelephoneEvent latest_telephone_event_; |
| 64 webrtc::AudioSendStream::Config config_; | 64 webrtc::AudioSendStream::Config config_; |
| 65 webrtc::AudioSendStream::Stats stats_; | 65 webrtc::AudioSendStream::Stats stats_; |
| 66 bool sending_ = false; | 66 bool sending_ = false; |
| 67 }; | 67 }; |
| 68 | 68 |
| 69 class FakeAudioReceiveStream final : public webrtc::AudioReceiveStream { | 69 class FakeAudioReceiveStream final : public webrtc::AudioReceiveStream { |
| 70 public: | 70 public: |
| (...skipping 175 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 246 std::vector<FakeAudioSendStream*> audio_send_streams_; | 246 std::vector<FakeAudioSendStream*> audio_send_streams_; |
| 247 std::vector<FakeVideoReceiveStream*> video_receive_streams_; | 247 std::vector<FakeVideoReceiveStream*> video_receive_streams_; |
| 248 std::vector<FakeAudioReceiveStream*> audio_receive_streams_; | 248 std::vector<FakeAudioReceiveStream*> audio_receive_streams_; |
| 249 | 249 |
| 250 int num_created_send_streams_; | 250 int num_created_send_streams_; |
| 251 int num_created_receive_streams_; | 251 int num_created_receive_streams_; |
| 252 }; | 252 }; |
| 253 | 253 |
| 254 } // namespace cricket | 254 } // namespace cricket |
| 255 #endif // TALK_MEDIA_WEBRTC_WEBRTCVIDEOENGINE2_UNITTEST_H_ | 255 #endif // TALK_MEDIA_WEBRTC_WEBRTCVIDEOENGINE2_UNITTEST_H_ |
| OLD | NEW |