From patchwork Tue Aug 23 17:43:14 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Laurent Pinchart X-Patchwork-Id: 17192 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 03329C327D for ; Tue, 23 Aug 2022 17:43:33 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 9E52B61FCA; Tue, 23 Aug 2022 19:43:32 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org; s=mail; t=1661276612; bh=/SXJKJDO3SeO9tKwX/HD8uXUoE84grewaMGkleZeAqs=; h=To:Date:In-Reply-To:References:Subject:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To: From; b=YEJWogwWhMJKCRP9zkoHqIfNbQ+f3wT7G+JzH8l2L+3hKT5vnVb1oHXnm8wj/6Q7i C2chh0no0fOcMcAVCm70EhTgb1vS+lb5S+CCoSTmQRjOdH9YH3GYwLRXQTCrIGt+OP GdaYrlvW8cINWF1OeTkUnsKGXemyGSRiz6zuBqU73KD8SHoiaI6lrEbxHb6W2y3sPR wxmytJk1yEZzaTWm3mNMjUCP+O1kYKh5iTNZHC2GnPM6658os5SFtf/4VTERUN52Hd LWfgfeW29VmN0VYEU6/k4L0SlwXu31InVcQ3VKXAxW8QQuYeoML5OR04yD0386VIpU B3uypyY9o/pwQ== Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [213.167.242.64]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 1C9BC61FCA for ; Tue, 23 Aug 2022 19:43:29 +0200 (CEST) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (1024-bit key; unprotected) header.d=ideasonboard.com header.i=@ideasonboard.com header.b="Vga8QM8q"; dkim-atps=neutral Received: from pendragon.ideasonboard.com (62-78-145-57.bb.dnainternet.fi [62.78.145.57]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id 953F1484 for ; Tue, 23 Aug 2022 19:43:28 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1661276608; bh=/SXJKJDO3SeO9tKwX/HD8uXUoE84grewaMGkleZeAqs=; h=From:To:Subject:Date:In-Reply-To:References:From; b=Vga8QM8qyr8Gx3/0g7/PztOsM4thp8tKk+86hdx4gDdBFYoxs0Z+Y66mfSpl1SwSf Z5kYvuAUA4zFNZyiFVRpwSTu6TXIQp94IhE0ALSoovC4ntvfWIqXNeaOoWiHgXgssC 8dJp9E/MzhIPENRNn9XgUhHzFkHDq3tQBDPadm10= To: libcamera-devel@lists.libcamera.org Date: Tue, 23 Aug 2022 20:43:14 +0300 Message-Id: <20220823174314.14881-7-laurent.pinchart@ideasonboard.com> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220823174314.14881-1-laurent.pinchart@ideasonboard.com> References: <20220823174314.14881-1-laurent.pinchart@ideasonboard.com> MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH 6/6] cam: Add color space 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: Laurent Pinchart via libcamera-devel From: Laurent Pinchart Reply-To: Laurent Pinchart Errors-To: libcamera-devel-bounces@lists.libcamera.org Sender: "libcamera-devel" Add support for color space to the StreamKeyValueParser, allowing selection of a color space on the command line. Signed-off-by: Laurent Pinchart Reviewed-by: Umang Jain Reviewed-by: Paul Elder --- src/cam/stream_options.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/cam/stream_options.cpp b/src/cam/stream_options.cpp index a68135a9ed88..3a5625f5f267 100644 --- a/src/cam/stream_options.cpp +++ b/src/cam/stream_options.cpp @@ -8,6 +8,8 @@ #include +#include + using namespace libcamera; StreamKeyValueParser::StreamKeyValueParser() @@ -21,6 +23,8 @@ StreamKeyValueParser::StreamKeyValueParser() ArgumentRequired); addOption("pixelformat", OptionString, "Pixel format name", ArgumentRequired); + addOption("colorspace", OptionString, "Color space", + ArgumentRequired); } KeyValueParser::Options StreamKeyValueParser::parse(const char *arguments) @@ -96,6 +100,9 @@ int StreamKeyValueParser::updateConfiguration(CameraConfiguration *config, if (opts.isSet("pixelformat")) cfg.pixelFormat = PixelFormat::fromString(opts["pixelformat"].toString()); + + if (opts.isSet("colorspace")) + cfg.colorSpace = ColorSpace::fromString(opts["colorspace"].toString()); } return 0;