From patchwork Sat Jul 23 09:53:29 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jacopo Mondi X-Patchwork-Id: 16746 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 F1E0ABE173 for ; Sat, 23 Jul 2022 09:54:19 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id B363F63313; Sat, 23 Jul 2022 11:54:19 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org; s=mail; t=1658570059; bh=LjB52t49HIdA+C3UCIW3Kz6qybxJwlduNjpfr85aPvw=; 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=FWFRVZ/aQo0p0WDRa4LbLK5ey43jtfkbX9RGTPZvpqwYkreK9zZCnxfRNENRyMGvM NBJtUWWVMloVewK+1GRpNa6YnOfJqielH2tZanFWv0sBdf0C46eHdezv7hhuT91gqy GcfV5dI7eo+Y/FyFFENpklgY2oCavubwASq8VIpi+hlQY7A0JQku9XsdvmF+HOC7+2 FFWrx2JcKR54i6SnrEovycQBXYJ5ZpPNW4SXRzJ9tsMQNiK4HuDt5A1VhP4pBci4Fm /DHUmqficd4p4d620EaYYWjRRHDor/FMKVcqOXKtEjersJz0G80b9vpvUkfLunFjKt Bg93Cs7WvR0Dg== Received: from relay8-d.mail.gandi.net (relay8-d.mail.gandi.net [217.70.183.201]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id D81C26330D for ; Sat, 23 Jul 2022 11:54:18 +0200 (CEST) Received: (Authenticated sender: jacopo@jmondi.org) by mail.gandi.net (Postfix) with ESMTPSA id F3DDB1BF207; Sat, 23 Jul 2022 09:54:15 +0000 (UTC) To: libcamera-devel@lists.libcamera.org Date: Sat, 23 Jul 2022 11:53:29 +0200 Message-Id: <20220723095330.43542-8-jacopo@jmondi.org> X-Mailer: git-send-email 2.37.1 In-Reply-To: <20220723095330.43542-1-jacopo@jmondi.org> References: <20220723095330.43542-1-jacopo@jmondi.org> MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH v2 7/8] 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 Reviewed-by: Laurent Pinchart --- 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,