[libcamera-devel] [PATCH v4 01/12] libcamera: ipu3: Sub-class Stream with IPU3Stream
Jacopo Mondi
jacopo at jmondi.org
Tue Apr 9 21:25:37 CEST 2019
In preparation for multiple stream support provide a Stream sub-class to
maintain IPU3 specific data. In order to be able to sub-class Stream
remove the 'final' specifier from the class definition and make its
private members protected.
Signed-off-by: Jacopo Mondi <jacopo at jmondi.org>
---
include/libcamera/stream.h | 4 ++--
src/libcamera/pipeline/ipu3/ipu3.cpp | 16 ++++++++++++++--
2 files changed, 16 insertions(+), 4 deletions(-)
diff --git a/include/libcamera/stream.h b/include/libcamera/stream.h
index d0f7b0e12485..8a47930f8614 100644
--- a/include/libcamera/stream.h
+++ b/include/libcamera/stream.h
@@ -43,7 +43,7 @@ private:
Size size_;
};
-class Stream final
+class Stream
{
public:
class StillCapture : public StreamUsage
@@ -68,7 +68,7 @@ public:
BufferPool &bufferPool() { return bufferPool_; }
const StreamConfiguration &configuration() const { return configuration_; }
-private:
+protected:
friend class Camera;
BufferPool bufferPool_;
diff --git a/src/libcamera/pipeline/ipu3/ipu3.cpp b/src/libcamera/pipeline/ipu3/ipu3.cpp
index ca09da753b90..00907bb53891 100644
--- a/src/libcamera/pipeline/ipu3/ipu3.cpp
+++ b/src/libcamera/pipeline/ipu3/ipu3.cpp
@@ -133,6 +133,18 @@ public:
BufferPool pool_;
};
+class IPU3Stream : public Stream
+{
+public:
+ IPU3Stream()
+ : active_(false)
+ {
+ }
+
+ bool active_;
+ std::string name_;
+};
+
class PipelineHandlerIPU3 : public PipelineHandler
{
public:
@@ -171,7 +183,7 @@ private:
CIO2Device cio2_;
ImgUDevice *imgu_;
- Stream stream_;
+ IPU3Stream stream_;
};
static constexpr unsigned int IPU3_BUFFER_COUNT = 4;
@@ -404,7 +416,7 @@ int PipelineHandlerIPU3::queueRequest(Camera *camera, Request *request)
{
IPU3CameraData *data = cameraData(camera);
V4L2Device *output = data->imgu_->output_.dev;
- Stream *stream = &data->stream_;
+ IPU3Stream *stream = &data->stream_;
/* Queue a buffer to the ImgU output for capture. */
Buffer *buffer = request->findBuffer(stream);
--
2.21.0
More information about the libcamera-devel
mailing list