[{"id":1485,"web_url":"https://patchwork.libcamera.org/comment/1485/","msgid":"<20190419104637.GD7006@pendragon.ideasonboard.com>","date":"2019-04-19T10:46:37","subject":"Re: [libcamera-devel] [PATCH v7 2/8] libcamera: camera: Reset\n\tbasefield to decimal","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 Fri, Apr 19, 2019 at 12:18:33PM +0200, Jacopo Mondi wrote:\n> When logging the camera configuration, the same ostringstream instance\n> is used to assemble a message describing configuration of all the\n> configured streams.\n> \n> After the first stream configuration has been assembled, the use of\n> std::hex modifies the ostringstream basefield, causing all successive\n> integers values inserted in the stream to be expressed as hexadecimals.\n> \n> Fix that by resetting the stream's basefield to decimal, before\n> assembling a stream configuration description.\n> \n> Before this patch:\n> INFO Camera camera.cpp:615  (0) 640x480-0x3231564e (1) 140xa0-0x3231564e\n> After this patch:\n> INFO Camera camera.cpp:616  (0) 640x480-0x3231564e (1) 320x160-0x3231564e\n> \n> Fixes: 9c9078133216 (\"libcamera: camera: Log requested configuration in configureStreams()\")\n> Signed-off-by: Jacopo Mondi <jacopo@jmondi.org>\n\nSorry for breaking it, and thank you for the fix.\n\n> ---\n>  src/libcamera/camera.cpp | 1 +\n>  1 file changed, 1 insertion(+)\n> \n> diff --git a/src/libcamera/camera.cpp b/src/libcamera/camera.cpp\n> index bd381fa1cb56..4af3780d305e 100644\n> --- a/src/libcamera/camera.cpp\n> +++ b/src/libcamera/camera.cpp\n> @@ -605,6 +605,7 @@ int Camera::configureStreams(const CameraConfiguration &config)\n>  \t\t\treturn -EINVAL;\n>  \n>  \t\tconst StreamConfiguration &cfg = config[stream];\n> +\t\tmsg << std::dec;\n>  \t\tmsg << \" (\" << index << \") \" << cfg.width << \"x\"\n\nYou could combine those two lines, they fit in 80 characters.\n\n\t\tmsg << std::dec << \" (\" << index << \") \" << cfg.width << \"x\"\n\nReviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\n\n>  \t\t    << cfg.height << \"-0x\" << std::hex << std::setfill('0')\n>  \t\t    << std::setw(8) << cfg.pixelFormat;","headers":{"Return-Path":"<laurent.pinchart@ideasonboard.com>","Received":["from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[213.167.242.64])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id C44E860B2E\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tFri, 19 Apr 2019 12:46:54 +0200 (CEST)","from pendragon.ideasonboard.com (unknown\n\t[IPv6:2001:14ba:21f5:5b00:ce28:277f:58d7:3ca4])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id 3470731A;\n\tFri, 19 Apr 2019 12:46:54 +0200 (CEST)"],"DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1555670814;\n\tbh=4Ah1KFzW13gYlEQxAwzlzinCqHpeO1erfjIyzF3jcsg=;\n\th=Date:From:To:Cc:Subject:References:In-Reply-To:From;\n\tb=TpaCanL1Nl310RQf3VyYXJtyE8uQ0+Oji4CS9qUQt7oHFAnF/CMqLG9TNOVpmhZIP\n\t++kztbWwf5ZeCCUGA3ouaxJ+LWyOTvPY2RmZgAUhL1qjfjM85dXwyjWkupKXE4BJyY\n\tfIgzUcm1c7kb1nmxpUDrNGDKns/gleRwDSFCEHe4=","Date":"Fri, 19 Apr 2019 13:46:37 +0300","From":"Laurent Pinchart <laurent.pinchart@ideasonboard.com>","To":"Jacopo Mondi <jacopo@jmondi.org>","Cc":"libcamera-devel@lists.libcamera.org","Message-ID":"<20190419104637.GD7006@pendragon.ideasonboard.com>","References":"<20190419101839.10337-1-jacopo@jmondi.org>\n\t<20190419101839.10337-3-jacopo@jmondi.org>","MIME-Version":"1.0","Content-Type":"text/plain; charset=utf-8","Content-Disposition":"inline","In-Reply-To":"<20190419101839.10337-3-jacopo@jmondi.org>","User-Agent":"Mutt/1.10.1 (2018-07-13)","Subject":"Re: [libcamera-devel] [PATCH v7 2/8] libcamera: camera: Reset\n\tbasefield to decimal","X-BeenThere":"libcamera-devel@lists.libcamera.org","X-Mailman-Version":"2.1.23","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>","X-List-Received-Date":"Fri, 19 Apr 2019 10:46:55 -0000"}}]