| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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 MEDIA_VIDEO_CAPTURE_VIDEO_CAPTURE_BUFFER_POOL_H_ | 5 #ifndef MEDIA_VIDEO_CAPTURE_VIDEO_CAPTURE_BUFFER_POOL_H_ |
| 6 #define MEDIA_VIDEO_CAPTURE_VIDEO_CAPTURE_BUFFER_POOL_H_ | 6 #define MEDIA_VIDEO_CAPTURE_VIDEO_CAPTURE_BUFFER_POOL_H_ |
| 7 | 7 |
| 8 #include "base/memory/ref_counted.h" | 8 #include "base/memory/ref_counted.h" |
| 9 #include "media/base/video_capture_types.h" | 9 #include "media/base/video_capture_types.h" |
| 10 #include "media/capture/capture_export.h" | 10 #include "media/capture/capture_export.h" |
| (...skipping 27 matching lines...) Expand all Loading... |
| 38 class CAPTURE_EXPORT VideoCaptureBufferPool | 38 class CAPTURE_EXPORT VideoCaptureBufferPool |
| 39 : public base::RefCountedThreadSafe<VideoCaptureBufferPool> { | 39 : public base::RefCountedThreadSafe<VideoCaptureBufferPool> { |
| 40 public: | 40 public: |
| 41 static constexpr int kInvalidId = -1; | 41 static constexpr int kInvalidId = -1; |
| 42 | 42 |
| 43 // One-time (per client/per-buffer) initialization to share a particular | 43 // One-time (per client/per-buffer) initialization to share a particular |
| 44 // buffer to a process. The shared handle is returned as |new_handle|. | 44 // buffer to a process. The shared handle is returned as |new_handle|. |
| 45 virtual bool ShareToProcess(int buffer_id, | 45 virtual bool ShareToProcess(int buffer_id, |
| 46 base::ProcessHandle process_handle, | 46 base::ProcessHandle process_handle, |
| 47 base::SharedMemoryHandle* new_handle) = 0; | 47 base::SharedMemoryHandle* new_handle) = 0; |
| 48 virtual bool ShareToProcess2(int buffer_id, | |
| 49 int plane, | |
| 50 base::ProcessHandle process_handle, | |
| 51 gfx::GpuMemoryBufferHandle* new_handle) = 0; | |
| 52 | 48 |
| 53 // Try and obtain a BufferHandle for |buffer_id|. | 49 // Try and obtain a BufferHandle for |buffer_id|. |
| 54 virtual std::unique_ptr<VideoCaptureBufferHandle> GetBufferHandle( | 50 virtual std::unique_ptr<VideoCaptureBufferHandle> GetBufferHandle( |
| 55 int buffer_id) = 0; | 51 int buffer_id) = 0; |
| 56 | 52 |
| 57 // Reserve or allocate a buffer to support a packed frame of |dimensions| of | 53 // Reserve or allocate a buffer to support a packed frame of |dimensions| of |
| 58 // pixel |format| and return its id. This will fail (returning kInvalidId) if | 54 // pixel |format| and return its id. This will fail (returning kInvalidId) if |
| 59 // the pool already is at its |count| limit of the number of allocations, and | 55 // the pool already is at its |count| limit of the number of allocations, and |
| 60 // all allocated buffers are in use by the producer and/or consumers. | 56 // all allocated buffers are in use by the producer and/or consumers. |
| 61 // | 57 // |
| (...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 106 protected: | 102 protected: |
| 107 virtual ~VideoCaptureBufferPool() {} | 103 virtual ~VideoCaptureBufferPool() {} |
| 108 | 104 |
| 109 private: | 105 private: |
| 110 friend class base::RefCountedThreadSafe<VideoCaptureBufferPool>; | 106 friend class base::RefCountedThreadSafe<VideoCaptureBufferPool>; |
| 111 }; | 107 }; |
| 112 | 108 |
| 113 } // namespace media | 109 } // namespace media |
| 114 | 110 |
| 115 #endif // MEDIA_VIDEO_CAPTURE_VIDEO_CAPTURE_BUFFER_POOL_H_ | 111 #endif // MEDIA_VIDEO_CAPTURE_VIDEO_CAPTURE_BUFFER_POOL_H_ |
| OLD | NEW |