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

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

Issue 10382184: [Chromoting] Initial plumbing for cursor shape. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Call SetCursor only for native format images Created 8 years, 7 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) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 #ifndef REMOTING_HOST_SCREEN_RECORDER_H_ 5 #ifndef REMOTING_HOST_SCREEN_RECORDER_H_
6 #define REMOTING_HOST_SCREEN_RECORDER_H_ 6 #define REMOTING_HOST_SCREEN_RECORDER_H_
7 7
8 #include <vector> 8 #include <vector>
9 9
10 #include "base/basictypes.h" 10 #include "base/basictypes.h"
11 #include "base/callback.h" 11 #include "base/callback.h"
12 #include "base/memory/ref_counted.h" 12 #include "base/memory/ref_counted.h"
13 #include "base/memory/scoped_ptr.h" 13 #include "base/memory/scoped_ptr.h"
14 #include "base/message_loop.h" 14 #include "base/message_loop.h"
15 #include "base/time.h" 15 #include "base/time.h"
16 #include "base/timer.h" 16 #include "base/timer.h"
17 #include "remoting/base/encoder.h" 17 #include "remoting/base/encoder.h"
18 #include "remoting/host/capturer.h" 18 #include "remoting/host/capturer.h"
19 #include "remoting/host/capture_scheduler.h" 19 #include "remoting/host/capture_scheduler.h"
20 #include "remoting/proto/video.pb.h" 20 #include "remoting/proto/video.pb.h"
21 21
22 namespace base { 22 namespace base {
23 class MessageLoopProxy; 23 class MessageLoopProxy;
24 } // namespace base 24 } // namespace base
25 25
26 namespace remoting { 26 namespace remoting {
27 27
28 namespace protocol { 28 namespace protocol {
29 class ConnectionToClient; 29 class ConnectionToClient;
30 class CursorShapeInfo;
30 } // namespace protocol 31 } // namespace protocol
31 32
32 class CaptureData; 33 class CaptureData;
33 34
34 // A class for controlling and coordinate Capturer, Encoder 35 // A class for controlling and coordinate Capturer, Encoder
35 // and NetworkChannel in a record session. 36 // and NetworkChannel in a record session.
36 // 37 //
37 // THREADING 38 // THREADING
38 // 39 //
39 // This class works on three threads, namely capture, encode and network 40 // This class works on three threads, namely capture, encode and network
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after
116 // Capturer thread ---------------------------------------------------------- 117 // Capturer thread ----------------------------------------------------------
117 118
118 void DoStart(); 119 void DoStart();
119 void DoSetMaxRate(double max_rate); 120 void DoSetMaxRate(double max_rate);
120 121
121 // Hepler method to schedule next capture using the current rate. 122 // Hepler method to schedule next capture using the current rate.
122 void StartCaptureTimer(); 123 void StartCaptureTimer();
123 124
124 void DoCapture(); 125 void DoCapture();
125 void CaptureDoneCallback(scoped_refptr<CaptureData> capture_data); 126 void CaptureDoneCallback(scoped_refptr<CaptureData> capture_data);
127 void CursorShapeChangedCallback(
128 scoped_ptr<protocol::CursorShapeInfo> cursor_data);
126 void DoFinishOneRecording(); 129 void DoFinishOneRecording();
127 void DoInvalidateFullScreen(); 130 void DoInvalidateFullScreen();
128 131
129 // Network thread ----------------------------------------------------------- 132 // Network thread -----------------------------------------------------------
130 133
131 void DoSendVideoPacket(scoped_ptr<VideoPacket> packet); 134 void DoSendVideoPacket(scoped_ptr<VideoPacket> packet);
132 135
133 void DoSendInit(scoped_refptr<protocol::ConnectionToClient> connection, 136 void DoSendInit(scoped_refptr<protocol::ConnectionToClient> connection,
134 int width, int height); 137 int width, int height);
135 138
136 // Signal network thread to cease activities. 139 // Signal network thread to cease activities.
137 void DoStopOnNetworkThread(const base::Closure& done_task); 140 void DoStopOnNetworkThread(const base::Closure& done_task);
138 141
139 // Callback for VideoStub::ProcessVideoPacket() that is used for 142 // Callback for VideoStub::ProcessVideoPacket() that is used for
140 // each last packet in a frame. 143 // each last packet in a frame.
141 void VideoFrameSentCallback(); 144 void VideoFrameSentCallback();
142 145
146 // Send updated cursor shape to client.
147 void DoSendCursorShape(scoped_ptr<protocol::CursorShapeInfo> cursor_shape);
148
143 // Encoder thread ----------------------------------------------------------- 149 // Encoder thread -----------------------------------------------------------
144 150
145 void DoEncode(scoped_refptr<CaptureData> capture_data); 151 void DoEncode(scoped_refptr<CaptureData> capture_data);
152 void DoEncodeCursorShape(scoped_ptr<protocol::CursorShapeInfo> cursor);
146 153
147 // Perform stop operations on encode thread. 154 // Perform stop operations on encode thread.
148 void DoStopOnEncodeThread(const base::Closure& done_task); 155 void DoStopOnEncodeThread(const base::Closure& done_task);
149 156
150 void EncodedDataAvailableCallback(scoped_ptr<VideoPacket> packet); 157 void EncodedDataAvailableCallback(scoped_ptr<VideoPacket> packet);
151 void SendVideoPacket(VideoPacket* packet); 158 void SendVideoPacket(VideoPacket* packet);
152 159
153 // Message loops used by this class. 160 // Message loops used by this class.
154 MessageLoop* capture_loop_; 161 MessageLoop* capture_loop_;
155 MessageLoop* encode_loop_; 162 MessageLoop* encode_loop_;
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
197 204
198 // An object to schedule capturing. 205 // An object to schedule capturing.
199 CaptureScheduler scheduler_; 206 CaptureScheduler scheduler_;
200 207
201 DISALLOW_COPY_AND_ASSIGN(ScreenRecorder); 208 DISALLOW_COPY_AND_ASSIGN(ScreenRecorder);
202 }; 209 };
203 210
204 } // namespace remoting 211 } // namespace remoting
205 212
206 #endif // REMOTING_HOST_SCREEN_RECORDER_H_ 213 #endif // REMOTING_HOST_SCREEN_RECORDER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698