{"id":19556,"url":"https://patchwork.libcamera.org/api/1.1/patches/19556/?format=json","web_url":"https://patchwork.libcamera.org/patch/19556/","project":{"id":1,"url":"https://patchwork.libcamera.org/api/1.1/projects/1/?format=json","name":"libcamera","link_name":"libcamera","list_id":"libcamera_core","list_email":"libcamera-devel@lists.libcamera.org","web_url":"","scm_url":"","webscm_url":""},"msgid":"<20240227140953.26093-6-laurent.pinchart@ideasonboard.com>","date":"2024-02-27T14:09:49","name":"[5/9] libcamera: v4l2_subdevice: Drop V4L2SubdeviceFormat::bitsPerPixel()","commit_ref":null,"pull_url":null,"state":"accepted","archived":false,"hash":"940535e55bfad49cca98f3ab2c5dbbf6334b5cc0","submitter":{"id":2,"url":"https://patchwork.libcamera.org/api/1.1/people/2/?format=json","name":"Laurent Pinchart","email":"laurent.pinchart@ideasonboard.com"},"delegate":null,"mbox":"https://patchwork.libcamera.org/patch/19556/mbox/","series":[{"id":4189,"url":"https://patchwork.libcamera.org/api/1.1/series/4189/?format=json","web_url":"https://patchwork.libcamera.org/project/libcamera/list/?series=4189","date":"2024-02-27T14:09:44","name":"libcamera: v4l2_subdevice: Prepare for embedded data support","version":1,"mbox":"https://patchwork.libcamera.org/series/4189/mbox/"}],"comments":"https://patchwork.libcamera.org/api/patches/19556/comments/","check":"pending","checks":"https://patchwork.libcamera.org/api/patches/19556/checks/","tags":{},"headers":{"Return-Path":"<libcamera-devel-bounces@lists.libcamera.org>","X-Original-To":"parsemail@patchwork.libcamera.org","Delivered-To":"parsemail@patchwork.libcamera.org","Received":["from lancelot.ideasonboard.com (lancelot.ideasonboard.com\n\t[92.243.16.209])\n\tby patchwork.libcamera.org (Postfix) with ESMTPS id F3484C3264\n\tfor <parsemail@patchwork.libcamera.org>;\n\tTue, 27 Feb 2024 14:10:01 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id AF5AC6291F;\n\tTue, 27 Feb 2024 15:10:01 +0100 (CET)","from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[213.167.242.64])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 2B6DC6285F\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tTue, 27 Feb 2024 15:09:58 +0100 (CET)","from pendragon.ideasonboard.com (89-27-53-110.bb.dnainternet.fi\n\t[89.27.53.110])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id E71759CE\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tTue, 27 Feb 2024 15:09:45 +0100 (CET)"],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (1024-bit key;\n\tunprotected) header.d=ideasonboard.com header.i=@ideasonboard.com\n\theader.b=\"fkmYSqM9\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1709042986;\n\tbh=bZVF+rwfoH51KLCKAHoK7amt2U7foeTYCTW3XevjWkw=;\n\th=From:To:Subject:Date:In-Reply-To:References:From;\n\tb=fkmYSqM9MjGMJ3PGL+pPBeVBUfRiCLcQOsZn06Q8UYyohps8N5WuKmZPY1CkBIk6i\n\tZ8FYFuLsx4rkyT9slo1zuf/+f1M5e5aqu5WePn60eUo6mjOvUusvbJwkwxk0EMx+lw\n\tMAU3dszPKBsKS3vdmS4XWsnD57U3Wwu0XTWID+Kk=","From":"Laurent Pinchart <laurent.pinchart@ideasonboard.com>","To":"libcamera-devel@lists.libcamera.org","Subject":"[PATCH 5/9] libcamera: v4l2_subdevice: Drop\n\tV4L2SubdeviceFormat::bitsPerPixel()","Date":"Tue, 27 Feb 2024 16:09:49 +0200","Message-ID":"<20240227140953.26093-6-laurent.pinchart@ideasonboard.com>","X-Mailer":"git-send-email 2.43.0","In-Reply-To":"<20240227140953.26093-1-laurent.pinchart@ideasonboard.com>","References":"<20240227140953.26093-1-laurent.pinchart@ideasonboard.com>","MIME-Version":"1.0","Content-Transfer-Encoding":"8bit","X-BeenThere":"libcamera-devel@lists.libcamera.org","X-Mailman-Version":"2.1.29","Precedence":"list","List-Id":"<libcamera-devel.lists.libcamera.org>","List-Unsubscribe":"<https://lists.libcamera.org/options/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=unsubscribe>","List-Archive":"<https://lists.libcamera.org/pipermail/libcamera-devel/>","List-Post":"<mailto:libcamera-devel@lists.libcamera.org>","List-Help":"<mailto:libcamera-devel-request@lists.libcamera.org?subject=help>","List-Subscribe":"<https://lists.libcamera.org/listinfo/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=subscribe>","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"},"content":"The V4L2SubdeviceFormat::bitsPerPixel() function is just a wrapper\naround a MediaBusFormatInfo lookup. It made sense when the\nMediaBusFormatInfo class was not exposed outside of the compilation\nunit, but is now redundant. Drop it and use MediaBusFormatInfo in the\nonly caller.\n\nSigned-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\n---\n include/libcamera/internal/v4l2_subdevice.h |  1 -\n src/libcamera/camera_sensor.cpp             |  3 ++-\n src/libcamera/v4l2_subdevice.cpp            | 10 ----------\n 3 files changed, 2 insertions(+), 12 deletions(-)","diff":"diff --git a/include/libcamera/internal/v4l2_subdevice.h b/include/libcamera/internal/v4l2_subdevice.h\nindex c9aa90e00ec8..a87981341d75 100644\n--- a/include/libcamera/internal/v4l2_subdevice.h\n+++ b/include/libcamera/internal/v4l2_subdevice.h\n@@ -66,7 +66,6 @@ struct V4L2SubdeviceFormat {\n \tstd::optional<ColorSpace> colorSpace;\n \n \tconst std::string toString() const;\n-\tuint8_t bitsPerPixel() const;\n };\n \n std::ostream &operator<<(std::ostream &out, const V4L2SubdeviceFormat &f);\ndiff --git a/src/libcamera/camera_sensor.cpp b/src/libcamera/camera_sensor.cpp\nindex 0ef78d9c8b0a..55c9c74b10c2 100644\n--- a/src/libcamera/camera_sensor.cpp\n+++ b/src/libcamera/camera_sensor.cpp\n@@ -1060,7 +1060,8 @@ int CameraSensor::sensorInfo(IPACameraSensorInfo *info) const\n \tret = subdev_->getFormat(pad_, &format);\n \tif (ret)\n \t\treturn ret;\n-\tinfo->bitsPerPixel = format.bitsPerPixel();\n+\n+\tinfo->bitsPerPixel = MediaBusFormatInfo::info(format.mbus_code).bitsPerPixel;\n \tinfo->outputSize = format.size;\n \n \tstd::optional<int32_t> cfa = properties_.get(properties::draft::ColorFilterArrangement);\ndiff --git a/src/libcamera/v4l2_subdevice.cpp b/src/libcamera/v4l2_subdevice.cpp\nindex a535bf63c332..d48d12f26042 100644\n--- a/src/libcamera/v4l2_subdevice.cpp\n+++ b/src/libcamera/v4l2_subdevice.cpp\n@@ -765,16 +765,6 @@ const std::string V4L2SubdeviceFormat::toString() const\n \treturn ss.str();\n }\n \n-/**\n- * \\brief Retrieve the number of bits per pixel for the V4L2 subdevice format\n- * \\return The number of bits per pixel for the format, or 0 if the format is\n- * not supported\n- */\n-uint8_t V4L2SubdeviceFormat::bitsPerPixel() const\n-{\n-\treturn MediaBusFormatInfo::info(mbus_code).bitsPerPixel;\n-}\n-\n /**\n  * \\brief Insert a text representation of a V4L2SubdeviceFormat into an output\n  * stream\n","prefixes":["5/9"]}