| 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 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 68 } | 68 } |
| 69 | 69 |
| 70 webrtc::AudioSendStream::Config config_; | 70 webrtc::AudioSendStream::Config config_; |
| 71 }; | 71 }; |
| 72 | 72 |
| 73 class FakeAudioReceiveStream : public webrtc::AudioReceiveStream { | 73 class FakeAudioReceiveStream : public webrtc::AudioReceiveStream { |
| 74 public: | 74 public: |
| 75 explicit FakeAudioReceiveStream( | 75 explicit FakeAudioReceiveStream( |
| 76 const webrtc::AudioReceiveStream::Config& config); | 76 const webrtc::AudioReceiveStream::Config& config); |
| 77 | 77 |
| 78 // webrtc::AudioReceiveStream implementation. | |
| 79 webrtc::AudioReceiveStream::Stats GetStats() const override; | |
| 80 | |
| 81 const webrtc::AudioReceiveStream::Config& GetConfig() const; | 78 const webrtc::AudioReceiveStream::Config& GetConfig() const; |
| 82 | 79 void SetStats(const webrtc::AudioReceiveStream::Stats& stats); |
| 83 int received_packets() const { return received_packets_; } | 80 int received_packets() const { return received_packets_; } |
| 84 void IncrementReceivedPackets(); | 81 void IncrementReceivedPackets(); |
| 85 | 82 |
| 86 private: | 83 private: |
| 87 // webrtc::ReceiveStream implementation. | 84 // webrtc::ReceiveStream implementation. |
| 88 void Start() override {} | 85 void Start() override {} |
| 89 void Stop() override {} | 86 void Stop() override {} |
| 90 void SignalNetworkState(webrtc::NetworkState state) override {} | 87 void SignalNetworkState(webrtc::NetworkState state) override {} |
| 91 bool DeliverRtcp(const uint8_t* packet, size_t length) override { | 88 bool DeliverRtcp(const uint8_t* packet, size_t length) override { |
| 92 return true; | 89 return true; |
| 93 } | 90 } |
| 94 bool DeliverRtp(const uint8_t* packet, | 91 bool DeliverRtp(const uint8_t* packet, |
| 95 size_t length, | 92 size_t length, |
| 96 const webrtc::PacketTime& packet_time) override { | 93 const webrtc::PacketTime& packet_time) override { |
| 97 return true; | 94 return true; |
| 98 } | 95 } |
| 99 | 96 |
| 97 // webrtc::AudioReceiveStream implementation. |
| 98 webrtc::AudioReceiveStream::Stats GetStats() const override { |
| 99 return stats_; |
| 100 } |
| 101 |
| 100 webrtc::AudioReceiveStream::Config config_; | 102 webrtc::AudioReceiveStream::Config config_; |
| 103 webrtc::AudioReceiveStream::Stats stats_; |
| 101 int received_packets_; | 104 int received_packets_; |
| 102 }; | 105 }; |
| 103 | 106 |
| 104 class FakeVideoSendStream : public webrtc::VideoSendStream, | 107 class FakeVideoSendStream : public webrtc::VideoSendStream, |
| 105 public webrtc::VideoCaptureInput { | 108 public webrtc::VideoCaptureInput { |
| 106 public: | 109 public: |
| 107 FakeVideoSendStream(const webrtc::VideoSendStream::Config& config, | 110 FakeVideoSendStream(const webrtc::VideoSendStream::Config& config, |
| 108 const webrtc::VideoEncoderConfig& encoder_config); | 111 const webrtc::VideoEncoderConfig& encoder_config); |
| 109 webrtc::VideoSendStream::Config GetConfig() const; | 112 webrtc::VideoSendStream::Config GetConfig() const; |
| 110 webrtc::VideoEncoderConfig GetEncoderConfig() const; | 113 webrtc::VideoEncoderConfig GetEncoderConfig() const; |
| (...skipping 135 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 246 std::vector<FakeAudioSendStream*> audio_send_streams_; | 249 std::vector<FakeAudioSendStream*> audio_send_streams_; |
| 247 std::vector<FakeVideoReceiveStream*> video_receive_streams_; | 250 std::vector<FakeVideoReceiveStream*> video_receive_streams_; |
| 248 std::vector<FakeAudioReceiveStream*> audio_receive_streams_; | 251 std::vector<FakeAudioReceiveStream*> audio_receive_streams_; |
| 249 | 252 |
| 250 int num_created_send_streams_; | 253 int num_created_send_streams_; |
| 251 int num_created_receive_streams_; | 254 int num_created_receive_streams_; |
| 252 }; | 255 }; |
| 253 | 256 |
| 254 } // namespace cricket | 257 } // namespace cricket |
| 255 #endif // TALK_MEDIA_WEBRTC_WEBRTCVIDEOENGINE2_UNITTEST_H_ | 258 #endif // TALK_MEDIA_WEBRTC_WEBRTCVIDEOENGINE2_UNITTEST_H_ |
| OLD | NEW |