From patchwork Mon Aug 21 13:10:34 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gabrielle George X-Patchwork-Id: 18943 Return-Path: X-Original-To: parsemail@patchwork.libcamera.org Delivered-To: parsemail@patchwork.libcamera.org Received: from lancelot.ideasonboard.com (lancelot.ideasonboard.com [92.243.16.209]) by patchwork.libcamera.org (Postfix) with ESMTPS id E1894BF415 for ; Mon, 21 Aug 2023 13:10:45 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id D1736627E2; Mon, 21 Aug 2023 15:10:44 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org; s=mail; t=1692623444; bh=Hxg9vNrz7FnkE+PIMFf/LThlDFqqOKjbJ3khg0iJJt0=; h=To:Date:Subject:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:From; b=HvE6mLsfhQsV8Bwdq+Gfj66wue8n4xnGWU+9PYvmZ7a5+30ywp5yMIn0VysqOA6sB No0yzj/GusgCuU+KQ7j+hIVaL9pKZMLfEV0sBLf7m+lmRgHR9QoGodSCFzR3SGCW75 6MZyKJHiEuWfjmBmjE8nkZrhFEijluNmuX2B8pc/1ZS2lt8IgJ1N6B9X5Ti17zee44 s7lDsAWdBDgCkBhWnng/hDHlYeGPOYtmgQdi4+bqZqumUloKlWy+yv2g/3k6vQg/G3 PqIJ1QRajdgvx8a2BjQGQiVmQbRUEh/vQoV3qECE7KbaBQsRFyTG21vl72Ub9MXdvN 0UAWap+ZhKTsw== Received: from mail-oa1-x30.google.com (mail-oa1-x30.google.com [IPv6:2001:4860:4864:20::30]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 2236261E09 for ; Mon, 21 Aug 2023 15:10:43 +0200 (CEST) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="JRzekBBe"; dkim-atps=neutral Received: by mail-oa1-x30.google.com with SMTP id 586e51a60fabf-1c4d8eaa8ebso2197383fac.0 for ; Mon, 21 Aug 2023 06:10:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1692623441; x=1693228241; h=content-transfer-encoding:mime-version:message-id:date:subject:to :from:from:to:cc:subject:date:message-id:reply-to; bh=sS0yRUoSu9PYQHyz1Z04JaGwvJXt3FKdaeZ8a+Opu2w=; b=JRzekBBeFhWvzoECYpzTCkO7oO+wuMkztl0ZYTInetC6raRZqcWkUYsJBMS4pC1Ujc wnLiQfCdWUhbceFAKBYCmteYnFNLEGHi6Me2qamYgJaDIgjhRnrqnO//zpSGo4YteAmI ATXbQ2oBTjTGN9eyAZdPw0ymRJc6pw43wiuum3jZGw8SH0QN45zQdcCwz4OfoX83oTlQ 4liJLxkt49pd5D+Jc6nnMpY/zD6uI81o0ze27MuKB+mQyUGWv52h6+zt0ClE357LcGed NNnop1l3ieeIo6oruFcX8nAr5FC7cEX79KPCIRGogrhvsLO2L0tD//0EvGZFhO9wyPdP oeBw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1692623441; x=1693228241; h=content-transfer-encoding:mime-version:message-id:date:subject:to :from:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=sS0yRUoSu9PYQHyz1Z04JaGwvJXt3FKdaeZ8a+Opu2w=; b=O86IeX3edWnrR7CoUbvNzDa5tdM0KW4YMisoX3Plas6qHg9QI8sqT7hTNhUA7j6dJB 9gjAgXRriQ1Xh3V4rco5UmUfmPb9tRWRXSz/5cIG6xU8UuBFsEGaCPYss/DWeRo0Y7HU u7mXJyH6plofMe8MF0pG9uyhtUp7PRqY3+Gxu5PzprlYAAb5a6pEMDwQwReMar4UVQCt 6m+SUtB09ZMCSa+768A6MddWDvGXigShR4QX5AUn+eIaadwIrSVcrj7ObHpNa7Zch+Do tsj5r0hk6K5a4p6YYLh5WLqyXCgDtZRwtGrnhztj2t9YL3T+yDgmb/Qd10OlWckuLQmr BLPQ== X-Gm-Message-State: AOJu0YyR2yr91GF7ofj+8HC2GVICJ2+X98+kbCTtHNHUBN91KaktUEdP C+evBbypW6Pfp5RskijhwUx9azRmgPQ= X-Google-Smtp-Source: AGHT+IGK2prxrieq0cAGWqkSESs0ua5wdKvtyNuPi2fbpYtMP80L8T1EBQPFR4hwptlIEPFJhYLJRw== X-Received: by 2002:a05:6870:830e:b0:1bf:43d2:526c with SMTP id p14-20020a056870830e00b001bf43d2526cmr9195287oae.15.1692623441314; Mon, 21 Aug 2023 06:10:41 -0700 (PDT) Received: from localhost.localdomain (97-115-76-16.ptld.qwest.net. [97.115.76.16]) by smtp.gmail.com with ESMTPSA id ci1-20020a056871c48100b001bb51450d85sm4160283oac.4.2023.08.21.06.10.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 21 Aug 2023 06:10:40 -0700 (PDT) To: libcamera-devel@lists.libcamera.org, kieran.bingham@ideasonboard.com, vedantparanjape160201@gmail.com, gabbymg94@gmail.com Date: Mon, 21 Aug 2023 06:10:34 -0700 Message-Id: <20230821131039.127370-1-gabbymg94@gmail.com> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 Subject: [libcamera-devel] [RFC PATCH v2 0/5] Add UVC Metadata buffer timestamp support X-BeenThere: libcamera-devel@lists.libcamera.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Patchwork-Original-From: Gabby George via libcamera-devel From: Gabrielle George Reply-To: Gabby George Errors-To: libcamera-devel-bounces@lists.libcamera.org Sender: "libcamera-devel" This series proposes to increase the accuracy of reported uvc timestamps by using timestamps recorded in UVC's header data, rather than the default timestamps libcamera samples from the kernel. When metadata device nodes are not available, the default timestamp is used. Metadata headers are exposed through a v4l2 device node. This device node can largely be handled the same way as for video streaming nodes. The uvcvideo pipeline handler manages this metadata node alongside the video stream's V4L2VideoDevice. The metadata stream's initialization, buffer allocation, conversion of the device's timestamp into kernel clock time, and cleanup are all done within the uvcvideo pipeline handler and not exposed to the user. Known issues: When device framerate drops, the metadata stream will cease and the pipeline will not finish correctly. There will be another patch for calculating accurate timestamp based on the metadata contents. Gabby George (5): libcamera: pipeline: uvcvideo: Add UVC metadata node libcamera: MappedFrameBuffer: Use stored plane offset libcamera: v4l2 device: Store buffer info in planes libcamera: pipeline: uvcvideo: Allocate metadata buffers libcamera: pipeline: uvcvideo: Handle metadata stream .../libcamera/internal/mapped_framebuffer.h | 3 +- src/libcamera/mapped_framebuffer.cpp | 20 +- src/libcamera/pipeline/uvcvideo/uvcvideo.cpp | 306 +++++++++++++++++- src/libcamera/v4l2_videodevice.cpp | 31 +- 4 files changed, 336 insertions(+), 24 deletions(-)