Show a patch.

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

{
    "id": 10560,
    "url": "https://patchwork.libcamera.org/api/patches/10560/?format=api",
    "web_url": "https://patchwork.libcamera.org/patch/10560/",
    "project": {
        "id": 1,
        "url": "https://patchwork.libcamera.org/api/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": "<20201204153121.66136-2-naush@raspberrypi.com>",
    "date": "2020-12-04T15:31:19",
    "name": "[libcamera-devel,v3,1/3] libcamera: pipeline: Pass libcamera controls into pipeline_handler::start()",
    "commit_ref": null,
    "pull_url": null,
    "state": "accepted",
    "archived": false,
    "hash": "33b28ce6cc8d9ffd37e6d33ff2a845de11c34235",
    "submitter": {
        "id": 34,
        "url": "https://patchwork.libcamera.org/api/people/34/?format=api",
        "name": "Naushir Patuck",
        "email": "naush@raspberrypi.com"
    },
    "delegate": null,
    "mbox": "https://patchwork.libcamera.org/patch/10560/mbox/",
    "series": [
        {
            "id": 1505,
            "url": "https://patchwork.libcamera.org/api/series/1505/?format=api",
            "web_url": "https://patchwork.libcamera.org/project/libcamera/list/?series=1505",
            "date": "2020-12-04T15:31:18",
            "name": "Pass controls on camera:start()",
            "version": 3,
            "mbox": "https://patchwork.libcamera.org/series/1505/mbox/"
        }
    ],
    "comments": "https://patchwork.libcamera.org/api/patches/10560/comments/",
    "check": "pending",
    "checks": "https://patchwork.libcamera.org/api/patches/10560/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 EBE03BE177\n\tfor <parsemail@patchwork.libcamera.org>;\n\tFri,  4 Dec 2020 15:31:29 +0000 (UTC)",
            "from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id B81F0635F1;\n\tFri,  4 Dec 2020 16:31:29 +0100 (CET)",
            "from mail-wr1-x430.google.com (mail-wr1-x430.google.com\n\t[IPv6:2a00:1450:4864:20::430])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 42CA1635D6\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tFri,  4 Dec 2020 16:31:27 +0100 (CET)",
            "by mail-wr1-x430.google.com with SMTP id k14so5734280wrn.1\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tFri, 04 Dec 2020 07:31:27 -0800 (PST)",
            "from naushir-VirtualBox.pitowers.org\n\t([2a00:1098:3142:14:a00:27ff:fe4d:f6a2])\n\tby smtp.gmail.com with ESMTPSA id\n\tx66sm3465426wmg.26.2020.12.04.07.31.25\n\t(version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n\tFri, 04 Dec 2020 07:31:25 -0800 (PST)"
        ],
        "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=\"lHn2nQXH\"; 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=1HtdDSULhK9SeVwOWHg5T+PVgm3b5ORCZg0yBjiniz8=;\n\tb=lHn2nQXHOHjRSYre4SjxY22Av6ifqxOJKBDBs3rjDipeJX4qiL1DNjkAgFzvMwU4Sg\n\t0bGRT+SbJwn7zYEhHj46xJwwMKWrf7iI7/nEZFzEwIIo/Ax7IXeWIUSXipIwxog15Nk8\n\tVw9kYTgS1FDaz5k0t/pVwglI6h5ti95CLWTZhZvcjDhkz0CoGKZDFfFCLKXhYzWy+eyP\n\t+FZCryANHWKADVxHEHhBT5xK8jOjIumVs6KBv8rJUOVa3EhTO18Vs0MfUp6XnrBFae4f\n\t/sRZLv8n8HNtRHp3mE7+eSW43qDWv4OF7m2IkFSOGMFKFGHQ1+aQeM+CEEkqDiZRCvZ5\n\tzX2w==",
        "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=1HtdDSULhK9SeVwOWHg5T+PVgm3b5ORCZg0yBjiniz8=;\n\tb=IH4JccblpmkoDjsWibwaub8VKt8yUQHF5sD/KDcUzWFF81ORvc/4idLqb30B9qEYNs\n\tJZfIC9D51/eV7nweKtS9lEn7RjVGOYgJdJcGs36MffQOBxap8XQyocaDOFu6cjJbIRyN\n\tkXyq4IN8FxuSpoenQfb1QdkrC6LC9AZzH0PE2NKDL0iGrXK2FsTpnU6GWh9gQkgBXSJ0\n\tMZMWAMBqbzPVQ+duyESI5mUdG3Jp7nZPvZztNiyNH9ReukQ8U1pJajZIJjmSvyJPP4JZ\n\tmR4CvJ5/D2Dp6iZU0cYzLKacZu7mLgYodjkkxHRCGJ3yWOFD6qO2tO39WQBdN5RcB2Dp\n\tfdxw==",
        "X-Gm-Message-State": "AOAM533rmhF6mNTx3Q9fP+GudSVvyT3Wutnx7mr4SeKjVewZYsrJohEY\n\tuLQuexSXtz376skCM+CL4hU7O4mup9Wp0g==",
        "X-Google-Smtp-Source": "ABdhPJzoNeJ5xHPr9JvCJszF7nOMfkakINQLLEyb1DuHTLLUMCRUkQ5+rhka2G3fG+un257y3781NA==",
        "X-Received": "by 2002:a5d:4b09:: with SMTP id v9mr5697824wrq.394.1607095886244;\n\tFri, 04 Dec 2020 07:31:26 -0800 (PST)",
        "From": "Naushir Patuck <naush@raspberrypi.com>",
        "To": "libcamera-devel@lists.libcamera.org",
        "Date": "Fri,  4 Dec 2020 15:31:19 +0000",
        "Message-Id": "<20201204153121.66136-2-naush@raspberrypi.com>",
        "X-Mailer": "git-send-email 2.25.1",
        "In-Reply-To": "<20201204153121.66136-1-naush@raspberrypi.com>",
        "References": "<20201204153121.66136-1-naush@raspberrypi.com>",
        "MIME-Version": "1.0",
        "Subject": "[libcamera-devel] [PATCH v3 1/3] libcamera: pipeline: Pass\n\tlibcamera controls into pipeline_handler::start()",
        "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": "Applications now have the ability to pass in controls that need to be\napplied on startup, rather than doing it through Request where there might\nbe some frames of delay in getting the controls applied.\n\nThis commit adds the ability to pass in a set of libcamera controls into\nthe pipeline handlers through the pipeline_handler::start() method. These\ncontrols are provided by the application through the camera::start()\npublic API.\n\nSigned-off-by: Naushir Patuck <naush@raspberrypi.com>\nReviewed-by: David Plowman <david.plowman@raspberrypi.com>\nTested-by: David Plowman <david.plowman@raspberrypi.com>\nReviewed-by: Jacopo Mondi <jacopo@jmondi.org>\n---\n Documentation/guides/pipeline-handler.rst          |  4 ++--\n include/libcamera/camera.h                         |  2 +-\n include/libcamera/internal/pipeline_handler.h      |  2 +-\n src/libcamera/camera.cpp                           | 11 ++++++-----\n src/libcamera/pipeline/ipu3/ipu3.cpp               |  4 ++--\n src/libcamera/pipeline/raspberrypi/raspberrypi.cpp |  4 ++--\n src/libcamera/pipeline/rkisp1/rkisp1.cpp           |  4 ++--\n src/libcamera/pipeline/simple/simple.cpp           |  4 ++--\n src/libcamera/pipeline/uvcvideo/uvcvideo.cpp       |  4 ++--\n src/libcamera/pipeline/vimc/vimc.cpp               |  4 ++--\n src/libcamera/pipeline_handler.cpp                 |  1 +\n 11 files changed, 23 insertions(+), 21 deletions(-)",
    "diff": "diff --git a/Documentation/guides/pipeline-handler.rst b/Documentation/guides/pipeline-handler.rst\nindex 57aee455..63275a12 100644\n--- a/Documentation/guides/pipeline-handler.rst\n+++ b/Documentation/guides/pipeline-handler.rst\n@@ -209,7 +209,7 @@ methods for the overridden class members.\n           int exportFrameBuffers(Camera *camera, Stream *stream,\n           std::vector<std::unique_ptr<FrameBuffer>> *buffers) override;\n \n-          int start(Camera *camera) override;\n+          int start(Camera *camera, ControlList *controls) override;\n           void stop(Camera *camera) override;\n \n           int queueRequestDevice(Camera *camera, Request *request) override;\n@@ -239,7 +239,7 @@ methods for the overridden class members.\n           return -1;\n    }\n \n-   int PipelineHandlerVivid::start(Camera *camera)\n+   int PipelineHandlerVivid::start(Camera *camera, ControlList *controls)\n    {\n           return -1;\n    }\ndiff --git a/include/libcamera/camera.h b/include/libcamera/camera.h\nindex 5c5f1a05..f94f8599 100644\n--- a/include/libcamera/camera.h\n+++ b/include/libcamera/camera.h\n@@ -103,7 +103,7 @@ public:\n \tstd::unique_ptr<Request> createRequest(uint64_t cookie = 0);\n \tint queueRequest(Request *request);\n \n-\tint start();\n+\tint start(ControlList *controls = nullptr);\n \tint stop();\n \n private:\ndiff --git a/include/libcamera/internal/pipeline_handler.h b/include/libcamera/internal/pipeline_handler.h\nindex c12c8904..bd3c4a81 100644\n--- a/include/libcamera/internal/pipeline_handler.h\n+++ b/include/libcamera/internal/pipeline_handler.h\n@@ -78,7 +78,7 @@ public:\n \tvirtual int exportFrameBuffers(Camera *camera, Stream *stream,\n \t\t\t\t       std::vector<std::unique_ptr<FrameBuffer>> *buffers) = 0;\n \n-\tvirtual int start(Camera *camera) = 0;\n+\tvirtual int start(Camera *camera, ControlList *controls) = 0;\n \tvirtual void stop(Camera *camera) = 0;\n \n \tint queueRequest(Camera *camera, Request *request);\ndiff --git a/src/libcamera/camera.cpp b/src/libcamera/camera.cpp\nindex bcb7b046..ffb63fb2 100644\n--- a/src/libcamera/camera.cpp\n+++ b/src/libcamera/camera.cpp\n@@ -1003,9 +1003,10 @@ int Camera::queueRequest(Request *request)\n /**\n  * \\brief Start capture from camera\n  *\n- * Start the camera capture session. Once the camera is started the application\n- * can queue requests to the camera to process and return to the application\n- * until the capture session is terminated with \\a stop().\n+ * Start the camera capture session, optionally providing a list of controls to\n+ * action before starting. Once the camera is started the application can queue\n+ * requests to the camera to process and return to the application until the\n+ * capture session is terminated with \\a stop().\n  *\n  * \\context This function may only be called when the camera is in the\n  * Configured state as defined in \\ref camera_operation, and shall be\n@@ -1016,7 +1017,7 @@ int Camera::queueRequest(Request *request)\n  * \\retval -ENODEV The camera has been disconnected from the system\n  * \\retval -EACCES The camera is not in a state where it can be started\n  */\n-int Camera::start()\n+int Camera::start(ControlList *controls)\n {\n \tPrivate *const d = LIBCAMERA_D_PTR();\n \n@@ -1027,7 +1028,7 @@ int Camera::start()\n \tLOG(Camera, Debug) << \"Starting capture\";\n \n \tret = d->pipe_->invokeMethod(&PipelineHandler::start,\n-\t\t\t\t     ConnectionTypeBlocking, this);\n+\t\t\t\t     ConnectionTypeBlocking, this, controls);\n \tif (ret)\n \t\treturn ret;\n \ndiff --git a/src/libcamera/pipeline/ipu3/ipu3.cpp b/src/libcamera/pipeline/ipu3/ipu3.cpp\nindex 4cedb32b..8a1918d5 100644\n--- a/src/libcamera/pipeline/ipu3/ipu3.cpp\n+++ b/src/libcamera/pipeline/ipu3/ipu3.cpp\n@@ -105,7 +105,7 @@ public:\n \tint exportFrameBuffers(Camera *camera, Stream *stream,\n \t\t\t       std::vector<std::unique_ptr<FrameBuffer>> *buffers) override;\n \n-\tint start(Camera *camera) override;\n+\tint start(Camera *camera, ControlList *controls) override;\n \tvoid stop(Camera *camera) override;\n \n \tint queueRequestDevice(Camera *camera, Request *request) override;\n@@ -596,7 +596,7 @@ int PipelineHandlerIPU3::freeBuffers(Camera *camera)\n \treturn 0;\n }\n \n-int PipelineHandlerIPU3::start(Camera *camera)\n+int PipelineHandlerIPU3::start(Camera *camera, [[maybe_unused]] ControlList *controls)\n {\n \tIPU3CameraData *data = cameraData(camera);\n \tCIO2Device *cio2 = &data->cio2_;\ndiff --git a/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp b/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp\nindex 6fcdf557..9937db73 100644\n--- a/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp\n+++ b/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp\n@@ -242,7 +242,7 @@ public:\n \tint exportFrameBuffers(Camera *camera, Stream *stream,\n \t\t\t       std::vector<std::unique_ptr<FrameBuffer>> *buffers) override;\n \n-\tint start(Camera *camera) override;\n+\tint start(Camera *camera, ControlList *controls) override;\n \tvoid stop(Camera *camera) override;\n \n \tint queueRequestDevice(Camera *camera, Request *request) override;\n@@ -731,7 +731,7 @@ int PipelineHandlerRPi::exportFrameBuffers([[maybe_unused]] Camera *camera, Stre\n \treturn ret;\n }\n \n-int PipelineHandlerRPi::start(Camera *camera)\n+int PipelineHandlerRPi::start(Camera *camera, [[maybe_unused]] ControlList *controls)\n {\n \tRPiCameraData *data = cameraData(camera);\n \tint ret;\ndiff --git a/src/libcamera/pipeline/rkisp1/rkisp1.cpp b/src/libcamera/pipeline/rkisp1/rkisp1.cpp\nindex 6e74a49a..4e959fde 100644\n--- a/src/libcamera/pipeline/rkisp1/rkisp1.cpp\n+++ b/src/libcamera/pipeline/rkisp1/rkisp1.cpp\n@@ -187,7 +187,7 @@ public:\n \tint exportFrameBuffers(Camera *camera, Stream *stream,\n \t\t\t       std::vector<std::unique_ptr<FrameBuffer>> *buffers) override;\n \n-\tint start(Camera *camera) override;\n+\tint start(Camera *camera, ControlList *controls) override;\n \tvoid stop(Camera *camera) override;\n \n \tint queueRequestDevice(Camera *camera, Request *request) override;\n@@ -832,7 +832,7 @@ int PipelineHandlerRkISP1::freeBuffers(Camera *camera)\n \treturn 0;\n }\n \n-int PipelineHandlerRkISP1::start(Camera *camera)\n+int PipelineHandlerRkISP1::start(Camera *camera, [[maybe_unused]] ControlList *controls)\n {\n \tRkISP1CameraData *data = cameraData(camera);\n \tint ret;\ndiff --git a/src/libcamera/pipeline/simple/simple.cpp b/src/libcamera/pipeline/simple/simple.cpp\nindex 0d3078f7..b047aeb9 100644\n--- a/src/libcamera/pipeline/simple/simple.cpp\n+++ b/src/libcamera/pipeline/simple/simple.cpp\n@@ -126,7 +126,7 @@ public:\n \tint exportFrameBuffers(Camera *camera, Stream *stream,\n \t\t\t       std::vector<std::unique_ptr<FrameBuffer>> *buffers) override;\n \n-\tint start(Camera *camera) override;\n+\tint start(Camera *camera, ControlList *controls) override;\n \tvoid stop(Camera *camera) override;\n \n \tbool match(DeviceEnumerator *enumerator) override;\n@@ -646,7 +646,7 @@ int SimplePipelineHandler::exportFrameBuffers(Camera *camera, Stream *stream,\n \t\treturn data->video_->exportBuffers(count, buffers);\n }\n \n-int SimplePipelineHandler::start(Camera *camera)\n+int SimplePipelineHandler::start(Camera *camera, [[maybe_unused]] ControlList *controls)\n {\n \tSimpleCameraData *data = cameraData(camera);\n \tV4L2VideoDevice *video = data->video_;\ndiff --git a/src/libcamera/pipeline/uvcvideo/uvcvideo.cpp b/src/libcamera/pipeline/uvcvideo/uvcvideo.cpp\nindex 0f3241cc..87b0f03d 100644\n--- a/src/libcamera/pipeline/uvcvideo/uvcvideo.cpp\n+++ b/src/libcamera/pipeline/uvcvideo/uvcvideo.cpp\n@@ -76,7 +76,7 @@ public:\n \tint exportFrameBuffers(Camera *camera, Stream *stream,\n \t\t\t       std::vector<std::unique_ptr<FrameBuffer>> *buffers) override;\n \n-\tint start(Camera *camera) override;\n+\tint start(Camera *camera, ControlList *controls) override;\n \tvoid stop(Camera *camera) override;\n \n \tint queueRequestDevice(Camera *camera, Request *request) override;\n@@ -236,7 +236,7 @@ int PipelineHandlerUVC::exportFrameBuffers(Camera *camera, Stream *stream,\n \treturn data->video_->exportBuffers(count, buffers);\n }\n \n-int PipelineHandlerUVC::start(Camera *camera)\n+int PipelineHandlerUVC::start(Camera *camera, [[maybe_unused]] ControlList *controls)\n {\n \tUVCCameraData *data = cameraData(camera);\n \tunsigned int count = data->stream_.configuration().bufferCount;\ndiff --git a/src/libcamera/pipeline/vimc/vimc.cpp b/src/libcamera/pipeline/vimc/vimc.cpp\nindex 914b6b54..d81b8598 100644\n--- a/src/libcamera/pipeline/vimc/vimc.cpp\n+++ b/src/libcamera/pipeline/vimc/vimc.cpp\n@@ -92,7 +92,7 @@ public:\n \tint exportFrameBuffers(Camera *camera, Stream *stream,\n \t\t\t       std::vector<std::unique_ptr<FrameBuffer>> *buffers) override;\n \n-\tint start(Camera *camera) override;\n+\tint start(Camera *camera, ControlList *controls) override;\n \tvoid stop(Camera *camera) override;\n \n \tint queueRequestDevice(Camera *camera, Request *request) override;\n@@ -313,7 +313,7 @@ int PipelineHandlerVimc::exportFrameBuffers(Camera *camera, Stream *stream,\n \treturn data->video_->exportBuffers(count, buffers);\n }\n \n-int PipelineHandlerVimc::start(Camera *camera)\n+int PipelineHandlerVimc::start(Camera *camera, [[maybe_unused]] ControlList *controls)\n {\n \tVimcCameraData *data = cameraData(camera);\n \tunsigned int count = data->stream_.configuration().bufferCount;\ndiff --git a/src/libcamera/pipeline_handler.cpp b/src/libcamera/pipeline_handler.cpp\nindex 894200ee..c75ebbd5 100644\n--- a/src/libcamera/pipeline_handler.cpp\n+++ b/src/libcamera/pipeline_handler.cpp\n@@ -351,6 +351,7 @@ const ControlList &PipelineHandler::properties(const Camera *camera) const\n  * \\fn PipelineHandler::start()\n  * \\brief Start capturing from a group of streams\n  * \\param[in] camera The camera to start\n+ * \\param[in] controls Controls to be applied before starting the Camera\n  *\n  * Start the group of streams that have been configured for capture by\n  * \\a configure(). The intended caller of this method is the Camera class which\n",
    "prefixes": [
        "libcamera-devel",
        "v3",
        "1/3"
    ]
}