{"id":9781,"url":"https://patchwork.libcamera.org/api/1.1/patches/9781/?format=json","web_url":"https://patchwork.libcamera.org/patch/9781/","project":{"id":1,"url":"https://patchwork.libcamera.org/api/1.1/projects/1/?format=json","name":"libcamera","link_name":"libcamera","list_id":"libcamera_core","list_email":"libcamera-devel@lists.libcamera.org","web_url":"","scm_url":"","webscm_url":""},"msgid":"<20200924091927.116385-2-naush@raspberrypi.com>","date":"2020-09-24T09:19:24","name":"[libcamera-devel,1/4] pipeline: raspberrypi: Rename RPi::RPiStream and RPi::RPiDevice","commit_ref":null,"pull_url":null,"state":"accepted","archived":false,"hash":"8adc62d0d761b878c3d96c00816dd16a83513b45","submitter":{"id":34,"url":"https://patchwork.libcamera.org/api/1.1/people/34/?format=json","name":"Naushir Patuck","email":"naush@raspberrypi.com"},"delegate":null,"mbox":"https://patchwork.libcamera.org/patch/9781/mbox/","series":[{"id":1318,"url":"https://patchwork.libcamera.org/api/1.1/series/1318/?format=json","web_url":"https://patchwork.libcamera.org/project/libcamera/list/?series=1318","date":"2020-09-24T09:19:23","name":"Code tidy-ups","version":1,"mbox":"https://patchwork.libcamera.org/series/1318/mbox/"}],"comments":"https://patchwork.libcamera.org/api/patches/9781/comments/","check":"pending","checks":"https://patchwork.libcamera.org/api/patches/9781/checks/","tags":{},"headers":{"Return-Path":"<libcamera-devel-bounces@lists.libcamera.org>","X-Original-To":"parsemail@patchwork.libcamera.org","Delivered-To":"parsemail@patchwork.libcamera.org","Received":["from lancelot.ideasonboard.com (lancelot.ideasonboard.com\n\t[92.243.16.209])\n\tby patchwork.libcamera.org (Postfix) with ESMTPS id 43D48C3B5B\n\tfor <parsemail@patchwork.libcamera.org>;\n\tThu, 24 Sep 2020 09:19:36 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 0DCDA62FFB;\n\tThu, 24 Sep 2020 11:19:36 +0200 (CEST)","from mail-wr1-x42d.google.com (mail-wr1-x42d.google.com\n\t[IPv6:2a00:1450:4864:20::42d])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id EE37862FD2\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tThu, 24 Sep 2020 11:19:32 +0200 (CEST)","by mail-wr1-x42d.google.com with SMTP id z1so2996904wrt.3\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tThu, 24 Sep 2020 02:19:32 -0700 (PDT)","from naushir-VirtualBox.pitowers.org\n\t([2a00:1098:3142:14:a00:27ff:fe4d:f6a2])\n\tby smtp.gmail.com with ESMTPSA id\n\tw81sm2689324wmg.47.2020.09.24.02.19.30\n\t(version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n\tThu, 24 Sep 2020 02:19:31 -0700 (PDT)"],"Authentication-Results":"lancelot.ideasonboard.com;\n\tdkim=fail reason=\"signature verification failed\" (2048-bit key;\n\tunprotected) header.d=raspberrypi.com header.i=@raspberrypi.com\n\theader.b=\"lkfM5qGt\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=raspberrypi.com; s=google;\n\th=from:to:cc:subject:date:message-id:in-reply-to:references\n\t:mime-version:content-transfer-encoding;\n\tbh=0S30In/5NRUCT+HJyBd2LgxQpoRUdTA5xnKpz8J3KS8=;\n\tb=lkfM5qGtGet6Z/xrvuJDmlvEAOF7khJnN5ccjITd0/W3RUrc0GxCJ/dYlXLJuIctUK\n\t24yrm8sI2/6qC7suSCX8JDXE9V9ttDAavWDAWg1oPCLkK0WXTlEz8/C+OkHHkVz8GLWE\n\tGEFh3vmriyhtr4AEUGbDkhY66LYa4GJSuwf0A1WVRqcVPYkNEA+TAHGznUuWzdZu+ivE\n\tkk1RCGqW8ytsoINzYcKLjvgyBLJPcVCfZt1E/lJLFUg71itYQeJTJKlU2RfYLtOA6Os7\n\tiZPRKEeRdfieVaepcN6ALrN0WeXWUlwFbN4Vl6O8b/nL21zmeWygJzndLFYZb8zoKmy+\n\tMm8w==","X-Google-DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20161025;\n\th=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to\n\t:references:mime-version:content-transfer-encoding;\n\tbh=0S30In/5NRUCT+HJyBd2LgxQpoRUdTA5xnKpz8J3KS8=;\n\tb=kWYZWd86bUXPncQHvaL3quc1fTbU+W5OIQQp4qyOcFmAM9LrSPMBfxIKcreTaQkD0h\n\tOh7P6bhdoF1FuFeNh0r4MB+m6sMVM1zBN58FAlZKnEmngI7VEWdoL5YA2rl6fy+ncMRl\n\tcT6BanJeOr+3/fq8Upz6Ege79Q1ZMHcly2W5JWET7vO/2++BQM1rBW2td/OTnfXfZmoV\n\tTFhWultEdqiwOp9i9GIu1kZv49zAhCiFOYoEzYLNypcExZjQCsCcDp3TGPwg+WrD0eQO\n\t74/6mtnd31Y5F9vJhgVkcFdOZ+VIU625aS0166ZBjyP3kNUVfRYL3P5e4CROXqRnIDTK\n\tLm6g==","X-Gm-Message-State":"AOAM532WiXPzoKNvlRfflKBYWczWJw++LtOJbyRjP/tR96qjlwgTIDSM\n\tRcAxu8SHvLV2p3Litu7fwfx8PMntYyZcoA==","X-Google-Smtp-Source":"ABdhPJwLF9KW2e1sPyNanGPRrlE3ALmnD0COxcrbzL7QU/WfzgNZD3lurgS4+QwoKN32JYYROpDpJA==","X-Received":"by 2002:adf:90a2:: with SMTP id\n\ti31mr4394359wri.276.1600939171965; \n\tThu, 24 Sep 2020 02:19:31 -0700 (PDT)","From":"Naushir Patuck <naush@raspberrypi.com>","To":"libcamera-devel@lists.libcamera.org","Date":"Thu, 24 Sep 2020 10:19:24 +0100","Message-Id":"<20200924091927.116385-2-naush@raspberrypi.com>","X-Mailer":"git-send-email 2.25.1","In-Reply-To":"<20200924091927.116385-1-naush@raspberrypi.com>","References":"<20200924091927.116385-1-naush@raspberrypi.com>","MIME-Version":"1.0","Subject":"[libcamera-devel] [PATCH 1/4] pipeline: raspberrypi: Rename\n\tRPi::RPiStream and RPi::RPiDevice","X-BeenThere":"libcamera-devel@lists.libcamera.org","X-Mailman-Version":"2.1.29","Precedence":"list","List-Id":"<libcamera-devel.lists.libcamera.org>","List-Unsubscribe":"<https://lists.libcamera.org/options/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=unsubscribe>","List-Archive":"<https://lists.libcamera.org/pipermail/libcamera-devel/>","List-Post":"<mailto:libcamera-devel@lists.libcamera.org>","List-Help":"<mailto:libcamera-devel-request@lists.libcamera.org?subject=help>","List-Subscribe":"<https://lists.libcamera.org/listinfo/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=subscribe>","Content-Type":"text/plain; charset=\"us-ascii\"","Content-Transfer-Encoding":"7bit","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"},"content":"Rename RPi::RPiStream -> RPi::Stream and RPi::RPiDevice -> RPi::Device.\n\nThere are no functional changes in this commit.\n\nSigned-off-by: Naushir Patuck <naush@raspberrypi.com>\nReviewed-by: Jacopo Mondi <jacopo@jmondi.org>\nReviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>\nAcked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\n---\n .../pipeline/raspberrypi/raspberrypi.cpp      | 42 +++++++++----------\n .../pipeline/raspberrypi/rpi_stream.cpp       | 34 +++++++--------\n .../pipeline/raspberrypi/rpi_stream.h         | 16 +++----\n 3 files changed, 46 insertions(+), 46 deletions(-)","diff":"diff --git a/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp b/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp\nindex 50f07182..5ed74d51 100644\n--- a/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp\n+++ b/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp\n@@ -150,16 +150,16 @@ public:\n \tvoid ispOutputDequeue(FrameBuffer *buffer);\n \n \tvoid clearIncompleteRequests();\n-\tvoid handleStreamBuffer(FrameBuffer *buffer, RPi::RPiStream *stream);\n-\tvoid handleExternalBuffer(FrameBuffer *buffer, RPi::RPiStream *stream);\n+\tvoid handleStreamBuffer(FrameBuffer *buffer, RPi::Stream *stream);\n+\tvoid handleExternalBuffer(FrameBuffer *buffer, RPi::Stream *stream);\n \tvoid handleState();\n \n \tCameraSensor *sensor_;\n \t/* Array of Unicam and ISP device streams and associated buffers/streams. */\n-\tRPi::RPiDevice<Unicam, 2> unicam_;\n-\tRPi::RPiDevice<Isp, 4> isp_;\n+\tRPi::Device<Unicam, 2> unicam_;\n+\tRPi::Device<Isp, 4> isp_;\n \t/* The vector below is just for convenience when iterating over all streams. */\n-\tstd::vector<RPi::RPiStream *> streams_;\n+\tstd::vector<RPi::Stream *> streams_;\n \t/* Stores the ids of the buffers mapped in the IPA. */\n \tstd::unordered_set<unsigned int> ipaBuffers_;\n \n@@ -189,7 +189,7 @@ private:\n \tvoid tryRunPipeline();\n \tvoid tryFlushQueues();\n \tFrameBuffer *updateQueue(std::queue<FrameBuffer *> &q, uint64_t timestamp,\n-\t\t\t\t RPi::RPiStream *stream);\n+\t\t\t\t RPi::Stream *stream);\n \n \tunsigned int ispOutputCount_;\n };\n@@ -618,7 +618,7 @@ int PipelineHandlerRPi::configure(Camera *camera, CameraConfiguration *config)\n int PipelineHandlerRPi::exportFrameBuffers([[maybe_unused]] Camera *camera, Stream *stream,\n \t\t\t\t\t   std::vector<std::unique_ptr<FrameBuffer>> *buffers)\n {\n-\tRPi::RPiStream *s = static_cast<RPi::RPiStream *>(stream);\n+\tRPi::Stream *s = static_cast<RPi::Stream *>(stream);\n \tunsigned int count = stream->configuration().bufferCount;\n \tint ret = s->dev()->exportBuffers(count, buffers);\n \n@@ -787,14 +787,14 @@ bool PipelineHandlerRPi::match(DeviceEnumerator *enumerator)\n \t\treturn false;\n \n \t/* Locate and open the unicam video streams. */\n-\tdata->unicam_[Unicam::Embedded] = RPi::RPiStream(\"Unicam Embedded\", unicam_->getEntityByName(\"unicam-embedded\"));\n-\tdata->unicam_[Unicam::Image] = RPi::RPiStream(\"Unicam Image\", unicam_->getEntityByName(\"unicam-image\"));\n+\tdata->unicam_[Unicam::Embedded] = RPi::Stream(\"Unicam Embedded\", unicam_->getEntityByName(\"unicam-embedded\"));\n+\tdata->unicam_[Unicam::Image] = RPi::Stream(\"Unicam Image\", unicam_->getEntityByName(\"unicam-image\"));\n \n \t/* Tag the ISP input stream as an import stream. */\n-\tdata->isp_[Isp::Input] = RPi::RPiStream(\"ISP Input\", isp_->getEntityByName(\"bcm2835-isp0-output0\"), true);\n-\tdata->isp_[Isp::Output0] = RPi::RPiStream(\"ISP Output0\", isp_->getEntityByName(\"bcm2835-isp0-capture1\"));\n-\tdata->isp_[Isp::Output1] = RPi::RPiStream(\"ISP Output1\", isp_->getEntityByName(\"bcm2835-isp0-capture2\"));\n-\tdata->isp_[Isp::Stats] = RPi::RPiStream(\"ISP Stats\", isp_->getEntityByName(\"bcm2835-isp0-capture3\"));\n+\tdata->isp_[Isp::Input] = RPi::Stream(\"ISP Input\", isp_->getEntityByName(\"bcm2835-isp0-output0\"), true);\n+\tdata->isp_[Isp::Output0] = RPi::Stream(\"ISP Output0\", isp_->getEntityByName(\"bcm2835-isp0-capture1\"));\n+\tdata->isp_[Isp::Output1] = RPi::Stream(\"ISP Output1\", isp_->getEntityByName(\"bcm2835-isp0-capture2\"));\n+\tdata->isp_[Isp::Stats] = RPi::Stream(\"ISP Stats\", isp_->getEntityByName(\"bcm2835-isp0-capture3\"));\n \n \t/* This is just for convenience so that we can easily iterate over all streams. */\n \tfor (auto &stream : data->unicam_)\n@@ -912,7 +912,7 @@ int PipelineHandlerRPi::prepareBuffers(Camera *camera)\n \t */\n \tunsigned int maxBuffers = 0;\n \tfor (const Stream *s : camera->streams())\n-\t\tif (static_cast<const RPi::RPiStream *>(s)->isExternal())\n+\t\tif (static_cast<const RPi::Stream *>(s)->isExternal())\n \t\t\tmaxBuffers = std::max(maxBuffers, s->configuration().bufferCount);\n \n \tfor (auto const stream : data->streams_) {\n@@ -1133,13 +1133,13 @@ done:\n \n void RPiCameraData::unicamBufferDequeue(FrameBuffer *buffer)\n {\n-\tRPi::RPiStream *stream = nullptr;\n+\tRPi::Stream *stream = nullptr;\n \tint index;\n \n \tif (state_ == State::Stopped)\n \t\treturn;\n \n-\tfor (RPi::RPiStream &s : unicam_) {\n+\tfor (RPi::Stream &s : unicam_) {\n \t\tindex = s.getBufferId(buffer);\n \t\tif (index != -1) {\n \t\t\tstream = &s;\n@@ -1201,13 +1201,13 @@ void RPiCameraData::ispInputDequeue(FrameBuffer *buffer)\n \n void RPiCameraData::ispOutputDequeue(FrameBuffer *buffer)\n {\n-\tRPi::RPiStream *stream = nullptr;\n+\tRPi::Stream *stream = nullptr;\n \tint index;\n \n \tif (state_ == State::Stopped)\n \t\treturn;\n \n-\tfor (RPi::RPiStream &s : isp_) {\n+\tfor (RPi::Stream &s : isp_) {\n \t\tindex = s.getBufferId(buffer);\n \t\tif (index != -1) {\n \t\t\tstream = &s;\n@@ -1297,7 +1297,7 @@ void RPiCameraData::clearIncompleteRequests()\n \t}\n }\n \n-void RPiCameraData::handleStreamBuffer(FrameBuffer *buffer, RPi::RPiStream *stream)\n+void RPiCameraData::handleStreamBuffer(FrameBuffer *buffer, RPi::Stream *stream)\n {\n \tif (stream->isExternal()) {\n \t\t/*\n@@ -1330,7 +1330,7 @@ void RPiCameraData::handleStreamBuffer(FrameBuffer *buffer, RPi::RPiStream *stre\n \t}\n }\n \n-void RPiCameraData::handleExternalBuffer(FrameBuffer *buffer, RPi::RPiStream *stream)\n+void RPiCameraData::handleExternalBuffer(FrameBuffer *buffer, RPi::Stream *stream)\n {\n \tunsigned int id = stream->getBufferId(buffer);\n \n@@ -1510,7 +1510,7 @@ void RPiCameraData::tryFlushQueues()\n }\n \n FrameBuffer *RPiCameraData::updateQueue(std::queue<FrameBuffer *> &q, uint64_t timestamp,\n-\t\t\t\t\tRPi::RPiStream *stream)\n+\t\t\t\t\tRPi::Stream *stream)\n {\n \t/*\n \t * If the unicam streams are external (both have be to the same), then we\ndiff --git a/src/libcamera/pipeline/raspberrypi/rpi_stream.cpp b/src/libcamera/pipeline/raspberrypi/rpi_stream.cpp\nindex 2dcf96ca..3ee859e9 100644\n--- a/src/libcamera/pipeline/raspberrypi/rpi_stream.cpp\n+++ b/src/libcamera/pipeline/raspberrypi/rpi_stream.cpp\n@@ -14,46 +14,46 @@ LOG_DEFINE_CATEGORY(RPISTREAM)\n \n namespace RPi {\n \n-V4L2VideoDevice *RPiStream::dev() const\n+V4L2VideoDevice *Stream::dev() const\n {\n \treturn dev_.get();\n }\n \n-std::string RPiStream::name() const\n+std::string Stream::name() const\n {\n \treturn name_;\n }\n \n-void RPiStream::reset()\n+void Stream::reset()\n {\n \texternal_ = false;\n \tclearBuffers();\n }\n \n-void RPiStream::setExternal(bool external)\n+void Stream::setExternal(bool external)\n {\n \t/* Import streams cannot be external. */\n \tASSERT(!external || !importOnly_);\n \texternal_ = external;\n }\n \n-bool RPiStream::isExternal() const\n+bool Stream::isExternal() const\n {\n \treturn external_;\n }\n \n-void RPiStream::setExportedBuffers(std::vector<std::unique_ptr<FrameBuffer>> *buffers)\n+void Stream::setExportedBuffers(std::vector<std::unique_ptr<FrameBuffer>> *buffers)\n {\n \tfor (auto const &buffer : *buffers)\n \t\tbufferMap_.emplace(id_.get(), buffer.get());\n }\n \n-const BufferMap &RPiStream::getBuffers() const\n+const BufferMap &Stream::getBuffers() const\n {\n \treturn bufferMap_;\n }\n \n-int RPiStream::getBufferId(FrameBuffer *buffer) const\n+int Stream::getBufferId(FrameBuffer *buffer) const\n {\n \tif (importOnly_)\n \t\treturn -1;\n@@ -68,12 +68,12 @@ int RPiStream::getBufferId(FrameBuffer *buffer) const\n \treturn it->first;\n }\n \n-void RPiStream::setExternalBuffer(FrameBuffer *buffer)\n+void Stream::setExternalBuffer(FrameBuffer *buffer)\n {\n \tbufferMap_.emplace(RPiBufferMask::EXTERNAL_BUFFER | id_.get(), buffer);\n }\n \n-void RPiStream::removeExternalBuffer(FrameBuffer *buffer)\n+void Stream::removeExternalBuffer(FrameBuffer *buffer)\n {\n \tint id = getBufferId(buffer);\n \n@@ -82,7 +82,7 @@ void RPiStream::removeExternalBuffer(FrameBuffer *buffer)\n \tbufferMap_.erase(id);\n }\n \n-int RPiStream::prepareBuffers(unsigned int count)\n+int Stream::prepareBuffers(unsigned int count)\n {\n \tint ret;\n \n@@ -108,7 +108,7 @@ int RPiStream::prepareBuffers(unsigned int count)\n \treturn dev_->importBuffers(count);\n }\n \n-int RPiStream::queueBuffer(FrameBuffer *buffer)\n+int Stream::queueBuffer(FrameBuffer *buffer)\n {\n \t/*\n \t * A nullptr buffer implies an external stream, but no external\n@@ -147,7 +147,7 @@ int RPiStream::queueBuffer(FrameBuffer *buffer)\n \treturn 0;\n }\n \n-void RPiStream::returnBuffer(FrameBuffer *buffer)\n+void Stream::returnBuffer(FrameBuffer *buffer)\n {\n \t/* This can only be called for external streams. */\n \tASSERT(external_);\n@@ -186,7 +186,7 @@ void RPiStream::returnBuffer(FrameBuffer *buffer)\n \t}\n }\n \n-int RPiStream::queueAllBuffers()\n+int Stream::queueAllBuffers()\n {\n \tint ret;\n \n@@ -204,13 +204,13 @@ int RPiStream::queueAllBuffers()\n \treturn 0;\n }\n \n-void RPiStream::releaseBuffers()\n+void Stream::releaseBuffers()\n {\n \tdev_->releaseBuffers();\n \tclearBuffers();\n }\n \n-void RPiStream::clearBuffers()\n+void Stream::clearBuffers()\n {\n \tavailableBuffers_ = std::queue<FrameBuffer *>{};\n \trequestBuffers_ = std::queue<FrameBuffer *>{};\n@@ -219,7 +219,7 @@ void RPiStream::clearBuffers()\n \tid_.reset();\n }\n \n-int RPiStream::queueToDevice(FrameBuffer *buffer)\n+int Stream::queueToDevice(FrameBuffer *buffer)\n {\n \tLOG(RPISTREAM, Debug) << \"Queuing buffer \" << getBufferId(buffer)\n \t\t\t      << \" for \" << name_;\ndiff --git a/src/libcamera/pipeline/raspberrypi/rpi_stream.h b/src/libcamera/pipeline/raspberrypi/rpi_stream.h\nindex a2c21bcd..cb097e1c 100644\n--- a/src/libcamera/pipeline/raspberrypi/rpi_stream.h\n+++ b/src/libcamera/pipeline/raspberrypi/rpi_stream.h\n@@ -27,15 +27,15 @@ using BufferMap = std::unordered_map<unsigned int, FrameBuffer *>;\n  * Device stream abstraction for either an internal or external stream.\n  * Used for both Unicam and the ISP.\n  */\n-class RPiStream : public Stream\n+class Stream : public libcamera::Stream\n {\n public:\n-\tRPiStream()\n+\tStream()\n \t\t: id_(RPiBufferMask::ID)\n \t{\n \t}\n \n-\tRPiStream(const char *name, MediaEntity *dev, bool importOnly = false)\n+\tStream(const char *name, MediaEntity *dev, bool importOnly = false)\n \t\t: external_(false), importOnly_(importOnly), name_(name),\n \t\t  dev_(std::make_unique<V4L2VideoDevice>(dev)), id_(RPiBufferMask::ID)\n \t{\n@@ -155,7 +155,7 @@ private:\n  * streams indexed with an enum class.\n  */\n template<typename E, std::size_t N>\n-class RPiDevice : public std::array<class RPiStream, N>\n+class Device : public std::array<class Stream, N>\n {\n private:\n \tconstexpr auto index(E e) const noexcept\n@@ -163,13 +163,13 @@ private:\n \t\treturn static_cast<std::underlying_type_t<E>>(e);\n \t}\n public:\n-\tRPiStream &operator[](E e)\n+\tStream &operator[](E e)\n \t{\n-\t\treturn std::array<class RPiStream, N>::operator[](index(e));\n+\t\treturn std::array<class Stream, N>::operator[](index(e));\n \t}\n-\tconst RPiStream &operator[](E e) const\n+\tconst Stream &operator[](E e) const\n \t{\n-\t\treturn std::array<class RPiStream, N>::operator[](index(e));\n+\t\treturn std::array<class Stream, N>::operator[](index(e));\n \t}\n };\n \n","prefixes":["libcamera-devel","1/4"]}