| OLD | NEW |
| 1 /* | 1 /* |
| 2 * libjingle | 2 * libjingle |
| 3 * Copyright 2012 Google Inc. | 3 * Copyright 2012 Google Inc. |
| 4 * | 4 * |
| 5 * Redistribution and use in source and binary forms, with or without | 5 * Redistribution and use in source and binary forms, with or without |
| 6 * modification, are permitted provided that the following conditions are met: | 6 * modification, are permitted provided that the following conditions are met: |
| 7 * | 7 * |
| 8 * 1. Redistributions of source code must retain the above copyright notice, | 8 * 1. Redistributions of source code must retain the above copyright notice, |
| 9 * this list of conditions and the following disclaimer. | 9 * this list of conditions and the following disclaimer. |
| 10 * 2. Redistributions in binary form must reproduce the above copyright notice, | 10 * 2. Redistributions in binary form must reproduce the above copyright notice, |
| (...skipping 418 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 429 | 429 |
| 430 void VideoSource::Stop() { | 430 void VideoSource::Stop() { |
| 431 channel_manager_->StopVideoCapture(video_capturer_.get(), format_); | 431 channel_manager_->StopVideoCapture(video_capturer_.get(), format_); |
| 432 } | 432 } |
| 433 | 433 |
| 434 void VideoSource::Restart() { | 434 void VideoSource::Restart() { |
| 435 if (!channel_manager_->StartVideoCapture(video_capturer_.get(), format_)) { | 435 if (!channel_manager_->StartVideoCapture(video_capturer_.get(), format_)) { |
| 436 SetState(kEnded); | 436 SetState(kEnded); |
| 437 return; | 437 return; |
| 438 } | 438 } |
| 439 for (auto* sink : sinks_) { | 439 for(cricket::VideoRenderer* sink : sinks_) { |
| 440 channel_manager_->AddVideoSink(video_capturer_.get(), sink); | 440 channel_manager_->AddVideoRenderer(video_capturer_.get(), sink); |
| 441 } | 441 } |
| 442 } | 442 } |
| 443 | 443 |
| 444 void VideoSource::AddSink( | 444 void VideoSource::AddSink(cricket::VideoRenderer* output) { |
| 445 rtc::VideoSinkInterface<cricket::VideoFrame>* output) { | |
| 446 sinks_.push_back(output); | 445 sinks_.push_back(output); |
| 447 channel_manager_->AddVideoSink(video_capturer_.get(), output); | 446 channel_manager_->AddVideoRenderer(video_capturer_.get(), output); |
| 448 } | 447 } |
| 449 | 448 |
| 450 void VideoSource::RemoveSink( | 449 void VideoSource::RemoveSink(cricket::VideoRenderer* output) { |
| 451 rtc::VideoSinkInterface<cricket::VideoFrame>* output) { | |
| 452 sinks_.remove(output); | 450 sinks_.remove(output); |
| 453 channel_manager_->RemoveVideoSink(video_capturer_.get(), output); | 451 channel_manager_->RemoveVideoRenderer(video_capturer_.get(), output); |
| 454 } | 452 } |
| 455 | 453 |
| 456 // OnStateChange listens to the ChannelManager::SignalVideoCaptureStateChange. | 454 // OnStateChange listens to the ChannelManager::SignalVideoCaptureStateChange. |
| 457 // This signal is triggered for all video capturers. Not only the one we are | 455 // This signal is triggered for all video capturers. Not only the one we are |
| 458 // interested in. | 456 // interested in. |
| 459 void VideoSource::OnStateChange(cricket::VideoCapturer* capturer, | 457 void VideoSource::OnStateChange(cricket::VideoCapturer* capturer, |
| 460 cricket::CaptureState capture_state) { | 458 cricket::CaptureState capture_state) { |
| 461 if (capturer == video_capturer_.get()) { | 459 if (capturer == video_capturer_.get()) { |
| 462 SetState(GetReadyState(capture_state)); | 460 SetState(GetReadyState(capture_state)); |
| 463 } | 461 } |
| 464 } | 462 } |
| 465 | 463 |
| 466 void VideoSource::SetState(SourceState new_state) { | 464 void VideoSource::SetState(SourceState new_state) { |
| 467 // TODO(hbos): Temporarily disabled VERIFY due to webrtc:4776. | 465 // TODO(hbos): Temporarily disabled VERIFY due to webrtc:4776. |
| 468 // if (VERIFY(state_ != new_state)) { | 466 // if (VERIFY(state_ != new_state)) { |
| 469 if (state_ != new_state) { | 467 if (state_ != new_state) { |
| 470 state_ = new_state; | 468 state_ = new_state; |
| 471 FireOnChanged(); | 469 FireOnChanged(); |
| 472 } | 470 } |
| 473 } | 471 } |
| 474 | 472 |
| 475 } // namespace webrtc | 473 } // namespace webrtc |
| OLD | NEW |