OLD | NEW |
---|---|
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 Loading... | |
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 current_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 { | |
269 rtc::CritScope lock(&crit_); | |
270 return current_sink_wants_; | |
271 } | |
272 | |
273 size_t FrameForwarder::number_of_sinks() const { | |
åsapersson
2016/10/24 07:54:05
maybe bool has_sink()
perkj_webrtc
2016/10/26 16:40:16
A source should support multiple sinks.. Currently
| |
274 rtc::CritScope lock(&crit_); | |
275 return sink_ ? 1u : 0u; | |
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 Loading... | |
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 |
OLD | NEW |