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

Side by Side Diff: remoting/capturer/video_frame.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/video_capturer_mock_objects.cc ('k') | remoting/capturer/video_frame.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_VIDEO_FRAME_H_
6 #define REMOTING_CAPTURER_VIDEO_FRAME_H_
7
8 #include "base/basictypes.h"
9 #include "base/compiler_specific.h"
10 #include "base/memory/ref_counted.h"
11 #include "remoting/capturer/shared_buffer.h"
12 #include "third_party/skia/include/core/SkSize.h"
13 #include "third_party/skia/include/core/SkTypes.h"
14
15 namespace remoting {
16
17 // Represents a video frame.
18 class VideoFrame {
19 public:
20 virtual ~VideoFrame();
21
22 int bytes_per_row() const { return bytes_per_row_; }
23 const SkISize& dimensions() const { return dimensions_; }
24 uint8* pixels() const { return pixels_; }
25 const scoped_refptr<SharedBuffer>& shared_buffer() const {
26 return shared_buffer_;
27 }
28
29 protected:
30 // Initializes an empty video frame. Derived classes are expected to allocate
31 // memory for the frame in a platform-specific way and set the properties of
32 // the allocated frame.
33 VideoFrame();
34
35 void set_bytes_per_row(int bytes_per_row) {
36 bytes_per_row_ = bytes_per_row;
37 }
38
39 void set_dimensions(const SkISize& dimensions) { dimensions_ = dimensions; }
40 void set_pixels(uint8* ptr) { pixels_ = ptr; }
41 void set_shared_buffer(scoped_refptr<SharedBuffer> shared_buffer) {
42 shared_buffer_ = shared_buffer;
43 }
44
45 private:
46 // Bytes per row of pixels including necessary padding.
47 int bytes_per_row_;
48
49 // Dimensions of the buffer in pixels.
50 SkISize dimensions_;
51
52 // Points to the pixel buffer.
53 uint8* pixels_;
54
55 // Points to an optional shared memory buffer that backs up |pixels_| buffer.
56 scoped_refptr<SharedBuffer> shared_buffer_;
57
58 DISALLOW_COPY_AND_ASSIGN(VideoFrame);
59 };
60
61 } // namespace remoting
62
63 #endif // REMOTING_CAPTURER_VIDEO_FRAME_H_
OLDNEW
« no previous file with comments | « remoting/capturer/video_capturer_mock_objects.cc ('k') | remoting/capturer/video_frame.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698