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