From patchwork Mon Aug 14 11:28:44 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gabrielle George X-Patchwork-Id: 18937 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 8BB18BF415 for ; Mon, 14 Aug 2023 11:28:59 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 7AC33628DE; Mon, 14 Aug 2023 13:28:58 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org; s=mail; t=1692012538; bh=f9z3PAaSQOWxCKXmZ93wUhK6qRhZlKsH2NWp477ODSQ=; h=To:Date:Subject:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:From; b=0O2+FyBTRCZLWBoZBzQzQUVR0NU78IFqmG+eQ1S8oco2UMaZEsqtbz086rJcgCPwZ zeLooeyT8e4Ck0ONFiyNsU9owMZ8CXTooUesgioAHVVeKubtUM2pBfH65HtzKbAm99 ZFPMRGSKKeVuQunTdeo3njZ/hZ5UAwff1IpLkEfTyCuFbpsGjG5V5IbyYwAscj19V6 MxPT+whQNeUclRpTSWMA4lbeJ899oUfjy8CU0+7ANhapIN79mvSVxGqhXVSuEc0ziQ q5LY9li5eh0AYH4cUwbJjuJT+MOKOBwgrhCrjyqkaAo/WrPbc3FQKOs9avE3DKNIC2 b7n3cyoB0lXdg== Received: from mail-ot1-x32c.google.com (mail-ot1-x32c.google.com [IPv6:2607:f8b0:4864:20::32c]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 5CB6661E0B for ; Mon, 14 Aug 2023 13:28:53 +0200 (CEST) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="g/ql8id0"; dkim-atps=neutral Received: by mail-ot1-x32c.google.com with SMTP id 46e09a7af769-6b9a2416b1cso3716803a34.2 for ; Mon, 14 Aug 2023 04:28:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1692012531; x=1692617331; h=content-transfer-encoding:mime-version:message-id:date:subject:to :from:from:to:cc:subject:date:message-id:reply-to; bh=XQVT6k3TbxDjV/R4eudt+WuZOP3vVzF+3yPLx9bUFP8=; b=g/ql8id0c9RrVp3MZpL5+pXHINI8emQk2Gwy4FQ5rA37qwI/UvZdHG0hCawold/2Qb TkS34F4lvVHMDCMaqAMFqh1lNla5gn9V81DBl4YrNSj5r6lI/FbwjQfTlgyVDqYBWfQy h8b+gKwKRfY9kHV69sd8RgSR1uc+VWB8BJLxDQw5BTx+/IDTGUgGCTH61vzZEIuFcwvW uCOI04aphKcT9vzKLSrnM58IpXzRXFA1BaCXaB1Qh9LGDNYnsqSengWd+4gKuwy6UC67 VO2+xa2aSvFvq7r3DoLDjs131PRMICPIv6qoqecAcvlZEvi/HE8hBJNbk6d+g9cMpZxJ OTCQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1692012531; x=1692617331; 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=XQVT6k3TbxDjV/R4eudt+WuZOP3vVzF+3yPLx9bUFP8=; b=YjV8xRWhNMpRUDfLzzSdaaMYo0L0UD/si8Da/iS1yFlHcvLFJzbggtuz+0OYpv8ZOb /zviDJ0XVfOxINldIJ9Grvq5xT1hyHmU1Ooss033GW+k9tXzDsr9fLbKE85PJ0WHgEEX UOvFSoTD37mO/oAe47XdgXty/B/XHu6JkJ2m4fwrMeKUjQE7xKDXaHhyNoONy0YK72Nb Ok8xyQjt4ioaXE6uktvRC2cfXzdrc82BO6SUhPZEFIbuEhCN3BeVX42N/a5cK+OO7E4j UujqrbmmFicsLqM15/tUm5NOnZU/EiqdKLOnvOuHHkigSRrT6XdAb4JBOkvPAejT7N3W hfaQ== X-Gm-Message-State: AOJu0YxBcwxliSHzAIKlZAgnBg4RMPeiLT7AbK209zUqhG6U3j3ITKCP y1i/ti5Cz0LINwciK7g084pV+yD+Aaklcw== X-Google-Smtp-Source: AGHT+IGd9KHhqnkD+mkXtRE5dOMSa9Q4khseZYOgadS1A0Zul0tkjZ+MLcv/VIvhnuj/uAYmMz53SQ== X-Received: by 2002:a9d:68c5:0:b0:6b9:9b3f:d8ad with SMTP id i5-20020a9d68c5000000b006b99b3fd8admr8586749oto.36.1692012531778; Mon, 14 Aug 2023 04:28:51 -0700 (PDT) Received: from localhost.localdomain (97-115-76-16.ptld.qwest.net. [97.115.76.16]) by smtp.gmail.com with ESMTPSA id c3-20020a9d6c83000000b006b92509e76esm4163817otr.32.2023.08.14.04.28.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 14 Aug 2023 04:28:51 -0700 (PDT) To: libcamera-devel@lists.libcamera.org, kieran.bingham@ideasonboard.com, vedantparanjape160201@gmail.com, gabbymg94@gmail.com Date: Mon, 14 Aug 2023 04:28:44 -0700 Message-Id: <20230814112849.176943-1-gabbymg94@gmail.com> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 Subject: [libcamera-devel] [RFC PATCH 0/5] RFC: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 | 2 +- src/libcamera/mapped_framebuffer.cpp | 16 +- src/libcamera/pipeline/uvcvideo/uvcvideo.cpp | 286 +++++++++++++++++- src/libcamera/v4l2_videodevice.cpp | 32 +- 4 files changed, 314 insertions(+), 22 deletions(-)