blob: b2c4f89d682d6cfb19759dd3a80cfe9e1a7d0eb2 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
|
/* SPDX-License-Identifier: LGPL-2.1-or-later */
/*
* Copyright (C) 2019, Google Inc.
*
* cio2.h - Intel IPU3 CIO2
*/
#ifndef __LIBCAMERA_PIPELINE_IPU3_CIO2_H__
#define __LIBCAMERA_PIPELINE_IPU3_CIO2_H__
#include <memory>
#include <queue>
#include <vector>
namespace libcamera {
class CameraSensor;
class FrameBuffer;
class MediaDevice;
class V4L2DeviceFormat;
class V4L2Subdevice;
class V4L2VideoDevice;
struct Size;
class CIO2Device
{
public:
static constexpr unsigned int CIO2_BUFFER_COUNT = 4;
CIO2Device();
~CIO2Device();
int init(const MediaDevice *media, unsigned int index);
int configure(const Size &size, V4L2DeviceFormat *outputFormat);
int allocateBuffers();
void freeBuffers();
FrameBuffer *getBuffer();
void putBuffer(FrameBuffer *buffer);
int start();
int stop();
V4L2VideoDevice *output_;
V4L2Subdevice *csi2_;
CameraSensor *sensor_;
private:
std::vector<std::unique_ptr<FrameBuffer>> buffers_;
std::queue<FrameBuffer *> availableBuffers_;
};
} /* namespace libcamera */
#endif /* __LIBCAMERA_PIPELINE_IPU3_CIO2_H__ */
|