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

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

Issue 2257413002: Replace interface VideoCapturerInput with VideoSinkInterface. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: git cl format Created 4 years, 4 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
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 void FrameForwarder::IncomingCapturedFrame(const VideoFrame& video_frame) {
243 rtc::CritScope lock(&crit_);
244 if (sink_)
245 sink_->OnFrame(video_frame);
246 }
247
248 void FrameForwarder::AddOrUpdateSink(rtc::VideoSinkInterface<VideoFrame>* sink,
249 const rtc::VideoSinkWants& wants) {
250 rtc::CritScope lock(&crit_);
251 RTC_DCHECK(!sink_ || sink_ == sink);
252 sink_ = sink;
253 }
254
255 void FrameForwarder::RemoveSink(rtc::VideoSinkInterface<VideoFrame>* sink) {
256 rtc::CritScope lock(&crit_);
257 RTC_DCHECK(sink == sink_);
258 sink_ = nullptr;
259 }
260
242 FrameGenerator* FrameGenerator::CreateChromaGenerator(size_t width, 261 FrameGenerator* FrameGenerator::CreateChromaGenerator(size_t width,
243 size_t height) { 262 size_t height) {
244 return new ChromaGenerator(width, height); 263 return new ChromaGenerator(width, height);
245 } 264 }
246 265
247 FrameGenerator* FrameGenerator::CreateFromYuvFile( 266 FrameGenerator* FrameGenerator::CreateFromYuvFile(
248 std::vector<std::string> filenames, 267 std::vector<std::string> filenames,
249 size_t width, 268 size_t width,
250 size_t height, 269 size_t height,
251 int frame_repeat_count) { 270 int frame_repeat_count) {
(...skipping 25 matching lines...) Expand all
277 files.push_back(file); 296 files.push_back(file);
278 } 297 }
279 298
280 return new ScrollingImageFrameGenerator( 299 return new ScrollingImageFrameGenerator(
281 clock, files, source_width, source_height, target_width, target_height, 300 clock, files, source_width, source_height, target_width, target_height,
282 scroll_time_ms, pause_time_ms); 301 scroll_time_ms, pause_time_ms);
283 } 302 }
284 303
285 } // namespace test 304 } // namespace test
286 } // namespace webrtc 305 } // namespace webrtc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698