| 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 24 matching lines...) Expand all Loading... |
| 35 #include "webrtc/video_frame.h" | 35 #include "webrtc/video_frame.h" |
| 36 #include "webrtc/video_receive_stream.h" | 36 #include "webrtc/video_receive_stream.h" |
| 37 #include "webrtc/video_send_stream.h" | 37 #include "webrtc/video_send_stream.h" |
| 38 | 38 |
| 39 namespace cricket { | 39 namespace cricket { |
| 40 class FakeAudioReceiveStream : public webrtc::AudioReceiveStream { | 40 class FakeAudioReceiveStream : public webrtc::AudioReceiveStream { |
| 41 public: | 41 public: |
| 42 explicit FakeAudioReceiveStream( | 42 explicit FakeAudioReceiveStream( |
| 43 const webrtc::AudioReceiveStream::Config& config); | 43 const webrtc::AudioReceiveStream::Config& config); |
| 44 | 44 |
| 45 // webrtc::AudioReceiveStream implementation. |
| 46 webrtc::AudioReceiveStream::Stats GetStats() const override; |
| 47 |
| 45 const webrtc::AudioReceiveStream::Config& GetConfig() const; | 48 const webrtc::AudioReceiveStream::Config& GetConfig() const; |
| 46 void SetStats(const webrtc::AudioReceiveStream::Stats& stats); | 49 |
| 47 int received_packets() const { return received_packets_; } | 50 int received_packets() const { return received_packets_; } |
| 48 void IncrementReceivedPackets(); | 51 void IncrementReceivedPackets(); |
| 49 | 52 |
| 50 private: | 53 private: |
| 51 // webrtc::ReceiveStream implementation. | 54 // webrtc::ReceiveStream implementation. |
| 52 void Start() override {} | 55 void Start() override {} |
| 53 void Stop() override {} | 56 void Stop() override {} |
| 54 void SignalNetworkState(webrtc::NetworkState state) override {} | 57 void SignalNetworkState(webrtc::NetworkState state) override {} |
| 55 bool DeliverRtcp(const uint8_t* packet, size_t length) override { | 58 bool DeliverRtcp(const uint8_t* packet, size_t length) override { |
| 56 return true; | 59 return true; |
| 57 } | 60 } |
| 58 bool DeliverRtp(const uint8_t* packet, | 61 bool DeliverRtp(const uint8_t* packet, |
| 59 size_t length, | 62 size_t length, |
| 60 const webrtc::PacketTime& packet_time) override { | 63 const webrtc::PacketTime& packet_time) override { |
| 61 return true; | 64 return true; |
| 62 } | 65 } |
| 63 | 66 |
| 64 // webrtc::AudioReceiveStream implementation. | |
| 65 webrtc::AudioReceiveStream::Stats GetStats() const override { | |
| 66 return stats_; | |
| 67 } | |
| 68 | |
| 69 webrtc::AudioReceiveStream::Config config_; | 67 webrtc::AudioReceiveStream::Config config_; |
| 70 webrtc::AudioReceiveStream::Stats stats_; | |
| 71 int received_packets_; | 68 int received_packets_; |
| 72 }; | 69 }; |
| 73 | 70 |
| 74 class FakeVideoSendStream : public webrtc::VideoSendStream, | 71 class FakeVideoSendStream : public webrtc::VideoSendStream, |
| 75 public webrtc::VideoCaptureInput { | 72 public webrtc::VideoCaptureInput { |
| 76 public: | 73 public: |
| 77 FakeVideoSendStream(const webrtc::VideoSendStream::Config& config, | 74 FakeVideoSendStream(const webrtc::VideoSendStream::Config& config, |
| 78 const webrtc::VideoEncoderConfig& encoder_config); | 75 const webrtc::VideoEncoderConfig& encoder_config); |
| 79 webrtc::VideoSendStream::Config GetConfig() const; | 76 webrtc::VideoSendStream::Config GetConfig() const; |
| 80 webrtc::VideoEncoderConfig GetEncoderConfig() const; | 77 webrtc::VideoEncoderConfig GetEncoderConfig() const; |
| (...skipping 132 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 213 std::vector<FakeVideoSendStream*> video_send_streams_; | 210 std::vector<FakeVideoSendStream*> video_send_streams_; |
| 214 std::vector<FakeVideoReceiveStream*> video_receive_streams_; | 211 std::vector<FakeVideoReceiveStream*> video_receive_streams_; |
| 215 std::vector<FakeAudioReceiveStream*> audio_receive_streams_; | 212 std::vector<FakeAudioReceiveStream*> audio_receive_streams_; |
| 216 | 213 |
| 217 int num_created_send_streams_; | 214 int num_created_send_streams_; |
| 218 int num_created_receive_streams_; | 215 int num_created_receive_streams_; |
| 219 }; | 216 }; |
| 220 | 217 |
| 221 } // namespace cricket | 218 } // namespace cricket |
| 222 #endif // TALK_MEDIA_WEBRTC_WEBRTCVIDEOENGINE2_UNITTEST_H_ | 219 #endif // TALK_MEDIA_WEBRTC_WEBRTCVIDEOENGINE2_UNITTEST_H_ |
| OLD | NEW |