Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(207)

Side by Side Diff: media/capture/video/video_capture_buffer_pool.h

Issue 2398813002: Cleanup of video capture into GpuMemoryBuffer (Closed)
Patch Set: Rebase Created 4 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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
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_
OLDNEW
« no previous file with comments | « media/capture/video/fake_video_capture_device_unittest.cc ('k') | media/capture/video/video_capture_buffer_pool_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698