| OLD | NEW |
| 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_CAPTURER_CAPTURE_DATA_H_ | 5 #ifndef MEDIA_VIDEO_CAPTURE_SCREEN_CAPTURE_DATA_H_ |
| 6 #define REMOTING_CAPTURER_CAPTURE_DATA_H_ | 6 #define MEDIA_VIDEO_CAPTURE_SCREEN_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/memory/ref_counted.h" | 11 #include "base/memory/ref_counted.h" |
| 12 #include "remoting/capturer/shared_buffer.h" | 12 #include "media/base/media_export.h" |
| 13 #include "media/video/capture/screen/shared_buffer.h" |
| 13 #include "third_party/skia/include/core/SkRegion.h" | 14 #include "third_party/skia/include/core/SkRegion.h" |
| 14 | 15 |
| 15 namespace remoting { | 16 namespace media { |
| 16 | 17 |
| 17 class SharedBuffer; | 18 class SharedBuffer; |
| 18 | 19 |
| 19 // Stores the data and information of a capture to pass off to the | 20 // Stores the data and information of a capture to pass off to the |
| 20 // encoding thread. | 21 // encoding thread. |
| 21 class CaptureData : public base::RefCountedThreadSafe<CaptureData> { | 22 class MEDIA_EXPORT ScreenCaptureData |
| 23 : public base::RefCountedThreadSafe<ScreenCaptureData> { |
| 22 public: | 24 public: |
| 23 // 32 bit RGB is 4 bytes per pixel. | 25 // 32 bit RGB is 4 bytes per pixel. |
| 24 static const int kBytesPerPixel = 4; | 26 static const int kBytesPerPixel = 4; |
| 25 | 27 |
| 26 CaptureData(uint8* data, int stride, const SkISize& size); | 28 ScreenCaptureData(uint8* data, int stride, const SkISize& size); |
| 27 | 29 |
| 28 // Data buffer. | 30 // Data buffer. |
| 29 uint8* data() const { return data_; } | 31 uint8* data() const { return data_; } |
| 30 | 32 |
| 31 // Distance in bytes between neighboring lines in the data buffer. | 33 // Distance in bytes between neighboring lines in the data buffer. |
| 32 int stride() const { return stride_; } | 34 int stride() const { return stride_; } |
| 33 | 35 |
| 34 // Gets the dirty region from the previous capture. | 36 // Gets the dirty region from the previous capture. |
| 35 const SkRegion& dirty_region() const { return dirty_region_; } | 37 const SkRegion& dirty_region() const { return dirty_region_; } |
| 36 | 38 |
| (...skipping 22 matching lines...) Expand all Loading... |
| 59 | 61 |
| 60 // Returns the shared memory buffer pointed to by |data|. | 62 // Returns the shared memory buffer pointed to by |data|. |
| 61 scoped_refptr<SharedBuffer> shared_buffer() const { return shared_buffer_; } | 63 scoped_refptr<SharedBuffer> shared_buffer() const { return shared_buffer_; } |
| 62 | 64 |
| 63 // Sets the shared memory buffer pointed to by |data|. | 65 // Sets the shared memory buffer pointed to by |data|. |
| 64 void set_shared_buffer(scoped_refptr<SharedBuffer> shared_buffer) { | 66 void set_shared_buffer(scoped_refptr<SharedBuffer> shared_buffer) { |
| 65 shared_buffer_ = shared_buffer; | 67 shared_buffer_ = shared_buffer; |
| 66 } | 68 } |
| 67 | 69 |
| 68 private: | 70 private: |
| 69 friend class base::RefCountedThreadSafe<CaptureData>; | 71 friend class base::RefCountedThreadSafe<ScreenCaptureData>; |
| 70 virtual ~CaptureData(); | 72 virtual ~ScreenCaptureData(); |
| 71 | 73 |
| 72 uint8* data_; | 74 uint8* data_; |
| 73 int stride_; | 75 int stride_; |
| 74 SkRegion dirty_region_; | 76 SkRegion dirty_region_; |
| 75 SkISize size_; | 77 SkISize size_; |
| 76 | 78 |
| 77 // Time spent in capture. Unit is in milliseconds. | 79 // Time spent in capture. Unit is in milliseconds. |
| 78 int capture_time_ms_; | 80 int capture_time_ms_; |
| 79 | 81 |
| 80 // Sequence number supplied by client for performance tracking. | 82 // Sequence number supplied by client for performance tracking. |
| 81 int64 client_sequence_number_; | 83 int64 client_sequence_number_; |
| 82 | 84 |
| 83 // DPI for this frame. | 85 // DPI for this frame. |
| 84 SkIPoint dpi_; | 86 SkIPoint dpi_; |
| 85 | 87 |
| 86 scoped_refptr<SharedBuffer> shared_buffer_; | 88 scoped_refptr<SharedBuffer> shared_buffer_; |
| 87 }; | 89 }; |
| 88 | 90 |
| 89 } // namespace remoting | 91 } // namespace media |
| 90 | 92 |
| 91 #endif // REMOTING_CAPTURER_CAPTURE_DATA_H_ | 93 #endif // MEDIA_VIDEO_CAPTURE_SCREEN_CAPTURE_DATA_H_ |
| OLD | NEW |