[{"id":16713,"web_url":"https://patchwork.libcamera.org/comment/16713/","msgid":"<YIz2KnhBkmyvS8Kj@oden.dyn.berto.se>","date":"2021-05-01T06:33:14","subject":"Re: [libcamera-devel] [PATCH v4 09/16] libcamera: simple: Report\n\tsensor timestamp","submitter":{"id":5,"url":"https://patchwork.libcamera.org/api/people/5/","name":"Niklas Söderlund","email":"niklas.soderlund@ragnatech.se"},"content":"Hi Jacopo,\n\nThanks for your work.\n\nOn 2021-04-30 18:00:19 +0200, Jacopo Mondi wrote:\n> Report the sensor's timestamp in the Request metadata using the\n> completed buffer timestamp.\n> \n> The buffer's timestamp is recorded at DMA-transfer time, and it does not\n> theoretically matches the 'start of exposure' definition. Record this with\n> a \\todo entry.\n> \n> Reviewed-by: Hirokazu Honda <hiroh@chromium.org>\n> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\n> Signed-off-by: Jacopo Mondi <jacopo@jmondi.org>\n> ---\n>  src/libcamera/pipeline/simple/simple.cpp | 12 +++++++++++-\n>  1 file changed, 11 insertions(+), 1 deletion(-)\n> \n> diff --git a/src/libcamera/pipeline/simple/simple.cpp b/src/libcamera/pipeline/simple/simple.cpp\n> index f6095d38e97a..e1ee640b0a92 100644\n> --- a/src/libcamera/pipeline/simple/simple.cpp\n> +++ b/src/libcamera/pipeline/simple/simple.cpp\n> @@ -22,6 +22,7 @@\n>  #include <linux/media-bus-format.h>\n>  \n>  #include <libcamera/camera.h>\n> +#include <libcamera/control_ids.h>\n>  #include <libcamera/request.h>\n>  #include <libcamera/stream.h>\n>  \n> @@ -1116,6 +1117,16 @@ void SimplePipelineHandler::bufferReady(FrameBuffer *buffer)\n>  \t\treturn;\n>  \t}\n>  \n> +\t/*\n> +\t * Record the sensor's timestamp in the request metadata.\n> +\t *\n> +\t * \\todo The sensor timestamp should be better estimated by connecting\n> +\t * to the V4L2Device::frameStart signal if the platform provides it.\n> +\t */\n\n:-)\n\n> +\tRequest *request = buffer->request();\n> +\trequest->metadata().set(controls::SensorTimestamp,\n> +\t\t\t\tbuffer->metadata().timestamp);\n\nReviewed-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>\n\n> +\n>  \t/*\n>  \t * Queue the captured and the request buffer to the converter if format\n>  \t * conversion is needed. If there's no queued request, just requeue the\n> @@ -1133,7 +1144,6 @@ void SimplePipelineHandler::bufferReady(FrameBuffer *buffer)\n>  \t}\n>  \n>  \t/* Otherwise simply complete the request. */\n> -\tRequest *request = buffer->request();\n>  \tcompleteBuffer(request, buffer);\n>  \tcompleteRequest(request);\n>  }\n> -- \n> 2.31.1\n> \n> _______________________________________________\n> libcamera-devel mailing list\n> libcamera-devel@lists.libcamera.org\n> https://lists.libcamera.org/listinfo/libcamera-devel","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 9C430BDE6B\n\tfor <parsemail@patchwork.libcamera.org>;\n\tSat,  1 May 2021 06:33:17 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 59A1C60511;\n\tSat,  1 May 2021 08:33:17 +0200 (CEST)","from mail-lj1-x22e.google.com (mail-lj1-x22e.google.com\n\t[IPv6:2a00:1450:4864:20::22e])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 3351E602BF\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tSat,  1 May 2021 08:33:16 +0200 (CEST)","by mail-lj1-x22e.google.com with SMTP id b21so734254ljf.11\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tFri, 30 Apr 2021 23:33:16 -0700 (PDT)","from localhost (h-209-203.A463.priv.bahnhof.se. [155.4.209.203])\n\tby smtp.gmail.com with ESMTPSA id\n\tb28sm418655lfo.213.2021.04.30.23.33.15\n\t(version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n\tFri, 30 Apr 2021 23:33:15 -0700 (PDT)"],"Authentication-Results":"lancelot.ideasonboard.com;\n\tdkim=fail reason=\"signature verification failed\" (2048-bit key;\n\tunprotected) header.d=ragnatech-se.20150623.gappssmtp.com\n\theader.i=@ragnatech-se.20150623.gappssmtp.com\n\theader.b=\"f51EQIhp\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=ragnatech-se.20150623.gappssmtp.com; s=20150623;\n\th=date:from:to:cc:subject:message-id:references:mime-version\n\t:content-disposition:content-transfer-encoding:in-reply-to;\n\tbh=Ih3NklxqcQVMDKTewLcK+tR4p3qvjZQmNh9hLQ5vz2s=;\n\tb=f51EQIhp5Rxkio6/2piRt4EHoYjIBH9bEPbvZHVrg+8jqSXjTLYz1cLZwQ6kR5gnHM\n\ts7QPW581oWQT7s2m6/CFeytY/u7/9KxeGWB52UPk/GiAGyLaFwz5Ah4Pgb9PMHwt5PlV\n\tMbuaBZk0MOlu4IkWMCwBxcOCmXdsUnW1DT+TnqanFkjnM5/eWUwUIg0uZ6FOl5Ep13R/\n\tyQZOoTGvD14MS9ZKwuncj7WVzfzxV7uTWHpDMD7DbkvVxfYgQaTVSF6OXPZ33f/Wsrc9\n\tOEujTYdebJkxX3C5Pekj5mwgHQ/8fSV60p4KuvAapvT6J/dSsOEwJ+GBDlSRpRH7sWed\n\twhHA==","X-Google-DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20161025;\n\th=x-gm-message-state:date:from:to:cc:subject:message-id:references\n\t:mime-version:content-disposition:content-transfer-encoding\n\t:in-reply-to;\n\tbh=Ih3NklxqcQVMDKTewLcK+tR4p3qvjZQmNh9hLQ5vz2s=;\n\tb=L5QAM8iizmnXnCQ3amNeVmb9QptEpm91GSXCWRWCzEKSbnwv+CVwZxCwoeITWVid4E\n\tZPOxY619LME8hi0odovMFVNSNJ032xOH2Hqxtiaf8X5xEizv7G9fa7SmFyJiPkAx+JvC\n\tgn8aq5E1LzUbP9lKaG77egVOiaJYfPuM/AQzQEk3cIbx7Seu5J4hDAk7jjykAuL5cVwj\n\tXUTXTz3YhK7D/Ad4Wx4mpOOPgHCutwzbZTx8JW3sejyn9hrr/fMEJRUYUgdNohSK/t/G\n\txKtBlDlTPW9peAMtTqCUYCmU/UE9yiufEbiNnvyMaL8d+Hi8At4NOjWDnpTfI+bQSMYz\n\th1cw==","X-Gm-Message-State":"AOAM533Si2LoY+wVtw6srb9D1haLkycTR2SCGISuvzXu+ugCKlNVf8jp\n\tq/C1/6JVxswONAHKF3SM1G9GohzHBExzPg==","X-Google-Smtp-Source":"ABdhPJx16ICYbjvlx42TkOaB+SG9rIAfV6KhseF3IeMRPtmjojjzXegy7MDRT6YHX2CBW02RTBoa7g==","X-Received":"by 2002:a2e:7f03:: with SMTP id a3mr6097677ljd.406.1619850795717;\n\tFri, 30 Apr 2021 23:33:15 -0700 (PDT)","Date":"Sat, 1 May 2021 08:33:14 +0200","From":"Niklas =?iso-8859-1?q?S=F6derlund?= <niklas.soderlund@ragnatech.se>","To":"Jacopo Mondi <jacopo@jmondi.org>","Message-ID":"<YIz2KnhBkmyvS8Kj@oden.dyn.berto.se>","References":"<20210430160026.190724-1-jacopo@jmondi.org>\n\t<20210430160026.190724-10-jacopo@jmondi.org>","MIME-Version":"1.0","Content-Disposition":"inline","In-Reply-To":"<20210430160026.190724-10-jacopo@jmondi.org>","Subject":"Re: [libcamera-devel] [PATCH v4 09/16] libcamera: simple: Report\n\tsensor timestamp","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>","Cc":"libcamera-devel@lists.libcamera.org","Content-Type":"text/plain; charset=\"iso-8859-1\"","Content-Transfer-Encoding":"quoted-printable","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"}}]