OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 UI_OZONE_PLATFORM_DRM_GPU_DRM_DEVICE_H_ | 5 #ifndef UI_OZONE_PLATFORM_DRM_GPU_DRM_DEVICE_H_ |
6 #define UI_OZONE_PLATFORM_DRM_GPU_DRM_DEVICE_H_ | 6 #define UI_OZONE_PLATFORM_DRM_GPU_DRM_DEVICE_H_ |
7 | 7 |
8 #include <stdint.h> | 8 #include <stdint.h> |
9 | 9 |
10 #include <vector> | 10 #include <vector> |
(...skipping 27 matching lines...) Expand all Loading... |
38 | 38 |
39 // Wraps DRM calls into a nice interface. Used to provide different | 39 // Wraps DRM calls into a nice interface. Used to provide different |
40 // implementations of the DRM calls. For the actual implementation the DRM API | 40 // implementations of the DRM calls. For the actual implementation the DRM API |
41 // would be called. In unit tests this interface would be stubbed. | 41 // would be called. In unit tests this interface would be stubbed. |
42 class OZONE_EXPORT DrmDevice : public base::RefCountedThreadSafe<DrmDevice> { | 42 class OZONE_EXPORT DrmDevice : public base::RefCountedThreadSafe<DrmDevice> { |
43 public: | 43 public: |
44 typedef base::Callback<void(unsigned int /* frame */, | 44 typedef base::Callback<void(unsigned int /* frame */, |
45 unsigned int /* seconds */, | 45 unsigned int /* seconds */, |
46 unsigned int /* useconds */)> PageFlipCallback; | 46 unsigned int /* useconds */)> PageFlipCallback; |
47 | 47 |
48 DrmDevice(const base::FilePath& device_path); | |
49 DrmDevice(const base::FilePath& device_path, base::File file); | 48 DrmDevice(const base::FilePath& device_path, base::File file); |
50 | 49 |
51 // Open device. | 50 // Open device. |
52 virtual bool Initialize(); | 51 virtual bool Initialize(); |
53 | 52 |
54 // |task_runner| will be used to asynchronously page flip. | 53 // |task_runner| will be used to asynchronously page flip. |
55 virtual void InitializeTaskRunner( | 54 virtual void InitializeTaskRunner( |
56 const scoped_refptr<base::SingleThreadTaskRunner>& task_runner); | 55 const scoped_refptr<base::SingleThreadTaskRunner>& task_runner); |
57 | 56 |
58 // Get the CRTC state. This is generally used to save state before using the | 57 // Get the CRTC state. This is generally used to save state before using the |
(...skipping 143 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
202 scoped_refptr<IOWatcher> watcher_; | 201 scoped_refptr<IOWatcher> watcher_; |
203 | 202 |
204 scoped_refptr<PageFlipManager> page_flip_manager_; | 203 scoped_refptr<PageFlipManager> page_flip_manager_; |
205 | 204 |
206 DISALLOW_COPY_AND_ASSIGN(DrmDevice); | 205 DISALLOW_COPY_AND_ASSIGN(DrmDevice); |
207 }; | 206 }; |
208 | 207 |
209 } // namespace ui | 208 } // namespace ui |
210 | 209 |
211 #endif // UI_OZONE_PLATFORM_DRM_GPU_DRM_DEVICE_H_ | 210 #endif // UI_OZONE_PLATFORM_DRM_GPU_DRM_DEVICE_H_ |
OLD | NEW |