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

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

Issue 2304363002: Let ViEEncoder express resolution requests as Sinkwants (Closed)
Patch Set: Rebased. 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
« 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 240 matching lines...) Expand 10 before | Expand all | Expand 10 after
251 rtc::CritScope lock(&crit_); 251 rtc::CritScope lock(&crit_);
252 if (sink_) 252 if (sink_)
253 sink_->OnFrame(video_frame); 253 sink_->OnFrame(video_frame);
254 } 254 }
255 255
256 void FrameForwarder::AddOrUpdateSink(rtc::VideoSinkInterface<VideoFrame>* sink, 256 void FrameForwarder::AddOrUpdateSink(rtc::VideoSinkInterface<VideoFrame>* sink,
257 const rtc::VideoSinkWants& wants) { 257 const rtc::VideoSinkWants& wants) {
258 rtc::CritScope lock(&crit_); 258 rtc::CritScope lock(&crit_);
259 RTC_DCHECK(!sink_ || sink_ == sink); 259 RTC_DCHECK(!sink_ || sink_ == sink);
260 sink_ = sink; 260 sink_ = sink;
261 sink_wants_ = wants;
261 } 262 }
262 263
263 void FrameForwarder::RemoveSink(rtc::VideoSinkInterface<VideoFrame>* sink) { 264 void FrameForwarder::RemoveSink(rtc::VideoSinkInterface<VideoFrame>* sink) {
264 rtc::CritScope lock(&crit_); 265 rtc::CritScope lock(&crit_);
265 RTC_DCHECK_EQ(sink, sink_); 266 RTC_DCHECK_EQ(sink, sink_);
266 sink_ = nullptr; 267 sink_ = nullptr;
267 } 268 }
268 269
270 rtc::VideoSinkWants FrameForwarder::sink_wants() const {
271 rtc::CritScope lock(&crit_);
272 return sink_wants_;
273 }
274
275 bool FrameForwarder::has_sinks() const {
276 rtc::CritScope lock(&crit_);
277 return sink_ != nullptr;
278 }
279
269 FrameGenerator* FrameGenerator::CreateChromaGenerator(size_t width, 280 FrameGenerator* FrameGenerator::CreateChromaGenerator(size_t width,
270 size_t height) { 281 size_t height) {
271 return new ChromaGenerator(width, height); 282 return new ChromaGenerator(width, height);
272 } 283 }
273 284
274 FrameGenerator* FrameGenerator::CreateFromYuvFile( 285 FrameGenerator* FrameGenerator::CreateFromYuvFile(
275 std::vector<std::string> filenames, 286 std::vector<std::string> filenames,
276 size_t width, 287 size_t width,
277 size_t height, 288 size_t height,
278 int frame_repeat_count) { 289 int frame_repeat_count) {
(...skipping 25 matching lines...) Expand all
304 files.push_back(file); 315 files.push_back(file);
305 } 316 }
306 317
307 return new ScrollingImageFrameGenerator( 318 return new ScrollingImageFrameGenerator(
308 clock, files, source_width, source_height, target_width, target_height, 319 clock, files, source_width, source_height, target_width, target_height,
309 scroll_time_ms, pause_time_ms); 320 scroll_time_ms, pause_time_ms);
310 } 321 }
311 322
312 } // namespace test 323 } // namespace test
313 } // namespace webrtc 324 } // 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