From patchwork Fri Jul 15 13:50:07 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jacopo Mondi X-Patchwork-Id: 16645 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 7B842C3274 for ; Fri, 15 Jul 2022 13:50:31 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 4329D63325; Fri, 15 Jul 2022 15:50:31 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org; s=mail; t=1657893031; bh=aRjSCXAQuNkdIKSUN+wY1r4RD2HhNObZ04hzesEBcgI=; h=To:Date:In-Reply-To:References:Subject:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:Cc: From; b=Q5P7GugKxcDyYVX/LHy204EFtCPgHDoETmaqe9hJ3GeyFzuPGoFY2NnUQ7keexTJr AVzxtl9eYGs/f1DP39dkQV1VCKzssxNEAsgt3DKdgQxJoSH5NL/A1heovbzz2Upc1a LlSE5bmuWqFsaKNJe4DwVNkYO9sSxnAkA3aFaO8AAxD0xREuwX3dF+8TggyjxQTPXH 084Lfzp62v7HFy5WO2oBBXObS2OwN/QIwK9fQk608P3UjIEtf3VnusaZtNS48/+T6T SA8kmiCehew8OFNqBvtRrQQbWjgG/cp79L7Cb25d+uPnLdsi8MYZiXf5Wf19ieWP1Q 9S63Otl4x5J6g== Received: from relay3-d.mail.gandi.net (relay3-d.mail.gandi.net [217.70.183.195]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id C25276331A for ; Fri, 15 Jul 2022 15:50:28 +0200 (CEST) Received: (Authenticated sender: jacopo@jmondi.org) by mail.gandi.net (Postfix) with ESMTPSA id 9C91660002; Fri, 15 Jul 2022 13:50:27 +0000 (UTC) To: libcamera-devel@lists.libcamera.org Date: Fri, 15 Jul 2022 15:50:07 +0200 Message-Id: <20220715135007.53574-8-jacopo@jmondi.org> X-Mailer: git-send-email 2.36.1 In-Reply-To: <20220715135007.53574-1-jacopo@jmondi.org> References: <20220715135007.53574-1-jacopo@jmondi.org> MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH 7/7] libcamera: formats: Map V4L2_PIX_FMT_JPEG to formats::MJPEG 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-Patchwork-Original-From: Jacopo Mondi via libcamera-devel From: Jacopo Mondi Reply-To: Jacopo Mondi Cc: jozef@mlich.cz, Pavel Machek Errors-To: libcamera-devel-bounces@lists.libcamera.org Sender: "libcamera-devel" The V4L2_PIX_FMT_JPEG and V4L2_PIX_FMT_MJPEG formats are under-specified and are used interchangeably by kernel drivers. Map both of them to formats::MJPEG and use the newly re-introduced V4L2VideoDevice::toV4L2PixelFormat() to map to the one actually used by the video device. Signed-off-by: Jacopo Mondi --- src/libcamera/formats.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/libcamera/formats.cpp b/src/libcamera/formats.cpp index 86fc698a0f4e..564ccc1b5a62 100644 --- a/src/libcamera/formats.cpp +++ b/src/libcamera/formats.cpp @@ -948,7 +948,10 @@ const std::map pixelFormatInfo{ .name = "MJPEG", .format = formats::MJPEG, .v4l2Formats = { - .single = { V4L2PixelFormat(V4L2_PIX_FMT_MJPEG) }, + .single = { + V4L2PixelFormat(V4L2_PIX_FMT_MJPEG), + V4L2PixelFormat(V4L2_PIX_FMT_JPEG), + }, .multi = { V4L2PixelFormat() }, }, .bitsPerPixel = 0,