/* SPDX-License-Identifier: LGPL-2.1-or-later */ /* * Copyright (C) 2020, Laurent Pinchart * * converter.h - Format converter for simple pipeline handler */ #ifndef __LIBCAMERA_PIPELINE_SIMPLE_CONVERTER_H__ #define __LIBCAMERA_PIPELINE_SIMPLE_CONVERTER_H__ #include #include #include #include #include #include namespace libcamera { class FrameBuffer; class MediaDevice; class Size; class SizeRange; struct StreamConfiguration; class V4L2M2MDevice; class SimpleConverter { public: SimpleConverter(MediaDevice *media); ~SimpleConverter(); int open(); void close(); std::vector formats(PixelFormat input); SizeRange sizes(const Size &input); int configure(PixelFormat inputFormat, const Size &inputSize, StreamConfiguration *cfg); int exportBuffers(unsigned int count, std::vector> *buffers); int start(unsigned int count); void stop(); int queueBuffers(FrameBuffer *input, FrameBuffer *output); std::tuple strideAndFrameSize(const Size &size, const PixelFormat &pixelFormat); Signal bufferReady; private: void captureBufferReady(FrameBuffer *buffer); void outputBufferReady(FrameBuffer *buffer); V4L2M2MDevice *m2m_; std::queue captureDoneQueue_; std::queue outputDoneQueue_; }; } /* namespace libcamera */ #endif /* __LIBCAMERA_PIPELINE_SIMPLE_CONVERTER_H__ */