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 // Returns a scoped handle to the underlying storage. | 53 virtual std::unique_ptr<VideoCaptureBufferHandle> GetMemoryMappedAccess() = 0; |
54 virtual std::unique_ptr<VideoCaptureBufferHandle> GetBufferHandle() = 0; | |
55 | |
56 virtual mojo::ScopedSharedBufferHandle GetHandleForTransit() = 0; | 54 virtual mojo::ScopedSharedBufferHandle GetHandleForTransit() = 0; |
57 | 55 |
58 private: | 56 private: |
59 // |dimensions_| may change as a VideoCaptureBufferTracker is re-used, but | 57 // |dimensions_| may change as a VideoCaptureBufferTracker is re-used, but |
60 // |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 |
61 // the lifetime of a VideoCaptureBufferTracker. | 59 // the lifetime of a VideoCaptureBufferTracker. |
62 gfx::Size dimensions_; | 60 gfx::Size dimensions_; |
63 size_t max_pixel_count_; | 61 size_t max_pixel_count_; |
64 media::VideoPixelFormat pixel_format_; | 62 media::VideoPixelFormat pixel_format_; |
65 media::VideoPixelStorage storage_type_; | 63 media::VideoPixelStorage storage_type_; |
66 | 64 |
67 // Indicates whether this VideoCaptureBufferTracker is currently referenced by | 65 // Indicates whether this VideoCaptureBufferTracker is currently referenced by |
68 // the producer. | 66 // the producer. |
69 bool held_by_producer_; | 67 bool held_by_producer_; |
70 | 68 |
71 // Number of consumer processes which hold this VideoCaptureBufferTracker. | 69 // Number of consumer processes which hold this VideoCaptureBufferTracker. |
72 int consumer_hold_count_; | 70 int consumer_hold_count_; |
73 | 71 |
74 int frame_feedback_id_; | 72 int frame_feedback_id_; |
75 }; | 73 }; |
76 | 74 |
77 } // namespace content | 75 } // namespace content |
78 | 76 |
79 #endif // MEDIA_CAPTURE_VIDEO_VIDEO_CAPTURE_BUFFER_TRACKER_H_ | 77 #endif // MEDIA_CAPTURE_VIDEO_VIDEO_CAPTURE_BUFFER_TRACKER_H_ |
OLD | NEW |