From patchwork Mon Jun 29 15:14:06 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paul Elder X-Patchwork-Id: 8500 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 4B62ABFFE2 for ; Mon, 29 Jun 2020 15:14:26 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 103D6609DF; Mon, 29 Jun 2020 17:14:26 +0200 (CEST) Authentication-Results: lancelot.ideasonboard.com; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=ideasonboard.com header.i=@ideasonboard.com header.b="Yyh7FBdT"; dkim-atps=neutral Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [IPv6:2001:4b98:dc2:55:216:3eff:fef7:d647]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id A737D603B4 for ; Mon, 29 Jun 2020 17:14:24 +0200 (CEST) Received: from pyrite.rasen.tech (unknown [IPv6:2400:4051:61:600:2c71:1b79:d06d:5032]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id 3F800299; Mon, 29 Jun 2020 17:14:22 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1593443664; bh=hakLbbDlnyNZGsnHzZIbnjRyPI+c1jtPXJjxk2lb5ds=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Yyh7FBdTCOeMeoN/Kpt+UwVONYV8J32Y1qIWQaTMFX0VbcykPTZ7wNXL/1HhmA3Y9 1YPy+I9Tsy8G+bwn5bG1Q5ayaaa3EIY6u8rznJTBBMRMOjK0NCVoDDlQH8rs0l+LUi 5gp0Jq8IG/awPNxGEDEhQkAZlGkdxe/WkJGRBzYA= From: Paul Elder To: libcamera-devel@lists.libcamera.org Date: Tue, 30 Jun 2020 00:14:06 +0900 Message-Id: <20200629151411.216477-2-paul.elder@ideasonboard.com> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20200629151411.216477-1-paul.elder@ideasonboard.com> References: <20200629151411.216477-1-paul.elder@ideasonboard.com> MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH 1/6] libcamera: formats: Add NV24 and NV42, and reorder NV formats 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" Add formats for NV24 and NV42. While at it, reorder the NV formats so that NV12 and NV21 come first, followed by NV16, NV61, NV24, and NV42. Signed-off-by: Paul Elder Reviewed-by: Laurent Pinchart --- src/libcamera/formats.cpp | 36 ++++++++++++++++++++++++++---------- 1 file changed, 26 insertions(+), 10 deletions(-) diff --git a/src/libcamera/formats.cpp b/src/libcamera/formats.cpp index 436672e..d3b722c 100644 --- a/src/libcamera/formats.cpp +++ b/src/libcamera/formats.cpp @@ -256,6 +256,22 @@ const std::map pixelFormatInfo{ } }, /* YUV planar formats. */ + { formats::NV12, { + .name = "NV12", + .format = formats::NV12, + .v4l2Format = V4L2PixelFormat(V4L2_PIX_FMT_NV12), + .bitsPerPixel = 12, + .colourEncoding = PixelFormatInfo::ColourEncodingYUV, + .packed = false, + } }, + { formats::NV21, { + .name = "NV21", + .format = formats::NV21, + .v4l2Format = V4L2PixelFormat(V4L2_PIX_FMT_NV21), + .bitsPerPixel = 12, + .colourEncoding = PixelFormatInfo::ColourEncodingYUV, + .packed = false, + } }, { formats::NV16, { .name = "NV16", .format = formats::NV16, @@ -272,19 +288,19 @@ const std::map pixelFormatInfo{ .colourEncoding = PixelFormatInfo::ColourEncodingYUV, .packed = false, } }, - { formats::NV12, { - .name = "NV12", - .format = formats::NV12, - .v4l2Format = V4L2PixelFormat(V4L2_PIX_FMT_NV12), - .bitsPerPixel = 12, + { formats::NV24, { + .name = "NV24", + .format = formats::NV24, + .v4l2Format = V4L2PixelFormat(V4L2_PIX_FMT_NV24), + .bitsPerPixel = 24, .colourEncoding = PixelFormatInfo::ColourEncodingYUV, .packed = false, } }, - { formats::NV21, { - .name = "NV21", - .format = formats::NV21, - .v4l2Format = V4L2PixelFormat(V4L2_PIX_FMT_NV21), - .bitsPerPixel = 12, + { formats::NV42, { + .name = "NV42", + .format = formats::NV42, + .v4l2Format = V4L2PixelFormat(V4L2_PIX_FMT_NV42), + .bitsPerPixel = 24, .colourEncoding = PixelFormatInfo::ColourEncodingYUV, .packed = false, } },