From patchwork Mon Jul 27 16:21:43 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kaaira Gupta X-Patchwork-Id: 9024 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 91EDABD86F for ; Mon, 27 Jul 2020 16:22:05 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 5C93F611A2; Mon, 27 Jul 2020 18:22:05 +0200 (CEST) Authentication-Results: lancelot.ideasonboard.com; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=es-iitr-ac-in.20150623.gappssmtp.com header.i=@es-iitr-ac-in.20150623.gappssmtp.com header.b="U6hHlBrB"; dkim-atps=neutral Received: from mail-pg1-x541.google.com (mail-pg1-x541.google.com [IPv6:2607:f8b0:4864:20::541]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id AE7F7605B2 for ; Mon, 27 Jul 2020 18:22:03 +0200 (CEST) Received: by mail-pg1-x541.google.com with SMTP id t6so9957106pgq.1 for ; Mon, 27 Jul 2020 09:22:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=es-iitr-ac-in.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=Vujycd8EPvoebCgjNl2OyNBkTEe2zGIFJY2qcVv2RBk=; b=U6hHlBrBoTT0lSTKdJqUc4kPLvFa8R2FhCelYIfEjD4l/BIeHnSFdqUxtKECQCyWRE DEg8EF5jxCi4vWX8XJSjc/nsYrD0E2MiZN8I5ooinjeNILDrJdYb6ECBcUNgOMaKuCIw E7kfLAGcZ6HuBb3MherrnBXomkA3xDfCn/auS8J5WwAmCxL9Y2ONdwzZSWLv2fd0cvu7 CvZIoPBD2vNQbywMdpey0QeoOu9+IEXaclyetCxUHxkscFRHj9SlNuQD387hbVP473vq kmaV7tiLZrHL6AWc/DeRNvPwC+14hE3WW7l4JTc9gl8C34wsaqb7dg4Xl4srLxtNHhkx X+aA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=Vujycd8EPvoebCgjNl2OyNBkTEe2zGIFJY2qcVv2RBk=; b=iWlHlgUTKaL8I559g5rVTpfZm5U0bbvdPO2BPkeQkGY2NsYQ7Il0t3wOfOTJigtOAg tBUdTs5DyZ2+vRIOqr/lT1djTliolkaSV3JDkDkfIel+I94k/iNVNqxUVg/PhW34vA3B 5e2IsuazPa4Ow/KuB9DxVW70z207s1r9MJ+IqQRalqR9JeyWWwA+PS73eGulrNiBKn4y kDh8u4mUtQxZ/s1+cNNd/qRxfpb84DciWrsRNpnVh1YCmLVjc5Lmm5w75zXCVf1N3fDl k8P9qqQb1nzy3nGWBj4epytU4867YJPvDrXwe6+7EYj7SUvU39V6lWcukXa/nmi1ncgX LluQ== X-Gm-Message-State: AOAM532uZqAK0LOOtVIsPdtsoeeJ62Cz70Vyt/tj7cbnQ8fSWgr72ido xLhY8E3RgkvN9ZOWVNzJFpKbtmw29Zs= X-Google-Smtp-Source: ABdhPJzYy9T/m2Hnh/9axzubc85MNseZn+F31JezUzycu265cF7a7z5SnzRrh6LMyKMAgTF0QGcdkw== X-Received: by 2002:a63:be47:: with SMTP id g7mr20215120pgo.7.1595866922331; Mon, 27 Jul 2020 09:22:02 -0700 (PDT) Received: from kaaira-HP-Pavilion-Notebook ([103.113.213.178]) by smtp.gmail.com with ESMTPSA id n14sm15811266pgd.78.2020.07.27.09.22.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 27 Jul 2020 09:22:01 -0700 (PDT) From: Kaaira Gupta To: libcamera-devel@lists.libcamera.org, Kieran Bingham , =?utf-8?q?Niklas_S=C3=B6derlund?= Date: Mon, 27 Jul 2020 21:51:43 +0530 Message-Id: <20200727162143.31317-4-kgupta@es.iitr.ac.in> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200727162143.31317-1-kgupta@es.iitr.ac.in> References: <20200727162143.31317-1-kgupta@es.iitr.ac.in> Subject: [libcamera-devel] [PATCH v4 3/3] libcamera: stream_option: use format name to set cam/qcam format 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: , Cc: Kaaira Gupta MIME-Version: 1.0 Errors-To: libcamera-devel-bounces@lists.libcamera.org Sender: "libcamera-devel" Replace hex input for pixel formats with their format names, for input in cam and qcam. Hence, remove the todo. Signed-off-by: Kaaira Gupta Reviewed-by: Kieran Bingham Reviewed-by: Laurent Pinchart --- src/cam/stream_options.cpp | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/cam/stream_options.cpp b/src/cam/stream_options.cpp index bd12c8f..4168e5d 100644 --- a/src/cam/stream_options.cpp +++ b/src/cam/stream_options.cpp @@ -19,7 +19,7 @@ StreamKeyValueParser::StreamKeyValueParser() ArgumentRequired); addOption("height", OptionInteger, "Height in pixels", ArgumentRequired); - addOption("pixelformat", OptionInteger, "Pixel format", + addOption("pixelformat", OptionString, "Pixel format name", ArgumentRequired); } @@ -95,9 +95,8 @@ int StreamKeyValueParser::updateConfiguration(CameraConfiguration *config, cfg.size.height = opts["height"]; } - /* \todo Translate 4CC string to pixelformat with modifier. */ if (opts.isSet("pixelformat")) - cfg.pixelFormat = PixelFormat(opts["pixelformat"]); + cfg.pixelFormat = PixelFormat::fromString(opts["pixelformat"].toString()); } return 0;