From patchwork Thu Apr 30 00:52:22 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Laurent Pinchart X-Patchwork-Id: 3620 Return-Path: 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 ECD806041C for ; Thu, 30 Apr 2020 02:52:30 +0200 (CEST) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (1024-bit key; unprotected) header.d=ideasonboard.com header.i=@ideasonboard.com header.b="X+xJ1lc7"; dkim-atps=neutral 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 85ACA503 for ; Thu, 30 Apr 2020 02:52:30 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1588207950; bh=k6jQ0If4SHXimesBpweu9oOHxFJFowfY1ysOYUCf95w=; h=From:To:Subject:Date:From; b=X+xJ1lc7QPhbGgTb25SeEX1L/nUtULic70fOCLHPOZ1Pk1s/hoHlMcGU+YDzYCLcL /X7PPeBFVcHDbv84nHpuKbJ4N3bFWKmJkjyKABmGi6JC2Ous9ESh8SOc4qcnP3pwAC VbNH0pgvRWv3kHrhdOIqrIaMQifhkngrRVDQD6eE= From: Laurent Pinchart To: libcamera-devel@lists.libcamera.org Date: Thu, 30 Apr 2020 03:52:22 +0300 Message-Id: <20200430005226.18162-1-laurent.pinchart@ideasonboard.com> X-Mailer: git-send-email 2.25.3 MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH 0/4] libcamera: Improve conversion between DRM and V4L2 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: , X-List-Received-Date: Thu, 30 Apr 2020 00:52:31 -0000 Hello, This small series improves conversion between DRM and V4L2 formats, to pave the way to adding more format information in the libcamera core. Patch 1/4 starts by moving the V4L2PixelFormat class to a separate file, without modifying the code. Patch 2/4 then moves format conversion from V4L2VideoDevice to V4L2PixelFormat, and patch 3/4 replaces the big switch-case's with std::map. Patch 4/4 finally adds support for MIPI-packed 10-bit Bayer formats. Laurent Pinchart (4): libcamera: v4l2_pixelformat: Move V4L2PixelFormat to a new file libcamera: v4l2_pixelformat: Move DRM/V4L2 format conversion libcamera: v4l2_pixelformat: Use maps to convert between DRM and V4L2 libcamera: v4l2_pixelformat: Add support for 10-bit Bayer formats src/libcamera/include/meson.build | 1 + src/libcamera/include/v4l2_pixelformat.h | 49 ++++ src/libcamera/include/v4l2_videodevice.h | 27 +- src/libcamera/meson.build | 1 + src/libcamera/pipeline/uvcvideo/uvcvideo.cpp | 2 +- src/libcamera/v4l2_pixelformat.cpp | 292 +++++++++++++++++++ src/libcamera/v4l2_videodevice.cpp | 224 +------------- test/libtest/buffer_source.cpp | 4 +- 8 files changed, 349 insertions(+), 251 deletions(-) create mode 100644 src/libcamera/include/v4l2_pixelformat.h create mode 100644 src/libcamera/v4l2_pixelformat.cpp