| 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 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 46 #include "webrtc/video_receive_stream.h" | 46 #include "webrtc/video_receive_stream.h" |
| 47 #include "webrtc/video_send_stream.h" | 47 #include "webrtc/video_send_stream.h" |
| 48 | 48 |
| 49 namespace cricket { | 49 namespace cricket { |
| 50 | 50 |
| 51 class FakeAudioSendStream : public webrtc::AudioSendStream { | 51 class FakeAudioSendStream : public webrtc::AudioSendStream { |
| 52 public: | 52 public: |
| 53 explicit FakeAudioSendStream( | 53 explicit FakeAudioSendStream( |
| 54 const webrtc::AudioSendStream::Config& config); | 54 const webrtc::AudioSendStream::Config& config); |
| 55 | 55 |
| 56 // webrtc::AudioSendStream implementation. | |
| 57 webrtc::AudioSendStream::Stats GetStats() const override; | |
| 58 | |
| 59 const webrtc::AudioSendStream::Config& GetConfig() const; | 56 const webrtc::AudioSendStream::Config& GetConfig() const; |
| 57 void SetStats(const webrtc::AudioSendStream::Stats& stats); |
| 60 | 58 |
| 61 private: | 59 private: |
| 62 // webrtc::SendStream implementation. | 60 // webrtc::SendStream implementation. |
| 63 void Start() override {} | 61 void Start() override {} |
| 64 void Stop() override {} | 62 void Stop() override {} |
| 65 void SignalNetworkState(webrtc::NetworkState state) override {} | 63 void SignalNetworkState(webrtc::NetworkState state) override {} |
| 66 bool DeliverRtcp(const uint8_t* packet, size_t length) override { | 64 bool DeliverRtcp(const uint8_t* packet, size_t length) override { |
| 67 return true; | 65 return true; |
| 68 } | 66 } |
| 69 | 67 |
| 68 // webrtc::AudioSendStream implementation. |
| 69 webrtc::AudioSendStream::Stats GetStats() const override; |
| 70 |
| 70 webrtc::AudioSendStream::Config config_; | 71 webrtc::AudioSendStream::Config config_; |
| 72 webrtc::AudioSendStream::Stats stats_; |
| 71 }; | 73 }; |
| 72 | 74 |
| 73 class FakeAudioReceiveStream : public webrtc::AudioReceiveStream { | 75 class FakeAudioReceiveStream : public webrtc::AudioReceiveStream { |
| 74 public: | 76 public: |
| 75 explicit FakeAudioReceiveStream( | 77 explicit FakeAudioReceiveStream( |
| 76 const webrtc::AudioReceiveStream::Config& config); | 78 const webrtc::AudioReceiveStream::Config& config); |
| 77 | 79 |
| 78 const webrtc::AudioReceiveStream::Config& GetConfig() const; | 80 const webrtc::AudioReceiveStream::Config& GetConfig() const; |
| 79 void SetStats(const webrtc::AudioReceiveStream::Stats& stats); | 81 void SetStats(const webrtc::AudioReceiveStream::Stats& stats); |
| 80 int received_packets() const { return received_packets_; } | 82 int received_packets() const { return received_packets_; } |
| 81 void IncrementReceivedPackets(); | 83 void IncrementReceivedPackets(); |
| 82 | 84 |
| 83 private: | 85 private: |
| 84 // webrtc::ReceiveStream implementation. | 86 // webrtc::ReceiveStream implementation. |
| 85 void Start() override {} | 87 void Start() override {} |
| 86 void Stop() override {} | 88 void Stop() override {} |
| 87 void SignalNetworkState(webrtc::NetworkState state) override {} | 89 void SignalNetworkState(webrtc::NetworkState state) override {} |
| 88 bool DeliverRtcp(const uint8_t* packet, size_t length) override { | 90 bool DeliverRtcp(const uint8_t* packet, size_t length) override { |
| 89 return true; | 91 return true; |
| 90 } | 92 } |
| 91 bool DeliverRtp(const uint8_t* packet, | 93 bool DeliverRtp(const uint8_t* packet, |
| 92 size_t length, | 94 size_t length, |
| 93 const webrtc::PacketTime& packet_time) override { | 95 const webrtc::PacketTime& packet_time) override { |
| 94 return true; | 96 return true; |
| 95 } | 97 } |
| 96 | 98 |
| 97 // webrtc::AudioReceiveStream implementation. | 99 // webrtc::AudioReceiveStream implementation. |
| 98 webrtc::AudioReceiveStream::Stats GetStats() const override { | 100 webrtc::AudioReceiveStream::Stats GetStats() const override; |
| 99 return stats_; | |
| 100 } | |
| 101 | 101 |
| 102 webrtc::AudioReceiveStream::Config config_; | 102 webrtc::AudioReceiveStream::Config config_; |
| 103 webrtc::AudioReceiveStream::Stats stats_; | 103 webrtc::AudioReceiveStream::Stats stats_; |
| 104 int received_packets_; | 104 int received_packets_; |
| 105 }; | 105 }; |
| 106 | 106 |
| 107 class FakeVideoSendStream : public webrtc::VideoSendStream, | 107 class FakeVideoSendStream : public webrtc::VideoSendStream, |
| 108 public webrtc::VideoCaptureInput { | 108 public webrtc::VideoCaptureInput { |
| 109 public: | 109 public: |
| 110 FakeVideoSendStream(const webrtc::VideoSendStream::Config& config, | 110 FakeVideoSendStream(const webrtc::VideoSendStream::Config& config, |
| (...skipping 138 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 249 std::vector<FakeAudioSendStream*> audio_send_streams_; | 249 std::vector<FakeAudioSendStream*> audio_send_streams_; |
| 250 std::vector<FakeVideoReceiveStream*> video_receive_streams_; | 250 std::vector<FakeVideoReceiveStream*> video_receive_streams_; |
| 251 std::vector<FakeAudioReceiveStream*> audio_receive_streams_; | 251 std::vector<FakeAudioReceiveStream*> audio_receive_streams_; |
| 252 | 252 |
| 253 int num_created_send_streams_; | 253 int num_created_send_streams_; |
| 254 int num_created_receive_streams_; | 254 int num_created_receive_streams_; |
| 255 }; | 255 }; |
| 256 | 256 |
| 257 } // namespace cricket | 257 } // namespace cricket |
| 258 #endif // TALK_MEDIA_WEBRTC_WEBRTCVIDEOENGINE2_UNITTEST_H_ | 258 #endif // TALK_MEDIA_WEBRTC_WEBRTCVIDEOENGINE2_UNITTEST_H_ |
| OLD | NEW |