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

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

Issue 2304363002: Let ViEEncoder express resolution requests as Sinkwants (Closed)
Patch Set: Revert changes to OveruseFrameDetector. Fix merge mistake Created 4 years, 1 month 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 238 matching lines...) Expand 10 before | Expand all | Expand 10 after
249 rtc::CritScope lock(&crit_); 249 rtc::CritScope lock(&crit_);
250 if (sink_) 250 if (sink_)
251 sink_->OnFrame(video_frame); 251 sink_->OnFrame(video_frame);
252 } 252 }
253 253
254 void FrameForwarder::AddOrUpdateSink(rtc::VideoSinkInterface<VideoFrame>* sink, 254 void FrameForwarder::AddOrUpdateSink(rtc::VideoSinkInterface<VideoFrame>* sink,
255 const rtc::VideoSinkWants& wants) { 255 const rtc::VideoSinkWants& wants) {
256 rtc::CritScope lock(&crit_); 256 rtc::CritScope lock(&crit_);
257 RTC_DCHECK(!sink_ || sink_ == sink); 257 RTC_DCHECK(!sink_ || sink_ == sink);
258 sink_ = sink; 258 sink_ = sink;
259 sink_wants_ = wants;
259 } 260 }
260 261
261 void FrameForwarder::RemoveSink(rtc::VideoSinkInterface<VideoFrame>* sink) { 262 void FrameForwarder::RemoveSink(rtc::VideoSinkInterface<VideoFrame>* sink) {
262 rtc::CritScope lock(&crit_); 263 rtc::CritScope lock(&crit_);
263 RTC_DCHECK_EQ(sink, sink_); 264 RTC_DCHECK_EQ(sink, sink_);
264 sink_ = nullptr; 265 sink_ = nullptr;
265 } 266 }
266 267
268 rtc::VideoSinkWants FrameForwarder::current_sink_wants() const {
åsapersson 2016/10/31 08:43:02 sink_wants()
perkj_webrtc 2016/10/31 19:45:18 Done.
269 rtc::CritScope lock(&crit_);
270 return sink_wants_;
271 }
272
273 bool FrameForwarder::has_sinks() const {
274 rtc::CritScope lock(&crit_);
275 return sink_ != nullptr;
276 }
277
267 FrameGenerator* FrameGenerator::CreateChromaGenerator(size_t width, 278 FrameGenerator* FrameGenerator::CreateChromaGenerator(size_t width,
268 size_t height) { 279 size_t height) {
269 return new ChromaGenerator(width, height); 280 return new ChromaGenerator(width, height);
270 } 281 }
271 282
272 FrameGenerator* FrameGenerator::CreateFromYuvFile( 283 FrameGenerator* FrameGenerator::CreateFromYuvFile(
273 std::vector<std::string> filenames, 284 std::vector<std::string> filenames,
274 size_t width, 285 size_t width,
275 size_t height, 286 size_t height,
276 int frame_repeat_count) { 287 int frame_repeat_count) {
(...skipping 25 matching lines...) Expand all
302 files.push_back(file); 313 files.push_back(file);
303 } 314 }
304 315
305 return new ScrollingImageFrameGenerator( 316 return new ScrollingImageFrameGenerator(
306 clock, files, source_width, source_height, target_width, target_height, 317 clock, files, source_width, source_height, target_width, target_height,
307 scroll_time_ms, pause_time_ms); 318 scroll_time_ms, pause_time_ms);
308 } 319 }
309 320
310 } // namespace test 321 } // namespace test
311 } // namespace webrtc 322 } // namespace webrtc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698