Show a patch.

GET /api/1.1/patches/19832/?format=api
HTTP 200 OK
Allow: GET, PUT, PATCH, HEAD, OPTIONS
Content-Type: application/json
Vary: Accept

{
    "id": 19832,
    "url": "https://patchwork.libcamera.org/api/1.1/patches/19832/?format=api",
    "web_url": "https://patchwork.libcamera.org/patch/19832/",
    "project": {
        "id": 1,
        "url": "https://patchwork.libcamera.org/api/1.1/projects/1/?format=api",
        "name": "libcamera",
        "link_name": "libcamera",
        "list_id": "libcamera_core",
        "list_email": "libcamera-devel@lists.libcamera.org",
        "web_url": "",
        "scm_url": "",
        "webscm_url": ""
    },
    "msgid": "<20240404084657.353464-13-mzamazal@redhat.com>",
    "date": "2024-04-04T08:46:49",
    "name": "[v7,12/18] libcamera: pipeline: simple: rename converterBuffers_ and related vars",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": false,
    "hash": "16642e803066030722896c4032f4efe90926f50a",
    "submitter": {
        "id": 177,
        "url": "https://patchwork.libcamera.org/api/1.1/people/177/?format=api",
        "name": "Milan Zamazal",
        "email": "mzamazal@redhat.com"
    },
    "delegate": null,
    "mbox": "https://patchwork.libcamera.org/patch/19832/mbox/",
    "series": [
        {
            "id": 4246,
            "url": "https://patchwork.libcamera.org/api/1.1/series/4246/?format=api",
            "web_url": "https://patchwork.libcamera.org/project/libcamera/list/?series=4246",
            "date": "2024-04-04T08:46:37",
            "name": "libcamera: introduce Software ISP and Software IPA",
            "version": 7,
            "mbox": "https://patchwork.libcamera.org/series/4246/mbox/"
        }
    ],
    "comments": "https://patchwork.libcamera.org/api/patches/19832/comments/",
    "check": "pending",
    "checks": "https://patchwork.libcamera.org/api/patches/19832/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 62D21C32CF\n\tfor <parsemail@patchwork.libcamera.org>;\n\tThu,  4 Apr 2024 08:47:52 +0000 (UTC)",
            "from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id D5F4263385;\n\tThu,  4 Apr 2024 10:47:51 +0200 (CEST)",
            "from us-smtp-delivery-124.mimecast.com\n\t(us-smtp-delivery-124.mimecast.com [170.10.129.124])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 6478D6338B\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tThu,  4 Apr 2024 10:47:49 +0200 (CEST)",
            "from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com\n\t[66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS\n\t(version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id\n\tus-mta-383-s9OeTH4kM-2r5rWEtTj4zA-1; Thu, 04 Apr 2024 04:47:46 -0400",
            "from smtp.corp.redhat.com\n\t(int-mx05.intmail.prod.int.rdu2.redhat.com [10.11.54.5])\n\t(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)\n\tkey-exchange X25519 server-signature RSA-PSS (2048 bits)\n\tserver-digest SHA256) (No client certificate requested)\n\tby mimecast-mx02.redhat.com (Postfix) with ESMTPS id DA02B868906;\n\tThu,  4 Apr 2024 08:47:45 +0000 (UTC)",
            "from nuthatch.brq.redhat.com (unknown [10.43.17.39])\n\tby smtp.corp.redhat.com (Postfix) with ESMTP id 826F58173;\n\tThu,  4 Apr 2024 08:47:44 +0000 (UTC)"
        ],
        "Authentication-Results": "lancelot.ideasonboard.com; dkim=pass (1024-bit key;\n\tunprotected) header.d=redhat.com header.i=@redhat.com\n\theader.b=\"blJlle8Q\"; dkim-atps=neutral",
        "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com;\n\ts=mimecast20190719; t=1712220468;\n\th=from:from:reply-to:subject:subject:date:date:message-id:message-id:\n\tto:to:cc:cc:mime-version:mime-version:content-type:content-type:\n\tcontent-transfer-encoding:content-transfer-encoding:\n\tin-reply-to:in-reply-to:references:references;\n\tbh=rEqIlebEr1duCYHGgLPQsps4iYqzhd4FbALUXYTj3Cw=;\n\tb=blJlle8QMvHzXdOfw6mYAwxuKGdfU9I2mA4sDoz6Q0XXowsSmnVtiStc+qA7VafYw0rR87\n\tOnjZ55yflY4wGFAIhLY+ohELTB3BKtZ7/8mX0pG0n50I1MjSGW0VTN//DfluA5mD+OQX0M\n\tBoSq8qK3wllDfaoUEHbkNwSOcNY4opU=",
        "X-MC-Unique": "s9OeTH4kM-2r5rWEtTj4zA-1",
        "From": "Milan Zamazal <mzamazal@redhat.com>",
        "To": "libcamera-devel@lists.libcamera.org",
        "Cc": "Andrey Konovalov <andrey.konovalov@linaro.org>,\n\tAndrei Konovalov <andrey.konovalov.ynk@gmail.com>,\n\tBryan O'Donoghue <bryan.odonoghue@linaro.org>,\n\tMaxime Ripard <mripard@redhat.com>, Milan Zamazal <mzamazal@redhat.com>, \n\tPavel Machek <pavel@ucw.cz>, Hans de Goede <hdegoede@redhat.com>,\n\tKieran Bingham <kieran.bingham@ideasonboard.com>,\n\tLaurent Pinchart <laurent.pinchart@ideasonboard.com>",
        "Subject": "[PATCH v7 12/18] libcamera: pipeline: simple: rename\n\tconverterBuffers_ and related vars",
        "Date": "Thu,  4 Apr 2024 10:46:49 +0200",
        "Message-ID": "<20240404084657.353464-13-mzamazal@redhat.com>",
        "In-Reply-To": "<20240404084657.353464-1-mzamazal@redhat.com>",
        "References": "<20240404084657.353464-1-mzamazal@redhat.com>",
        "MIME-Version": "1.0",
        "X-Scanned-By": "MIMEDefang 3.4.1 on 10.11.54.5",
        "X-Mimecast-Spam-Score": "0",
        "X-Mimecast-Originator": "redhat.com",
        "Content-Transfer-Encoding": "8bit",
        "Content-Type": "text/plain; charset=\"US-ASCII\"; x-default=true",
        "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>",
        "Errors-To": "libcamera-devel-bounces@lists.libcamera.org",
        "Sender": "\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"
    },
    "content": "From: Andrey Konovalov <andrey.konovalov@linaro.org>\n\nThe converterBuffers_ and the converterQueue_ are not that specific\nto the Converter, and could be used by another entity doing the format\nconversion.\n\nRename converterBuffers_, converterQueue_, and useConverter_ to\nconversionBuffers_, conversionQueue_ and useConversion_ to\ndisassociate them from the Converter.\n\nTested-by: Bryan O'Donoghue <bryan.odonoghue@linaro.org> # sc8280xp Lenovo x13s\nTested-by: Pavel Machek <pavel@ucw.cz>\nReviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>\nReviewed-by: Pavel Machek <pavel@ucw.cz>\nReviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\nSigned-off-by: Andrey Konovalov <andrey.konovalov@linaro.org>\nSigned-off-by: Hans de Goede <hdegoede@redhat.com>\n---\n src/libcamera/pipeline/simple/simple.cpp | 63 ++++++++++++------------\n 1 file changed, 32 insertions(+), 31 deletions(-)",
    "diff": "diff --git a/src/libcamera/pipeline/simple/simple.cpp b/src/libcamera/pipeline/simple/simple.cpp\nindex d2b88795..c950f88f 100644\n--- a/src/libcamera/pipeline/simple/simple.cpp\n+++ b/src/libcamera/pipeline/simple/simple.cpp\n@@ -270,17 +270,18 @@ public:\n \tstd::vector<Configuration> configs_;\n \tstd::map<PixelFormat, std::vector<const Configuration *>> formats_;\n \n+\tstd::vector<std::unique_ptr<FrameBuffer>> conversionBuffers_;\n+\tstd::queue<std::map<unsigned int, FrameBuffer *>> conversionQueue_;\n+\tbool useConversion_;\n+\n \tstd::unique_ptr<Converter> converter_;\n-\tstd::vector<std::unique_ptr<FrameBuffer>> converterBuffers_;\n-\tbool useConverter_;\n-\tstd::queue<std::map<unsigned int, FrameBuffer *>> converterQueue_;\n \n private:\n \tvoid tryPipeline(unsigned int code, const Size &size);\n \tstatic std::vector<const MediaPad *> routedSourcePads(MediaPad *sink);\n \n-\tvoid converterInputDone(FrameBuffer *buffer);\n-\tvoid converterOutputDone(FrameBuffer *buffer);\n+\tvoid conversionInputDone(FrameBuffer *buffer);\n+\tvoid conversionOutputDone(FrameBuffer *buffer);\n };\n \n class SimpleCameraConfiguration : public CameraConfiguration\n@@ -504,8 +505,8 @@ int SimpleCameraData::init()\n \t\t\t\t<< \"Failed to create converter, disabling format conversion\";\n \t\t\tconverter_.reset();\n \t\t} else {\n-\t\t\tconverter_->inputBufferReady.connect(this, &SimpleCameraData::converterInputDone);\n-\t\t\tconverter_->outputBufferReady.connect(this, &SimpleCameraData::converterOutputDone);\n+\t\t\tconverter_->inputBufferReady.connect(this, &SimpleCameraData::conversionInputDone);\n+\t\t\tconverter_->outputBufferReady.connect(this, &SimpleCameraData::conversionOutputDone);\n \t\t}\n \t}\n \n@@ -741,7 +742,7 @@ void SimpleCameraData::bufferReady(FrameBuffer *buffer)\n \t * point converting an erroneous buffer.\n \t */\n \tif (buffer->metadata().status != FrameMetadata::FrameSuccess) {\n-\t\tif (!useConverter_) {\n+\t\tif (!useConversion_) {\n \t\t\t/* No conversion, just complete the request. */\n \t\t\tRequest *request = buffer->request();\n \t\t\tpipe->completeBuffer(request, buffer);\n@@ -757,16 +758,16 @@ void SimpleCameraData::bufferReady(FrameBuffer *buffer)\n \t\tif (buffer->metadata().status != FrameMetadata::FrameCancelled)\n \t\t\tvideo_->queueBuffer(buffer);\n \n-\t\tif (converterQueue_.empty())\n+\t\tif (conversionQueue_.empty())\n \t\t\treturn;\n \n \t\tRequest *request = nullptr;\n-\t\tfor (auto &item : converterQueue_.front()) {\n+\t\tfor (auto &item : conversionQueue_.front()) {\n \t\t\tFrameBuffer *outputBuffer = item.second;\n \t\t\trequest = outputBuffer->request();\n \t\t\tpipe->completeBuffer(request, outputBuffer);\n \t\t}\n-\t\tconverterQueue_.pop();\n+\t\tconversionQueue_.pop();\n \n \t\tif (request)\n \t\t\tpipe->completeRequest(request);\n@@ -783,9 +784,9 @@ void SimpleCameraData::bufferReady(FrameBuffer *buffer)\n \t */\n \tRequest *request = buffer->request();\n \n-\tif (useConverter_ && !converterQueue_.empty()) {\n+\tif (useConversion_ && !conversionQueue_.empty()) {\n \t\tconst std::map<unsigned int, FrameBuffer *> &outputs =\n-\t\t\tconverterQueue_.front();\n+\t\t\tconversionQueue_.front();\n \t\tif (!outputs.empty()) {\n \t\t\tFrameBuffer *outputBuffer = outputs.begin()->second;\n \t\t\tif (outputBuffer)\n@@ -802,14 +803,14 @@ void SimpleCameraData::bufferReady(FrameBuffer *buffer)\n \t * conversion is needed. If there's no queued request, just requeue the\n \t * captured buffer for capture.\n \t */\n-\tif (useConverter_) {\n-\t\tif (converterQueue_.empty()) {\n+\tif (useConversion_) {\n+\t\tif (conversionQueue_.empty()) {\n \t\t\tvideo_->queueBuffer(buffer);\n \t\t\treturn;\n \t\t}\n \n-\t\tconverter_->queueBuffers(buffer, converterQueue_.front());\n-\t\tconverterQueue_.pop();\n+\t\tconverter_->queueBuffers(buffer, conversionQueue_.front());\n+\t\tconversionQueue_.pop();\n \t\treturn;\n \t}\n \n@@ -818,13 +819,13 @@ void SimpleCameraData::bufferReady(FrameBuffer *buffer)\n \tpipe->completeRequest(request);\n }\n \n-void SimpleCameraData::converterInputDone(FrameBuffer *buffer)\n+void SimpleCameraData::conversionInputDone(FrameBuffer *buffer)\n {\n \t/* Queue the input buffer back for capture. */\n \tvideo_->queueBuffer(buffer);\n }\n \n-void SimpleCameraData::converterOutputDone(FrameBuffer *buffer)\n+void SimpleCameraData::conversionOutputDone(FrameBuffer *buffer)\n {\n \tSimplePipelineHandler *pipe = SimpleCameraData::pipe();\n \n@@ -1193,14 +1194,14 @@ int SimplePipelineHandler::configure(Camera *camera, CameraConfiguration *c)\n \n \t/* Configure the converter if needed. */\n \tstd::vector<std::reference_wrapper<StreamConfiguration>> outputCfgs;\n-\tdata->useConverter_ = config->needConversion();\n+\tdata->useConversion_ = config->needConversion();\n \n \tfor (unsigned int i = 0; i < config->size(); ++i) {\n \t\tStreamConfiguration &cfg = config->at(i);\n \n \t\tcfg.setStream(&data->streams_[i]);\n \n-\t\tif (data->useConverter_)\n+\t\tif (data->useConversion_)\n \t\t\toutputCfgs.push_back(cfg);\n \t}\n \n@@ -1226,7 +1227,7 @@ int SimplePipelineHandler::exportFrameBuffers(Camera *camera, Stream *stream,\n \t * Export buffers on the converter or capture video node, depending on\n \t * whether the converter is used or not.\n \t */\n-\tif (data->useConverter_)\n+\tif (data->useConversion_)\n \t\treturn data->converter_->exportBuffers(data->streamIndex(stream),\n \t\t\t\t\t\t       count, buffers);\n \telse\n@@ -1247,13 +1248,13 @@ int SimplePipelineHandler::start(Camera *camera, [[maybe_unused]] const ControlL\n \t\treturn -EBUSY;\n \t}\n \n-\tif (data->useConverter_) {\n+\tif (data->useConversion_) {\n \t\t/*\n \t\t * When using the converter allocate a fixed number of internal\n \t\t * buffers.\n \t\t */\n \t\tret = video->allocateBuffers(kNumInternalBuffers,\n-\t\t\t\t\t     &data->converterBuffers_);\n+\t\t\t\t\t     &data->conversionBuffers_);\n \t} else {\n \t\t/* Otherwise, prepare for using buffers from the only stream. */\n \t\tStream *stream = &data->streams_[0];\n@@ -1272,7 +1273,7 @@ int SimplePipelineHandler::start(Camera *camera, [[maybe_unused]] const ControlL\n \t\treturn ret;\n \t}\n \n-\tif (data->useConverter_) {\n+\tif (data->useConversion_) {\n \t\tret = data->converter_->start();\n \t\tif (ret < 0) {\n \t\t\tstop(camera);\n@@ -1280,7 +1281,7 @@ int SimplePipelineHandler::start(Camera *camera, [[maybe_unused]] const ControlL\n \t\t}\n \n \t\t/* Queue all internal buffers for capture. */\n-\t\tfor (std::unique_ptr<FrameBuffer> &buffer : data->converterBuffers_)\n+\t\tfor (std::unique_ptr<FrameBuffer> &buffer : data->conversionBuffers_)\n \t\t\tvideo->queueBuffer(buffer.get());\n \t}\n \n@@ -1292,7 +1293,7 @@ void SimplePipelineHandler::stopDevice(Camera *camera)\n \tSimpleCameraData *data = cameraData(camera);\n \tV4L2VideoDevice *video = data->video_;\n \n-\tif (data->useConverter_)\n+\tif (data->useConversion_)\n \t\tdata->converter_->stop();\n \n \tvideo->streamOff();\n@@ -1300,7 +1301,7 @@ void SimplePipelineHandler::stopDevice(Camera *camera)\n \n \tvideo->bufferReady.disconnect(data, &SimpleCameraData::bufferReady);\n \n-\tdata->converterBuffers_.clear();\n+\tdata->conversionBuffers_.clear();\n \n \treleasePipeline(data);\n }\n@@ -1318,7 +1319,7 @@ int SimplePipelineHandler::queueRequestDevice(Camera *camera, Request *request)\n \t\t * queue, it will be handed to the converter in the capture\n \t\t * completion handler.\n \t\t */\n-\t\tif (data->useConverter_) {\n+\t\tif (data->useConversion_) {\n \t\t\tbuffers.emplace(data->streamIndex(stream), buffer);\n \t\t} else {\n \t\t\tret = data->video_->queueBuffer(buffer);\n@@ -1327,8 +1328,8 @@ int SimplePipelineHandler::queueRequestDevice(Camera *camera, Request *request)\n \t\t}\n \t}\n \n-\tif (data->useConverter_)\n-\t\tdata->converterQueue_.push(std::move(buffers));\n+\tif (data->useConversion_)\n+\t\tdata->conversionQueue_.push(std::move(buffers));\n \n \treturn 0;\n }\n",
    "prefixes": [
        "v7",
        "12/18"
    ]
}