| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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_BASE_CAPTURE_DATA_H_ | 5 #ifndef REMOTING_BASE_CAPTURE_DATA_H_ |
| 6 #define REMOTING_BASE_CAPTURE_DATA_H_ | 6 #define REMOTING_BASE_CAPTURE_DATA_H_ |
| 7 | 7 |
| 8 #include <vector> | 8 #include <vector> |
| 9 | 9 |
| 10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
| 11 #include "base/ref_counted.h" | 11 #include "base/ref_counted.h" |
| 12 #include "media/base/video_frame.h" |
| 12 #include "remoting/base/types.h" | 13 #include "remoting/base/types.h" |
| 13 #include "remoting/proto/video.pb.h" | |
| 14 | 14 |
| 15 namespace remoting { | 15 namespace remoting { |
| 16 | 16 |
| 17 struct DataPlanes { | 17 struct DataPlanes { |
| 18 DataPlanes(); | 18 DataPlanes(); |
| 19 | 19 |
| 20 static const int kPlaneCount = 3; | 20 static const int kPlaneCount = 3; |
| 21 uint8* data[kPlaneCount]; | 21 uint8* data[kPlaneCount]; |
| 22 int strides[kPlaneCount]; | 22 int strides[kPlaneCount]; |
| 23 }; | 23 }; |
| 24 | 24 |
| 25 // Stores the data and information of a capture to pass off to the | 25 // Stores the data and information of a capture to pass off to the |
| 26 // encoding thread. | 26 // encoding thread. |
| 27 class CaptureData : public base::RefCountedThreadSafe<CaptureData> { | 27 class CaptureData : public base::RefCountedThreadSafe<CaptureData> { |
| 28 public: | 28 public: |
| 29 CaptureData(const DataPlanes &data_planes, | 29 CaptureData(const DataPlanes &data_planes, |
| 30 int width, | 30 int width, |
| 31 int height, | 31 int height, |
| 32 PixelFormat format); | 32 media::VideoFrame::Format format); |
| 33 | 33 |
| 34 // Get the data_planes data of the last capture. | 34 // Get the data_planes data of the last capture. |
| 35 const DataPlanes& data_planes() const { return data_planes_; } | 35 const DataPlanes& data_planes() const { return data_planes_; } |
| 36 | 36 |
| 37 // Get the list of updated rectangles in the last capture. The result is | 37 // Get the list of updated rectangles in the last capture. The result is |
| 38 // written into |rects|. | 38 // written into |rects|. |
| 39 const InvalidRects& dirty_rects() const { return dirty_rects_; } | 39 const InvalidRects& dirty_rects() const { return dirty_rects_; } |
| 40 | 40 |
| 41 // Get the width of the image captured. | 41 // Get the width of the image captured. |
| 42 int width() const { return width_; } | 42 int width() const { return width_; } |
| 43 | 43 |
| 44 // Get the height of the image captured. | 44 // Get the height of the image captured. |
| 45 int height() const { return height_; } | 45 int height() const { return height_; } |
| 46 | 46 |
| 47 // Get the pixel format of the image captured. | 47 // Get the pixel format of the image captured. |
| 48 PixelFormat pixel_format() const { return pixel_format_; } | 48 media::VideoFrame::Format pixel_format() const { return pixel_format_; } |
| 49 | 49 |
| 50 // Mutating methods. | 50 // Mutating methods. |
| 51 InvalidRects& mutable_dirty_rects() { return dirty_rects_; } | 51 InvalidRects& mutable_dirty_rects() { return dirty_rects_; } |
| 52 | 52 |
| 53 private: | 53 private: |
| 54 const DataPlanes data_planes_; | 54 const DataPlanes data_planes_; |
| 55 InvalidRects dirty_rects_; | 55 InvalidRects dirty_rects_; |
| 56 int width_; | 56 int width_; |
| 57 int height_; | 57 int height_; |
| 58 PixelFormat pixel_format_; | 58 media::VideoFrame::Format pixel_format_; |
| 59 | 59 |
| 60 friend class base::RefCountedThreadSafe<CaptureData>; | 60 friend class base::RefCountedThreadSafe<CaptureData>; |
| 61 virtual ~CaptureData(); | 61 virtual ~CaptureData(); |
| 62 }; | 62 }; |
| 63 | 63 |
| 64 } // namespace remoting | 64 } // namespace remoting |
| 65 | 65 |
| 66 #endif // REMOTING_BASE_CAPTURE_DATA_H_ | 66 #endif // REMOTING_BASE_CAPTURE_DATA_H_ |
| OLD | NEW |