Show a patch.

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

{
    "id": 19404,
    "url": "https://patchwork.libcamera.org/api/1.1/patches/19404/?format=api",
    "web_url": "https://patchwork.libcamera.org/patch/19404/",
    "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": "<20240113142218.28063-15-hdegoede@redhat.com>",
    "date": "2024-01-13T14:22:14",
    "name": "[libcamera-devel,v2,14/18] libcamera: pipeline: simple: rename converterBuffers_ and related vars",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": false,
    "hash": "16642e803066030722896c4032f4efe90926f50a",
    "submitter": {
        "id": 102,
        "url": "https://patchwork.libcamera.org/api/1.1/people/102/?format=api",
        "name": "Hans de Goede",
        "email": "hdegoede@redhat.com"
    },
    "delegate": null,
    "mbox": "https://patchwork.libcamera.org/patch/19404/mbox/",
    "series": [
        {
            "id": 4142,
            "url": "https://patchwork.libcamera.org/api/1.1/series/4142/?format=api",
            "web_url": "https://patchwork.libcamera.org/project/libcamera/list/?series=4142",
            "date": "2024-01-13T14:22:00",
            "name": "[libcamera-devel,v2,01/18] libcamera: pipeline: simple: fix size adjustment in validate()",
            "version": 2,
            "mbox": "https://patchwork.libcamera.org/series/4142/mbox/"
        }
    ],
    "comments": "https://patchwork.libcamera.org/api/patches/19404/comments/",
    "check": "pending",
    "checks": "https://patchwork.libcamera.org/api/patches/19404/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 86E91C32BC\n\tfor <parsemail@patchwork.libcamera.org>;\n\tSat, 13 Jan 2024 14:23:08 +0000 (UTC)",
            "from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 1E747628D8;\n\tSat, 13 Jan 2024 15:23:08 +0100 (CET)",
            "from us-smtp-delivery-124.mimecast.com\n\t(us-smtp-delivery-124.mimecast.com [170.10.133.124])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id B94E362945\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tSat, 13 Jan 2024 15:23:05 +0100 (CET)",
            "from mimecast-mx02.redhat.com (mx-ext.redhat.com [66.187.233.73])\n\tby relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3,\n\tcipher=TLS_AES_256_GCM_SHA384) id us-mta-272-Qy-qza2yMU20LrG0hoDpxA-1;\n\tSat, 13 Jan 2024 09:23:01 -0500",
            "from smtp.corp.redhat.com\n\t(int-mx01.intmail.prod.int.rdu2.redhat.com [10.11.54.1])\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 ABD8E380409B;\n\tSat, 13 Jan 2024 14:23:00 +0000 (UTC)",
            "from localhost.localdomain (unknown [10.39.192.58])\n\tby smtp.corp.redhat.com (Postfix) with ESMTP id 906863C25;\n\tSat, 13 Jan 2024 14:22:58 +0000 (UTC)"
        ],
        "DKIM-Signature": [
            "v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org;\n\ts=mail; t=1705155788;\n\tbh=RcnatGuep0KaEgXuxt7iV4wxbfm31boF7Mvv5BGJd94=;\n\th=To:Date:In-Reply-To:References:Subject:List-Id:List-Unsubscribe:\n\tList-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:Cc:\n\tFrom;\n\tb=yHyHzrNAXZVQThQztMRbVuNZLlnWqb0QxBq/UfhH+vZQrAzqAdakLt5TT3h6AR54D\n\tTyynkOnsReoU+V4HscIIG2dY+P9F7gwgio8nJyJAy8insgIAu7MC2QW1aTHZV9NAS+\n\tpebyg8xpITzP0Ani2Ny/eVkb/yobbL+vVyb2L1EBz2QtYMQzEco0jMNb3q1rOmy6l1\n\tN/9iiLiGF3aX3YCRvdfec+MGV2J4ResIhYHj9cvP/naWBjN6FuR92yXGwO1dNWSJTR\n\teAcUtFVHEsm0VA7TBNIUrLN++oWVZiRJtN3aO7Efk1FMGtAmlrc+oWuuyvm35brLBf\n\tctpuKF56CdLkg==",
            "v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com;\n\ts=mimecast20190719; t=1705155784;\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=soM/A070UM2ujggKFrjYBygbGnH6AS5EDCo3Jn7Fmwk=;\n\tb=bOB5OJ8QlM5gkzRLbur5EPAGgiQ/cF0/wlmbZ4wsr/tp5vmQ4J27n67Y9XkXp6Z8Gc4eez\n\tQy5NCnWwyTo5KkTHnr7MDlHo9WU4uYraeeCeffG20OCbTbrhNVB0MsUkYcr1j4KJxw/U3P\n\t7SjWDaTeMVkBx1QFLdqoPPHvbH4PGm4="
        ],
        "Authentication-Results": "lancelot.ideasonboard.com; dkim=pass (1024-bit key; \n\tunprotected) header.d=redhat.com\n\theader.i=@redhat.com header.b=\"bOB5OJ8Q\"; \n\tdkim-atps=neutral",
        "X-MC-Unique": "Qy-qza2yMU20LrG0hoDpxA-1",
        "To": "libcamera-devel@lists.libcamera.org,\n\tAndrey Konovalov <andrey.konovalov.ynk@gmail.com>",
        "Date": "Sat, 13 Jan 2024 15:22:14 +0100",
        "Message-ID": "<20240113142218.28063-15-hdegoede@redhat.com>",
        "In-Reply-To": "<20240113142218.28063-1-hdegoede@redhat.com>",
        "References": "<20240113142218.28063-1-hdegoede@redhat.com>",
        "MIME-Version": "1.0",
        "X-Scanned-By": "MIMEDefang 3.4.1 on 10.11.54.1",
        "X-Mimecast-Spam-Score": "0",
        "X-Mimecast-Originator": "redhat.com",
        "Content-Transfer-Encoding": "8bit",
        "Content-Type": "text/plain; charset=\"US-ASCII\"; x-default=true",
        "Subject": "[libcamera-devel] [PATCH v2 14/18] libcamera: pipeline: simple:\n\trename converterBuffers_ and related vars",
        "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>",
        "From": "Hans de Goede via libcamera-devel <libcamera-devel@lists.libcamera.org>",
        "Reply-To": "Hans de Goede <hdegoede@redhat.com>",
        "Cc": "Maxime Ripard <mripard@redhat.com>, g.martti@gmail.com,\n\tt.langendam@gmail.com, srinivas.kandagatla@linaro.org,\n\tPavel Machek <pavel@ucw.cz>,\n\tBryan O'Donoghue <bryan.odonoghue@linaro.org>, admin@dennisbonke.com",
        "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\nSigned-off-by: Andrey Konovalov <andrey.konovalov@linaro.org>\nSigned-off-by: Hans de Goede <hdegoede@redhat.com>\nTested-by: Bryan O'Donoghue <bryan.odonoghue@linaro.org> # sc8280xp Lenovo x13s\nTested-by: Pavel Machek <pavel@ucw.cz>\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 4d0e7255..fa298746 100644\n--- a/src/libcamera/pipeline/simple/simple.cpp\n+++ b/src/libcamera/pipeline/simple/simple.cpp\n@@ -269,17 +269,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@@ -503,8 +504,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@@ -740,7 +741,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@@ -756,16 +757,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@@ -782,9 +783,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@@ -801,14 +802,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@@ -817,13 +818,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@@ -1159,14 +1160,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@@ -1192,7 +1193,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@@ -1213,13 +1214,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@@ -1238,7 +1239,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@@ -1246,7 +1247,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@@ -1258,7 +1259,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@@ -1266,7 +1267,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@@ -1284,7 +1285,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@@ -1293,8 +1294,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": [
        "libcamera-devel",
        "v2",
        "14/18"
    ]
}