OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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_LINUX_V4L2_VIDEO_CAPTURE_DELEGATE_H_ | 5 #ifndef MEDIA_VIDEO_CAPTURE_LINUX_V4L2_VIDEO_CAPTURE_DELEGATE_H_ |
6 #define MEDIA_VIDEO_CAPTURE_LINUX_V4L2_VIDEO_CAPTURE_DELEGATE_H_ | 6 #define MEDIA_VIDEO_CAPTURE_LINUX_V4L2_VIDEO_CAPTURE_DELEGATE_H_ |
7 | 7 |
8 #if defined(OS_OPENBSD) | 8 #if defined(OS_OPENBSD) |
9 #include <sys/videoio.h> | 9 #include <sys/videoio.h> |
10 #else | 10 #else |
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
92 // Fill in |format| with the given parameters, in a planarity dependent way. | 92 // Fill in |format| with the given parameters, in a planarity dependent way. |
93 virtual bool FillV4L2Format(v4l2_format* format, | 93 virtual bool FillV4L2Format(v4l2_format* format, |
94 uint32_t width, | 94 uint32_t width, |
95 uint32_t height, | 95 uint32_t height, |
96 uint32_t pixelformat_fourcc) const = 0; | 96 uint32_t pixelformat_fourcc) const = 0; |
97 | 97 |
98 // Finish filling |buffer| struct with planarity-dependent data. | 98 // Finish filling |buffer| struct with planarity-dependent data. |
99 virtual void FinishFillingV4L2Buffer(v4l2_buffer* buffer) const = 0; | 99 virtual void FinishFillingV4L2Buffer(v4l2_buffer* buffer) const = 0; |
100 | 100 |
101 // Sends the captured |buffer| to the |client_|, synchronously. | 101 // Sends the captured |buffer| to the |client_|, synchronously. |
102 virtual void SendBuffer( | 102 virtual void SendBuffer(const scoped_refptr<BufferTracker>& buffer_tracker, |
103 const scoped_refptr<BufferTracker>& buffer_tracker, | 103 const v4l2_format& format, |
104 const v4l2_format& format) const = 0; | 104 size_t bytes_used) const = 0; |
105 | 105 |
106 // A few accessors for SendBuffer()'s to access private member variables. | 106 // A few accessors for SendBuffer()'s to access private member variables. |
107 VideoCaptureFormat capture_format() const { return capture_format_; } | 107 VideoCaptureFormat capture_format() const { return capture_format_; } |
108 VideoCaptureDevice::Client* client() const { return client_.get(); } | 108 VideoCaptureDevice::Client* client() const { return client_.get(); } |
109 int rotation() const { return rotation_; } | 109 int rotation() const { return rotation_; } |
110 | 110 |
111 private: | 111 private: |
112 friend class base::RefCountedThreadSafe<V4L2CaptureDelegate>; | 112 friend class base::RefCountedThreadSafe<V4L2CaptureDelegate>; |
113 | 113 |
114 // Returns the input |fourcc| as a std::string four char representation. | 114 // Returns the input |fourcc| as a std::string four char representation. |
(...skipping 26 matching lines...) Expand all Loading... |
141 | 141 |
142 // Clockwise rotation in degrees. This value should be 0, 90, 180, or 270. | 142 // Clockwise rotation in degrees. This value should be 0, 90, 180, or 270. |
143 int rotation_; | 143 int rotation_; |
144 | 144 |
145 DISALLOW_COPY_AND_ASSIGN(V4L2CaptureDelegate); | 145 DISALLOW_COPY_AND_ASSIGN(V4L2CaptureDelegate); |
146 }; | 146 }; |
147 | 147 |
148 } // namespace media | 148 } // namespace media |
149 | 149 |
150 #endif // MEDIA_VIDEO_CAPTURE_LINUX_V4L2_VIDEO_CAPTURE_DELEGATE_H_ | 150 #endif // MEDIA_VIDEO_CAPTURE_LINUX_V4L2_VIDEO_CAPTURE_DELEGATE_H_ |
OLD | NEW |