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

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

Issue 3003193002: Add a new frame generator that cycles through randomly generated slides. (Closed)
Patch Set: Patchset 3C. Created 3 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_capturer.h ('k') | webrtc/test/frame_generator_unittest.cc » ('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 10
(...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after
107 clock, 107 clock,
108 FrameGenerator::CreateFromYuvFile(std::vector<std::string>(1, file_name), 108 FrameGenerator::CreateFromYuvFile(std::vector<std::string>(1, file_name),
109 width, height, 1), 109 width, height, 1),
110 target_fps)); 110 target_fps));
111 if (!capturer->Init()) 111 if (!capturer->Init())
112 return nullptr; 112 return nullptr;
113 113
114 return capturer.release(); 114 return capturer.release();
115 } 115 }
116 116
117 FrameGeneratorCapturer* FrameGeneratorCapturer::CreateSlideGenerator(
118 int width,
119 int height,
erikvarga1 2017/08/29 15:26:41 Changed the width and height from size_t to int (l
120 int frame_repeat_count,
121 int target_fps,
122 Clock* clock) {
123 std::unique_ptr<FrameGeneratorCapturer> capturer(new FrameGeneratorCapturer(
124 clock, FrameGenerator::CreateSlideGenerator(width, height,
125 frame_repeat_count),
126 target_fps));
127 if (!capturer->Init())
128 return nullptr;
129
130 return capturer.release();
131 }
132
117 FrameGeneratorCapturer::FrameGeneratorCapturer( 133 FrameGeneratorCapturer::FrameGeneratorCapturer(
118 Clock* clock, 134 Clock* clock,
119 std::unique_ptr<FrameGenerator> frame_generator, 135 std::unique_ptr<FrameGenerator> frame_generator,
120 int target_fps) 136 int target_fps)
121 : clock_(clock), 137 : clock_(clock),
122 sending_(false), 138 sending_(false),
123 sink_(nullptr), 139 sink_(nullptr),
124 sink_wants_observer_(nullptr), 140 sink_wants_observer_(nullptr),
125 frame_generator_(std::move(frame_generator)), 141 frame_generator_(std::move(frame_generator)),
126 target_fps_(target_fps), 142 target_fps_(target_fps),
(...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after
234 250
235 int FrameGeneratorCapturer::GetCurrentConfiguredFramerate() { 251 int FrameGeneratorCapturer::GetCurrentConfiguredFramerate() {
236 rtc::CritScope cs(&lock_); 252 rtc::CritScope cs(&lock_);
237 if (wanted_fps_ && *wanted_fps_ < target_fps_) 253 if (wanted_fps_ && *wanted_fps_ < target_fps_)
238 return *wanted_fps_; 254 return *wanted_fps_;
239 return target_fps_; 255 return target_fps_;
240 } 256 }
241 257
242 } // namespace test 258 } // namespace test
243 } // namespace webrtc 259 } // namespace webrtc
OLDNEW
« no previous file with comments | « webrtc/test/frame_generator_capturer.h ('k') | webrtc/test/frame_generator_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698