[{"id":857,"web_url":"https://patchwork.libcamera.org/comment/857/","msgid":"<20190222105159.GG3522@pendragon.ideasonboard.com>","date":"2019-02-22T10:51:59","subject":"Re: [libcamera-devel] [PATCH 4/4] cam: fix return type of\n\tconfigureStreams()","submitter":{"id":2,"url":"https://patchwork.libcamera.org/api/people/2/","name":"Laurent Pinchart","email":"laurent.pinchart@ideasonboard.com"},"content":"Hi Niklas,\n\nThank you for the patch.\n\nOn Thu, Feb 21, 2019 at 12:59:39AM +0100, Niklas Söderlund wrote:\n> The only caller of configureStreams() stores its return value as an int\n> and not bool. This is confusing and also prevents the (possibly)\n> different error codes returned by Camera::configureStreams() to be\n> propagated inside the cam tool. Fix this by changing the return type to\n> int and propagate the return value from the camera.\n> \n> Signed-off-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>\n\nReviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\n\n> ---\n>  src/cam/main.cpp | 7 ++-----\n>  1 file changed, 2 insertions(+), 5 deletions(-)\n> \n> diff --git a/src/cam/main.cpp b/src/cam/main.cpp\n> index 9b67ab75a6a1663e..7c47ce652aa025d1 100644\n> --- a/src/cam/main.cpp\n> +++ b/src/cam/main.cpp\n> @@ -78,7 +78,7 @@ static int parseOptions(int argc, char *argv[])\n>  \treturn 0;\n>  }\n>  \n> -static bool configureStreams(Camera *camera, std::vector<Stream *> &streams)\n> +static int configureStreams(Camera *camera, std::vector<Stream *> &streams)\n>  {\n>  \tKeyValueParser::Options format = options[OptFormat];\n>  \tStream *id = streams.front();\n> @@ -98,10 +98,7 @@ static bool configureStreams(Camera *camera, std::vector<Stream *> &streams)\n>  \t\t\tconfig[id].pixelFormat = format[\"pixelformat\"];\n>  \t}\n>  \n> -\tif (camera->configureStreams(config))\n> -\t\treturn false;\n> -\n> -\treturn true;\n> +\treturn camera->configureStreams(config);\n>  }\n>  \n>  static void requestComplete(Request *request, const std::map<Stream *, Buffer *> &buffers)","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 B345B600FD\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tFri, 22 Feb 2019 11:52:04 +0100 (CET)","from pendragon.ideasonboard.com (81-175-216-236.bb.dnainternet.fi\n\t[81.175.216.236])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id 35694255;\n\tFri, 22 Feb 2019 11:52:04 +0100 (CET)"],"DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1550832724;\n\tbh=32Tvcg4Z9NxNMpDvProx5cDF1PAL5QIAk/zv/s/MKLg=;\n\th=Date:From:To:Cc:Subject:References:In-Reply-To:From;\n\tb=sOIwqJXiR581qvkvN/e5CQr/wxcvzAGK+I+2ID6oBs0vSgk9XncZYC9wEOf3YwwNk\n\tc4w4aN99/3ggGlTn8M9YMbQNMLOU9fvNAGfiGozT/pZ4JzdtP+Vw0wkPevyoWAaANg\n\t8GibdGZLFGrBoRBt7wKixU2vpUzie+nG8VYpkd9M=","Date":"Fri, 22 Feb 2019 12:51:59 +0200","From":"Laurent Pinchart <laurent.pinchart@ideasonboard.com>","To":"Niklas =?utf-8?q?S=C3=B6derlund?= <niklas.soderlund@ragnatech.se>","Cc":"libcamera-devel@lists.libcamera.org","Message-ID":"<20190222105159.GG3522@pendragon.ideasonboard.com>","References":"<20190220235939.25147-1-niklas.soderlund@ragnatech.se>\n\t<20190220235939.25147-5-niklas.soderlund@ragnatech.se>","MIME-Version":"1.0","Content-Type":"text/plain; charset=utf-8","Content-Disposition":"inline","Content-Transfer-Encoding":"8bit","In-Reply-To":"<20190220235939.25147-5-niklas.soderlund@ragnatech.se>","User-Agent":"Mutt/1.10.1 (2018-07-13)","Subject":"Re: [libcamera-devel] [PATCH 4/4] cam: fix return type of\n\tconfigureStreams()","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, 22 Feb 2019 10:52:04 -0000"}}]