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

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

Issue 7062013: Move media library AutoTaskRunner to base and rename ScopedTaskRunner. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 9 years, 6 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 | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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/screen_recorder.h" 5 #include "remoting/host/screen_recorder.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 8
9 #include "base/logging.h" 9 #include "base/logging.h"
10 #include "base/memory/scoped_ptr.h" 10 #include "base/memory/scoped_ptr.h"
11 #include "base/stl_util-inl.h" 11 #include "base/stl_util-inl.h"
12 #include "base/task.h" 12 #include "base/task.h"
13 #include "base/time.h" 13 #include "base/time.h"
14 #include "media/base/callback.h"
15 #include "remoting/base/capture_data.h" 14 #include "remoting/base/capture_data.h"
16 #include "remoting/base/tracer.h" 15 #include "remoting/base/tracer.h"
17 #include "remoting/proto/control.pb.h" 16 #include "remoting/proto/control.pb.h"
18 #include "remoting/proto/video.pb.h" 17 #include "remoting/proto/video.pb.h"
19 #include "remoting/protocol/client_stub.h" 18 #include "remoting/protocol/client_stub.h"
20 #include "remoting/protocol/connection_to_client.h" 19 #include "remoting/protocol/connection_to_client.h"
21 #include "remoting/protocol/message_decoder.h" 20 #include "remoting/protocol/message_decoder.h"
22 #include "remoting/protocol/util.h" 21 #include "remoting/protocol/util.h"
23 22
24 using remoting::protocol::ConnectionToClient; 23 using remoting::protocol::ConnectionToClient;
(...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after
144 is_recording_ = true; 143 is_recording_ = true;
145 StartCaptureTimer(); 144 StartCaptureTimer();
146 145
147 // Capture first frame immedately. 146 // Capture first frame immedately.
148 DoCapture(); 147 DoCapture();
149 } 148 }
150 149
151 void ScreenRecorder::DoStop(Task* done_task) { 150 void ScreenRecorder::DoStop(Task* done_task) {
152 DCHECK_EQ(capture_loop_, MessageLoop::current()); 151 DCHECK_EQ(capture_loop_, MessageLoop::current());
153 152
154 media::AutoTaskRunner done_runner(done_task); 153 ScopedTaskRunner done_runner(done_task);
155 154
156 // We might have not started when we receive a stop command, simply run the 155 // We might have not started when we receive a stop command, simply run the
157 // task and then return. 156 // task and then return.
158 if (!is_recording_) 157 if (!is_recording_)
159 return; 158 return;
160 159
161 capture_timer_.Stop(); 160 capture_timer_.Stop();
162 is_recording_ = false; 161 is_recording_ = false;
163 162
164 DCHECK_GE(recordings_, 0); 163 DCHECK_GE(recordings_, 0);
(...skipping 234 matching lines...) Expand 10 before | Expand all | Expand 10 after
399 (base::Time::Now() - encode_start_time_).InMilliseconds()); 398 (base::Time::Now() - encode_start_time_).InMilliseconds());
400 packet->set_encode_time_ms(encode_time); 399 packet->set_encode_time_ms(encode_time);
401 } 400 }
402 401
403 network_loop_->PostTask( 402 network_loop_->PostTask(
404 FROM_HERE, 403 FROM_HERE,
405 NewTracedMethod(this, &ScreenRecorder::DoSendVideoPacket, packet)); 404 NewTracedMethod(this, &ScreenRecorder::DoSendVideoPacket, packet));
406 } 405 }
407 406
408 } // namespace remoting 407 } // namespace remoting
OLDNEW
« remoting/client/rectangle_update_decoder.cc ('K') | « remoting/host/event_executor_linux.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698