From patchwork Mon Jul 27 15:18:20 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kaaira Gupta X-Patchwork-Id: 9020 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 7FC38BD878 for ; Mon, 27 Jul 2020 15:18:51 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 4ED35613D2; Mon, 27 Jul 2020 17:18:51 +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="qCRaCI+q"; dkim-atps=neutral Received: from mail-pf1-x443.google.com (mail-pf1-x443.google.com [IPv6:2607:f8b0:4864:20::443]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 8E0F66118A for ; Mon, 27 Jul 2020 17:18:49 +0200 (CEST) Received: by mail-pf1-x443.google.com with SMTP id s26so9228790pfm.4 for ; Mon, 27 Jul 2020 08:18:49 -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=qCRaCI+qcPA1rrJBhngpz+H7PKYfcQ+AxlIxWVhh+qobqWEgF0qMDdQtVBAHnFDr71 2ItFaEF9S8O/g18DNNA9gk592j0191JPtGl5fdG4i4K50aztu4ALOS2rN37u+wvenBAZ E2LmZZfXhlryIVcU2Wr3kRq0D9ECF0cWLyrM0+wDOXrj5KtYRTgjrDT3OLl1x54i6hjl xrSoIqRyAAL/XsA6AF/+cQ7Ocrp3seHly/38EL4eM4muBHf0TM4hQjs2J6sFM6cS2xm5 hTKHUDyZTBfJeKe5RMqhERyJIdsMeDSMLxwWra0Hc8NxT/95gDGokMKBQDEMRm1081yM 25GQ== 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=HNgZOZzMtWG2rQ7w+ddanRCX63IATZz1p2yeBwkosl2vwZp1S/lTg7ZXMXUZSdd1sM TPDmFT87sD/M+Dv/SMhiGb2wlfvdi4nA3VtkqvQNxJo/EXqX/qPUXn33IXEPJJJ+AkNH 0MazTF9wfjUFNGOKH0L746CSpR9y+vADNPE0Isk5cIUSEra9M9DQtbTbwmrkVZ6H56Ns HN14XkYQR4qVONGIhLbikQYwGaL3k/gGYgrFSmwX8Nz/3PoL59h7e8zo4krQokQj2zvn /tw8DqaqloDFtC1xsPEjGdYUPUvLJbxGWPP+p1OngsOz7af5moTgDRFHFa7SijeE0leq QW+A== X-Gm-Message-State: AOAM5330eveITMp2gbCTmcCZhNklYFS25gByastpS+isp9WxqF8sSN6q t1T2tqMd6hvORfqqPSiK0hSSvB3GN9s= X-Google-Smtp-Source: ABdhPJxnMmOTSauMtDrfFD4cIpW+AAJ4qrHFxZ4HSlyldcbiw7IWbyAiRVncD4Sv3Qh2auXOjAf2xg== X-Received: by 2002:a63:4144:: with SMTP id o65mr20061672pga.8.1595863128005; Mon, 27 Jul 2020 08:18:48 -0700 (PDT) Received: from kaaira-HP-Pavilion-Notebook ([103.113.213.178]) by smtp.gmail.com with ESMTPSA id q24sm14784792pgg.3.2020.07.27.08.18.46 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 27 Jul 2020 08:18:47 -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 20:48:20 +0530 Message-Id: <20200727151820.24466-4-kgupta@es.iitr.ac.in> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200727151820.24466-1-kgupta@es.iitr.ac.in> References: <20200727151820.24466-1-kgupta@es.iitr.ac.in> Subject: [libcamera-devel] [PATCH v3 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 --- 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;