Show a patch.

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

{
    "id": 18762,
    "url": "https://patchwork.libcamera.org/api/1.1/patches/18762/?format=api",
    "web_url": "https://patchwork.libcamera.org/patch/18762/",
    "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": "<20230626211747.101412-1-umang.jain@ideasonboard.com>",
    "date": "2023-06-26T21:17:47",
    "name": "[libcamera-devel,RFC] gstreamer: Drop libcamera_private dependency",
    "commit_ref": null,
    "pull_url": null,
    "state": "accepted",
    "archived": false,
    "hash": "02a507336e3f7729a791d6d4e6c969e0d1821aaf",
    "submitter": {
        "id": 86,
        "url": "https://patchwork.libcamera.org/api/1.1/people/86/?format=api",
        "name": "Umang Jain",
        "email": "umang.jain@ideasonboard.com"
    },
    "delegate": null,
    "mbox": "https://patchwork.libcamera.org/patch/18762/mbox/",
    "series": [
        {
            "id": 3939,
            "url": "https://patchwork.libcamera.org/api/1.1/series/3939/?format=api",
            "web_url": "https://patchwork.libcamera.org/project/libcamera/list/?series=3939",
            "date": "2023-06-26T21:17:47",
            "name": "[libcamera-devel,RFC] gstreamer: Drop libcamera_private dependency",
            "version": 1,
            "mbox": "https://patchwork.libcamera.org/series/3939/mbox/"
        }
    ],
    "comments": "https://patchwork.libcamera.org/api/patches/18762/comments/",
    "check": "pending",
    "checks": "https://patchwork.libcamera.org/api/patches/18762/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 06BC8C3237\n\tfor <parsemail@patchwork.libcamera.org>;\n\tMon, 26 Jun 2023 21:17:55 +0000 (UTC)",
            "from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 754A0628BC;\n\tMon, 26 Jun 2023 23:17:54 +0200 (CEST)",
            "from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[213.167.242.64])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id A9B80628BB\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tMon, 26 Jun 2023 23:17:53 +0200 (CEST)",
            "from umang.jainideasonboard.com (85-160-54-103.reb.o2.cz\n\t[85.160.54.103])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id 5AC584AD;\n\tMon, 26 Jun 2023 23:17:14 +0200 (CEST)"
        ],
        "DKIM-Signature": [
            "v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org;\n\ts=mail; t=1687814274;\n\tbh=hBisCnAt6484XqCTAbBRXAssOiOm/4Zrqm2iT09ki/g=;\n\th=To:Date:Subject:List-Id:List-Unsubscribe:List-Archive:List-Post:\n\tList-Help:List-Subscribe:From:Reply-To:From;\n\tb=Azj93JZIH3408frQtiCAoeW/uE7bxHxkprIT1emL7iyB9Y/OOyPVcTKaYmGSC+In1\n\tot+gKJ3Pclx1MWWAQJ8X8O97ohAyvL/l0POIPKWxehCMtvn/b7QimIILT0TpPWJ2zY\n\tTRCRJ68ma8PO7/PNWxKYSgEpYtKo+Tjg56+yw9L7JRCSLpoHEBfWLwtWOO/ip9lBFH\n\tioSSDqpumAm0vnRfrH4Ygad1BOhodZGlQKvmc0afHsDWPOPcaaVSE+boLencYT6a/L\n\tppl2VP1ka3noNRpKM+EwtMGOZbCBV5DZIn97YmKeOMrAI3HF+qv9/v0yUpw/C/Y5nY\n\t4AeJBrsfIp3rw==",
            "v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1687814234;\n\tbh=hBisCnAt6484XqCTAbBRXAssOiOm/4Zrqm2iT09ki/g=;\n\th=From:To:Cc:Subject:Date:From;\n\tb=nXqeufA9+7F10z0k41enl5sdwOry2AHr6bjDOhEYbj+GRe/fpG4Yl0RiUpi3JS7HS\n\tpcevg++fwFK7cpkhZBGC9xU+greudgE9e/OK7y0fxMXOCA3alQzCWRBdmPfvF1aV5Z\n\tH4R6OKfFIoNbyI33H6PDFj3UdGxv/p7fW0qId+Y8="
        ],
        "Authentication-Results": "lancelot.ideasonboard.com; dkim=pass (1024-bit key; \n\tunprotected) header.d=ideasonboard.com\n\theader.i=@ideasonboard.com\n\theader.b=\"nXqeufA9\"; dkim-atps=neutral",
        "To": "libcamera-devel@lists.libcamera.org",
        "Date": "Mon, 26 Jun 2023 23:17:47 +0200",
        "Message-Id": "<20230626211747.101412-1-umang.jain@ideasonboard.com>",
        "X-Mailer": "git-send-email 2.39.1",
        "MIME-Version": "1.0",
        "Content-Transfer-Encoding": "8bit",
        "Subject": "[libcamera-devel] [RFC PATCH] gstreamer: Drop libcamera_private\n\tdependency",
        "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": "Umang Jain via libcamera-devel <libcamera-devel@lists.libcamera.org>",
        "Reply-To": "Umang Jain <umang.jain@ideasonboard.com>",
        "Errors-To": "libcamera-devel-bounces@lists.libcamera.org",
        "Sender": "\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"
    },
    "content": "Drop libcamera_private dependency entirely as to avoid libcamerasrc\ngetting more dependent on it. In order to achieve that, one of the\nmutex locks in GstLibcameraSrcState needs to be replaced with GMutex.\n\nHowever doing so, this won't let us to use the clang's thread annotation\nmacros in libcamera (which should be fine as libcamerasrc would move\nout of libcamera repo once matured).\n\nSigned-off-by: Umang Jain <umang.jain@ideasonboard.com>\n---\n src/gstreamer/gstlibcamerasrc.cpp | 20 ++++++++------------\n src/gstreamer/meson.build         |  2 +-\n 2 files changed, 9 insertions(+), 13 deletions(-)",
    "diff": "diff --git a/src/gstreamer/gstlibcamerasrc.cpp b/src/gstreamer/gstlibcamerasrc.cpp\nindex 11f15068..fda5610f 100644\n--- a/src/gstreamer/gstlibcamerasrc.cpp\n+++ b/src/gstreamer/gstlibcamerasrc.cpp\n@@ -32,8 +32,6 @@\n #include <queue>\n #include <vector>\n \n-#include <libcamera/base/mutex.h>\n-\n #include <libcamera/camera.h>\n #include <libcamera/camera_manager.h>\n #include <libcamera/control_ids.h>\n@@ -125,11 +123,9 @@ struct GstLibcameraSrcState {\n \t * be held while calling into other graph elements (e.g. when calling\n \t * gst_pad_query()).\n \t */\n-\tMutex lock_;\n-\tstd::queue<std::unique_ptr<RequestWrap>> queuedRequests_\n-\t\tLIBCAMERA_TSA_GUARDED_BY(lock_);\n-\tstd::queue<std::unique_ptr<RequestWrap>> completedRequests_\n-\t\tLIBCAMERA_TSA_GUARDED_BY(lock_);\n+\tGMutex lock_;\n+\tstd::queue<std::unique_ptr<RequestWrap>> queuedRequests_;\n+\tstd::queue<std::unique_ptr<RequestWrap>> completedRequests_;\n \n \tControlList initControls_;\n \tguint group_id_;\n@@ -208,7 +204,7 @@ int GstLibcameraSrcState::queueRequest()\n \tcam_->queueRequest(wrap->request_.get());\n \n \t{\n-\t\tMutexLocker locker(lock_);\n+\t\tGLibLocker locker(&lock_);\n \t\tqueuedRequests_.push(std::move(wrap));\n \t}\n \n@@ -224,7 +220,7 @@ GstLibcameraSrcState::requestCompleted(Request *request)\n \tstd::unique_ptr<RequestWrap> wrap;\n \n \t{\n-\t\tMutexLocker locker(lock_);\n+\t\tGLibLocker locker(&lock_);\n \t\twrap = std::move(queuedRequests_.front());\n \t\tqueuedRequests_.pop();\n \t}\n@@ -251,7 +247,7 @@ GstLibcameraSrcState::requestCompleted(Request *request)\n \t}\n \n \t{\n-\t\tMutexLocker locker(lock_);\n+\t\tGLibLocker locker(&lock_);\n \t\tcompletedRequests_.push(std::move(wrap));\n \t}\n \n@@ -265,7 +261,7 @@ int GstLibcameraSrcState::processRequest()\n \tint err = 0;\n \n \t{\n-\t\tMutexLocker locker(lock_);\n+\t\tGLibLocker locker(&lock_);\n \n \t\tif (!completedRequests_.empty()) {\n \t\t\twrap = std::move(completedRequests_.front());\n@@ -639,7 +635,7 @@ gst_libcamera_src_task_leave([[maybe_unused]] GstTask *task,\n \tstate->cam_->stop();\n \n \t{\n-\t\tMutexLocker locker(state->lock_);\n+\t\tGLibLocker locker(&state->lock_);\n \t\tstate->completedRequests_ = {};\n \t}\n \ndiff --git a/src/gstreamer/meson.build b/src/gstreamer/meson.build\nindex eda246d7..77c79140 100644\n--- a/src/gstreamer/meson.build\n+++ b/src/gstreamer/meson.build\n@@ -42,7 +42,7 @@ endif\n libcamera_gst = shared_library('gstlibcamera',\n     libcamera_gst_sources,\n     cpp_args : libcamera_gst_cpp_args,\n-    dependencies : [libcamera_private, gstvideo_dep, gstallocator_dep],\n+    dependencies : [libcamera_public, gstvideo_dep, gstallocator_dep],\n     install: true,\n     install_dir : '@0@/gstreamer-1.0'.format(get_option('libdir')),\n )\n",
    "prefixes": [
        "libcamera-devel",
        "RFC"
    ]
}