{"id":9600,"url":"https://patchwork.libcamera.org/api/patches/9600/?format=json","web_url":"https://patchwork.libcamera.org/patch/9600/","project":{"id":1,"url":"https://patchwork.libcamera.org/api/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":"<20200914142149.63857-9-niklas.soderlund@ragnatech.se>","date":"2020-09-14T14:21:44","name":"[libcamera-devel,v2,08/13] libcamera: pipeline: rkisp1: Prefix main path video and resizer","commit_ref":null,"pull_url":null,"state":"accepted","archived":false,"hash":"c1ee79d936e7acbb5871bf7254743d85dfafd201","submitter":{"id":5,"url":"https://patchwork.libcamera.org/api/people/5/?format=json","name":"Niklas Söderlund","email":"niklas.soderlund@ragnatech.se"},"delegate":null,"mbox":"https://patchwork.libcamera.org/patch/9600/mbox/","series":[{"id":1289,"url":"https://patchwork.libcamera.org/api/series/1289/?format=json","web_url":"https://patchwork.libcamera.org/project/libcamera/list/?series=1289","date":"2020-09-14T14:21:36","name":"libcamera: pipeline: rkisp1: Extend to support two streams","version":2,"mbox":"https://patchwork.libcamera.org/series/1289/mbox/"}],"comments":"https://patchwork.libcamera.org/api/patches/9600/comments/","check":"pending","checks":"https://patchwork.libcamera.org/api/patches/9600/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 06726BF01C\n\tfor <parsemail@patchwork.libcamera.org>;\n\tMon, 14 Sep 2020 14:22:15 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id CE56962E09;\n\tMon, 14 Sep 2020 16:22:14 +0200 (CEST)","from bin-mail-out-05.binero.net (bin-mail-out-05.binero.net\n\t[195.74.38.228])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 63A4062DFD\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tMon, 14 Sep 2020 16:22:12 +0200 (CEST)","from bismarck.berto.se (p54ac52a8.dip0.t-ipconnect.de\n\t[84.172.82.168]) by bin-vsp-out-02.atm.binero.net (Halon) with ESMTPA\n\tid ad8fa69b-f695-11ea-a39b-005056917f90;\n\tMon, 14 Sep 2020 16:22:11 +0200 (CEST)"],"X-Halon-ID":"ad8fa69b-f695-11ea-a39b-005056917f90","Authorized-sender":"niklas.soderlund@fsdn.se","From":"=?utf-8?q?Niklas_S=C3=B6derlund?= <niklas.soderlund@ragnatech.se>","To":"libcamera-devel@lists.libcamera.org","Date":"Mon, 14 Sep 2020 16:21:44 +0200","Message-Id":"<20200914142149.63857-9-niklas.soderlund@ragnatech.se>","X-Mailer":"git-send-email 2.28.0","In-Reply-To":"<20200914142149.63857-1-niklas.soderlund@ragnatech.se>","References":"<20200914142149.63857-1-niklas.soderlund@ragnatech.se>","MIME-Version":"1.0","Subject":"[libcamera-devel] [PATCH v2 08/13] libcamera: pipeline: rkisp1:\n\tPrefix main path video and resizer","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=\"utf-8\"","Content-Transfer-Encoding":"base64","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"},"content":"In preparation of supporting both the main and self path prefix the main\npath specific variables with mainPath.\n\nSigned-off-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>\n---\n src/libcamera/pipeline/rkisp1/rkisp1.cpp | 82 ++++++++++++------------\n 1 file changed, 41 insertions(+), 41 deletions(-)","diff":"diff --git a/src/libcamera/pipeline/rkisp1/rkisp1.cpp b/src/libcamera/pipeline/rkisp1/rkisp1.cpp\nindex 45c5e40186df693d..4e1295486c184178 100644\n--- a/src/libcamera/pipeline/rkisp1/rkisp1.cpp\n+++ b/src/libcamera/pipeline/rkisp1/rkisp1.cpp\n@@ -68,7 +68,7 @@ struct RkISP1FrameInfo {\n \n \tFrameBuffer *paramBuffer;\n \tFrameBuffer *statBuffer;\n-\tFrameBuffer *videoBuffer;\n+\tFrameBuffer *mainPathBuffer;\n \n \tbool paramFilled;\n \tbool paramDequeued;\n@@ -133,7 +133,7 @@ class RkISP1CameraData : public CameraData\n public:\n \tRkISP1CameraData(PipelineHandler *pipe, V4L2VideoDevice *video)\n \t\t: CameraData(pipe), sensor_(nullptr), frame_(0),\n-\t\t  frameInfo_(pipe), video_(video)\n+\t\t  frameInfo_(pipe), mainPathVideo_(video)\n \t{\n \t}\n \n@@ -144,14 +144,14 @@ public:\n \n \tint loadIPA();\n \n-\tStream stream_;\n+\tStream mainPathStream_;\n \tCameraSensor *sensor_;\n \tunsigned int frame_;\n \tstd::vector<IPABuffer> ipaBuffers_;\n \tRkISP1Frames frameInfo_;\n \tRkISP1Timeline timeline_;\n \n-\tV4L2VideoDevice *video_;\n+\tV4L2VideoDevice *mainPathVideo_;\n \n private:\n \tvoid queueFrameAction(unsigned int frame,\n@@ -227,8 +227,8 @@ private:\n \n \tMediaDevice *media_;\n \tV4L2Subdevice *isp_;\n-\tV4L2Subdevice *resizer_;\n-\tV4L2VideoDevice *video_;\n+\tV4L2Subdevice *mainPathResizer_;\n+\tV4L2VideoDevice *mainPathVideo_;\n \tV4L2VideoDevice *param_;\n \tV4L2VideoDevice *stat_;\n \n@@ -261,8 +261,8 @@ RkISP1FrameInfo *RkISP1Frames::create(const RkISP1CameraData *data, Request *req\n \t}\n \tFrameBuffer *statBuffer = pipe_->availableStatBuffers_.front();\n \n-\tFrameBuffer *videoBuffer = request->findBuffer(&data->stream_);\n-\tif (!videoBuffer) {\n+\tFrameBuffer *mainPathBuffer = request->findBuffer(&data->mainPathStream_);\n+\tif (!mainPathBuffer) {\n \t\tLOG(RkISP1, Error)\n \t\t\t<< \"Attempt to queue request with invalid stream\";\n \t\treturn nullptr;\n@@ -276,7 +276,7 @@ RkISP1FrameInfo *RkISP1Frames::create(const RkISP1CameraData *data, Request *req\n \tinfo->frame = frame;\n \tinfo->request = request;\n \tinfo->paramBuffer = paramBuffer;\n-\tinfo->videoBuffer = videoBuffer;\n+\tinfo->mainPathBuffer = mainPathBuffer;\n \tinfo->statBuffer = statBuffer;\n \tinfo->paramFilled = false;\n \tinfo->paramDequeued = false;\n@@ -335,7 +335,7 @@ RkISP1FrameInfo *RkISP1Frames::find(FrameBuffer *buffer)\n \n \t\tif (info->paramBuffer == buffer ||\n \t\t    info->statBuffer == buffer ||\n-\t\t    info->videoBuffer == buffer)\n+\t\t    info->mainPathBuffer == buffer)\n \t\t\treturn info;\n \t}\n \n@@ -407,7 +407,7 @@ protected:\n \n \t\tpipe_->param_->queueBuffer(info->paramBuffer);\n \t\tpipe_->stat_->queueBuffer(info->statBuffer);\n-\t\tpipe_->video_->queueBuffer(info->videoBuffer);\n+\t\tpipe_->mainPathVideo_->queueBuffer(info->mainPathBuffer);\n \t}\n \n private:\n@@ -546,10 +546,10 @@ CameraConfiguration::Status RkISP1CameraConfiguration::validate()\n \tcfg.bufferCount = RKISP1_BUFFER_COUNT;\n \n \tV4L2DeviceFormat format = {};\n-\tformat.fourcc = data_->video_->toV4L2PixelFormat(cfg.pixelFormat);\n+\tformat.fourcc = data_->mainPathVideo_->toV4L2PixelFormat(cfg.pixelFormat);\n \tformat.size = cfg.size;\n \n-\tint ret = data_->video_->tryFormat(&format);\n+\tint ret = data_->mainPathVideo_->tryFormat(&format);\n \tif (ret)\n \t\treturn Invalid;\n \n@@ -560,8 +560,8 @@ CameraConfiguration::Status RkISP1CameraConfiguration::validate()\n }\n \n PipelineHandlerRkISP1::PipelineHandlerRkISP1(CameraManager *manager)\n-\t: PipelineHandler(manager), isp_(nullptr), resizer_(nullptr),\n-\t  video_(nullptr), param_(nullptr), stat_(nullptr)\n+\t: PipelineHandler(manager), isp_(nullptr), mainPathResizer_(nullptr),\n+\t  mainPathVideo_(nullptr), param_(nullptr), stat_(nullptr)\n {\n }\n \n@@ -569,8 +569,8 @@ PipelineHandlerRkISP1::~PipelineHandlerRkISP1()\n {\n \tdelete param_;\n \tdelete stat_;\n-\tdelete video_;\n-\tdelete resizer_;\n+\tdelete mainPathVideo_;\n+\tdelete mainPathResizer_;\n \tdelete isp_;\n }\n \n@@ -651,7 +651,7 @@ int PipelineHandlerRkISP1::configure(Camera *camera, CameraConfiguration *c)\n \n \tLOG(RkISP1, Debug) << \"ISP output pad configured with \" << format.toString();\n \n-\tret = resizer_->setFormat(0, &format);\n+\tret = mainPathResizer_->setFormat(0, &format);\n \tif (ret < 0)\n \t\treturn ret;\n \n@@ -661,7 +661,7 @@ int PipelineHandlerRkISP1::configure(Camera *camera, CameraConfiguration *c)\n \n \tLOG(RkISP1, Debug) << \"Configuring resizer output pad with \" << format.toString();\n \n-\tret = resizer_->setFormat(1, &format);\n+\tret = mainPathResizer_->setFormat(1, &format);\n \tif (ret < 0)\n \t\treturn ret;\n \n@@ -669,16 +669,16 @@ int PipelineHandlerRkISP1::configure(Camera *camera, CameraConfiguration *c)\n \n \tconst PixelFormatInfo &info = PixelFormatInfo::info(cfg.pixelFormat);\n \tV4L2DeviceFormat outputFormat = {};\n-\toutputFormat.fourcc = video_->toV4L2PixelFormat(cfg.pixelFormat);\n+\toutputFormat.fourcc = mainPathVideo_->toV4L2PixelFormat(cfg.pixelFormat);\n \toutputFormat.size = cfg.size;\n \toutputFormat.planesCount = info.numPlanes();\n \n-\tret = video_->setFormat(&outputFormat);\n+\tret = mainPathVideo_->setFormat(&outputFormat);\n \tif (ret)\n \t\treturn ret;\n \n \tif (outputFormat.size != cfg.size ||\n-\t    outputFormat.fourcc != video_->toV4L2PixelFormat(cfg.pixelFormat)) {\n+\t    outputFormat.fourcc != mainPathVideo_->toV4L2PixelFormat(cfg.pixelFormat)) {\n \t\tLOG(RkISP1, Error)\n \t\t\t<< \"Unable to configure capture in \" << cfg.toString();\n \t\treturn -EINVAL;\n@@ -696,7 +696,7 @@ int PipelineHandlerRkISP1::configure(Camera *camera, CameraConfiguration *c)\n \tif (ret)\n \t\treturn ret;\n \n-\tcfg.setStream(&data->stream_);\n+\tcfg.setStream(&data->mainPathStream_);\n \n \treturn 0;\n }\n@@ -705,17 +705,17 @@ int PipelineHandlerRkISP1::exportFrameBuffers([[maybe_unused]] Camera *camera, S\n \t\t\t\t\t      std::vector<std::unique_ptr<FrameBuffer>> *buffers)\n {\n \tunsigned int count = stream->configuration().bufferCount;\n-\treturn video_->exportBuffers(count, buffers);\n+\treturn mainPathVideo_->exportBuffers(count, buffers);\n }\n \n int PipelineHandlerRkISP1::allocateBuffers(Camera *camera)\n {\n \tRkISP1CameraData *data = cameraData(camera);\n-\tunsigned int count = data->stream_.configuration().bufferCount;\n+\tunsigned int count = data->mainPathStream_.configuration().bufferCount;\n \tunsigned int ipaBufferId = 1;\n \tint ret;\n \n-\tret = video_->importBuffers(count);\n+\tret = mainPathVideo_->importBuffers(count);\n \tif (ret < 0)\n \t\tgoto error;\n \n@@ -748,7 +748,7 @@ int PipelineHandlerRkISP1::allocateBuffers(Camera *camera)\n error:\n \tparamBuffers_.clear();\n \tstatBuffers_.clear();\n-\tvideo_->releaseBuffers();\n+\tmainPathVideo_->releaseBuffers();\n \n \treturn ret;\n }\n@@ -779,8 +779,8 @@ int PipelineHandlerRkISP1::freeBuffers(Camera *camera)\n \tif (stat_->releaseBuffers())\n \t\tLOG(RkISP1, Error) << \"Failed to release stat buffers\";\n \n-\tif (video_->releaseBuffers())\n-\t\tLOG(RkISP1, Error) << \"Failed to release video buffers\";\n+\tif (mainPathVideo_->releaseBuffers())\n+\t\tLOG(RkISP1, Error) << \"Failed to release main path buffers\";\n \n \treturn 0;\n }\n@@ -824,7 +824,7 @@ int PipelineHandlerRkISP1::start(Camera *camera)\n \t\treturn ret;\n \t}\n \n-\tret = video_->streamOn();\n+\tret = mainPathVideo_->streamOn();\n \tif (ret) {\n \t\tparam_->streamOff();\n \t\tstat_->streamOff();\n@@ -849,8 +849,8 @@ int PipelineHandlerRkISP1::start(Camera *camera)\n \n \tstd::map<unsigned int, IPAStream> streamConfig;\n \tstreamConfig[0] = {\n-\t\t.pixelFormat = data->stream_.configuration().pixelFormat,\n-\t\t.size = data->stream_.configuration().size,\n+\t\t.pixelFormat = data->mainPathStream_.configuration().pixelFormat,\n+\t\t.size = data->mainPathStream_.configuration().size,\n \t};\n \n \tstd::map<unsigned int, const ControlInfoMap &> entityControls;\n@@ -868,7 +868,7 @@ void PipelineHandlerRkISP1::stop(Camera *camera)\n \tRkISP1CameraData *data = cameraData(camera);\n \tint ret;\n \n-\tret = video_->streamOff();\n+\tret = mainPathVideo_->streamOff();\n \tif (ret)\n \t\tLOG(RkISP1, Warning)\n \t\t\t<< \"Failed to stop camera \" << camera->id();\n@@ -953,7 +953,7 @@ int PipelineHandlerRkISP1::initLinks(const Camera *camera,\n \n \tfor (const StreamConfiguration &cfg : config) {\n \t\tMediaLink *link = nullptr;\n-\t\tif (cfg.stream() == &data->stream_)\n+\t\tif (cfg.stream() == &data->mainPathStream_)\n \t\t\tlink = media_->link(\"rkisp1_isp\", 2,\n \t\t\t\t\t    \"rkisp1_resizer_mainpath\", 0);\n \t\telse\n@@ -975,7 +975,7 @@ int PipelineHandlerRkISP1::createCamera(MediaEntity *sensor)\n \tint ret;\n \n \tstd::unique_ptr<RkISP1CameraData> data =\n-\t\tstd::make_unique<RkISP1CameraData>(this, video_);\n+\t\tstd::make_unique<RkISP1CameraData>(this, mainPathVideo_);\n \n \tControlInfoMap::Map ctrls;\n \tctrls.emplace(std::piecewise_construct,\n@@ -996,7 +996,7 @@ int PipelineHandlerRkISP1::createCamera(MediaEntity *sensor)\n \tif (ret)\n \t\treturn ret;\n \n-\tstd::set<Stream *> streams{ &data->stream_ };\n+\tstd::set<Stream *> streams{ &data->mainPathStream_ };\n \tstd::shared_ptr<Camera> camera =\n \t\tCamera::create(this, data->sensor_->id(), streams);\n \tregisterCamera(std::move(camera), std::move(data));\n@@ -1026,13 +1026,13 @@ bool PipelineHandlerRkISP1::match(DeviceEnumerator *enumerator)\n \tif (isp_->open() < 0)\n \t\treturn false;\n \n-\tresizer_ = V4L2Subdevice::fromEntityName(media_, \"rkisp1_resizer_mainpath\");\n-\tif (resizer_->open() < 0)\n+\tmainPathResizer_ = V4L2Subdevice::fromEntityName(media_, \"rkisp1_resizer_mainpath\");\n+\tif (mainPathResizer_->open() < 0)\n \t\treturn false;\n \n \t/* Locate and open the capture video node. */\n-\tvideo_ = V4L2VideoDevice::fromEntityName(media_, \"rkisp1_mainpath\");\n-\tif (video_->open() < 0)\n+\tmainPathVideo_ = V4L2VideoDevice::fromEntityName(media_, \"rkisp1_mainpath\");\n+\tif (mainPathVideo_->open() < 0)\n \t\treturn false;\n \n \tstat_ = V4L2VideoDevice::fromEntityName(media_, \"rkisp1_stats\");\n@@ -1043,7 +1043,7 @@ bool PipelineHandlerRkISP1::match(DeviceEnumerator *enumerator)\n \tif (param_->open() < 0)\n \t\treturn false;\n \n-\tvideo_->bufferReady.connect(this, &PipelineHandlerRkISP1::bufferReady);\n+\tmainPathVideo_->bufferReady.connect(this, &PipelineHandlerRkISP1::bufferReady);\n \tstat_->bufferReady.connect(this, &PipelineHandlerRkISP1::statReady);\n \tparam_->bufferReady.connect(this, &PipelineHandlerRkISP1::paramReady);\n \n","prefixes":["libcamera-devel","v2","08/13"]}