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

Side by Side Diff: remoting/host/cast_video_capturer_adapter.cc

Issue 1355063004: Template methods on Timer classes instead of the classes themselves. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: timer: fixcaller Created 5 years, 3 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 | « remoting/host/cast_video_capturer_adapter.h ('k') | remoting/host/chromeos/clipboard_aura.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 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "remoting/host/cast_video_capturer_adapter.h" 5 #include "remoting/host/cast_video_capturer_adapter.h"
6 6
7 #include "third_party/webrtc/modules/desktop_capture/desktop_frame.h" 7 #include "third_party/webrtc/modules/desktop_capture/desktop_frame.h"
8 8
9 namespace remoting { 9 namespace remoting {
10 10
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after
88 // This is required to tell the cricket::VideoCapturer base class what the 88 // This is required to tell the cricket::VideoCapturer base class what the
89 // capture format will be. 89 // capture format will be.
90 SetCaptureFormat(&capture_format); 90 SetCaptureFormat(&capture_format);
91 91
92 desktop_capturer_->Start(this); 92 desktop_capturer_->Start(this);
93 93
94 // Save the Start() time of |desktop_capturer_|. This will be used 94 // Save the Start() time of |desktop_capturer_|. This will be used
95 // to estimate the creation time of the frame source, to set the elapsed_time 95 // to estimate the creation time of the frame source, to set the elapsed_time
96 // of future CapturedFrames in OnCaptureCompleted(). 96 // of future CapturedFrames in OnCaptureCompleted().
97 start_time_ = base::TimeTicks::Now(); 97 start_time_ = base::TimeTicks::Now();
98 capture_timer_.reset(new base::RepeatingTimer<CastVideoCapturerAdapter>()); 98 capture_timer_.reset(new base::RepeatingTimer());
99 capture_timer_->Start(FROM_HERE, 99 capture_timer_->Start(FROM_HERE,
100 base::TimeDelta::FromMicroseconds( 100 base::TimeDelta::FromMicroseconds(
101 GetCaptureFormat()->interval / 101 GetCaptureFormat()->interval /
102 (base::Time::kNanosecondsPerMicrosecond)), 102 (base::Time::kNanosecondsPerMicrosecond)),
103 this, 103 this,
104 &CastVideoCapturerAdapter::CaptureNextFrame); 104 &CastVideoCapturerAdapter::CaptureNextFrame);
105 105
106 return cricket::CS_RUNNING; 106 return cricket::CS_RUNNING;
107 } 107 }
108 108
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after
192 void CastVideoCapturerAdapter::CaptureNextFrame() { 192 void CastVideoCapturerAdapter::CaptureNextFrame() {
193 // If we are paused, then don't capture. 193 // If we are paused, then don't capture.
194 if (!IsRunning()) 194 if (!IsRunning())
195 return; 195 return;
196 196
197 desktop_capturer_->Capture(webrtc::DesktopRegion()); 197 desktop_capturer_->Capture(webrtc::DesktopRegion());
198 } 198 }
199 199
200 } // namespace remoting 200 } // namespace remoting
201 201
OLDNEW
« no previous file with comments | « remoting/host/cast_video_capturer_adapter.h ('k') | remoting/host/chromeos/clipboard_aura.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698