Patch Detail
Show a patch.
GET /api/patches/18944/?format=api
{ "id": 18944, "url": "https://patchwork.libcamera.org/api/patches/18944/?format=api", "web_url": "https://patchwork.libcamera.org/patch/18944/", "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": "<20230821131039.127370-2-gabbymg94@gmail.com>", "date": "2023-08-21T13:10:35", "name": "[libcamera-devel,RFC,v2,1/5] libcamera: pipeline: uvcvideo: Add UVC metadata node", "commit_ref": null, "pull_url": null, "state": "new", "archived": false, "hash": "28924b47e2d09778525767347a609728bdc2735d", "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/18944/mbox/", "series": [ { "id": 4004, "url": "https://patchwork.libcamera.org/api/series/4004/?format=api", "web_url": "https://patchwork.libcamera.org/project/libcamera/list/?series=4004", "date": "2023-08-21T13:10:34", "name": "Add UVC Metadata buffer timestamp support", "version": 2, "mbox": "https://patchwork.libcamera.org/series/4004/mbox/" } ], "comments": "https://patchwork.libcamera.org/api/patches/18944/comments/", "check": "pending", "checks": "https://patchwork.libcamera.org/api/patches/18944/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 1ADC4C3261\n\tfor <parsemail@patchwork.libcamera.org>;\n\tMon, 21 Aug 2023 13:10:47 +0000 (UTC)", "from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 9E228627E4;\n\tMon, 21 Aug 2023 15:10:45 +0200 (CEST)", "from mail-oa1-x36.google.com (mail-oa1-x36.google.com\n\t[IPv6:2001:4860:4864:20::36])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id E360661E09\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tMon, 21 Aug 2023 15:10:43 +0200 (CEST)", "by mail-oa1-x36.google.com with SMTP id\n\t586e51a60fabf-1c0fff40ec6so2037825fac.2\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tMon, 21 Aug 2023 06:10:43 -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\tci1-20020a056871c48100b001bb51450d85sm4160283oac.4.2023.08.21.06.10.41\n\t(version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n\tMon, 21 Aug 2023 06:10:42 -0700 (PDT)" ], "DKIM-Signature": [ "v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org;\n\ts=mail; t=1692623445;\n\tbh=V7dvhyL1dJls6TnTqwFfnwsQqRVVoRsc/vzZXaJCdJk=;\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=ykCMcihxYJkslOM4Bwsvt149Ik/+u9iwoGliAhsyMf9MebE85LkdyT4VsIC5vPIGs\n\tQFAjyrXddSUaZ5KtSMZZNRflIgtpFeGlO8SPIaIxyCxWyKN9eTM1x2WtN+DeEsnqW+\n\tLc9lUF1rcxX6Z6kUrm7wQQCPehhXkwtBxOJiW+eMap9zI2UcBz72MsGXjmArc1xtgo\n\tQjoNaIydUwozyfwcd24kAAJdU3tQkRrgxU97b/qIZ7131WUD2LYq6X9KS0k2d7KEOU\n\tS+ji3iyN3/EDefCJ3ucdY+UIsadexAykFY/yDEn///9hOWssX2c/As6+Wx3S/FQAt+\n\t54b9EuFP+RjrA==", "v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=gmail.com; s=20221208; t=1692623442; x=1693228242;\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=OmfY6WyS9NxuJh3gBonJnWAumuZMXL/N1xt6mkK1am8=;\n\tb=pp6zpTOFzscdasJLhGkGfBjKxZ5OdtUbhlrc3fCv0gBfRvUzLwB/yiHvR/UHxNBP8O\n\tmMYR1KiD5T+Y1N0reKNO1YTCvw6Mwaz/Tln/GD95yz0X3Ju+LW2iU8BLPmpJxb4BFhuH\n\tRFx/9hks5hKqOugt/oW+Lv7g4Ce+kzbmfis+R0gG69VUpGLAeImA22xnAakbzVQ+Xm6k\n\t43PnqJHGJriPsA+U547KgmMeW9ZYuPTZsNtWsOchPJ4KIUJVGgc6eIMfcn7VTvDzJm1b\n\tAnB3KzMN+Pke+w1P2Tq13A1GK05/qxVcd+SSQDskopBzT+CGDWFAUXFOXSx3TTGV3x2X\n\trx+Q==" ], "Authentication-Results": "lancelot.ideasonboard.com; dkim=pass (2048-bit key; \n\tunprotected) header.d=gmail.com header.i=@gmail.com\n\theader.b=\"pp6zpTOF\"; dkim-atps=neutral", "X-Google-DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20221208; t=1692623442; x=1693228242;\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=OmfY6WyS9NxuJh3gBonJnWAumuZMXL/N1xt6mkK1am8=;\n\tb=k1UxmMFJVbCXj6DpmHG7ZWwmws1PzZvP0yJdvr/9gbVy0kHbWSDlfzo/9It78abQm+\n\t13qUkJt/tyV/K8hAa/UjUW6WdN9f2yfwHHE5w9LHNEhX20eVWdxXRSCu+eTZ7sZkLV2l\n\t5LYCaGA+auWCp1D2QB/uFUFWmVDAmG2emfsQ0oAM0CJI3arjrHw80uTToRmdNsO6a2Ku\n\tta4/At0YuhWSVgXjsb4oJpWSjuZx9smdACBZ7HdZdoP0wAswVFdNJwQsORmrGOkbQdr/\n\t85H4YtqBsBrzrYe9F/TRn3isKW1ugaezUHc5NY0JHZ1OiBFUzXqdQqNRivMFjKKiAcvO\n\tsB0g==", "X-Gm-Message-State": "AOJu0YwWXhssVM5xAf4Wt0y8B456pa/RyC0aSAJlTCPa4HOlKnw480is\n\tpMZkClbsEuYs7vQsyyG8DSoYDSw8zDY=", "X-Google-Smtp-Source": "AGHT+IGc8asc16gReMOCbrjMICJSWpupZ7LniilQ52PK0Y6byGaNy7xPTfdjoZgB9YNZPaZ/yGvobQ==", "X-Received": "by 2002:a05:6870:e313:b0:1b0:222f:9cda with SMTP id\n\tz19-20020a056870e31300b001b0222f9cdamr8864169oad.0.1692623442403; \n\tMon, 21 Aug 2023 06:10:42 -0700 (PDT)", "To": "libcamera-devel@lists.libcamera.org, kieran.bingham@ideasonboard.com,\n\tvedantparanjape160201@gmail.com, gabbymg94@gmail.com", "Date": "Mon, 21 Aug 2023 06:10:35 -0700", "Message-Id": "<20230821131039.127370-2-gabbymg94@gmail.com>", "X-Mailer": "git-send-email 2.34.1", "In-Reply-To": "<20230821131039.127370-1-gabbymg94@gmail.com>", "References": "<20230821131039.127370-1-gabbymg94@gmail.com>", "MIME-Version": "1.0", "Content-Transfer-Encoding": "8bit", "Subject": "[libcamera-devel] [RFC PATCH v2 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 | 42 ++++++++++++++++++++\n 1 file changed, 42 insertions(+)", "diff": "diff --git a/src/libcamera/pipeline/uvcvideo/uvcvideo.cpp b/src/libcamera/pipeline/uvcvideo/uvcvideo.cpp\nindex 38f48a5d..dbe0cc8c 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,39 @@ 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\n+\t\t\t\t\t\t\t&& !(e->flags() & MEDIA_ENT_FL_DEFAULT);\n+\t\t\t\t });\n+\n+\tif (metadata == entities.end()) {\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/*\n+\t\t * UVC Devices are usually only anticipated to expose two\n+ * devices, so we assume the non-default device is the metadata\n+ * device node\n+\t\t */\n+\t\treturn -EINVAL;\n+\t}\n+\treturn 0;\n+}\n+\n int UVCCameraData::init(MediaDevice *media)\n {\n \tint ret;\n@@ -512,6 +548,12 @@ int UVCCameraData::init(MediaDevice *media)\n \n \tcontrolInfo_ = ControlInfoMap(std::move(ctrls), controls::controls);\n \n+\tret = initMetadata(media);\n+\tif (ret) {\n+\t\tmetadata_ = nullptr;\n+\t\tLOG(UVC, Error) << \"Could not find a metadata video device.\";\n+\t}\n+\n \treturn 0;\n }\n \n", "prefixes": [ "libcamera-devel", "RFC", "v2", "1/5" ] }