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

Side by Side Diff: talk/app/webrtc/videosource.cc

Issue 1594973006: New rtc::VideoSinkInterface. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Workaround to not break chrome. Created 4 years, 11 months 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 | « talk/app/webrtc/videosource.h ('k') | talk/app/webrtc/videosourceinterface.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 * 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
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(cricket::VideoRenderer* sink : sinks_) { 439 for (auto* sink : sinks_) {
440 channel_manager_->AddVideoRenderer(video_capturer_.get(), sink); 440 channel_manager_->AddVideoSink(video_capturer_.get(), sink);
441 } 441 }
442 } 442 }
443 443
444 void VideoSource::AddSink(cricket::VideoRenderer* output) { 444 void VideoSource::AddSink(
445 rtc::VideoSinkInterface<cricket::VideoFrame>* output) {
445 sinks_.push_back(output); 446 sinks_.push_back(output);
446 channel_manager_->AddVideoRenderer(video_capturer_.get(), output); 447 channel_manager_->AddVideoSink(video_capturer_.get(), output);
447 } 448 }
448 449
449 void VideoSource::RemoveSink(cricket::VideoRenderer* output) { 450 void VideoSource::RemoveSink(
451 rtc::VideoSinkInterface<cricket::VideoFrame>* output) {
450 sinks_.remove(output); 452 sinks_.remove(output);
451 channel_manager_->RemoveVideoRenderer(video_capturer_.get(), output); 453 channel_manager_->RemoveVideoSink(video_capturer_.get(), output);
452 } 454 }
453 455
454 // OnStateChange listens to the ChannelManager::SignalVideoCaptureStateChange. 456 // OnStateChange listens to the ChannelManager::SignalVideoCaptureStateChange.
455 // This signal is triggered for all video capturers. Not only the one we are 457 // This signal is triggered for all video capturers. Not only the one we are
456 // interested in. 458 // interested in.
457 void VideoSource::OnStateChange(cricket::VideoCapturer* capturer, 459 void VideoSource::OnStateChange(cricket::VideoCapturer* capturer,
458 cricket::CaptureState capture_state) { 460 cricket::CaptureState capture_state) {
459 if (capturer == video_capturer_.get()) { 461 if (capturer == video_capturer_.get()) {
460 SetState(GetReadyState(capture_state)); 462 SetState(GetReadyState(capture_state));
461 } 463 }
462 } 464 }
463 465
464 void VideoSource::SetState(SourceState new_state) { 466 void VideoSource::SetState(SourceState new_state) {
465 // TODO(hbos): Temporarily disabled VERIFY due to webrtc:4776. 467 // TODO(hbos): Temporarily disabled VERIFY due to webrtc:4776.
466 // if (VERIFY(state_ != new_state)) { 468 // if (VERIFY(state_ != new_state)) {
467 if (state_ != new_state) { 469 if (state_ != new_state) {
468 state_ = new_state; 470 state_ = new_state;
469 FireOnChanged(); 471 FireOnChanged();
470 } 472 }
471 } 473 }
472 474
473 } // namespace webrtc 475 } // namespace webrtc
OLDNEW
« no previous file with comments | « talk/app/webrtc/videosource.h ('k') | talk/app/webrtc/videosourceinterface.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698