| 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 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 51 void IncrementReceivedPackets(); | 51 void IncrementReceivedPackets(); |
| 52 | 52 |
| 53 private: | 53 private: |
| 54 // webrtc::ReceiveStream implementation. | 54 // webrtc::ReceiveStream implementation. |
| 55 void Start() override {} | 55 void Start() override {} |
| 56 void Stop() override {} | 56 void Stop() override {} |
| 57 void SignalNetworkState(webrtc::NetworkState state) override {} | 57 void SignalNetworkState(webrtc::NetworkState state) override {} |
| 58 bool DeliverRtcp(const uint8_t* packet, size_t length) override { | 58 bool DeliverRtcp(const uint8_t* packet, size_t length) override { |
| 59 return true; | 59 return true; |
| 60 } | 60 } |
| 61 bool DeliverRtp(const uint8_t* packet, size_t length) override { | 61 bool DeliverRtp(const uint8_t* packet, |
| 62 size_t length, |
| 63 const webrtc::PacketTime& packet_time) override { |
| 62 return true; | 64 return true; |
| 63 } | 65 } |
| 64 | 66 |
| 65 webrtc::AudioReceiveStream::Config config_; | 67 webrtc::AudioReceiveStream::Config config_; |
| 66 int received_packets_; | 68 int received_packets_; |
| 67 }; | 69 }; |
| 68 | 70 |
| 69 class FakeVideoSendStream : public webrtc::VideoSendStream, | 71 class FakeVideoSendStream : public webrtc::VideoSendStream, |
| 70 public webrtc::VideoCaptureInput { | 72 public webrtc::VideoCaptureInput { |
| 71 public: | 73 public: |
| (...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 129 void SetStats(const webrtc::VideoReceiveStream::Stats& stats); | 131 void SetStats(const webrtc::VideoReceiveStream::Stats& stats); |
| 130 | 132 |
| 131 private: | 133 private: |
| 132 // webrtc::ReceiveStream implementation. | 134 // webrtc::ReceiveStream implementation. |
| 133 void Start() override; | 135 void Start() override; |
| 134 void Stop() override; | 136 void Stop() override; |
| 135 void SignalNetworkState(webrtc::NetworkState state) override {} | 137 void SignalNetworkState(webrtc::NetworkState state) override {} |
| 136 bool DeliverRtcp(const uint8_t* packet, size_t length) override { | 138 bool DeliverRtcp(const uint8_t* packet, size_t length) override { |
| 137 return true; | 139 return true; |
| 138 } | 140 } |
| 139 bool DeliverRtp(const uint8_t* packet, size_t length) override { | 141 bool DeliverRtp(const uint8_t* packet, |
| 142 size_t length, |
| 143 const webrtc::PacketTime& packet_time) override { |
| 140 return true; | 144 return true; |
| 141 } | 145 } |
| 142 | 146 |
| 143 // webrtc::VideoReceiveStream implementation. | 147 // webrtc::VideoReceiveStream implementation. |
| 144 webrtc::VideoReceiveStream::Stats GetStats() const override; | 148 webrtc::VideoReceiveStream::Stats GetStats() const override; |
| 145 | 149 |
| 146 webrtc::VideoReceiveStream::Config config_; | 150 webrtc::VideoReceiveStream::Config config_; |
| 147 bool receiving_; | 151 bool receiving_; |
| 148 webrtc::VideoReceiveStream::Stats stats_; | 152 webrtc::VideoReceiveStream::Stats stats_; |
| 149 }; | 153 }; |
| (...skipping 30 matching lines...) Expand all Loading... |
| 180 const webrtc::VideoEncoderConfig& encoder_config) override; | 184 const webrtc::VideoEncoderConfig& encoder_config) override; |
| 181 void DestroyVideoSendStream(webrtc::VideoSendStream* send_stream) override; | 185 void DestroyVideoSendStream(webrtc::VideoSendStream* send_stream) override; |
| 182 | 186 |
| 183 webrtc::VideoReceiveStream* CreateVideoReceiveStream( | 187 webrtc::VideoReceiveStream* CreateVideoReceiveStream( |
| 184 const webrtc::VideoReceiveStream::Config& config) override; | 188 const webrtc::VideoReceiveStream::Config& config) override; |
| 185 void DestroyVideoReceiveStream( | 189 void DestroyVideoReceiveStream( |
| 186 webrtc::VideoReceiveStream* receive_stream) override; | 190 webrtc::VideoReceiveStream* receive_stream) override; |
| 187 webrtc::PacketReceiver* Receiver() override; | 191 webrtc::PacketReceiver* Receiver() override; |
| 188 | 192 |
| 189 DeliveryStatus DeliverPacket(webrtc::MediaType media_type, | 193 DeliveryStatus DeliverPacket(webrtc::MediaType media_type, |
| 190 const uint8_t* packet, size_t length) override; | 194 const uint8_t* packet, |
| 195 size_t length, |
| 196 const webrtc::PacketTime& packet_time) override; |
| 191 | 197 |
| 192 webrtc::Call::Stats GetStats() const override; | 198 webrtc::Call::Stats GetStats() const override; |
| 193 | 199 |
| 194 void SetBitrateConfig( | 200 void SetBitrateConfig( |
| 195 const webrtc::Call::Config::BitrateConfig& bitrate_config) override; | 201 const webrtc::Call::Config::BitrateConfig& bitrate_config) override; |
| 196 void SignalNetworkState(webrtc::NetworkState state) override; | 202 void SignalNetworkState(webrtc::NetworkState state) override; |
| 197 | 203 |
| 198 webrtc::Call::Config config_; | 204 webrtc::Call::Config config_; |
| 199 webrtc::NetworkState network_state_; | 205 webrtc::NetworkState network_state_; |
| 200 webrtc::Call::Stats stats_; | 206 webrtc::Call::Stats stats_; |
| 201 std::vector<FakeVideoSendStream*> video_send_streams_; | 207 std::vector<FakeVideoSendStream*> video_send_streams_; |
| 202 std::vector<FakeVideoReceiveStream*> video_receive_streams_; | 208 std::vector<FakeVideoReceiveStream*> video_receive_streams_; |
| 203 std::vector<FakeAudioReceiveStream*> audio_receive_streams_; | 209 std::vector<FakeAudioReceiveStream*> audio_receive_streams_; |
| 204 | 210 |
| 205 int num_created_send_streams_; | 211 int num_created_send_streams_; |
| 206 int num_created_receive_streams_; | 212 int num_created_receive_streams_; |
| 207 }; | 213 }; |
| 208 | 214 |
| 209 } // namespace cricket | 215 } // namespace cricket |
| 210 #endif // TALK_MEDIA_WEBRTC_WEBRTCVIDEOENGINE2_UNITTEST_H_ | 216 #endif // TALK_MEDIA_WEBRTC_WEBRTCVIDEOENGINE2_UNITTEST_H_ |
| OLD | NEW |