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

Unified Diff: remoting/protocol/webrtc_video_capturer_adapter.cc

Issue 1745923002: Remove use of deprecated methods to cricket::VideoCapturer in WebrtcVideoCapturerAdapter (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 9 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « remoting/protocol/webrtc_video_capturer_adapter.h ('k') | remoting/protocol/webrtc_video_stream.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: remoting/protocol/webrtc_video_capturer_adapter.cc
diff --git a/remoting/protocol/webrtc_video_capturer_adapter.cc b/remoting/protocol/webrtc_video_capturer_adapter.cc
index c0aeea1a193fe1cca5953777784155ef47c3e01c..0511a8fd390b5e2bfd8decda2516f77eef982036 100644
--- a/remoting/protocol/webrtc_video_capturer_adapter.cc
+++ b/remoting/protocol/webrtc_video_capturer_adapter.cc
@@ -71,16 +71,11 @@ cricket::CaptureState WebrtcVideoCapturerAdapter::Start(
return cricket::CS_RUNNING;
}
-// Similar to the base class implementation with some important differences:
-// 1. Does not call either Stop() or Start(), as those would affect the state of
-// |desktop_capturer_|.
-// 2. Does not support unpausing after stopping the capturer. It is unclear
-// if that flow needs to be supported.
-bool WebrtcVideoCapturerAdapter::Pause(bool pause) {
+bool WebrtcVideoCapturerAdapter::PauseCapturer(bool pause) {
DCHECK(thread_checker_.CalledOnValidThread());
if (pause) {
- if (capture_state() == cricket::CS_PAUSED)
+ if (paused_)
return true;
bool running = capture_state() == cricket::CS_STARTING ||
@@ -94,28 +89,25 @@ bool WebrtcVideoCapturerAdapter::Pause(bool pause) {
return false;
}
- // Stop |capture_timer_| and set capture state to cricket::CS_PAUSED.
capture_timer_->Stop();
- SetCaptureState(cricket::CS_PAUSED);
+ paused_ = true;
VLOG(1) << "WebrtcVideoCapturerAdapter paused.";
return true;
} else { // Unpausing.
- if (capture_state() != cricket::CS_PAUSED || !GetCaptureFormat() ||
- !capture_timer_) {
+ if (!paused_ || !GetCaptureFormat() || !capture_timer_) {
LOG(ERROR) << "Cannot unpause WebrtcVideoCapturerAdapter.";
return false;
}
- // Restart |capture_timer_| and set capture state to cricket::CS_RUNNING;
capture_timer_->Start(FROM_HERE,
base::TimeDelta::FromMicroseconds(
GetCaptureFormat()->interval /
(base::Time::kNanosecondsPerMicrosecond)),
this,
&WebrtcVideoCapturerAdapter::CaptureNextFrame);
- SetCaptureState(cricket::CS_RUNNING);
+ paused_ = false;
VLOG(1) << "WebrtcVideoCapturerAdapter unpaused.";
}
@@ -223,7 +215,7 @@ void WebrtcVideoCapturerAdapter::OnCaptureCompleted(
yuv_frame_->GetVPitch(), width, height);
}
- SignalVideoFrame(this, yuv_frame_.get());
+ OnFrame(this, yuv_frame_.get());
}
void WebrtcVideoCapturerAdapter::CaptureNextFrame() {
« no previous file with comments | « remoting/protocol/webrtc_video_capturer_adapter.h ('k') | remoting/protocol/webrtc_video_stream.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698