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

Side by Side Diff: remoting/capturer/capture_data.h

Issue 12047101: Move screen capturers from remoting/capturer to media/video/capturer/screen (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 10 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
« no previous file with comments | « remoting/capturer/DEPS ('k') | remoting/capturer/capture_data.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
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
3 // found in the LICENSE file.
4
5 #ifndef REMOTING_CAPTURER_CAPTURE_DATA_H_
6 #define REMOTING_CAPTURER_CAPTURE_DATA_H_
7
8 #include <vector>
9
10 #include "base/basictypes.h"
11 #include "base/memory/ref_counted.h"
12 #include "remoting/capturer/shared_buffer.h"
13 #include "third_party/skia/include/core/SkRegion.h"
14
15 namespace remoting {
16
17 class SharedBuffer;
18
19 // Stores the data and information of a capture to pass off to the
20 // encoding thread.
21 class CaptureData : public base::RefCountedThreadSafe<CaptureData> {
22 public:
23 // 32 bit RGB is 4 bytes per pixel.
24 static const int kBytesPerPixel = 4;
25
26 CaptureData(uint8* data, int stride, const SkISize& size);
27
28 // Data buffer.
29 uint8* data() const { return data_; }
30
31 // Distance in bytes between neighboring lines in the data buffer.
32 int stride() const { return stride_; }
33
34 // Gets the dirty region from the previous capture.
35 const SkRegion& dirty_region() const { return dirty_region_; }
36
37 // Returns the size of the image captured.
38 SkISize size() const { return size_; }
39
40 SkRegion& mutable_dirty_region() { return dirty_region_; }
41
42 // Returns the time spent on capturing.
43 int capture_time_ms() const { return capture_time_ms_; }
44
45 // Sets the time spent on capturing.
46 void set_capture_time_ms(int capture_time_ms) {
47 capture_time_ms_ = capture_time_ms;
48 }
49
50 int64 client_sequence_number() const { return client_sequence_number_; }
51
52 void set_client_sequence_number(int64 client_sequence_number) {
53 client_sequence_number_ = client_sequence_number;
54 }
55
56 SkIPoint dpi() const { return dpi_; }
57
58 void set_dpi(const SkIPoint& dpi) { dpi_ = dpi; }
59
60 // Returns the shared memory buffer pointed to by |data|.
61 scoped_refptr<SharedBuffer> shared_buffer() const { return shared_buffer_; }
62
63 // Sets the shared memory buffer pointed to by |data|.
64 void set_shared_buffer(scoped_refptr<SharedBuffer> shared_buffer) {
65 shared_buffer_ = shared_buffer;
66 }
67
68 private:
69 friend class base::RefCountedThreadSafe<CaptureData>;
70 virtual ~CaptureData();
71
72 uint8* data_;
73 int stride_;
74 SkRegion dirty_region_;
75 SkISize size_;
76
77 // Time spent in capture. Unit is in milliseconds.
78 int capture_time_ms_;
79
80 // Sequence number supplied by client for performance tracking.
81 int64 client_sequence_number_;
82
83 // DPI for this frame.
84 SkIPoint dpi_;
85
86 scoped_refptr<SharedBuffer> shared_buffer_;
87 };
88
89 } // namespace remoting
90
91 #endif // REMOTING_CAPTURER_CAPTURE_DATA_H_
OLDNEW
« no previous file with comments | « remoting/capturer/DEPS ('k') | remoting/capturer/capture_data.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698