diff options
author | Niklas Söderlund <niklas.soderlund@ragnatech.se> | 2020-05-26 15:53:23 +0200 |
---|---|---|
committer | Niklas Söderlund <niklas.soderlund@ragnatech.se> | 2020-06-26 13:32:29 +0200 |
commit | 6bd3d7259ffc6e28c5bd2d2681a1d8993099e883 (patch) | |
tree | 376cab2b610b9d2cc43c4f936e873a355142aa55 /src/libcamera/pipeline/ipu3/cio2.h | |
parent | 2cd95560219b45abb0f928172f2bdfcef32f5dce (diff) |
libcamera: ipu3: cio2: Move the CIO2Device class to separate files
In preparation of refactoring the IPU3 pipeline handler breakout the
CIO2Device into its own .cpp and .h file, no functional change.
Signed-off-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>
Reviewed-by: Jacopo Mondi <jacopo@jmondi.org>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Diffstat (limited to 'src/libcamera/pipeline/ipu3/cio2.h')
-rw-r--r-- | src/libcamera/pipeline/ipu3/cio2.h | 55 |
1 files changed, 55 insertions, 0 deletions
diff --git a/src/libcamera/pipeline/ipu3/cio2.h b/src/libcamera/pipeline/ipu3/cio2.h new file mode 100644 index 00000000..b2c4f89d --- /dev/null +++ b/src/libcamera/pipeline/ipu3/cio2.h @@ -0,0 +1,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__ */ |