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 <memory> |
| 24 #include <string> |
24 #include <vector> | 25 #include <vector> |
25 | 26 |
26 #include "webrtc/api/call/audio_receive_stream.h" | 27 #include "webrtc/api/call/audio_receive_stream.h" |
27 #include "webrtc/api/call/audio_send_stream.h" | 28 #include "webrtc/api/call/audio_send_stream.h" |
28 #include "webrtc/base/buffer.h" | 29 #include "webrtc/base/buffer.h" |
29 #include "webrtc/call.h" | 30 #include "webrtc/call.h" |
30 #include "webrtc/video_frame.h" | 31 #include "webrtc/video_frame.h" |
31 #include "webrtc/video_receive_stream.h" | 32 #include "webrtc/video_receive_stream.h" |
32 #include "webrtc/video_send_stream.h" | 33 #include "webrtc/video_send_stream.h" |
33 | 34 |
(...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
114 | 115 |
115 int GetNumberOfSwappedFrames() const; | 116 int GetNumberOfSwappedFrames() const; |
116 int GetLastWidth() const; | 117 int GetLastWidth() const; |
117 int GetLastHeight() const; | 118 int GetLastHeight() const; |
118 int64_t GetLastTimestamp() const; | 119 int64_t GetLastTimestamp() const; |
119 void SetStats(const webrtc::VideoSendStream::Stats& stats); | 120 void SetStats(const webrtc::VideoSendStream::Stats& stats); |
120 int num_encoder_reconfigurations() const { | 121 int num_encoder_reconfigurations() const { |
121 return num_encoder_reconfigurations_; | 122 return num_encoder_reconfigurations_; |
122 } | 123 } |
123 | 124 |
| 125 void EnableEncodedFrameRecording(const std::vector<rtc::PlatformFile>& files, |
| 126 size_t byte_limit) override; |
| 127 |
124 private: | 128 private: |
125 void IncomingCapturedFrame(const webrtc::VideoFrame& frame) override; | 129 void IncomingCapturedFrame(const webrtc::VideoFrame& frame) override; |
126 | 130 |
127 // webrtc::VideoSendStream implementation. | 131 // webrtc::VideoSendStream implementation. |
128 void Start() override; | 132 void Start() override; |
129 void Stop() override; | 133 void Stop() override; |
130 webrtc::VideoSendStream::Stats GetStats() override; | 134 webrtc::VideoSendStream::Stats GetStats() override; |
131 void ReconfigureVideoEncoder(webrtc::VideoEncoderConfig config) override; | 135 void ReconfigureVideoEncoder(webrtc::VideoEncoderConfig config) override; |
132 webrtc::VideoCaptureInput* Input() override; | 136 webrtc::VideoCaptureInput* Input() override; |
133 | 137 |
(...skipping 16 matching lines...) Expand all Loading... |
150 explicit FakeVideoReceiveStream(webrtc::VideoReceiveStream::Config config); | 154 explicit FakeVideoReceiveStream(webrtc::VideoReceiveStream::Config config); |
151 | 155 |
152 const webrtc::VideoReceiveStream::Config& GetConfig(); | 156 const webrtc::VideoReceiveStream::Config& GetConfig(); |
153 | 157 |
154 bool IsReceiving() const; | 158 bool IsReceiving() const; |
155 | 159 |
156 void InjectFrame(const webrtc::VideoFrame& frame); | 160 void InjectFrame(const webrtc::VideoFrame& frame); |
157 | 161 |
158 void SetStats(const webrtc::VideoReceiveStream::Stats& stats); | 162 void SetStats(const webrtc::VideoReceiveStream::Stats& stats); |
159 | 163 |
| 164 void EnableEncodedFrameRecording(rtc::PlatformFile file, |
| 165 size_t byte_limit) override; |
| 166 |
160 private: | 167 private: |
161 // webrtc::VideoReceiveStream implementation. | 168 // webrtc::VideoReceiveStream implementation. |
162 void Start() override; | 169 void Start() override; |
163 void Stop() override; | 170 void Stop() override; |
164 | 171 |
165 webrtc::VideoReceiveStream::Stats GetStats() const override; | 172 webrtc::VideoReceiveStream::Stats GetStats() const override; |
166 | 173 |
167 webrtc::VideoReceiveStream::Config config_; | 174 webrtc::VideoReceiveStream::Config config_; |
168 bool receiving_; | 175 bool receiving_; |
169 webrtc::VideoReceiveStream::Stats stats_; | 176 webrtc::VideoReceiveStream::Stats stats_; |
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
245 std::vector<FakeVideoSendStream*> video_send_streams_; | 252 std::vector<FakeVideoSendStream*> video_send_streams_; |
246 std::vector<FakeAudioSendStream*> audio_send_streams_; | 253 std::vector<FakeAudioSendStream*> audio_send_streams_; |
247 std::vector<FakeVideoReceiveStream*> video_receive_streams_; | 254 std::vector<FakeVideoReceiveStream*> video_receive_streams_; |
248 std::vector<FakeAudioReceiveStream*> audio_receive_streams_; | 255 std::vector<FakeAudioReceiveStream*> audio_receive_streams_; |
249 | 256 |
250 int num_created_send_streams_; | 257 int num_created_send_streams_; |
251 int num_created_receive_streams_; | 258 int num_created_receive_streams_; |
252 }; | 259 }; |
253 | 260 |
254 } // namespace cricket | 261 } // namespace cricket |
255 #endif // TALK_MEDIA_WEBRTC_WEBRTCVIDEOENGINE2_UNITTEST_H_ | 262 #endif // WEBRTC_MEDIA_ENGINE_FAKEWEBRTCCALL_H_ |
OLD | NEW |