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

Side by Side Diff: media/capture/video/video_capture_buffer_tracker.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_TRACKER_H_ 5 #ifndef MEDIA_VIDEO_CAPTURE_VIDEO_CAPTURE_BUFFER_TRACKER_H_
6 #define MEDIA_VIDEO_CAPTURE_VIDEO_CAPTURE_BUFFER_TRACKER_H_ 6 #define MEDIA_VIDEO_CAPTURE_VIDEO_CAPTURE_BUFFER_TRACKER_H_
7 7
8 #include <memory> 8 #include <memory>
9 9
10 #include "base/synchronization/lock.h" 10 #include "base/synchronization/lock.h"
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
45 void set_held_by_producer(bool value) { held_by_producer_ = value; } 45 void set_held_by_producer(bool value) { held_by_producer_ = value; }
46 int consumer_hold_count() const { return consumer_hold_count_; } 46 int consumer_hold_count() const { return consumer_hold_count_; }
47 void set_consumer_hold_count(int value) { consumer_hold_count_ = value; } 47 void set_consumer_hold_count(int value) { consumer_hold_count_ = value; }
48 48
49 // Returns a handle to the underlying storage, be that a block of Shared 49 // Returns a handle to the underlying storage, be that a block of Shared
50 // Memory, or a GpuMemoryBuffer. 50 // Memory, or a GpuMemoryBuffer.
51 virtual std::unique_ptr<VideoCaptureBufferHandle> GetBufferHandle() = 0; 51 virtual std::unique_ptr<VideoCaptureBufferHandle> GetBufferHandle() = 0;
52 52
53 virtual bool ShareToProcess(base::ProcessHandle process_handle, 53 virtual bool ShareToProcess(base::ProcessHandle process_handle,
54 base::SharedMemoryHandle* new_handle) = 0; 54 base::SharedMemoryHandle* new_handle) = 0;
55 virtual bool ShareToProcess2(int plane,
56 base::ProcessHandle process_handle,
57 gfx::GpuMemoryBufferHandle* new_handle) = 0;
58 55
59 private: 56 private:
60 // |dimensions_| may change as a VideoCaptureBufferTracker is re-used, but 57 // |dimensions_| may change as a VideoCaptureBufferTracker is re-used, but
61 // |max_pixel_count_|, |pixel_format_|, and |storage_type_| are set once for 58 // |max_pixel_count_|, |pixel_format_|, and |storage_type_| are set once for
62 // the lifetime of a VideoCaptureBufferTracker. 59 // the lifetime of a VideoCaptureBufferTracker.
63 gfx::Size dimensions_; 60 gfx::Size dimensions_;
64 size_t max_pixel_count_; 61 size_t max_pixel_count_;
65 media::VideoPixelFormat pixel_format_; 62 media::VideoPixelFormat pixel_format_;
66 media::VideoPixelStorage storage_type_; 63 media::VideoPixelStorage storage_type_;
67 64
68 // Indicates whether this VideoCaptureBufferTracker is currently referenced by 65 // Indicates whether this VideoCaptureBufferTracker is currently referenced by
69 // the producer. 66 // the producer.
70 bool held_by_producer_; 67 bool held_by_producer_;
71 68
72 // Number of consumer processes which hold this VideoCaptureBufferTracker. 69 // Number of consumer processes which hold this VideoCaptureBufferTracker.
73 int consumer_hold_count_; 70 int consumer_hold_count_;
74 }; 71 };
75 72
76 } // namespace content 73 } // namespace content
77 74
78 #endif // MEDIA_VIDEO_CAPTURE_VIDEO_CAPTURE_BUFFER_TRACKER_H_ 75 #endif // MEDIA_VIDEO_CAPTURE_VIDEO_CAPTURE_BUFFER_TRACKER_H_
OLDNEW
« no previous file with comments | « media/capture/video/video_capture_buffer_pool_impl.cc ('k') | media/capture/video/video_capture_device_client.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698