OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2012 The WebRTC project authors. All Rights Reserved. | 2 * Copyright 2012 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 376 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
387 } | 387 } |
388 if (!worker_thread_->Invoke<bool>( | 388 if (!worker_thread_->Invoke<bool>( |
389 rtc::Bind(&cricket::VideoCapturer::StartCapturing, | 389 rtc::Bind(&cricket::VideoCapturer::StartCapturing, |
390 video_capturer_.get(), format_))) { | 390 video_capturer_.get(), format_))) { |
391 SetState(kEnded); | 391 SetState(kEnded); |
392 return; | 392 return; |
393 } | 393 } |
394 started_ = true; | 394 started_ = true; |
395 } | 395 } |
396 | 396 |
397 void VideoSource::AddSink( | 397 void VideoSource::AddOrUpdateSink( |
398 rtc::VideoSinkInterface<cricket::VideoFrame>* output) { | 398 rtc::VideoSinkInterface<cricket::VideoFrame>* sink, |
399 // TODO(perkj): Use fake rtc::VideoSinkWants for now. This will change once | 399 const rtc::VideoSinkWants& wants) { |
400 // webrtc::VideoSourceInterface inherit rtc::VideoSourceInterface. | |
401 worker_thread_->Invoke<void>( | 400 worker_thread_->Invoke<void>( |
402 rtc::Bind(&cricket::VideoCapturer::AddOrUpdateSink, | 401 rtc::Bind(&cricket::VideoCapturer::AddOrUpdateSink, |
403 video_capturer_.get(), output, rtc::VideoSinkWants())); | 402 video_capturer_.get(), sink, wants)); |
404 } | 403 } |
405 | 404 |
406 void VideoSource::RemoveSink( | 405 void VideoSource::RemoveSink( |
407 rtc::VideoSinkInterface<cricket::VideoFrame>* output) { | 406 rtc::VideoSinkInterface<cricket::VideoFrame>* output) { |
408 worker_thread_->Invoke<void>( | 407 worker_thread_->Invoke<void>( |
409 rtc::Bind(&cricket::VideoCapturer::RemoveSink, | 408 rtc::Bind(&cricket::VideoCapturer::RemoveSink, |
410 video_capturer_.get(), output)); | 409 video_capturer_.get(), output)); |
411 } | 410 } |
412 | 411 |
413 // OnStateChange listens to the cricket::VideoCapturer::SignalStateChange. | 412 // OnStateChange listens to the cricket::VideoCapturer::SignalStateChange. |
(...skipping 12 matching lines...) Expand all Loading... |
426 } | 425 } |
427 | 426 |
428 void VideoSource::SetState(SourceState new_state) { | 427 void VideoSource::SetState(SourceState new_state) { |
429 if (state_ != new_state) { | 428 if (state_ != new_state) { |
430 state_ = new_state; | 429 state_ = new_state; |
431 FireOnChanged(); | 430 FireOnChanged(); |
432 } | 431 } |
433 } | 432 } |
434 | 433 |
435 } // namespace webrtc | 434 } // namespace webrtc |
OLD | NEW |