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 |
| 11 // This file contains fake implementations, for use in unit tests, of the | 11 // This file contains fake implementations, for use in unit tests, of the |
| 12 // following classes: | 12 // following classes: |
| 13 // | 13 // |
| 14 // webrtc::Call | 14 // webrtc::Call |
| 15 // webrtc::AudioSendStream | 15 // webrtc::AudioSendStream |
| 16 // webrtc::AudioReceiveStream | 16 // webrtc::AudioReceiveStream |
| 17 // webrtc::VideoSendStream | 17 // webrtc::VideoSendStream |
| 18 // webrtc::VideoReceiveStream | 18 // webrtc::VideoReceiveStream |
| 19 | 19 |
| 20 #ifndef WEBRTC_MEDIA_ENGINE_FAKEWEBRTCCALL_H_ | 20 #ifndef WEBRTC_MEDIA_ENGINE_FAKEWEBRTCCALL_H_ |
| 21 #define WEBRTC_MEDIA_ENGINE_FAKEWEBRTCCALL_H_ | 21 #define WEBRTC_MEDIA_ENGINE_FAKEWEBRTCCALL_H_ |
| 22 | 22 |
| 23 #include <memory> | |
| 23 #include <vector> | 24 #include <vector> |
| 24 | 25 |
| 25 #include "webrtc/audio_receive_stream.h" | 26 #include "webrtc/audio_receive_stream.h" |
| 26 #include "webrtc/audio_send_stream.h" | 27 #include "webrtc/audio_send_stream.h" |
| 27 #include "webrtc/call.h" | 28 #include "webrtc/call.h" |
| 28 #include "webrtc/video_frame.h" | 29 #include "webrtc/video_frame.h" |
| 29 #include "webrtc/video_receive_stream.h" | 30 #include "webrtc/video_receive_stream.h" |
| 30 #include "webrtc/video_send_stream.h" | 31 #include "webrtc/video_send_stream.h" |
| 31 | 32 |
| 32 namespace cricket { | 33 namespace cricket { |
| (...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 83 return true; | 84 return true; |
| 84 } | 85 } |
| 85 bool DeliverRtp(const uint8_t* packet, | 86 bool DeliverRtp(const uint8_t* packet, |
| 86 size_t length, | 87 size_t length, |
| 87 const webrtc::PacketTime& packet_time) override { | 88 const webrtc::PacketTime& packet_time) override { |
| 88 return true; | 89 return true; |
| 89 } | 90 } |
| 90 | 91 |
| 91 // webrtc::AudioReceiveStream implementation. | 92 // webrtc::AudioReceiveStream implementation. |
| 92 webrtc::AudioReceiveStream::Stats GetStats() const override; | 93 webrtc::AudioReceiveStream::Stats GetStats() const override; |
| 93 void SetSink(rtc::scoped_ptr<webrtc::AudioSinkInterface> sink) override; | 94 void SetSink(std::unique_ptr<webrtc::AudioSinkInterface> sink) override; |
| 94 | 95 |
| 95 webrtc::AudioReceiveStream::Config config_; | 96 webrtc::AudioReceiveStream::Config config_; |
| 96 webrtc::AudioReceiveStream::Stats stats_; | 97 webrtc::AudioReceiveStream::Stats stats_; |
| 97 int received_packets_; | 98 int received_packets_; |
| 98 rtc::scoped_ptr<webrtc::AudioSinkInterface> sink_; | 99 rtc::scoped_ptr<webrtc::AudioSinkInterface> sink_; |
|
the sun
2016/02/18 18:54:44
Change me!
kwiberg-webrtc
2016/02/18 20:02:16
In a later CL. This one changes only webrtc/audio/
| |
| 99 }; | 100 }; |
| 100 | 101 |
| 101 class FakeVideoSendStream final : public webrtc::VideoSendStream, | 102 class FakeVideoSendStream final : public webrtc::VideoSendStream, |
| 102 public webrtc::VideoCaptureInput { | 103 public webrtc::VideoCaptureInput { |
| 103 public: | 104 public: |
| 104 FakeVideoSendStream(const webrtc::VideoSendStream::Config& config, | 105 FakeVideoSendStream(const webrtc::VideoSendStream::Config& config, |
| 105 const webrtc::VideoEncoderConfig& encoder_config); | 106 const webrtc::VideoEncoderConfig& encoder_config); |
| 106 webrtc::VideoSendStream::Config GetConfig() const; | 107 webrtc::VideoSendStream::Config GetConfig() const; |
| 107 webrtc::VideoEncoderConfig GetEncoderConfig() const; | 108 webrtc::VideoEncoderConfig GetEncoderConfig() const; |
| 108 std::vector<webrtc::VideoStream> GetVideoStreams(); | 109 std::vector<webrtc::VideoStream> GetVideoStreams(); |
| (...skipping 134 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 243 std::vector<FakeAudioSendStream*> audio_send_streams_; | 244 std::vector<FakeAudioSendStream*> audio_send_streams_; |
| 244 std::vector<FakeVideoReceiveStream*> video_receive_streams_; | 245 std::vector<FakeVideoReceiveStream*> video_receive_streams_; |
| 245 std::vector<FakeAudioReceiveStream*> audio_receive_streams_; | 246 std::vector<FakeAudioReceiveStream*> audio_receive_streams_; |
| 246 | 247 |
| 247 int num_created_send_streams_; | 248 int num_created_send_streams_; |
| 248 int num_created_receive_streams_; | 249 int num_created_receive_streams_; |
| 249 }; | 250 }; |
| 250 | 251 |
| 251 } // namespace cricket | 252 } // namespace cricket |
| 252 #endif // TALK_MEDIA_WEBRTC_WEBRTCVIDEOENGINE2_UNITTEST_H_ | 253 #endif // TALK_MEDIA_WEBRTC_WEBRTCVIDEOENGINE2_UNITTEST_H_ |
| OLD | NEW |