From patchwork Thu Nov 18 16:42:16 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Naushir Patuck X-Patchwork-Id: 14637 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 9C434BDB1C for ; Thu, 18 Nov 2021 16:43:24 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 5BBD060371; Thu, 18 Nov 2021 17:43:24 +0100 (CET) Authentication-Results: lancelot.ideasonboard.com; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=raspberrypi.com header.i=@raspberrypi.com header.b="g0aPQmn3"; dkim-atps=neutral Received: from mail-wr1-x436.google.com (mail-wr1-x436.google.com [IPv6:2a00:1450:4864:20::436]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 9F21660231 for ; Thu, 18 Nov 2021 17:43:23 +0100 (CET) Received: by mail-wr1-x436.google.com with SMTP id a9so12760225wrr.8 for ; Thu, 18 Nov 2021 08:43:23 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=raspberrypi.com; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=WSxb4/4PrjoEknlE7tK2I4wOz4SjJt6N50Kw+mOFMJI=; b=g0aPQmn3N2l9BaF9+C0XmH/M1GfZjPt1aRTjLCjtbbkoSxOjCuTja/j5WboTXb2Vpb jZqU7vVwwn7Nr1PqcdqE6bcilDFleXkzk58gK6MjhfNo8fvqgS2vc3AC+7/mM6S7z+ew naky2fzyW3gdSVfabzgPAYor8WCyYCpXYxMsLyAob3po/OWd7WYhlLKAQt7Y2Qxmit3m /vEqM+bsGV6WVkp1vdrnNLTwWdaUzSRzhSJOLyJdnxEraN/B7WAJ+gr1ZZC2T4b7YPAd JwkXoj8ZfkIX2RV9mVMWCMnce8Pk50Q6OGbpVHRRtiMVTMCI6ol7HB5Mu/dPcRuDcWE6 PAKw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=WSxb4/4PrjoEknlE7tK2I4wOz4SjJt6N50Kw+mOFMJI=; b=BYKTDp97iB2t+ucSDfgoHn/VBT36+aoI40Eek+gtpOKwFyQPewTDoZzN25fa/hsj2a pqumADApgPRTxIw1WSSZzHgg2nv13T77h8y2kL0CK2gJO8yfXeJBfTtnIWRusWOqumMx /HHz22UCQGpnoOnaRzcnvcg+kluh6nqsUUM+VRR6ScP8YsKKWxMI0N3hbgM4QzbZVgN1 QKlIsJ0d/52+8I56rPzGOSKpIcxqPLHRcR0TfJGm6JtxuRVEkS3tIyNTGKXCl5wza5bD qOtEhCyI+kDnKTqHXCG5PPqtNJ8TX/bzy8YUx5wxUZKa+3wq6ygUAK0gpnHcNJTOKe9b 7yKg== X-Gm-Message-State: AOAM531afLKMXmMtMLx0shlAvJZ0HWRIhclLSWd6VJpZ8HLnBqB2haCo ffHJnE/x7lCVOEAjqCiUgpRrAn75oPnSG0nx X-Google-Smtp-Source: ABdhPJxpCtfT5R/EWqsENB3O6Njs/DOPhjkJqF1JE+bBu8DSADy58YNfPN6DMOlwBUHGjgGV10Macw== X-Received: by 2002:a5d:6d0b:: with SMTP id e11mr33004751wrq.16.1637253803198; Thu, 18 Nov 2021 08:43:23 -0800 (PST) Received: from naush-laptop.pitowers.org ([2a00:1098:3142:14:328d:499d:f54a:e461]) by smtp.gmail.com with ESMTPSA id a1sm496246wri.89.2021.11.18.08.43.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 18 Nov 2021 08:43:21 -0800 (PST) From: Naushir Patuck To: libcamera-devel@lists.libcamera.org Date: Thu, 18 Nov 2021 16:42:16 +0000 Message-Id: <20211118164216.2669449-5-naush@raspberrypi.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20211118164216.2669449-1-naush@raspberrypi.com> References: <20211118164216.2669449-1-naush@raspberrypi.com> MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH v3 4/4] pipeline: raspberrypi: Avoid invalid PixelFormat warning message 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: , Errors-To: libcamera-devel-bounces@lists.libcamera.org Sender: "libcamera-devel" PixelFormatInfo::info() would log a warning message if the PixelFormat was invalid when called from the isRaw() function. Add a validity test in isRaw() to avoid this warning message. Signed-off-by: Naushir Patuck Reviewed-by: Laurent Pinchart Reviewed-by: Kieran Bingham --- src/libcamera/pipeline/raspberrypi/raspberrypi.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp b/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp index 4f6c699a4379..ad526a8be6a2 100644 --- a/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp +++ b/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp @@ -102,6 +102,9 @@ bool isRaw(const PixelFormat &pixFmt) * The isRaw test might be redundant right now the pipeline handler only * supports RAW sensors. Leave it in for now, just as a sanity check. */ + if (!pixFmt.isValid()) + return false; + const PixelFormatInfo &info = PixelFormatInfo::info(pixFmt); if (!info.isValid()) return false;