From patchwork Mon Mar 16 23:46:47 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Laurent Pinchart X-Patchwork-Id: 3128 Return-Path: Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [213.167.242.64]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 41BF26041B for ; Tue, 17 Mar 2020 00:46:59 +0100 (CET) Received: from pendragon.bb.dnainternet.fi (81-175-216-236.bb.dnainternet.fi [81.175.216.236]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id B1463F9 for ; Tue, 17 Mar 2020 00:46:58 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1584402418; bh=BGXr6Rk1S09GNnYBE/56luBziPpo5TqzutdkHPwHSvY=; h=From:To:Subject:Date:From; b=wHOhSUtppt3tzVaaEZTUjCNQ1n1uQBgADxJaqxAir6YH4cwHw1ypZpciU7mgTyScf uLPe5hGw27TbUWKhtGsmxz2tNB5frcbDPAfvvPmcVBNSFN1x4i8qYcob2YsY15beKf jcDrZD8GX2tj5mRH14zmYBbj8pDCuXklnu6gpXyQ= From: Laurent Pinchart To: libcamera-devel@lists.libcamera.org Date: Tue, 17 Mar 2020 01:46:47 +0200 Message-Id: <20200316234649.2545-1-laurent.pinchart@ideasonboard.com> X-Mailer: git-send-email 2.24.1 MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH 0/2] Add a V4L2PixelFormat class 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-List-Received-Date: Mon, 16 Mar 2020 23:46:59 -0000 Hello, This small patch series builds on top of Niklas' PixelFormat work to introduce the V4L2 counterpart of the PixelFormat class. I've experimented with adding an implicit conversion from V4L2PixelFormat to uint32_t, which could possibly be useful for PixelFormat too as an alternate method to retrieve the FourCC. It likely makes sense to provide this for both classes, or for neither of them. A toString() method should be added, with a lookup table of pixel format names. Other helper methods to retrieve format information should probably be added too, hopefully removing some of the data from the pixelFormatInfo array in v4l2_camera_proxy. Ideas on how to split pixel format information and conversion between the PixelFormat, V4L2PixelFormat and V4L2VideoDevice classes are welcome. Laurent Pinchart (2): libcamera: v4l2_videodevice: Add V4L2PixelFormat class libcamera: v4l2_videodevice: Make V4L2PixelFormat constructor explicit src/libcamera/include/v4l2_videodevice.h | 35 ++++-- src/libcamera/pipeline/ipu3/ipu3.cpp | 14 +-- src/libcamera/pipeline/rkisp1/rkisp1.cpp | 4 +- src/libcamera/pipeline/vimc.cpp | 2 +- src/libcamera/v4l2_videodevice.cpp | 104 +++++++++++++----- .../v4l2_videodevice_test.cpp | 2 +- 6 files changed, 113 insertions(+), 48 deletions(-)