OLD | NEW |
| (Empty) |
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 | |
3 // found in the LICENSE file. | |
4 | |
5 #ifndef MEDIA_VIDEO_CAPTURE_LINUX_V4L2_CAPTURE_DELEGATE_SINGLE_PLANE_H_ | |
6 #define MEDIA_VIDEO_CAPTURE_LINUX_V4L2_CAPTURE_DELEGATE_SINGLE_PLANE_H_ | |
7 | |
8 #include "base/memory/ref_counted.h" | |
9 #include "media/video/capture/linux/v4l2_capture_delegate.h" | |
10 #include "media/video/capture/video_capture_device.h" | |
11 | |
12 namespace base { | |
13 class SingleThreadTaskRunner; | |
14 } // namespace base | |
15 | |
16 namespace media { | |
17 | |
18 // V4L2 specifics for SPLANE API. | |
19 class V4L2CaptureDelegateSinglePlane final : public V4L2CaptureDelegate { | |
20 public: | |
21 V4L2CaptureDelegateSinglePlane( | |
22 const VideoCaptureDevice::Name& device_name, | |
23 const scoped_refptr<base::SingleThreadTaskRunner>& v4l2_task_runner, | |
24 int power_line_frequency) | |
25 : V4L2CaptureDelegate(device_name, | |
26 v4l2_task_runner, | |
27 power_line_frequency) {} | |
28 | |
29 private: | |
30 // BufferTracker derivation to implement construction semantics for SPLANE. | |
31 class BufferTrackerSPlane final : public BufferTracker { | |
32 public: | |
33 bool Init(int fd, const v4l2_buffer& buffer) override; | |
34 | |
35 private: | |
36 ~BufferTrackerSPlane() override {} | |
37 }; | |
38 | |
39 ~V4L2CaptureDelegateSinglePlane() override {} | |
40 | |
41 // V4L2CaptureDelegate virtual methods implementation. | |
42 scoped_refptr<BufferTracker> CreateBufferTracker() const override; | |
43 bool FillV4L2Format(v4l2_format* format, | |
44 uint32_t width, | |
45 uint32_t height, | |
46 uint32_t pixelformat_fourcc) const override; | |
47 void FinishFillingV4L2Buffer(v4l2_buffer* buffer) const override; | |
48 void SendBuffer(const scoped_refptr<BufferTracker>& buffer_tracker, | |
49 const v4l2_format& format) const override; | |
50 }; | |
51 | |
52 } // namespace media | |
53 | |
54 #endif // MEDIA_VIDEO_CAPTURE_LINUX_V4L2_CAPTURE_DELEGATE_MULTI_PLANE_H_ | |
OLD | NEW |