Show a patch.

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

{
    "id": 16225,
    "url": "https://patchwork.libcamera.org/api/1.1/patches/16225/?format=api",
    "web_url": "https://patchwork.libcamera.org/patch/16225/",
    "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": "<20220615162601.48619-4-dse@thaumatec.com>",
    "date": "2022-06-15T16:26:01",
    "name": "[libcamera-devel,3/3] Documentation: Update the \"Start an event loop\" section",
    "commit_ref": null,
    "pull_url": null,
    "state": "accepted",
    "archived": false,
    "hash": "a2293ac9fa9f43bb91907ad1fde6d39b537a3806",
    "submitter": {
        "id": 126,
        "url": "https://patchwork.libcamera.org/api/1.1/people/126/?format=api",
        "name": "Daniel Semkowicz",
        "email": "dse@thaumatec.com"
    },
    "delegate": null,
    "mbox": "https://patchwork.libcamera.org/patch/16225/mbox/",
    "series": [
        {
            "id": 3176,
            "url": "https://patchwork.libcamera.org/api/1.1/series/3176/?format=api",
            "web_url": "https://patchwork.libcamera.org/project/libcamera/list/?series=3176",
            "date": "2022-06-15T16:25:58",
            "name": "Documentation: Update code examples in Application Writer's Guide",
            "version": 1,
            "mbox": "https://patchwork.libcamera.org/series/3176/mbox/"
        }
    ],
    "comments": "https://patchwork.libcamera.org/api/patches/16225/comments/",
    "check": "pending",
    "checks": "https://patchwork.libcamera.org/api/patches/16225/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 50E85BD161\n\tfor <parsemail@patchwork.libcamera.org>;\n\tWed, 15 Jun 2022 16:26:53 +0000 (UTC)",
            "from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 75D036563B;\n\tWed, 15 Jun 2022 18:26:52 +0200 (CEST)",
            "from mail-wr1-x433.google.com (mail-wr1-x433.google.com\n\t[IPv6:2a00:1450:4864:20::433])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 4CD1165631\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tWed, 15 Jun 2022 18:26:51 +0200 (CEST)",
            "by mail-wr1-x433.google.com with SMTP id m24so16055843wrb.10\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tWed, 15 Jun 2022 09:26:51 -0700 (PDT)",
            "from localhost.localdomain (ip092042140082.rev.nessus.at.\n\t[92.42.140.82]) by smtp.gmail.com with ESMTPSA id\n\tr17-20020a05600c35d100b0039c8d181ac6sm3135772wmq.26.2022.06.15.09.26.49\n\t(version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n\tWed, 15 Jun 2022 09:26:50 -0700 (PDT)"
        ],
        "DKIM-Signature": [
            "v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org;\n\ts=mail; t=1655310412;\n\tbh=Zz3mgoEdxlZ0YLtfx20Y4BEyNKgyBga+xVlO69YzjpM=;\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:\n\tFrom;\n\tb=l5oYvxaqKcF0CxmIDXEWpcNj4AAHrUKdUFkjG5AKV3kiOkISGUBZayaUfUOuMbeyL\n\tdcPg/uk6ukdA3DJ3KW/EuDI2fxRvNsYeHE3rIR4Gml/rMd39+pL9dtFtERPn7tFEEf\n\tUlqFe8MFBrVfMwnyjQxRNBnycTunEsFyvxHArDIkBbFg2jTcEyO2Ydi1EGmh+Oa05Q\n\ttxKbbM+u3FNo/HHs8uurgwTcPhmwB9lb6oGn9pxd1PEKi48TN/EX2qQGlhy6E5KYZX\n\tgZIYk2mtASms2io+Ums9OqPjJshLElUdlUoVV7osXSKpuNL4gMwluXGvKXq2nt5TcQ\n\tUkGVkjFmqg1Mw==",
            "v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=thaumatec-com.20210112.gappssmtp.com; s=20210112;\n\th=from:to:cc:subject:date:message-id:in-reply-to:references\n\t:mime-version:content-transfer-encoding;\n\tbh=aqQCb5uzLsNRQWZ/xnGq1V+ALWcNJVzZAg6ePoizt50=;\n\tb=TIWBLOD2bbIEEeSZQ9F4tnZU4rNGs/Pw2E9xFLJZ0qgRQww7wDKcdO4IDc6sx+AXCG\n\tnSfYAnXt2usclCSCKK0FXZkV+Y8Tlg1WG5IQfixnEZqxGEvaoWdu5ciW34n5VQhgu7Xb\n\t17hSS7fkQ9OKSEkDtoX9IlM6RPYB9ckuh7gvAzU6yN7fdW5sopd5ncBZ6kXbmhPK6sR1\n\tsMmzPYd7A8+HkwuzI30TSLp+hTjqpKpso73wThkCL+igYPaizg+97wyOx/O0r1BY4jqy\n\tFx5ie97UkgS2lPFh8HP3jTFXfrxoZH9icpizQgjqtFR9cmIqBfucvHd9ev3LXctJr1tx\n\t375w=="
        ],
        "Authentication-Results": "lancelot.ideasonboard.com; dkim=pass (2048-bit key; \n\tunprotected)\n\theader.d=thaumatec-com.20210112.gappssmtp.com\n\theader.i=@thaumatec-com.20210112.gappssmtp.com header.b=\"TIWBLOD2\"; \n\tdkim-atps=neutral",
        "X-Google-DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20210112;\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=aqQCb5uzLsNRQWZ/xnGq1V+ALWcNJVzZAg6ePoizt50=;\n\tb=K5zzOxIY2SWOG22NOR+Q6MOkwiva0Dy/dwsaupHVlVbgbGH+WCfozBnKcQ86ZbE1FV\n\tiTzEy+wjfCOjuDLCtXHWDZeCD8/VXJhkMB65qvLJudR0htlAL27bmAQxhl2C19p5Gja8\n\tIAWOyvElU8Pfc9UGWeSp51X5BGFMTnw9YwCzbTIT6crGYCLT+COnZpz99et4OQfJUmmp\n\t1THvzOJIZhMy5eIjizTAt5DafVXGWWiFOPxOSVP+zct5+szU6nfEdYDNAvel1t7f8Vd1\n\t6qJEoFhUbEl38uxv3qNstVIx8DEO6cCr9qVbZ9QeBJZLGKiT4U2cu0BWLeH4ovzb6tBZ\n\t49ow==",
        "X-Gm-Message-State": "AJIora/AtrHmuy9B07ewq963hAIGe5jAUxf5zX9Firujef3+QZgZOqEU\n\tqpP8c7Jl1y5iLjH9QI33/gRY189uLRJC+49O",
        "X-Google-Smtp-Source": "AGRyM1uP3yxbZFWBGV9EuwE5/5ownbikkUkzlwVApRepKORA/gd2z/Lv28gU6cIPYSUxJk/8g5fnrg==",
        "X-Received": "by 2002:adf:dc81:0:b0:212:3a72:2f07 with SMTP id\n\tr1-20020adfdc81000000b002123a722f07mr603573wrj.714.1655310410943; \n\tWed, 15 Jun 2022 09:26:50 -0700 (PDT)",
        "To": "libcamera-devel@lists.libcamera.org",
        "Date": "Wed, 15 Jun 2022 18:26:01 +0200",
        "Message-Id": "<20220615162601.48619-4-dse@thaumatec.com>",
        "X-Mailer": "git-send-email 2.34.1",
        "In-Reply-To": "<20220615162601.48619-1-dse@thaumatec.com>",
        "References": "<20220615162601.48619-1-dse@thaumatec.com>",
        "MIME-Version": "1.0",
        "Content-Transfer-Encoding": "8bit",
        "Subject": "[libcamera-devel] [PATCH 3/3] Documentation: Update the \"Start an\n\tevent loop\" section",
        "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": "Daniel Semkowicz via libcamera-devel\n\t<libcamera-devel@lists.libcamera.org>",
        "Reply-To": "Daniel Semkowicz <dse@thaumatec.com>",
        "Errors-To": "libcamera-devel-bounces@lists.libcamera.org",
        "Sender": "\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"
    },
    "content": "Event loop was moved to be a part of CameraManager, so it is no longer\na user responsibility to control the event dispatching.\n---\n .../guides/application-developer.rst          | 20 ++++++++++---------\n 1 file changed, 11 insertions(+), 9 deletions(-)",
    "diff": "diff --git a/Documentation/guides/application-developer.rst b/Documentation/guides/application-developer.rst\nindex 00bafb10..97c032a5 100644\n--- a/Documentation/guides/application-developer.rst\n+++ b/Documentation/guides/application-developer.rst\n@@ -27,10 +27,12 @@ defined names and types without the need of prefixing them.\n    #include <iomanip>\n    #include <iostream>\n    #include <memory>\n+   #include <thread>\n \n    #include <libcamera/libcamera.h>\n \n    using namespace libcamera;\n+   using namespace std::chrono_literals;\n \n    int main()\n    {\n@@ -506,7 +508,7 @@ and queue all the previously created requests.\n    for (std::unique_ptr<Request> &request : requests)\n        camera->queueRequest(request.get());\n \n-Start an event loop\n+Event loop\n ~~~~~~~~~~~~~~~~~~~\n \n The libcamera library needs an event loop to monitor and dispatch events\n@@ -524,17 +526,17 @@ a notifier it is monitoring, it emits the notifier's\n notifiers' signals and emit application visible events, such as the\n ``Camera::bufferReady`` and ``Camera::requestCompleted`` signals.\n \n-The code below retrieves a reference to the system-wide event dispatcher and for\n-the a fixed duration of 3 seconds, processes all the events detected in the\n-system.\n+Event loop is handled internally by ``CameraManager`` instance in a separate\n+thread. ``CameraManager::start()`` creates a new thread and starts the event\n+loop processing.\n+\n+As the ``CameraManager`` was already started in our example, we need to prevent\n+the immediate termination of the application. The code below pauses the main\n+thread for 3 seconds, so that the event loop thread can process the requests.\n \n .. code:: cpp\n \n-   EventDispatcher *dispatcher = cm->eventDispatcher();\n-   Timer timer;\n-   timer.start(3000);\n-   while (timer.isRunning())\n-       dispatcher->processEvents();\n+   std::this_thread::sleep_for(3000ms);\n \n Clean up and stop the application\n ---------------------------------\n",
    "prefixes": [
        "libcamera-devel",
        "3/3"
    ]
}