Patch Detail
Show a patch.
GET /api/patches/18938/?format=api
{ "id": 18938, "url": "https://patchwork.libcamera.org/api/patches/18938/?format=api", "web_url": "https://patchwork.libcamera.org/patch/18938/", "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": "<20230814112849.176943-2-gabbymg94@gmail.com>", "date": "2023-08-14T11:28:45", "name": "[libcamera-devel,RFC,1/5] libcamera: pipeline: uvcvideo: Add UVC metadata node", "commit_ref": null, "pull_url": null, "state": "superseded", "archived": false, "hash": "f58587e9457a2353adecfdda3873c3fe18213774", "submitter": { "id": 160, "url": "https://patchwork.libcamera.org/api/people/160/?format=api", "name": "Gabrielle George", "email": "gabbymg94@gmail.com" }, "delegate": null, "mbox": "https://patchwork.libcamera.org/patch/18938/mbox/", "series": [ { "id": 4003, "url": "https://patchwork.libcamera.org/api/series/4003/?format=api", "web_url": "https://patchwork.libcamera.org/project/libcamera/list/?series=4003", "date": "2023-08-14T11:28:44", "name": "RFC:Add UVC Metadata buffer timestamp support", "version": 1, "mbox": "https://patchwork.libcamera.org/series/4003/mbox/" } ], "comments": "https://patchwork.libcamera.org/api/patches/18938/comments/", "check": "pending", "checks": "https://patchwork.libcamera.org/api/patches/18938/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 C1ADEC3257\n\tfor <parsemail@patchwork.libcamera.org>;\n\tMon, 14 Aug 2023 11:29:00 +0000 (UTC)", "from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 2892D628DF;\n\tMon, 14 Aug 2023 13:28:59 +0200 (CEST)", "from mail-ot1-x32f.google.com (mail-ot1-x32f.google.com\n\t[IPv6:2607:f8b0:4864:20::32f])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 3A82B61E0B\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tMon, 14 Aug 2023 13:28:54 +0200 (CEST)", "by mail-ot1-x32f.google.com with SMTP id\n\t46e09a7af769-6bd045336c6so3840193a34.2\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tMon, 14 Aug 2023 04:28:54 -0700 (PDT)", "from localhost.localdomain (97-115-76-16.ptld.qwest.net.\n\t[97.115.76.16]) by smtp.gmail.com with ESMTPSA id\n\tc3-20020a9d6c83000000b006b92509e76esm4163817otr.32.2023.08.14.04.28.51\n\t(version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n\tMon, 14 Aug 2023 04:28:52 -0700 (PDT)" ], "DKIM-Signature": [ "v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org;\n\ts=mail; t=1692012539;\n\tbh=tITfKvnBlkEJdz07jEYOKbwfWNQmea4GTx911uz2yNk=;\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=MH8i+rlnnFvRzS6N0+nVKdM0bQNNVuhbnPIo6ULGvsayj5currCVaBMRRV6LKSUCL\n\tSgYXs+naI8RbJqQgNftbj7YCrtZzpMu3WZu2DXLg96bNLKT8WHSt8cgifWSqZES+lg\n\tBP0UbTLnuQqYiolPloXh8ypJCbenixpSELH7A50WBqbMSYLgw1NYxY/h6AtZgHzcVi\n\t8c9x+wP70lrT4/hFpq62mZPJ7hGwiQXWse8+XAJSA57Xu5ktF+3VfbcNYLvw7YrDxk\n\tsy+S1ihhTHFFnaX1+j2MoI9BaZBftjDJpaCL2AXyeEE0o92mCb7tLNVaeWUF7x/CXx\n\tZY9ykFYPN2Hyg==", "v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=gmail.com; s=20221208; t=1692012532; x=1692617332;\n\th=content-transfer-encoding:mime-version:references:in-reply-to\n\t:message-id:date:subject:to:from:from:to:cc:subject:date:message-id\n\t:reply-to; bh=qhmizX4FuLCSyb8453O84uUId5fqc6MvHIneCkyAl7Q=;\n\tb=hyfKpH92reKEo+zItwGxcONaR33ya1fu7VheiyzswFIYdsEu3XR7YB3tieIoD6y/mw\n\tnk7qfJvLDjzUbNRGAClGcflIz2oZe/6Olog8gTR7s/rhvLSXz4k72bsWUpE+Gcrc2eQk\n\tySYTH3gbsnfNoo+QLzsfgDPf+stSoBiOoe99txHMip0FmUKfU8rnITViudTg8C+q2SkA\n\t0/ng6x3wxHR1X2SBdAcmtDacuuYDds9uT+BGOvMuWC4qSIdHo78MNXR7U6Z0ynhWvW4N\n\tecN0RvtCLYo+3R1oG08L+hT4dlYZErLGEHbqKnwU79gMJRAkcg+QrTJ/j/BuTfDiqcdX\n\tP8Ww==" ], "Authentication-Results": "lancelot.ideasonboard.com; dkim=pass (2048-bit key; \n\tunprotected) header.d=gmail.com header.i=@gmail.com\n\theader.b=\"hyfKpH92\"; dkim-atps=neutral", "X-Google-DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20221208; t=1692012532; x=1692617332;\n\th=content-transfer-encoding:mime-version:references:in-reply-to\n\t:message-id:date:subject:to:from:x-gm-message-state:from:to:cc\n\t:subject:date:message-id:reply-to;\n\tbh=qhmizX4FuLCSyb8453O84uUId5fqc6MvHIneCkyAl7Q=;\n\tb=g5zOofQRKcFBaYdgZj54soktxBizvnEeSFcSEMu3upX3PBgDHDxnu4YTD8/jOd3M9j\n\tjx5On6ifkSnPLlwkKmsZ9Z4g2+cFj3M2KD++UUE0ET9kcenCo9k5qEKombv+WhXC+9KU\n\tVyslsivzkPjWH4qTBw1Hwdm7m2LyiqE+EFB/ZsloxBPDwzEf9eDPrC84xBLQWeP0mHTz\n\ts4jAR1B65E40nvYMUmmH1BSML6cLwJRUtrXhzqjYgA3Pbz4z13kRUMm+nj4CtmijNjve\n\thOKkHi/ugpLUiJkvuqTGTfgUUbnLRIHJUYi7shtAwtoV1RwxEjk8ksEmt4S/EMJVnuGD\n\tkTLg==", "X-Gm-Message-State": "AOJu0YwsqpRL/IckF+rgJv0jG2AfHW7WpTGcnEj9ohH3ybxqYn57mj4j\n\tBxl9M4qq3f/dk+O/CNuQW9len2mrNZ0ynA==", "X-Google-Smtp-Source": "AGHT+IGpqZZfiso8ESWgGoUb+YfXoZXAqy9f6NhCjcaWCrMxwMWO2/dxriTaJ4Eb7tIHfhMU6YnLmQ==", "X-Received": "by 2002:a9d:7dd6:0:b0:6b9:9288:613c with SMTP id\n\tk22-20020a9d7dd6000000b006b99288613cmr8539153otn.13.1692012532772; \n\tMon, 14 Aug 2023 04:28:52 -0700 (PDT)", "To": "libcamera-devel@lists.libcamera.org, kieran.bingham@ideasonboard.com,\n\tvedantparanjape160201@gmail.com, gabbymg94@gmail.com", "Date": "Mon, 14 Aug 2023 04:28:45 -0700", "Message-Id": "<20230814112849.176943-2-gabbymg94@gmail.com>", "X-Mailer": "git-send-email 2.34.1", "In-Reply-To": "<20230814112849.176943-1-gabbymg94@gmail.com>", "References": "<20230814112849.176943-1-gabbymg94@gmail.com>", "MIME-Version": "1.0", "Content-Transfer-Encoding": "8bit", "Subject": "[libcamera-devel] [RFC PATCH 1/5] libcamera: pipeline: uvcvideo:\n\tAdd UVC metadata node", "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": "Gabby George via libcamera-devel <libcamera-devel@lists.libcamera.org>", "Reply-To": "Gabby George <gabbymg94@gmail.com>", "Errors-To": "libcamera-devel-bounces@lists.libcamera.org", "Sender": "\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>" }, "content": "Identify and open the UVC metadata's video node. This will give us\naccess to metadata associated with the video stream of the uvc camera.\nThe user will not have access to this video node and will not need to\nmanage its data in any way.\n\nSigned-off-by: Gabby George <gabbymg94@gmail.com>\n---\n src/libcamera/pipeline/uvcvideo/uvcvideo.cpp | 36 +++++++++++++++++++-\n 1 file changed, 35 insertions(+), 1 deletion(-)", "diff": "diff --git a/src/libcamera/pipeline/uvcvideo/uvcvideo.cpp b/src/libcamera/pipeline/uvcvideo/uvcvideo.cpp\nindex 38f48a5d..4470d8a2 100644\n--- a/src/libcamera/pipeline/uvcvideo/uvcvideo.cpp\n+++ b/src/libcamera/pipeline/uvcvideo/uvcvideo.cpp\n@@ -49,10 +49,13 @@ public:\n \tconst std::string &id() const { return id_; }\n \n \tstd::unique_ptr<V4L2VideoDevice> video_;\n+\tstd::unique_ptr<V4L2VideoDevice> metadata_;\n \tStream stream_;\n \tstd::map<PixelFormat, std::vector<SizeRange>> formats_;\n \n private:\n+\tint initMetadata(MediaDevice *media);\n+\n \tbool generateId();\n \n \tstd::string id_;\n@@ -411,6 +414,37 @@ bool PipelineHandlerUVC::match(DeviceEnumerator *enumerator)\n \treturn true;\n }\n \n+int UVCCameraData::initMetadata(MediaDevice *media)\n+{\n+\tint ret;\n+\n+\tconst std::vector<MediaEntity *> &entities = media->entities();\n+\tstd::string dev_node_name = video_->deviceNode();\n+\tauto metadata = std::find_if(entities.begin(), entities.end(),\n+\t\t\t\t [&dev_node_name](MediaEntity *e) {\n+\t\t\t\t\t return e->type() == MediaEntity::Type::V4L2VideoDevice && !(e->flags() & MEDIA_ENT_FL_DEFAULT);\n+\t\t\t\t });\n+\n+\tif (metadata == entities.end()) {\n+\t\tLOG(UVC, Error) << \"Could not find a metadata video device.\";\n+\t\treturn -ENODEV;\n+\t}\n+\n+\t/* configure the metadata node */\n+\tmetadata_ = std::make_unique<V4L2VideoDevice>(*metadata);\n+\tret = metadata_->open();\n+\tif (ret)\n+\t\treturn ret;\n+\n+\tif (!(metadata_->caps().isMeta())) {\n+\t\t/* if the caps do not have the metadata attribute\n+\t\t * (shouldn't happen) */\n+\t\tmetadata_ = NULL;\n+\t\treturn -EINVAL;\n+\t}\n+\treturn 0;\n+}\n+\n int UVCCameraData::init(MediaDevice *media)\n {\n \tint ret;\n@@ -512,7 +546,7 @@ int UVCCameraData::init(MediaDevice *media)\n \n \tcontrolInfo_ = ControlInfoMap(std::move(ctrls), controls::controls);\n \n-\treturn 0;\n+\treturn initMetadata(media);\n }\n \n bool UVCCameraData::generateId()\n", "prefixes": [ "libcamera-devel", "RFC", "1/5" ] }