OLD | NEW |
1 /* | 1 /* |
2 * Copyright (c) 2013 The WebRTC project authors. All Rights Reserved. | 2 * Copyright (c) 2013 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 #include "webrtc/test/frame_generator.h" | 10 #include "webrtc/test/frame_generator.h" |
(...skipping 221 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
232 const int64_t pause_time_; | 232 const int64_t pause_time_; |
233 const size_t num_frames_; | 233 const size_t num_frames_; |
234 size_t current_frame_num_; | 234 size_t current_frame_num_; |
235 VideoFrame* current_source_frame_; | 235 VideoFrame* current_source_frame_; |
236 VideoFrame current_frame_; | 236 VideoFrame current_frame_; |
237 YuvFileGenerator file_generator_; | 237 YuvFileGenerator file_generator_; |
238 }; | 238 }; |
239 | 239 |
240 } // namespace | 240 } // namespace |
241 | 241 |
242 FrameForwarder::FrameForwarder() : sink_(nullptr) {} | |
243 | |
244 void FrameForwarder::IncomingCapturedFrame(const VideoFrame& video_frame) { | |
245 rtc::CritScope lock(&crit_); | |
246 if (sink_) | |
247 sink_->OnFrame(video_frame); | |
248 } | |
249 | |
250 void FrameForwarder::AddOrUpdateSink(rtc::VideoSinkInterface<VideoFrame>* sink, | |
251 const rtc::VideoSinkWants& wants) { | |
252 rtc::CritScope lock(&crit_); | |
253 RTC_DCHECK(!sink_ || sink_ == sink); | |
254 sink_ = sink; | |
255 } | |
256 | |
257 void FrameForwarder::RemoveSink(rtc::VideoSinkInterface<VideoFrame>* sink) { | |
258 rtc::CritScope lock(&crit_); | |
259 RTC_DCHECK_EQ(sink, sink_); | |
260 sink_ = nullptr; | |
261 } | |
262 | |
263 FrameGenerator* FrameGenerator::CreateChromaGenerator(size_t width, | 242 FrameGenerator* FrameGenerator::CreateChromaGenerator(size_t width, |
264 size_t height) { | 243 size_t height) { |
265 return new ChromaGenerator(width, height); | 244 return new ChromaGenerator(width, height); |
266 } | 245 } |
267 | 246 |
268 FrameGenerator* FrameGenerator::CreateFromYuvFile( | 247 FrameGenerator* FrameGenerator::CreateFromYuvFile( |
269 std::vector<std::string> filenames, | 248 std::vector<std::string> filenames, |
270 size_t width, | 249 size_t width, |
271 size_t height, | 250 size_t height, |
272 int frame_repeat_count) { | 251 int frame_repeat_count) { |
(...skipping 25 matching lines...) Expand all Loading... |
298 files.push_back(file); | 277 files.push_back(file); |
299 } | 278 } |
300 | 279 |
301 return new ScrollingImageFrameGenerator( | 280 return new ScrollingImageFrameGenerator( |
302 clock, files, source_width, source_height, target_width, target_height, | 281 clock, files, source_width, source_height, target_width, target_height, |
303 scroll_time_ms, pause_time_ms); | 282 scroll_time_ms, pause_time_ms); |
304 } | 283 } |
305 | 284 |
306 } // namespace test | 285 } // namespace test |
307 } // namespace webrtc | 286 } // namespace webrtc |
OLD | NEW |