Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 /* | 1 /* |
| 2 * Copyright (c) 2015 The WebRTC project authors. All Rights Reserved. | 2 * Copyright (c) 2015 The WebRTC project authors. All Rights Reserved. |
| 3 * | 3 * |
| 4 * Use of this source code is governed by a BSD-style license | 4 * Use of this source code is governed by a BSD-style license |
| 5 * that can be found in the LICENSE file in the root of the source | 5 * that can be found in the LICENSE file in the root of the source |
| 6 * tree. An additional intellectual property rights grant can be found | 6 * tree. An additional intellectual property rights grant can be found |
| 7 * in the file PATENTS. All contributing project authors may | 7 * in the file PATENTS. All contributing project authors may |
| 8 * be found in the AUTHORS file in the root of the source tree. | 8 * be found in the AUTHORS file in the root of the source tree. |
| 9 */ | 9 */ |
| 10 | 10 |
| (...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 67 }; | 67 }; |
| 68 | 68 |
| 69 class FakeAudioReceiveStream final : public webrtc::AudioReceiveStream { | 69 class FakeAudioReceiveStream final : public webrtc::AudioReceiveStream { |
| 70 public: | 70 public: |
| 71 explicit FakeAudioReceiveStream( | 71 explicit FakeAudioReceiveStream( |
| 72 const webrtc::AudioReceiveStream::Config& config); | 72 const webrtc::AudioReceiveStream::Config& config); |
| 73 | 73 |
| 74 const webrtc::AudioReceiveStream::Config& GetConfig() const; | 74 const webrtc::AudioReceiveStream::Config& GetConfig() const; |
| 75 void SetStats(const webrtc::AudioReceiveStream::Stats& stats); | 75 void SetStats(const webrtc::AudioReceiveStream::Stats& stats); |
| 76 int received_packets() const { return received_packets_; } | 76 int received_packets() const { return received_packets_; } |
| 77 void IncrementReceivedPackets(); | 77 bool VerifyLastPacket(const void* data, size_t length) const; |
|
the sun
2016/04/22 12:40:31
uint8_t*
mflodman
2016/04/27 13:42:17
Done.
| |
| 78 const webrtc::AudioSinkInterface* sink() const { return sink_.get(); } | 78 const webrtc::AudioSinkInterface* sink() const { return sink_.get(); } |
| 79 | 79 |
| 80 bool DeliverRtp(const uint8_t* packet, | |
| 81 size_t length, | |
| 82 const webrtc::PacketTime& packet_time) override; | |
| 83 bool DeliverRtcp(const uint8_t* packet, size_t length) override; | |
| 80 private: | 84 private: |
| 81 // webrtc::ReceiveStream implementation. | 85 // webrtc::ReceiveStream implementation. |
| 82 void Start() override {} | 86 void Start() override {} |
| 83 void Stop() override {} | 87 void Stop() override {} |
| 84 void SignalNetworkState(webrtc::NetworkState state) override {} | 88 void SignalNetworkState(webrtc::NetworkState state) override {} |
| 85 bool DeliverRtcp(const uint8_t* packet, size_t length) override { | |
| 86 return true; | |
| 87 } | |
| 88 bool DeliverRtp(const uint8_t* packet, | |
| 89 size_t length, | |
| 90 const webrtc::PacketTime& packet_time) override { | |
| 91 return true; | |
| 92 } | |
| 93 | 89 |
| 94 // webrtc::AudioReceiveStream implementation. | 90 // webrtc::AudioReceiveStream implementation. |
| 95 webrtc::AudioReceiveStream::Stats GetStats() const override; | 91 webrtc::AudioReceiveStream::Stats GetStats() const override; |
| 96 void SetSink(std::unique_ptr<webrtc::AudioSinkInterface> sink) override; | 92 void SetSink(std::unique_ptr<webrtc::AudioSinkInterface> sink) override; |
| 97 | 93 |
| 98 webrtc::AudioReceiveStream::Config config_; | 94 webrtc::AudioReceiveStream::Config config_; |
| 99 webrtc::AudioReceiveStream::Stats stats_; | 95 webrtc::AudioReceiveStream::Stats stats_; |
| 100 int received_packets_; | 96 int received_packets_; |
| 101 std::unique_ptr<webrtc::AudioSinkInterface> sink_; | 97 std::unique_ptr<webrtc::AudioSinkInterface> sink_; |
| 98 std::string last_packet_; | |
| 102 }; | 99 }; |
| 103 | 100 |
| 104 class FakeVideoSendStream final : public webrtc::VideoSendStream, | 101 class FakeVideoSendStream final : public webrtc::VideoSendStream, |
| 105 public webrtc::VideoCaptureInput { | 102 public webrtc::VideoCaptureInput { |
| 106 public: | 103 public: |
| 107 FakeVideoSendStream(const webrtc::VideoSendStream::Config& config, | 104 FakeVideoSendStream(const webrtc::VideoSendStream::Config& config, |
| 108 const webrtc::VideoEncoderConfig& encoder_config); | 105 const webrtc::VideoEncoderConfig& encoder_config); |
| 109 webrtc::VideoSendStream::Config GetConfig() const; | 106 webrtc::VideoSendStream::Config GetConfig() const; |
| 110 webrtc::VideoEncoderConfig GetEncoderConfig() const; | 107 webrtc::VideoEncoderConfig GetEncoderConfig() const; |
| 111 std::vector<webrtc::VideoStream> GetVideoStreams(); | 108 std::vector<webrtc::VideoStream> GetVideoStreams(); |
| (...skipping 142 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 254 std::vector<FakeAudioSendStream*> audio_send_streams_; | 251 std::vector<FakeAudioSendStream*> audio_send_streams_; |
| 255 std::vector<FakeVideoReceiveStream*> video_receive_streams_; | 252 std::vector<FakeVideoReceiveStream*> video_receive_streams_; |
| 256 std::vector<FakeAudioReceiveStream*> audio_receive_streams_; | 253 std::vector<FakeAudioReceiveStream*> audio_receive_streams_; |
| 257 | 254 |
| 258 int num_created_send_streams_; | 255 int num_created_send_streams_; |
| 259 int num_created_receive_streams_; | 256 int num_created_receive_streams_; |
| 260 }; | 257 }; |
| 261 | 258 |
| 262 } // namespace cricket | 259 } // namespace cricket |
| 263 #endif // TALK_MEDIA_WEBRTC_WEBRTCVIDEOENGINE2_UNITTEST_H_ | 260 #endif // TALK_MEDIA_WEBRTC_WEBRTCVIDEOENGINE2_UNITTEST_H_ |
| OLD | NEW |