Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(420)

Side by Side Diff: webrtc/test/frame_generator.cc

Issue 2344923002: Revert of Replace interface VideoCapturerInput with VideoSinkInterface. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Created 4 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « webrtc/test/frame_generator.h ('k') | webrtc/test/frame_generator_capturer.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « webrtc/test/frame_generator.h ('k') | webrtc/test/frame_generator_capturer.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698