| 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 <map> | 8 #include <map> |
| 9 | 9 |
| 10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
| (...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 46 static const int kInvalidId; | 46 static const int kInvalidId; |
| 47 | 47 |
| 48 // Abstraction of a pool's buffer data buffer and size for clients. | 48 // Abstraction of a pool's buffer data buffer and size for clients. |
| 49 class BufferHandle { | 49 class BufferHandle { |
| 50 public: | 50 public: |
| 51 virtual ~BufferHandle() {} | 51 virtual ~BufferHandle() {} |
| 52 virtual size_t size() const = 0; | 52 virtual size_t size() const = 0; |
| 53 virtual void* data() = 0; | 53 virtual void* data() = 0; |
| 54 virtual gfx::GpuMemoryBufferType GetType() = 0; | 54 virtual gfx::GpuMemoryBufferType GetType() = 0; |
| 55 virtual ClientBuffer AsClientBuffer() = 0; | 55 virtual ClientBuffer AsClientBuffer() = 0; |
| 56 virtual base::PlatformFile AsPlatformFile() = 0; |
| 56 }; | 57 }; |
| 57 | 58 |
| 58 explicit VideoCaptureBufferPool(int count); | 59 explicit VideoCaptureBufferPool(int count); |
| 59 | 60 |
| 60 // One-time (per client/per-buffer) initialization to share a particular | 61 // One-time (per client/per-buffer) initialization to share a particular |
| 61 // buffer to a process. The size of the allocation is returned as | 62 // buffer to a process. The size of the allocation is returned as |
| 62 // |memory_size|. | 63 // |memory_size|. |
| 63 base::SharedMemoryHandle ShareToProcess(int buffer_id, | 64 base::SharedMemoryHandle ShareToProcess(int buffer_id, |
| 64 base::ProcessHandle process_handle, | 65 base::ProcessHandle process_handle, |
| 65 size_t* memory_size); | 66 size_t* memory_size); |
| (...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 163 // The buffers, indexed by the first parameter, a buffer id. | 164 // The buffers, indexed by the first parameter, a buffer id. |
| 164 using TrackerMap = std::map<int, Tracker*>; | 165 using TrackerMap = std::map<int, Tracker*>; |
| 165 TrackerMap trackers_; | 166 TrackerMap trackers_; |
| 166 | 167 |
| 167 DISALLOW_IMPLICIT_CONSTRUCTORS(VideoCaptureBufferPool); | 168 DISALLOW_IMPLICIT_CONSTRUCTORS(VideoCaptureBufferPool); |
| 168 }; | 169 }; |
| 169 | 170 |
| 170 } // namespace content | 171 } // namespace content |
| 171 | 172 |
| 172 #endif // CONTENT_BROWSER_RENDERER_HOST_MEDIA_VIDEO_CAPTURE_BUFFER_POOL_H_ | 173 #endif // CONTENT_BROWSER_RENDERER_HOST_MEDIA_VIDEO_CAPTURE_BUFFER_POOL_H_ |
| OLD | NEW |