OLD | NEW |
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 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 CONTENT_BROWSER_RENDERER_HOST_MEDIA_VIDEO_CAPTURE_BUFFER_POOL_H_ | 5 #ifndef CONTENT_BROWSER_RENDERER_HOST_MEDIA_VIDEO_CAPTURE_BUFFER_POOL_H_ |
6 #define CONTENT_BROWSER_RENDERER_HOST_MEDIA_VIDEO_CAPTURE_BUFFER_POOL_H_ | 6 #define CONTENT_BROWSER_RENDERER_HOST_MEDIA_VIDEO_CAPTURE_BUFFER_POOL_H_ |
7 | 7 |
8 #include <stddef.h> | 8 #include <stddef.h> |
9 | 9 |
10 #include <map> | 10 #include <map> |
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
51 | 51 |
52 // Abstraction of a pool's buffer data buffer and size for clients. | 52 // Abstraction of a pool's buffer data buffer and size for clients. |
53 // TODO(emircan): See https://crbug.com/521059, refactor this class. | 53 // TODO(emircan): See https://crbug.com/521059, refactor this class. |
54 class BufferHandle { | 54 class BufferHandle { |
55 public: | 55 public: |
56 virtual ~BufferHandle() {} | 56 virtual ~BufferHandle() {} |
57 virtual gfx::Size dimensions() const = 0; | 57 virtual gfx::Size dimensions() const = 0; |
58 virtual size_t mapped_size() const = 0; | 58 virtual size_t mapped_size() const = 0; |
59 virtual void* data(int plane) = 0; | 59 virtual void* data(int plane) = 0; |
60 virtual ClientBuffer AsClientBuffer(int plane) = 0; | 60 virtual ClientBuffer AsClientBuffer(int plane) = 0; |
61 #if defined(OS_POSIX) && !(defined(OS_MACOSX) && !defined(OS_IOS)) | 61 #if defined(OS_POSIX) && !defined(OS_MACOSX) |
62 virtual base::FileDescriptor AsPlatformFile() = 0; | 62 virtual base::FileDescriptor AsPlatformFile() = 0; |
63 #endif | 63 #endif |
64 }; | 64 }; |
65 | 65 |
66 explicit VideoCaptureBufferPool(int count); | 66 explicit VideoCaptureBufferPool(int count); |
67 | 67 |
68 // One-time (per client/per-buffer) initialization to share a particular | 68 // One-time (per client/per-buffer) initialization to share a particular |
69 // buffer to a process. The shared handle is returned as |new_handle|. | 69 // buffer to a process. The shared handle is returned as |new_handle|. |
70 bool ShareToProcess(int buffer_id, | 70 bool ShareToProcess(int buffer_id, |
71 base::ProcessHandle process_handle, | 71 base::ProcessHandle process_handle, |
(...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
191 // The buffers, indexed by the first parameter, a buffer id. | 191 // The buffers, indexed by the first parameter, a buffer id. |
192 using TrackerMap = std::map<int, Tracker*>; | 192 using TrackerMap = std::map<int, Tracker*>; |
193 TrackerMap trackers_; | 193 TrackerMap trackers_; |
194 | 194 |
195 DISALLOW_IMPLICIT_CONSTRUCTORS(VideoCaptureBufferPool); | 195 DISALLOW_IMPLICIT_CONSTRUCTORS(VideoCaptureBufferPool); |
196 }; | 196 }; |
197 | 197 |
198 } // namespace content | 198 } // namespace content |
199 | 199 |
200 #endif // CONTENT_BROWSER_RENDERER_HOST_MEDIA_VIDEO_CAPTURE_BUFFER_POOL_H_ | 200 #endif // CONTENT_BROWSER_RENDERER_HOST_MEDIA_VIDEO_CAPTURE_BUFFER_POOL_H_ |
OLD | NEW |