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 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
116 | 117 |
117 int GetNumberOfSwappedFrames() const; | 118 int GetNumberOfSwappedFrames() const; |
118 int GetLastWidth() const; | 119 int GetLastWidth() const; |
119 int GetLastHeight() const; | 120 int GetLastHeight() const; |
120 int64_t GetLastTimestamp() const; | 121 int64_t GetLastTimestamp() const; |
121 void SetStats(const webrtc::VideoSendStream::Stats& stats); | 122 void SetStats(const webrtc::VideoSendStream::Stats& stats); |
122 int num_encoder_reconfigurations() const { | 123 int num_encoder_reconfigurations() const { |
123 return num_encoder_reconfigurations_; | 124 return num_encoder_reconfigurations_; |
124 } | 125 } |
125 | 126 |
| 127 void EnableEncodedFrameRecording(const std::vector<rtc::PlatformFile>& files, |
| 128 size_t byte_limit) override; |
| 129 |
126 private: | 130 private: |
127 // rtc::VideoSinkInterface<VideoFrame> implementation. | 131 // rtc::VideoSinkInterface<VideoFrame> implementation. |
128 void OnFrame(const webrtc::VideoFrame& frame) override; | 132 void OnFrame(const webrtc::VideoFrame& frame) override; |
129 | 133 |
130 // webrtc::VideoSendStream implementation. | 134 // webrtc::VideoSendStream implementation. |
131 void Start() override; | 135 void Start() override; |
132 void Stop() override; | 136 void Stop() override; |
133 void SetSource( | 137 void SetSource( |
134 rtc::VideoSourceInterface<webrtc::VideoFrame>* source) override; | 138 rtc::VideoSourceInterface<webrtc::VideoFrame>* source) override; |
135 webrtc::VideoSendStream::Stats GetStats() override; | 139 webrtc::VideoSendStream::Stats GetStats() override; |
(...skipping 19 matching lines...) Expand all Loading... |
155 explicit FakeVideoReceiveStream(webrtc::VideoReceiveStream::Config config); | 159 explicit FakeVideoReceiveStream(webrtc::VideoReceiveStream::Config config); |
156 | 160 |
157 const webrtc::VideoReceiveStream::Config& GetConfig(); | 161 const webrtc::VideoReceiveStream::Config& GetConfig(); |
158 | 162 |
159 bool IsReceiving() const; | 163 bool IsReceiving() const; |
160 | 164 |
161 void InjectFrame(const webrtc::VideoFrame& frame); | 165 void InjectFrame(const webrtc::VideoFrame& frame); |
162 | 166 |
163 void SetStats(const webrtc::VideoReceiveStream::Stats& stats); | 167 void SetStats(const webrtc::VideoReceiveStream::Stats& stats); |
164 | 168 |
| 169 void EnableEncodedFrameRecording(rtc::PlatformFile file, |
| 170 size_t byte_limit) override; |
| 171 |
165 private: | 172 private: |
166 // webrtc::VideoReceiveStream implementation. | 173 // webrtc::VideoReceiveStream implementation. |
167 void Start() override; | 174 void Start() override; |
168 void Stop() override; | 175 void Stop() override; |
169 | 176 |
170 webrtc::VideoReceiveStream::Stats GetStats() const override; | 177 webrtc::VideoReceiveStream::Stats GetStats() const override; |
171 | 178 |
172 webrtc::VideoReceiveStream::Config config_; | 179 webrtc::VideoReceiveStream::Config config_; |
173 bool receiving_; | 180 bool receiving_; |
174 webrtc::VideoReceiveStream::Stats stats_; | 181 webrtc::VideoReceiveStream::Stats stats_; |
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
250 std::vector<FakeVideoSendStream*> video_send_streams_; | 257 std::vector<FakeVideoSendStream*> video_send_streams_; |
251 std::vector<FakeAudioSendStream*> audio_send_streams_; | 258 std::vector<FakeAudioSendStream*> audio_send_streams_; |
252 std::vector<FakeVideoReceiveStream*> video_receive_streams_; | 259 std::vector<FakeVideoReceiveStream*> video_receive_streams_; |
253 std::vector<FakeAudioReceiveStream*> audio_receive_streams_; | 260 std::vector<FakeAudioReceiveStream*> audio_receive_streams_; |
254 | 261 |
255 int num_created_send_streams_; | 262 int num_created_send_streams_; |
256 int num_created_receive_streams_; | 263 int num_created_receive_streams_; |
257 }; | 264 }; |
258 | 265 |
259 } // namespace cricket | 266 } // namespace cricket |
260 #endif // TALK_MEDIA_WEBRTC_WEBRTCVIDEOENGINE2_UNITTEST_H_ | 267 #endif // WEBRTC_MEDIA_ENGINE_FAKEWEBRTCCALL_H_ |
OLD | NEW |