[{"id":20080,"web_url":"https://patchwork.libcamera.org/comment/20080/","msgid":"<YVz+xQWKGI0IyvVi@pendragon.ideasonboard.com>","date":"2021-10-06T01:41:25","subject":"Re: [libcamera-devel] [PATCH v2 09/17] android: capabilties:\n\tCorrectly populate STALL durations","submitter":{"id":2,"url":"https://patchwork.libcamera.org/api/people/2/","name":"Laurent Pinchart","email":"laurent.pinchart@ideasonboard.com"},"content":"Hi Jacopo,\n\nThank you for the patch.\n\nOn Tue, Sep 07, 2021 at 09:40:59PM +0200, Jacopo Mondi wrote:\n> We currently hardcode 2560x1920@30FPS as the only stalling frame duration.\n> \n> This is of course not correct, and all the required information to\n> properly populate the ANDROID_SCALER_AVAILABLE_STALL_DURATIONS static\n> metadata are available from initializeStaticMetadata().\n> \n> Use the collected stalling durations and sizes to properly popoulate the\n> static property.\n> \n> Signed-off-by: Jacopo Mondi <jacopo@jmondi.org>\n> Reviewed-by: Paul Elder <paul.elder@ideasonboard.com>\n> Reviewed-by: Umang Jain <umang.jain@ideasonboard.com>\n> ---\n>  src/android/camera_capabilities.cpp | 19 +++++++++++++------\n>  1 file changed, 13 insertions(+), 6 deletions(-)\n> \n> diff --git a/src/android/camera_capabilities.cpp b/src/android/camera_capabilities.cpp\n> index 5d8293843f57..526127176678 100644\n> --- a/src/android/camera_capabilities.cpp\n> +++ b/src/android/camera_capabilities.cpp\n> @@ -1265,12 +1265,6 @@ int CameraCapabilities::initializeStaticMetadata()\n>  \tstaticMetadata_->addEntry(ANDROID_SCALER_AVAILABLE_STREAM_CONFIGURATIONS,\n>  \t\t\t\t  availableStreamConfigurations);\n>  \n> -\tstd::vector<int64_t> availableStallDurations = {\n> -\t\tANDROID_SCALER_AVAILABLE_FORMATS_BLOB, 2560, 1920, 33333333,\n> -\t};\n> -\tstaticMetadata_->addEntry(ANDROID_SCALER_AVAILABLE_STALL_DURATIONS,\n> -\t\t\t\t  availableStallDurations);\n> -\n>  \tstd::vector<int64_t> minFrameDurations;\n>  \tminFrameDurations.reserve(streamConfigurations_.size() * 4);\n>  \tfor (const auto &entry : streamConfigurations_) {\n> @@ -1282,6 +1276,19 @@ int CameraCapabilities::initializeStaticMetadata()\n>  \tstaticMetadata_->addEntry(ANDROID_SCALER_AVAILABLE_MIN_FRAME_DURATIONS,\n>  \t\t\t\t  minFrameDurations);\n>  \n> +\tstd::vector<int64_t> availableStallDurations;\n> +\tfor (const auto &entry : streamConfigurations_) {\n> +\t\tif (entry.androidFormat != HAL_PIXEL_FORMAT_BLOB)\n> +\t\t\tcontinue;\n> +\n> +\t\tavailableStallDurations.push_back(entry.androidFormat);\n> +\t\tavailableStallDurations.push_back(entry.resolution.width);\n> +\t\tavailableStallDurations.push_back(entry.resolution.height);\n> +\t\tavailableStallDurations.push_back(entry.minFrameDurationNsec);\n\nShould we add a break here, as there should be a single JPEG stream\nconfiguration ? Or have I misunderstood this ?\n\nReviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\n\n> +\t}\n> +\tstaticMetadata_->addEntry(ANDROID_SCALER_AVAILABLE_STALL_DURATIONS,\n> +\t\t\t\t  availableStallDurations);\n> +\n>  \tuint8_t croppingType = ANDROID_SCALER_CROPPING_TYPE_CENTER_ONLY;\n>  \tstaticMetadata_->addEntry(ANDROID_SCALER_CROPPING_TYPE, croppingType);\n>","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 1A013BDC71\n\tfor <parsemail@patchwork.libcamera.org>;\n\tWed,  6 Oct 2021 01:41:35 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id AC2FD691B7;\n\tWed,  6 Oct 2021 03:41:34 +0200 (CEST)","from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[IPv6:2001:4b98:dc2:55:216:3eff:fef7:d647])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id EC380602DC\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tWed,  6 Oct 2021 03:41:33 +0200 (CEST)","from pendragon.ideasonboard.com (62-78-145-57.bb.dnainternet.fi\n\t[62.78.145.57])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id 6335E581;\n\tWed,  6 Oct 2021 03:41:33 +0200 (CEST)"],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (1024-bit key;\n\tunprotected) header.d=ideasonboard.com header.i=@ideasonboard.com\n\theader.b=\"AbV+wm0v\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1633484493;\n\tbh=gyhBXHpUeZ+Hhrma2UFHaYBCGR8XmUIWb/yKB152OXE=;\n\th=Date:From:To:Cc:Subject:References:In-Reply-To:From;\n\tb=AbV+wm0vFcKfCs9urUQHsT+TpFbMWKI4KfmkFgY17Kdimdd84C4g5WgU4MyQfAb7n\n\tnQD8Tm//kFpKrJXfuxsnn27WcaKWJH5YCNgMM84qnC79vODVdCbIhe+UES3Orefb4M\n\tnLe7auKOprEathP22ugjn8wbwQfsdFbwi5aO8DgY=","Date":"Wed, 6 Oct 2021 04:41:25 +0300","From":"Laurent Pinchart <laurent.pinchart@ideasonboard.com>","To":"Jacopo Mondi <jacopo@jmondi.org>","Message-ID":"<YVz+xQWKGI0IyvVi@pendragon.ideasonboard.com>","References":"<20210907194107.803730-1-jacopo@jmondi.org>\n\t<20210907194107.803730-10-jacopo@jmondi.org>","MIME-Version":"1.0","Content-Type":"text/plain; charset=utf-8","Content-Disposition":"inline","In-Reply-To":"<20210907194107.803730-10-jacopo@jmondi.org>","Subject":"Re: [libcamera-devel] [PATCH v2 09/17] android: capabilties:\n\tCorrectly populate STALL durations","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","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"}},{"id":20090,"web_url":"https://patchwork.libcamera.org/comment/20090/","msgid":"<20211006075643.o44f6npcd2n7zpal@uno.localdomain>","date":"2021-10-06T07:56:43","subject":"Re: [libcamera-devel] [PATCH v2 09/17] android: capabilties:\n\tCorrectly populate STALL durations","submitter":{"id":3,"url":"https://patchwork.libcamera.org/api/people/3/","name":"Jacopo Mondi","email":"jacopo@jmondi.org"},"content":"Hi Laurent,\n\nOn Wed, Oct 06, 2021 at 04:41:25AM +0300, Laurent Pinchart wrote:\n> Hi Jacopo,\n>\n> Thank you for the patch.\n>\n> On Tue, Sep 07, 2021 at 09:40:59PM +0200, Jacopo Mondi wrote:\n> > We currently hardcode 2560x1920@30FPS as the only stalling frame duration.\n> >\n> > This is of course not correct, and all the required information to\n> > properly populate the ANDROID_SCALER_AVAILABLE_STALL_DURATIONS static\n> > metadata are available from initializeStaticMetadata().\n> >\n> > Use the collected stalling durations and sizes to properly popoulate the\n> > static property.\n> >\n> > Signed-off-by: Jacopo Mondi <jacopo@jmondi.org>\n> > Reviewed-by: Paul Elder <paul.elder@ideasonboard.com>\n> > Reviewed-by: Umang Jain <umang.jain@ideasonboard.com>\n> > ---\n> >  src/android/camera_capabilities.cpp | 19 +++++++++++++------\n> >  1 file changed, 13 insertions(+), 6 deletions(-)\n> >\n> > diff --git a/src/android/camera_capabilities.cpp b/src/android/camera_capabilities.cpp\n> > index 5d8293843f57..526127176678 100644\n> > --- a/src/android/camera_capabilities.cpp\n> > +++ b/src/android/camera_capabilities.cpp\n> > @@ -1265,12 +1265,6 @@ int CameraCapabilities::initializeStaticMetadata()\n> >  \tstaticMetadata_->addEntry(ANDROID_SCALER_AVAILABLE_STREAM_CONFIGURATIONS,\n> >  \t\t\t\t  availableStreamConfigurations);\n> >\n> > -\tstd::vector<int64_t> availableStallDurations = {\n> > -\t\tANDROID_SCALER_AVAILABLE_FORMATS_BLOB, 2560, 1920, 33333333,\n> > -\t};\n> > -\tstaticMetadata_->addEntry(ANDROID_SCALER_AVAILABLE_STALL_DURATIONS,\n> > -\t\t\t\t  availableStallDurations);\n> > -\n> >  \tstd::vector<int64_t> minFrameDurations;\n> >  \tminFrameDurations.reserve(streamConfigurations_.size() * 4);\n> >  \tfor (const auto &entry : streamConfigurations_) {\n> > @@ -1282,6 +1276,19 @@ int CameraCapabilities::initializeStaticMetadata()\n> >  \tstaticMetadata_->addEntry(ANDROID_SCALER_AVAILABLE_MIN_FRAME_DURATIONS,\n> >  \t\t\t\t  minFrameDurations);\n> >\n> > +\tstd::vector<int64_t> availableStallDurations;\n> > +\tfor (const auto &entry : streamConfigurations_) {\n> > +\t\tif (entry.androidFormat != HAL_PIXEL_FORMAT_BLOB)\n> > +\t\t\tcontinue;\n> > +\n> > +\t\tavailableStallDurations.push_back(entry.androidFormat);\n> > +\t\tavailableStallDurations.push_back(entry.resolution.width);\n> > +\t\tavailableStallDurations.push_back(entry.resolution.height);\n> > +\t\tavailableStallDurations.push_back(entry.minFrameDurationNsec);\n>\n> Should we add a break here, as there should be a single JPEG stream\n> configuration ? Or have I misunderstood this ?\n\nI don't think so... The ANDROID_SCALER_AVAILABLE_STALL_DURATIONS\ncharacteristic is documented to have size (int64 x 4 x n) where 'n' I\nassume it's the number of stream configuration in stalling formats\n\nThe following formats may always have a stall duration (ImageFormat#JPEG\nand ImageFormat#RAW_SENSOR) but we only support JPEG at the moment.\n\n>\n> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\n\nThanks\n   j\n\n>\n> > +\t}\n> > +\tstaticMetadata_->addEntry(ANDROID_SCALER_AVAILABLE_STALL_DURATIONS,\n> > +\t\t\t\t  availableStallDurations);\n> > +\n> >  \tuint8_t croppingType = ANDROID_SCALER_CROPPING_TYPE_CENTER_ONLY;\n> >  \tstaticMetadata_->addEntry(ANDROID_SCALER_CROPPING_TYPE, croppingType);\n> >\n>\n> --\n> Regards,\n>\n> Laurent Pinchart","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 E5E16BDC71\n\tfor <parsemail@patchwork.libcamera.org>;\n\tWed,  6 Oct 2021 07:55:58 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 63787691BB;\n\tWed,  6 Oct 2021 09:55:58 +0200 (CEST)","from relay9-d.mail.gandi.net (relay9-d.mail.gandi.net\n\t[217.70.183.199])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id ABA71691AB\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tWed,  6 Oct 2021 09:55:57 +0200 (CEST)","(Authenticated sender: jacopo@jmondi.org)\n\tby relay9-d.mail.gandi.net (Postfix) with ESMTPSA id C6291FF807;\n\tWed,  6 Oct 2021 07:55:56 +0000 (UTC)"],"Date":"Wed, 6 Oct 2021 09:56:43 +0200","From":"Jacopo Mondi <jacopo@jmondi.org>","To":"Laurent Pinchart <laurent.pinchart@ideasonboard.com>","Message-ID":"<20211006075643.o44f6npcd2n7zpal@uno.localdomain>","References":"<20210907194107.803730-1-jacopo@jmondi.org>\n\t<20210907194107.803730-10-jacopo@jmondi.org>\n\t<YVz+xQWKGI0IyvVi@pendragon.ideasonboard.com>","MIME-Version":"1.0","Content-Type":"text/plain; charset=utf-8","Content-Disposition":"inline","In-Reply-To":"<YVz+xQWKGI0IyvVi@pendragon.ideasonboard.com>","Subject":"Re: [libcamera-devel] [PATCH v2 09/17] android: capabilties:\n\tCorrectly populate STALL durations","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","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"}}]