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_CAPTURE_VIDEO_VIDEO_CAPTURE_BUFFER_TRACKER_H_ | 5 #ifndef MEDIA_CAPTURE_VIDEO_VIDEO_CAPTURE_BUFFER_TRACKER_H_ |
6 #define MEDIA_CAPTURE_VIDEO_VIDEO_CAPTURE_BUFFER_TRACKER_H_ | 6 #define MEDIA_CAPTURE_VIDEO_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 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
43 void set_storage_type(media::VideoPixelStorage storage_type) { | 43 void set_storage_type(media::VideoPixelStorage storage_type) { |
44 storage_type_ = storage_type; | 44 storage_type_ = storage_type; |
45 } | 45 } |
46 bool held_by_producer() const { return held_by_producer_; } | 46 bool held_by_producer() const { return held_by_producer_; } |
47 void set_held_by_producer(bool value) { held_by_producer_ = value; } | 47 void set_held_by_producer(bool value) { held_by_producer_ = value; } |
48 int consumer_hold_count() const { return consumer_hold_count_; } | 48 int consumer_hold_count() const { return consumer_hold_count_; } |
49 void set_consumer_hold_count(int value) { consumer_hold_count_ = value; } | 49 void set_consumer_hold_count(int value) { consumer_hold_count_ = value; } |
50 void set_frame_feedback_id(int value) { frame_feedback_id_ = value; } | 50 void set_frame_feedback_id(int value) { frame_feedback_id_ = value; } |
51 int frame_feedback_id() { return frame_feedback_id_; } | 51 int frame_feedback_id() { return frame_feedback_id_; } |
52 | 52 |
53 virtual std::unique_ptr<VideoCaptureBufferHandle> GetMemoryMappedAccess() = 0; | 53 // Returns a scoped handle to the underlying storage. |
| 54 virtual std::unique_ptr<VideoCaptureBufferHandle> GetBufferHandle() = 0; |
| 55 |
54 virtual mojo::ScopedSharedBufferHandle GetHandleForTransit() = 0; | 56 virtual mojo::ScopedSharedBufferHandle GetHandleForTransit() = 0; |
55 | 57 |
56 private: | 58 private: |
57 // |dimensions_| may change as a VideoCaptureBufferTracker is re-used, but | 59 // |dimensions_| may change as a VideoCaptureBufferTracker is re-used, but |
58 // |max_pixel_count_|, |pixel_format_|, and |storage_type_| are set once for | 60 // |max_pixel_count_|, |pixel_format_|, and |storage_type_| are set once for |
59 // the lifetime of a VideoCaptureBufferTracker. | 61 // the lifetime of a VideoCaptureBufferTracker. |
60 gfx::Size dimensions_; | 62 gfx::Size dimensions_; |
61 size_t max_pixel_count_; | 63 size_t max_pixel_count_; |
62 media::VideoPixelFormat pixel_format_; | 64 media::VideoPixelFormat pixel_format_; |
63 media::VideoPixelStorage storage_type_; | 65 media::VideoPixelStorage storage_type_; |
64 | 66 |
65 // Indicates whether this VideoCaptureBufferTracker is currently referenced by | 67 // Indicates whether this VideoCaptureBufferTracker is currently referenced by |
66 // the producer. | 68 // the producer. |
67 bool held_by_producer_; | 69 bool held_by_producer_; |
68 | 70 |
69 // Number of consumer processes which hold this VideoCaptureBufferTracker. | 71 // Number of consumer processes which hold this VideoCaptureBufferTracker. |
70 int consumer_hold_count_; | 72 int consumer_hold_count_; |
71 | 73 |
72 int frame_feedback_id_; | 74 int frame_feedback_id_; |
73 }; | 75 }; |
74 | 76 |
75 } // namespace content | 77 } // namespace content |
76 | 78 |
77 #endif // MEDIA_CAPTURE_VIDEO_VIDEO_CAPTURE_BUFFER_TRACKER_H_ | 79 #endif // MEDIA_CAPTURE_VIDEO_VIDEO_CAPTURE_BUFFER_TRACKER_H_ |
OLD | NEW |