From patchwork Tue Apr 9 19:25:37 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jacopo Mondi X-Patchwork-Id: 956 Return-Path: Received: from relay12.mail.gandi.net (relay12.mail.gandi.net [217.70.178.232]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 2662460004 for ; Tue, 9 Apr 2019 21:25:06 +0200 (CEST) Received: from uno.lan (2-224-242-101.ip172.fastwebnet.it [2.224.242.101]) (Authenticated sender: jacopo@jmondi.org) by relay12.mail.gandi.net (Postfix) with ESMTPSA id B649A20000B; Tue, 9 Apr 2019 19:25:05 +0000 (UTC) From: Jacopo Mondi To: libcamera-devel@lists.libcamera.org Date: Tue, 9 Apr 2019 21:25:37 +0200 Message-Id: <20190409192548.20325-2-jacopo@jmondi.org> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190409192548.20325-1-jacopo@jmondi.org> References: <20190409192548.20325-1-jacopo@jmondi.org> MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH v4 01/12] libcamera: ipu3: Sub-class Stream with IPU3Stream X-BeenThere: libcamera-devel@lists.libcamera.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 09 Apr 2019 19:25:06 -0000 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 --- 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);