| 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 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 82 | 82 |
| 83 class FakeAudioReceiveStream final : public webrtc::AudioReceiveStream { | 83 class FakeAudioReceiveStream final : public webrtc::AudioReceiveStream { |
| 84 public: | 84 public: |
| 85 explicit FakeAudioReceiveStream( | 85 explicit FakeAudioReceiveStream( |
| 86 const webrtc::AudioReceiveStream::Config& config); | 86 const webrtc::AudioReceiveStream::Config& config); |
| 87 | 87 |
| 88 const webrtc::AudioReceiveStream::Config& GetConfig() const; | 88 const webrtc::AudioReceiveStream::Config& GetConfig() const; |
| 89 void SetStats(const webrtc::AudioReceiveStream::Stats& stats); | 89 void SetStats(const webrtc::AudioReceiveStream::Stats& stats); |
| 90 int received_packets() const { return received_packets_; } | 90 int received_packets() const { return received_packets_; } |
| 91 void IncrementReceivedPackets(); | 91 void IncrementReceivedPackets(); |
| 92 const rtc::scoped_refptr<webrtc::AudioSinkInterface>& sink() const { | |
| 93 return sink_; | |
| 94 } | |
| 95 | 92 |
| 96 private: | 93 private: |
| 97 // webrtc::ReceiveStream implementation. | 94 // webrtc::ReceiveStream implementation. |
| 98 void Start() override {} | 95 void Start() override {} |
| 99 void Stop() override {} | 96 void Stop() override {} |
| 100 void SignalNetworkState(webrtc::NetworkState state) override {} | 97 void SignalNetworkState(webrtc::NetworkState state) override {} |
| 101 bool DeliverRtcp(const uint8_t* packet, size_t length) override { | 98 bool DeliverRtcp(const uint8_t* packet, size_t length) override { |
| 102 return true; | 99 return true; |
| 103 } | 100 } |
| 104 bool DeliverRtp(const uint8_t* packet, | 101 bool DeliverRtp(const uint8_t* packet, |
| 105 size_t length, | 102 size_t length, |
| 106 const webrtc::PacketTime& packet_time) override { | 103 const webrtc::PacketTime& packet_time) override { |
| 107 return true; | 104 return true; |
| 108 } | 105 } |
| 109 | 106 |
| 110 // webrtc::AudioReceiveStream implementation. | 107 // webrtc::AudioReceiveStream implementation. |
| 111 webrtc::AudioReceiveStream::Stats GetStats() const override; | 108 webrtc::AudioReceiveStream::Stats GetStats() const override; |
| 112 void SetSink( | 109 void SetSink(rtc::scoped_ptr<webrtc::AudioSinkInterface> sink) override; |
| 113 const rtc::scoped_refptr<webrtc::AudioSinkInterface>& sink) override; | |
| 114 | 110 |
| 115 webrtc::AudioReceiveStream::Config config_; | 111 webrtc::AudioReceiveStream::Config config_; |
| 116 webrtc::AudioReceiveStream::Stats stats_; | 112 webrtc::AudioReceiveStream::Stats stats_; |
| 117 int received_packets_; | 113 int received_packets_; |
| 118 rtc::scoped_refptr<webrtc::AudioSinkInterface> sink_; | 114 rtc::scoped_ptr<webrtc::AudioSinkInterface> sink_; |
| 119 }; | 115 }; |
| 120 | 116 |
| 121 class FakeVideoSendStream final : public webrtc::VideoSendStream, | 117 class FakeVideoSendStream final : public webrtc::VideoSendStream, |
| 122 public webrtc::VideoCaptureInput { | 118 public webrtc::VideoCaptureInput { |
| 123 public: | 119 public: |
| 124 FakeVideoSendStream(const webrtc::VideoSendStream::Config& config, | 120 FakeVideoSendStream(const webrtc::VideoSendStream::Config& config, |
| 125 const webrtc::VideoEncoderConfig& encoder_config); | 121 const webrtc::VideoEncoderConfig& encoder_config); |
| 126 webrtc::VideoSendStream::Config GetConfig() const; | 122 webrtc::VideoSendStream::Config GetConfig() const; |
| 127 webrtc::VideoEncoderConfig GetEncoderConfig() const; | 123 webrtc::VideoEncoderConfig GetEncoderConfig() const; |
| 128 std::vector<webrtc::VideoStream> GetVideoStreams(); | 124 std::vector<webrtc::VideoStream> GetVideoStreams(); |
| (...skipping 134 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 263 std::vector<FakeAudioSendStream*> audio_send_streams_; | 259 std::vector<FakeAudioSendStream*> audio_send_streams_; |
| 264 std::vector<FakeVideoReceiveStream*> video_receive_streams_; | 260 std::vector<FakeVideoReceiveStream*> video_receive_streams_; |
| 265 std::vector<FakeAudioReceiveStream*> audio_receive_streams_; | 261 std::vector<FakeAudioReceiveStream*> audio_receive_streams_; |
| 266 | 262 |
| 267 int num_created_send_streams_; | 263 int num_created_send_streams_; |
| 268 int num_created_receive_streams_; | 264 int num_created_receive_streams_; |
| 269 }; | 265 }; |
| 270 | 266 |
| 271 } // namespace cricket | 267 } // namespace cricket |
| 272 #endif // TALK_MEDIA_WEBRTC_WEBRTCVIDEOENGINE2_UNITTEST_H_ | 268 #endif // TALK_MEDIA_WEBRTC_WEBRTCVIDEOENGINE2_UNITTEST_H_ |
| OLD | NEW |