From patchwork Fri Aug 30 15:27:09 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Milan Zamazal X-Patchwork-Id: 21116 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 1604AC32D9 for ; Fri, 30 Aug 2024 15:28:08 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 30AF9634ED; Fri, 30 Aug 2024 17:28:07 +0200 (CEST) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (1024-bit key; unprotected) header.d=redhat.com header.i=@redhat.com header.b="hsc8W9ef"; dkim-atps=neutral Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id C483D63471 for ; Fri, 30 Aug 2024 17:27:53 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1725031672; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=Oamet7IwBoNlXGKxprtbvcgZm97rhUZjtxLNc/Ss54U=; b=hsc8W9effnyhB7zHzGhhOFpSVDICLbjGLpvzdVzeeJlz2ztqvO0dXUKuRIfoLX6v1mGPSB 6jo9WH9uAA+3bQFH9pShCHuJoUhYXsFvInZKWKPmqnMBA3ERtSe4krPu5z/d6AGVa6E/5c BhDy5XrvUZo3c4GTvDcQe+wCwFR6wOU= Received: from mx-prod-mc-04.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-335-iPTWJ3O0PeeDtTVbGbL4SA-1; Fri, 30 Aug 2024 11:27:49 -0400 X-MC-Unique: iPTWJ3O0PeeDtTVbGbL4SA-1 Received: from mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.17]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-04.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 827611955D4F for ; Fri, 30 Aug 2024 15:27:48 +0000 (UTC) Received: from nuthatch.redhat.com (unknown [10.45.225.65]) by mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id C4E011956048; Fri, 30 Aug 2024 15:27:46 +0000 (UTC) From: Milan Zamazal To: libcamera-devel@lists.libcamera.org Cc: Milan Zamazal Subject: [PATCH v2 12/20] libcamera: v4l2_subdevice: Formatting improvements Date: Fri, 30 Aug 2024 17:27:09 +0200 Message-ID: <20240830152721.1420313-13-mzamazal@redhat.com> In-Reply-To: <20240830152721.1420313-1-mzamazal@redhat.com> References: <20240830152721.1420313-1-mzamazal@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.0 on 10.30.177.17 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com 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: , Errors-To: libcamera-devel-bounces@lists.libcamera.org Sender: "libcamera-devel" The LSP autoformatter doesn't like some of the current formatting, let's make it happy. In v4l2_subdevice.cpp, this causes larger changes, extracted to a separate patch. Signed-off-by: Milan Zamazal --- src/libcamera/v4l2_subdevice.cpp | 1306 ++++++++++++++++-------------- 1 file changed, 693 insertions(+), 613 deletions(-) diff --git a/src/libcamera/v4l2_subdevice.cpp b/src/libcamera/v4l2_subdevice.cpp index 9f2ec479..38b448dc 100644 --- a/src/libcamera/v4l2_subdevice.cpp +++ b/src/libcamera/v4l2_subdevice.cpp @@ -90,616 +90,695 @@ namespace { const std::map mediaBusFormatInfo{ /* This table is sorted to match the order in linux/media-bus-format.h */ - { MEDIA_BUS_FMT_RGB444_2X8_PADHI_BE, { - .name = "RGB444_2X8_PADHI_BE", - .code = MEDIA_BUS_FMT_RGB444_2X8_PADHI_BE, - .type = MediaBusFormatInfo::Type::Image, - .bitsPerPixel = 16, - .colourEncoding = PixelFormatInfo::ColourEncodingRGB, - } }, - { MEDIA_BUS_FMT_RGB444_2X8_PADHI_LE, { - .name = "RGB444_2X8_PADHI_LE", - .code = MEDIA_BUS_FMT_RGB444_2X8_PADHI_LE, - .type = MediaBusFormatInfo::Type::Image, - .bitsPerPixel = 16, - .colourEncoding = PixelFormatInfo::ColourEncodingRGB, - } }, - { MEDIA_BUS_FMT_RGB555_2X8_PADHI_BE, { - .name = "RGB555_2X8_PADHI_BE", - .code = MEDIA_BUS_FMT_RGB555_2X8_PADHI_BE, - .type = MediaBusFormatInfo::Type::Image, - .bitsPerPixel = 16, - .colourEncoding = PixelFormatInfo::ColourEncodingRGB, - } }, - { MEDIA_BUS_FMT_RGB555_2X8_PADHI_LE, { - .name = "RGB555_2X8_PADHI_LE", - .code = MEDIA_BUS_FMT_RGB555_2X8_PADHI_LE, - .type = MediaBusFormatInfo::Type::Image, - .bitsPerPixel = 16, - .colourEncoding = PixelFormatInfo::ColourEncodingRGB, - } }, - { MEDIA_BUS_FMT_RGB565_1X16, { - .name = "RGB565_1X16", - .code = MEDIA_BUS_FMT_RGB565_1X16, - .type = MediaBusFormatInfo::Type::Image, - .bitsPerPixel = 16, - .colourEncoding = PixelFormatInfo::ColourEncodingRGB, - } }, - { MEDIA_BUS_FMT_BGR565_2X8_BE, { - .name = "BGR565_2X8_BE", - .code = MEDIA_BUS_FMT_BGR565_2X8_BE, - .type = MediaBusFormatInfo::Type::Image, - .bitsPerPixel = 16, - .colourEncoding = PixelFormatInfo::ColourEncodingRGB, - } }, - { MEDIA_BUS_FMT_BGR565_2X8_LE, { - .name = "BGR565_2X8_LE", - .code = MEDIA_BUS_FMT_BGR565_2X8_LE, - .type = MediaBusFormatInfo::Type::Image, - .bitsPerPixel = 16, - .colourEncoding = PixelFormatInfo::ColourEncodingRGB, - } }, - { MEDIA_BUS_FMT_RGB565_2X8_BE, { - .name = "RGB565_2X8_BE", - .code = MEDIA_BUS_FMT_RGB565_2X8_BE, - .type = MediaBusFormatInfo::Type::Image, - .bitsPerPixel = 16, - .colourEncoding = PixelFormatInfo::ColourEncodingRGB, - } }, - { MEDIA_BUS_FMT_RGB565_2X8_LE, { - .name = "RGB565_2X8_LE", - .code = MEDIA_BUS_FMT_RGB565_2X8_LE, - .type = MediaBusFormatInfo::Type::Image, - .bitsPerPixel = 16, - .colourEncoding = PixelFormatInfo::ColourEncodingRGB, - } }, - { MEDIA_BUS_FMT_RGB666_1X18, { - .name = "RGB666_1X18", - .code = MEDIA_BUS_FMT_RGB666_1X18, - .type = MediaBusFormatInfo::Type::Image, - .bitsPerPixel = 18, - .colourEncoding = PixelFormatInfo::ColourEncodingRGB, - } }, - { MEDIA_BUS_FMT_BGR888_1X24, { - .name = "BGR888_1X24", - .code = MEDIA_BUS_FMT_BGR888_1X24, - .type = MediaBusFormatInfo::Type::Image, - .bitsPerPixel = 24, - .colourEncoding = PixelFormatInfo::ColourEncodingRGB, - } }, - { MEDIA_BUS_FMT_RGB888_1X24, { - .name = "RGB888_1X24", - .code = MEDIA_BUS_FMT_RGB888_1X24, - .type = MediaBusFormatInfo::Type::Image, - .bitsPerPixel = 24, - .colourEncoding = PixelFormatInfo::ColourEncodingRGB, - } }, - { MEDIA_BUS_FMT_RGB888_2X12_BE, { - .name = "RGB888_2X12_BE", - .code = MEDIA_BUS_FMT_RGB888_2X12_BE, - .type = MediaBusFormatInfo::Type::Image, - .bitsPerPixel = 24, - .colourEncoding = PixelFormatInfo::ColourEncodingRGB, - } }, - { MEDIA_BUS_FMT_RGB888_2X12_LE, { - .name = "RGB888_2X12_LE", - .code = MEDIA_BUS_FMT_RGB888_2X12_LE, - .type = MediaBusFormatInfo::Type::Image, - .bitsPerPixel = 24, - .colourEncoding = PixelFormatInfo::ColourEncodingRGB, - } }, - { MEDIA_BUS_FMT_ARGB8888_1X32, { - .name = "ARGB8888_1X32", - .code = MEDIA_BUS_FMT_ARGB8888_1X32, - .type = MediaBusFormatInfo::Type::Image, - .bitsPerPixel = 32, - .colourEncoding = PixelFormatInfo::ColourEncodingRGB, - } }, - { MEDIA_BUS_FMT_Y8_1X8, { - .name = "Y8_1X8", - .code = MEDIA_BUS_FMT_Y8_1X8, - .type = MediaBusFormatInfo::Type::Image, - .bitsPerPixel = 8, - .colourEncoding = PixelFormatInfo::ColourEncodingYUV, - } }, - { MEDIA_BUS_FMT_UV8_1X8, { - .name = "UV8_1X8", - .code = MEDIA_BUS_FMT_UV8_1X8, - .type = MediaBusFormatInfo::Type::Image, - .bitsPerPixel = 8, - .colourEncoding = PixelFormatInfo::ColourEncodingYUV, - } }, - { MEDIA_BUS_FMT_UYVY8_1_5X8, { - .name = "UYVY8_1_5X8", - .code = MEDIA_BUS_FMT_UYVY8_1_5X8, - .type = MediaBusFormatInfo::Type::Image, - .bitsPerPixel = 12, - .colourEncoding = PixelFormatInfo::ColourEncodingYUV, - } }, - { MEDIA_BUS_FMT_VYUY8_1_5X8, { - .name = "VYUY8_1_5X8", - .code = MEDIA_BUS_FMT_VYUY8_1_5X8, - .type = MediaBusFormatInfo::Type::Image, - .bitsPerPixel = 12, - .colourEncoding = PixelFormatInfo::ColourEncodingYUV, - } }, - { MEDIA_BUS_FMT_YUYV8_1_5X8, { - .name = "YUYV8_1_5X8", - .code = MEDIA_BUS_FMT_YUYV8_1_5X8, - .type = MediaBusFormatInfo::Type::Image, - .bitsPerPixel = 12, - .colourEncoding = PixelFormatInfo::ColourEncodingYUV, - } }, - { MEDIA_BUS_FMT_YVYU8_1_5X8, { - .name = "YVYU8_1_5X8", - .code = MEDIA_BUS_FMT_YVYU8_1_5X8, - .type = MediaBusFormatInfo::Type::Image, - .bitsPerPixel = 12, - .colourEncoding = PixelFormatInfo::ColourEncodingYUV, - } }, - { MEDIA_BUS_FMT_UYVY8_2X8, { - .name = "UYVY8_2X8", - .code = MEDIA_BUS_FMT_UYVY8_2X8, - .type = MediaBusFormatInfo::Type::Image, - .bitsPerPixel = 16, - .colourEncoding = PixelFormatInfo::ColourEncodingYUV, - } }, - { MEDIA_BUS_FMT_VYUY8_2X8, { - .name = "VYUY8_2X8", - .code = MEDIA_BUS_FMT_VYUY8_2X8, - .type = MediaBusFormatInfo::Type::Image, - .bitsPerPixel = 16, - .colourEncoding = PixelFormatInfo::ColourEncodingYUV, - } }, - { MEDIA_BUS_FMT_YUYV8_2X8, { - .name = "YUYV8_2X8", - .code = MEDIA_BUS_FMT_YUYV8_2X8, - .type = MediaBusFormatInfo::Type::Image, - .bitsPerPixel = 16, - .colourEncoding = PixelFormatInfo::ColourEncodingYUV, - } }, - { MEDIA_BUS_FMT_YVYU8_2X8, { - .name = "YVYU8_2X8", - .code = MEDIA_BUS_FMT_YVYU8_2X8, - .type = MediaBusFormatInfo::Type::Image, - .bitsPerPixel = 16, - .colourEncoding = PixelFormatInfo::ColourEncodingYUV, - } }, - { MEDIA_BUS_FMT_Y10_1X10, { - .name = "Y10_1X10", - .code = MEDIA_BUS_FMT_Y10_1X10, - .type = MediaBusFormatInfo::Type::Image, - .bitsPerPixel = 10, - .colourEncoding = PixelFormatInfo::ColourEncodingYUV, - } }, - { MEDIA_BUS_FMT_UYVY10_2X10, { - .name = "UYVY10_2X10", - .code = MEDIA_BUS_FMT_UYVY10_2X10, - .type = MediaBusFormatInfo::Type::Image, - .bitsPerPixel = 20, - .colourEncoding = PixelFormatInfo::ColourEncodingYUV, - } }, - { MEDIA_BUS_FMT_VYUY10_2X10, { - .name = "VYUY10_2X10", - .code = MEDIA_BUS_FMT_VYUY10_2X10, - .type = MediaBusFormatInfo::Type::Image, - .bitsPerPixel = 20, - .colourEncoding = PixelFormatInfo::ColourEncodingYUV, - } }, - { MEDIA_BUS_FMT_YUYV10_2X10, { - .name = "YUYV10_2X10", - .code = MEDIA_BUS_FMT_YUYV10_2X10, - .type = MediaBusFormatInfo::Type::Image, - .bitsPerPixel = 20, - .colourEncoding = PixelFormatInfo::ColourEncodingYUV, - } }, - { MEDIA_BUS_FMT_YVYU10_2X10, { - .name = "YVYU10_2X10", - .code = MEDIA_BUS_FMT_YVYU10_2X10, - .type = MediaBusFormatInfo::Type::Image, - .bitsPerPixel = 20, - .colourEncoding = PixelFormatInfo::ColourEncodingYUV, - } }, - { MEDIA_BUS_FMT_Y12_1X12, { - .name = "Y12_1X12", - .code = MEDIA_BUS_FMT_Y12_1X12, - .type = MediaBusFormatInfo::Type::Image, - .bitsPerPixel = 12, - .colourEncoding = PixelFormatInfo::ColourEncodingYUV, - } }, - { MEDIA_BUS_FMT_Y16_1X16, { - .name = "Y16_1X16", - .code = MEDIA_BUS_FMT_Y16_1X16, - .type = MediaBusFormatInfo::Type::Image, - .bitsPerPixel = 16, - .colourEncoding = PixelFormatInfo::ColourEncodingYUV, - } }, - { MEDIA_BUS_FMT_UYVY8_1X16, { - .name = "UYVY8_1X16", - .code = MEDIA_BUS_FMT_UYVY8_1X16, - .type = MediaBusFormatInfo::Type::Image, - .bitsPerPixel = 16, - .colourEncoding = PixelFormatInfo::ColourEncodingYUV, - } }, - { MEDIA_BUS_FMT_VYUY8_1X16, { - .name = "VYUY8_1X16", - .code = MEDIA_BUS_FMT_VYUY8_1X16, - .type = MediaBusFormatInfo::Type::Image, - .bitsPerPixel = 16, - .colourEncoding = PixelFormatInfo::ColourEncodingYUV, - } }, - { MEDIA_BUS_FMT_YUYV8_1X16, { - .name = "YUYV8_1X16", - .code = MEDIA_BUS_FMT_YUYV8_1X16, - .type = MediaBusFormatInfo::Type::Image, - .bitsPerPixel = 16, - .colourEncoding = PixelFormatInfo::ColourEncodingYUV, - } }, - { MEDIA_BUS_FMT_YVYU8_1X16, { - .name = "YVYU8_1X16", - .code = MEDIA_BUS_FMT_YVYU8_1X16, - .type = MediaBusFormatInfo::Type::Image, - .bitsPerPixel = 16, - .colourEncoding = PixelFormatInfo::ColourEncodingYUV, - } }, - { MEDIA_BUS_FMT_YDYUYDYV8_1X16, { - .name = "YDYUYDYV8_1X16", - .code = MEDIA_BUS_FMT_YDYUYDYV8_1X16, - .type = MediaBusFormatInfo::Type::Image, - .bitsPerPixel = 16, - .colourEncoding = PixelFormatInfo::ColourEncodingYUV, - } }, - { MEDIA_BUS_FMT_UYVY10_1X20, { - .name = "UYVY10_1X20", - .code = MEDIA_BUS_FMT_UYVY10_1X20, - .type = MediaBusFormatInfo::Type::Image, - .bitsPerPixel = 20, - .colourEncoding = PixelFormatInfo::ColourEncodingYUV, - } }, - { MEDIA_BUS_FMT_VYUY10_1X20, { - .name = "VYUY10_1X20", - .code = MEDIA_BUS_FMT_VYUY10_1X20, - .type = MediaBusFormatInfo::Type::Image, - .bitsPerPixel = 20, - .colourEncoding = PixelFormatInfo::ColourEncodingYUV, - } }, - { MEDIA_BUS_FMT_YUYV10_1X20, { - .name = "YUYV10_1X20", - .code = MEDIA_BUS_FMT_YUYV10_1X20, - .type = MediaBusFormatInfo::Type::Image, - .bitsPerPixel = 20, - .colourEncoding = PixelFormatInfo::ColourEncodingYUV, - } }, - { MEDIA_BUS_FMT_YVYU10_1X20, { - .name = "YVYU10_1X20", - .code = MEDIA_BUS_FMT_YVYU10_1X20, - .type = MediaBusFormatInfo::Type::Image, - .bitsPerPixel = 20, - .colourEncoding = PixelFormatInfo::ColourEncodingYUV, - } }, - { MEDIA_BUS_FMT_YUV8_1X24, { - .name = "YUV8_1X24", - .code = MEDIA_BUS_FMT_YUV8_1X24, - .type = MediaBusFormatInfo::Type::Image, - .bitsPerPixel = 24, - .colourEncoding = PixelFormatInfo::ColourEncodingYUV, - } }, - { MEDIA_BUS_FMT_YUV10_1X30, { - .name = "YUV10_1X30", - .code = MEDIA_BUS_FMT_YUV10_1X30, - .type = MediaBusFormatInfo::Type::Image, - .bitsPerPixel = 30, - .colourEncoding = PixelFormatInfo::ColourEncodingYUV, - } }, - { MEDIA_BUS_FMT_AYUV8_1X32, { - .name = "AYUV8_1X32", - .code = MEDIA_BUS_FMT_AYUV8_1X32, - .type = MediaBusFormatInfo::Type::Image, - .bitsPerPixel = 32, - .colourEncoding = PixelFormatInfo::ColourEncodingYUV, - } }, - { MEDIA_BUS_FMT_UYVY12_2X12, { - .name = "UYVY12_2X12", - .code = MEDIA_BUS_FMT_UYVY12_2X12, - .type = MediaBusFormatInfo::Type::Image, - .bitsPerPixel = 24, - .colourEncoding = PixelFormatInfo::ColourEncodingYUV, - } }, - { MEDIA_BUS_FMT_VYUY12_2X12, { - .name = "VYUY12_2X12", - .code = MEDIA_BUS_FMT_VYUY12_2X12, - .type = MediaBusFormatInfo::Type::Image, - .bitsPerPixel = 24, - .colourEncoding = PixelFormatInfo::ColourEncodingYUV, - } }, - { MEDIA_BUS_FMT_YUYV12_2X12, { - .name = "YUYV12_2X12", - .code = MEDIA_BUS_FMT_YUYV12_2X12, - .type = MediaBusFormatInfo::Type::Image, - .bitsPerPixel = 24, - .colourEncoding = PixelFormatInfo::ColourEncodingYUV, - } }, - { MEDIA_BUS_FMT_YVYU12_2X12, { - .name = "YVYU12_2X12", - .code = MEDIA_BUS_FMT_YVYU12_2X12, - .type = MediaBusFormatInfo::Type::Image, - .bitsPerPixel = 24, - .colourEncoding = PixelFormatInfo::ColourEncodingYUV, - } }, - { MEDIA_BUS_FMT_UYVY12_1X24, { - .name = "UYVY12_1X24", - .code = MEDIA_BUS_FMT_UYVY12_1X24, - .type = MediaBusFormatInfo::Type::Image, - .bitsPerPixel = 24, - .colourEncoding = PixelFormatInfo::ColourEncodingYUV, - } }, - { MEDIA_BUS_FMT_VYUY12_1X24, { - .name = "VYUY12_1X24", - .code = MEDIA_BUS_FMT_VYUY12_1X24, - .type = MediaBusFormatInfo::Type::Image, - .bitsPerPixel = 24, - .colourEncoding = PixelFormatInfo::ColourEncodingYUV, - } }, - { MEDIA_BUS_FMT_YUYV12_1X24, { - .name = "YUYV12_1X24", - .code = MEDIA_BUS_FMT_YUYV12_1X24, - .type = MediaBusFormatInfo::Type::Image, - .bitsPerPixel = 24, - .colourEncoding = PixelFormatInfo::ColourEncodingYUV, - } }, - { MEDIA_BUS_FMT_YVYU12_1X24, { - .name = "YVYU12_1X24", - .code = MEDIA_BUS_FMT_YVYU12_1X24, - .type = MediaBusFormatInfo::Type::Image, - .bitsPerPixel = 24, - .colourEncoding = PixelFormatInfo::ColourEncodingYUV, - } }, - { MEDIA_BUS_FMT_SBGGR8_1X8, { - .name = "SBGGR8_1X8", - .code = MEDIA_BUS_FMT_SBGGR8_1X8, - .type = MediaBusFormatInfo::Type::Image, - .bitsPerPixel = 8, - .colourEncoding = PixelFormatInfo::ColourEncodingRAW, - } }, - { MEDIA_BUS_FMT_SGBRG8_1X8, { - .name = "SGBRG8_1X8", - .code = MEDIA_BUS_FMT_SGBRG8_1X8, - .type = MediaBusFormatInfo::Type::Image, - .bitsPerPixel = 8, - .colourEncoding = PixelFormatInfo::ColourEncodingRAW, - } }, - { MEDIA_BUS_FMT_SGRBG8_1X8, { - .name = "SGRBG8_1X8", - .code = MEDIA_BUS_FMT_SGRBG8_1X8, - .type = MediaBusFormatInfo::Type::Image, - .bitsPerPixel = 8, - .colourEncoding = PixelFormatInfo::ColourEncodingRAW, - } }, - { MEDIA_BUS_FMT_SRGGB8_1X8, { - .name = "SRGGB8_1X8", - .code = MEDIA_BUS_FMT_SRGGB8_1X8, - .type = MediaBusFormatInfo::Type::Image, - .bitsPerPixel = 8, - .colourEncoding = PixelFormatInfo::ColourEncodingRAW, - } }, - { MEDIA_BUS_FMT_SBGGR10_ALAW8_1X8, { - .name = "SBGGR10_ALAW8_1X8", - .code = MEDIA_BUS_FMT_SBGGR10_ALAW8_1X8, - .type = MediaBusFormatInfo::Type::Image, - .bitsPerPixel = 8, - .colourEncoding = PixelFormatInfo::ColourEncodingRAW, - } }, - { MEDIA_BUS_FMT_SGBRG10_ALAW8_1X8, { - .name = "SGBRG10_ALAW8_1X8", - .code = MEDIA_BUS_FMT_SGBRG10_ALAW8_1X8, - .type = MediaBusFormatInfo::Type::Image, - .bitsPerPixel = 8, - .colourEncoding = PixelFormatInfo::ColourEncodingRAW, - } }, - { MEDIA_BUS_FMT_SGRBG10_ALAW8_1X8, { - .name = "SGRBG10_ALAW8_1X8", - .code = MEDIA_BUS_FMT_SGRBG10_ALAW8_1X8, - .type = MediaBusFormatInfo::Type::Image, - .bitsPerPixel = 8, - .colourEncoding = PixelFormatInfo::ColourEncodingRAW, - } }, - { MEDIA_BUS_FMT_SRGGB10_ALAW8_1X8, { - .name = "SRGGB10_ALAW8_1X8", - .code = MEDIA_BUS_FMT_SRGGB10_ALAW8_1X8, - .type = MediaBusFormatInfo::Type::Image, - .bitsPerPixel = 8, - .colourEncoding = PixelFormatInfo::ColourEncodingRAW, - } }, - { MEDIA_BUS_FMT_SBGGR10_DPCM8_1X8, { - .name = "SBGGR10_DPCM8_1X8", - .code = MEDIA_BUS_FMT_SBGGR10_DPCM8_1X8, - .type = MediaBusFormatInfo::Type::Image, - .bitsPerPixel = 8, - .colourEncoding = PixelFormatInfo::ColourEncodingRAW, - } }, - { MEDIA_BUS_FMT_SGBRG10_DPCM8_1X8, { - .name = "SGBRG10_DPCM8_1X8", - .code = MEDIA_BUS_FMT_SGBRG10_DPCM8_1X8, - .type = MediaBusFormatInfo::Type::Image, - .bitsPerPixel = 8, - .colourEncoding = PixelFormatInfo::ColourEncodingRAW, - } }, - { MEDIA_BUS_FMT_SGRBG10_DPCM8_1X8, { - .name = "SGRBG10_DPCM8_1X8", - .code = MEDIA_BUS_FMT_SGRBG10_DPCM8_1X8, - .type = MediaBusFormatInfo::Type::Image, - .bitsPerPixel = 8, - .colourEncoding = PixelFormatInfo::ColourEncodingRAW, - } }, - { MEDIA_BUS_FMT_SRGGB10_DPCM8_1X8, { - .name = "SRGGB10_DPCM8_1X8", - .code = MEDIA_BUS_FMT_SRGGB10_DPCM8_1X8, - .type = MediaBusFormatInfo::Type::Image, - .bitsPerPixel = 8, - .colourEncoding = PixelFormatInfo::ColourEncodingRAW, - } }, - { MEDIA_BUS_FMT_SBGGR10_2X8_PADHI_BE, { - .name = "SBGGR10_2X8_PADHI_BE", - .code = MEDIA_BUS_FMT_SBGGR10_2X8_PADHI_BE, - .type = MediaBusFormatInfo::Type::Image, - .bitsPerPixel = 16, - .colourEncoding = PixelFormatInfo::ColourEncodingRAW, - } }, - { MEDIA_BUS_FMT_SBGGR10_2X8_PADHI_LE, { - .name = "SBGGR10_2X8_PADHI_LE", - .code = MEDIA_BUS_FMT_SBGGR10_2X8_PADHI_LE, - .type = MediaBusFormatInfo::Type::Image, - .bitsPerPixel = 16, - .colourEncoding = PixelFormatInfo::ColourEncodingRAW, - } }, - { MEDIA_BUS_FMT_SBGGR10_2X8_PADLO_BE, { - .name = "SBGGR10_2X8_PADLO_BE", - .code = MEDIA_BUS_FMT_SBGGR10_2X8_PADLO_BE, - .type = MediaBusFormatInfo::Type::Image, - .bitsPerPixel = 16, - .colourEncoding = PixelFormatInfo::ColourEncodingRAW, - } }, - { MEDIA_BUS_FMT_SBGGR10_2X8_PADLO_LE, { - .name = "SBGGR10_2X8_PADLO_LE", - .code = MEDIA_BUS_FMT_SBGGR10_2X8_PADLO_LE, - .type = MediaBusFormatInfo::Type::Image, - .bitsPerPixel = 16, - .colourEncoding = PixelFormatInfo::ColourEncodingRAW, - } }, - { MEDIA_BUS_FMT_SBGGR10_1X10, { - .name = "SBGGR10_1X10", - .code = MEDIA_BUS_FMT_SBGGR10_1X10, - .type = MediaBusFormatInfo::Type::Image, - .bitsPerPixel = 10, - .colourEncoding = PixelFormatInfo::ColourEncodingRAW, - } }, - { MEDIA_BUS_FMT_SGBRG10_1X10, { - .name = "SGBRG10_1X10", - .code = MEDIA_BUS_FMT_SGBRG10_1X10, - .type = MediaBusFormatInfo::Type::Image, - .bitsPerPixel = 10, - .colourEncoding = PixelFormatInfo::ColourEncodingRAW, - } }, - { MEDIA_BUS_FMT_SGRBG10_1X10, { - .name = "SGRBG10_1X10", - .code = MEDIA_BUS_FMT_SGRBG10_1X10, - .type = MediaBusFormatInfo::Type::Image, - .bitsPerPixel = 10, - .colourEncoding = PixelFormatInfo::ColourEncodingRAW, - } }, - { MEDIA_BUS_FMT_SRGGB10_1X10, { - .name = "SRGGB10_1X10", - .code = MEDIA_BUS_FMT_SRGGB10_1X10, - .type = MediaBusFormatInfo::Type::Image, - .bitsPerPixel = 10, - .colourEncoding = PixelFormatInfo::ColourEncodingRAW, - } }, - { MEDIA_BUS_FMT_SBGGR12_1X12, { - .name = "SBGGR12_1X12", - .code = MEDIA_BUS_FMT_SBGGR12_1X12, - .type = MediaBusFormatInfo::Type::Image, - .bitsPerPixel = 12, - .colourEncoding = PixelFormatInfo::ColourEncodingRAW, - } }, - { MEDIA_BUS_FMT_SGBRG12_1X12, { - .name = "SGBRG12_1X12", - .code = MEDIA_BUS_FMT_SGBRG12_1X12, - .type = MediaBusFormatInfo::Type::Image, - .bitsPerPixel = 12, - .colourEncoding = PixelFormatInfo::ColourEncodingRAW, - } }, - { MEDIA_BUS_FMT_SGRBG12_1X12, { - .name = "SGRBG12_1X12", - .code = MEDIA_BUS_FMT_SGRBG12_1X12, - .type = MediaBusFormatInfo::Type::Image, - .bitsPerPixel = 12, - .colourEncoding = PixelFormatInfo::ColourEncodingRAW, - } }, - { MEDIA_BUS_FMT_SRGGB12_1X12, { - .name = "SRGGB12_1X12", - .code = MEDIA_BUS_FMT_SRGGB12_1X12, - .type = MediaBusFormatInfo::Type::Image, - .bitsPerPixel = 12, - .colourEncoding = PixelFormatInfo::ColourEncodingRAW, - } }, - { MEDIA_BUS_FMT_SBGGR14_1X14, { - .name = "SBGGR14_1X14", - .code = MEDIA_BUS_FMT_SBGGR14_1X14, - .type = MediaBusFormatInfo::Type::Image, - .bitsPerPixel = 14, - .colourEncoding = PixelFormatInfo::ColourEncodingRAW, - } }, - { MEDIA_BUS_FMT_SGBRG14_1X14, { - .name = "SGBRG14_1X14", - .code = MEDIA_BUS_FMT_SGBRG14_1X14, - .type = MediaBusFormatInfo::Type::Image, - .bitsPerPixel = 14, - .colourEncoding = PixelFormatInfo::ColourEncodingRAW, - } }, - { MEDIA_BUS_FMT_SGRBG14_1X14, { - .name = "SGRBG14_1X14", - .code = MEDIA_BUS_FMT_SGRBG14_1X14, - .type = MediaBusFormatInfo::Type::Image, - .bitsPerPixel = 14, - .colourEncoding = PixelFormatInfo::ColourEncodingRAW, - } }, - { MEDIA_BUS_FMT_SRGGB14_1X14, { - .name = "SRGGB14_1X14", - .code = MEDIA_BUS_FMT_SRGGB14_1X14, - .type = MediaBusFormatInfo::Type::Image, - .bitsPerPixel = 14, - .colourEncoding = PixelFormatInfo::ColourEncodingRAW, - } }, - { MEDIA_BUS_FMT_SBGGR16_1X16, { - .name = "SBGGR16_1X16", - .code = MEDIA_BUS_FMT_SBGGR16_1X16, - .type = MediaBusFormatInfo::Type::Image, - .bitsPerPixel = 16, - .colourEncoding = PixelFormatInfo::ColourEncodingRAW - } }, - { MEDIA_BUS_FMT_SGBRG16_1X16, { - .name = "SGBRG16_1X16", - .code = MEDIA_BUS_FMT_SGBRG16_1X16, - .type = MediaBusFormatInfo::Type::Image, - .bitsPerPixel = 16, - .colourEncoding = PixelFormatInfo::ColourEncodingRAW - } }, - { MEDIA_BUS_FMT_SGRBG16_1X16, { - .name = "SGRBG16_1X16", - .code = MEDIA_BUS_FMT_SGRBG16_1X16, - .type = MediaBusFormatInfo::Type::Image, - .bitsPerPixel = 16, - .colourEncoding = PixelFormatInfo::ColourEncodingRAW - } }, - { MEDIA_BUS_FMT_SRGGB16_1X16, { - .name = "SRGGB16_1X16", - .code = MEDIA_BUS_FMT_SRGGB16_1X16, - .type = MediaBusFormatInfo::Type::Image, - .bitsPerPixel = 16, - .colourEncoding = PixelFormatInfo::ColourEncodingRAW - } }, + { MEDIA_BUS_FMT_RGB444_2X8_PADHI_BE, + { + .name = "RGB444_2X8_PADHI_BE", + .code = MEDIA_BUS_FMT_RGB444_2X8_PADHI_BE, + .type = MediaBusFormatInfo::Type::Image, + .bitsPerPixel = 16, + .colourEncoding = PixelFormatInfo::ColourEncodingRGB, + } }, + { MEDIA_BUS_FMT_RGB444_2X8_PADHI_LE, + { + .name = "RGB444_2X8_PADHI_LE", + .code = MEDIA_BUS_FMT_RGB444_2X8_PADHI_LE, + .type = MediaBusFormatInfo::Type::Image, + .bitsPerPixel = 16, + .colourEncoding = PixelFormatInfo::ColourEncodingRGB, + } }, + { MEDIA_BUS_FMT_RGB555_2X8_PADHI_BE, + { + .name = "RGB555_2X8_PADHI_BE", + .code = MEDIA_BUS_FMT_RGB555_2X8_PADHI_BE, + .type = MediaBusFormatInfo::Type::Image, + .bitsPerPixel = 16, + .colourEncoding = PixelFormatInfo::ColourEncodingRGB, + } }, + { MEDIA_BUS_FMT_RGB555_2X8_PADHI_LE, + { + .name = "RGB555_2X8_PADHI_LE", + .code = MEDIA_BUS_FMT_RGB555_2X8_PADHI_LE, + .type = MediaBusFormatInfo::Type::Image, + .bitsPerPixel = 16, + .colourEncoding = PixelFormatInfo::ColourEncodingRGB, + } }, + { MEDIA_BUS_FMT_RGB565_1X16, + { + .name = "RGB565_1X16", + .code = MEDIA_BUS_FMT_RGB565_1X16, + .type = MediaBusFormatInfo::Type::Image, + .bitsPerPixel = 16, + .colourEncoding = PixelFormatInfo::ColourEncodingRGB, + } }, + { MEDIA_BUS_FMT_BGR565_2X8_BE, + { + .name = "BGR565_2X8_BE", + .code = MEDIA_BUS_FMT_BGR565_2X8_BE, + .type = MediaBusFormatInfo::Type::Image, + .bitsPerPixel = 16, + .colourEncoding = PixelFormatInfo::ColourEncodingRGB, + } }, + { MEDIA_BUS_FMT_BGR565_2X8_LE, + { + .name = "BGR565_2X8_LE", + .code = MEDIA_BUS_FMT_BGR565_2X8_LE, + .type = MediaBusFormatInfo::Type::Image, + .bitsPerPixel = 16, + .colourEncoding = PixelFormatInfo::ColourEncodingRGB, + } }, + { MEDIA_BUS_FMT_RGB565_2X8_BE, + { + .name = "RGB565_2X8_BE", + .code = MEDIA_BUS_FMT_RGB565_2X8_BE, + .type = MediaBusFormatInfo::Type::Image, + .bitsPerPixel = 16, + .colourEncoding = PixelFormatInfo::ColourEncodingRGB, + } }, + { MEDIA_BUS_FMT_RGB565_2X8_LE, + { + .name = "RGB565_2X8_LE", + .code = MEDIA_BUS_FMT_RGB565_2X8_LE, + .type = MediaBusFormatInfo::Type::Image, + .bitsPerPixel = 16, + .colourEncoding = PixelFormatInfo::ColourEncodingRGB, + } }, + { MEDIA_BUS_FMT_RGB666_1X18, + { + .name = "RGB666_1X18", + .code = MEDIA_BUS_FMT_RGB666_1X18, + .type = MediaBusFormatInfo::Type::Image, + .bitsPerPixel = 18, + .colourEncoding = PixelFormatInfo::ColourEncodingRGB, + } }, + { MEDIA_BUS_FMT_BGR888_1X24, + { + .name = "BGR888_1X24", + .code = MEDIA_BUS_FMT_BGR888_1X24, + .type = MediaBusFormatInfo::Type::Image, + .bitsPerPixel = 24, + .colourEncoding = PixelFormatInfo::ColourEncodingRGB, + } }, + { MEDIA_BUS_FMT_RGB888_1X24, + { + .name = "RGB888_1X24", + .code = MEDIA_BUS_FMT_RGB888_1X24, + .type = MediaBusFormatInfo::Type::Image, + .bitsPerPixel = 24, + .colourEncoding = PixelFormatInfo::ColourEncodingRGB, + } }, + { MEDIA_BUS_FMT_RGB888_2X12_BE, + { + .name = "RGB888_2X12_BE", + .code = MEDIA_BUS_FMT_RGB888_2X12_BE, + .type = MediaBusFormatInfo::Type::Image, + .bitsPerPixel = 24, + .colourEncoding = PixelFormatInfo::ColourEncodingRGB, + } }, + { MEDIA_BUS_FMT_RGB888_2X12_LE, + { + .name = "RGB888_2X12_LE", + .code = MEDIA_BUS_FMT_RGB888_2X12_LE, + .type = MediaBusFormatInfo::Type::Image, + .bitsPerPixel = 24, + .colourEncoding = PixelFormatInfo::ColourEncodingRGB, + } }, + { MEDIA_BUS_FMT_ARGB8888_1X32, + { + .name = "ARGB8888_1X32", + .code = MEDIA_BUS_FMT_ARGB8888_1X32, + .type = MediaBusFormatInfo::Type::Image, + .bitsPerPixel = 32, + .colourEncoding = PixelFormatInfo::ColourEncodingRGB, + } }, + { MEDIA_BUS_FMT_Y8_1X8, + { + .name = "Y8_1X8", + .code = MEDIA_BUS_FMT_Y8_1X8, + .type = MediaBusFormatInfo::Type::Image, + .bitsPerPixel = 8, + .colourEncoding = PixelFormatInfo::ColourEncodingYUV, + } }, + { MEDIA_BUS_FMT_UV8_1X8, + { + .name = "UV8_1X8", + .code = MEDIA_BUS_FMT_UV8_1X8, + .type = MediaBusFormatInfo::Type::Image, + .bitsPerPixel = 8, + .colourEncoding = PixelFormatInfo::ColourEncodingYUV, + } }, + { MEDIA_BUS_FMT_UYVY8_1_5X8, + { + .name = "UYVY8_1_5X8", + .code = MEDIA_BUS_FMT_UYVY8_1_5X8, + .type = MediaBusFormatInfo::Type::Image, + .bitsPerPixel = 12, + .colourEncoding = PixelFormatInfo::ColourEncodingYUV, + } }, + { MEDIA_BUS_FMT_VYUY8_1_5X8, + { + .name = "VYUY8_1_5X8", + .code = MEDIA_BUS_FMT_VYUY8_1_5X8, + .type = MediaBusFormatInfo::Type::Image, + .bitsPerPixel = 12, + .colourEncoding = PixelFormatInfo::ColourEncodingYUV, + } }, + { MEDIA_BUS_FMT_YUYV8_1_5X8, + { + .name = "YUYV8_1_5X8", + .code = MEDIA_BUS_FMT_YUYV8_1_5X8, + .type = MediaBusFormatInfo::Type::Image, + .bitsPerPixel = 12, + .colourEncoding = PixelFormatInfo::ColourEncodingYUV, + } }, + { MEDIA_BUS_FMT_YVYU8_1_5X8, + { + .name = "YVYU8_1_5X8", + .code = MEDIA_BUS_FMT_YVYU8_1_5X8, + .type = MediaBusFormatInfo::Type::Image, + .bitsPerPixel = 12, + .colourEncoding = PixelFormatInfo::ColourEncodingYUV, + } }, + { MEDIA_BUS_FMT_UYVY8_2X8, + { + .name = "UYVY8_2X8", + .code = MEDIA_BUS_FMT_UYVY8_2X8, + .type = MediaBusFormatInfo::Type::Image, + .bitsPerPixel = 16, + .colourEncoding = PixelFormatInfo::ColourEncodingYUV, + } }, + { MEDIA_BUS_FMT_VYUY8_2X8, + { + .name = "VYUY8_2X8", + .code = MEDIA_BUS_FMT_VYUY8_2X8, + .type = MediaBusFormatInfo::Type::Image, + .bitsPerPixel = 16, + .colourEncoding = PixelFormatInfo::ColourEncodingYUV, + } }, + { MEDIA_BUS_FMT_YUYV8_2X8, + { + .name = "YUYV8_2X8", + .code = MEDIA_BUS_FMT_YUYV8_2X8, + .type = MediaBusFormatInfo::Type::Image, + .bitsPerPixel = 16, + .colourEncoding = PixelFormatInfo::ColourEncodingYUV, + } }, + { MEDIA_BUS_FMT_YVYU8_2X8, + { + .name = "YVYU8_2X8", + .code = MEDIA_BUS_FMT_YVYU8_2X8, + .type = MediaBusFormatInfo::Type::Image, + .bitsPerPixel = 16, + .colourEncoding = PixelFormatInfo::ColourEncodingYUV, + } }, + { MEDIA_BUS_FMT_Y10_1X10, + { + .name = "Y10_1X10", + .code = MEDIA_BUS_FMT_Y10_1X10, + .type = MediaBusFormatInfo::Type::Image, + .bitsPerPixel = 10, + .colourEncoding = PixelFormatInfo::ColourEncodingYUV, + } }, + { MEDIA_BUS_FMT_UYVY10_2X10, + { + .name = "UYVY10_2X10", + .code = MEDIA_BUS_FMT_UYVY10_2X10, + .type = MediaBusFormatInfo::Type::Image, + .bitsPerPixel = 20, + .colourEncoding = PixelFormatInfo::ColourEncodingYUV, + } }, + { MEDIA_BUS_FMT_VYUY10_2X10, + { + .name = "VYUY10_2X10", + .code = MEDIA_BUS_FMT_VYUY10_2X10, + .type = MediaBusFormatInfo::Type::Image, + .bitsPerPixel = 20, + .colourEncoding = PixelFormatInfo::ColourEncodingYUV, + } }, + { MEDIA_BUS_FMT_YUYV10_2X10, + { + .name = "YUYV10_2X10", + .code = MEDIA_BUS_FMT_YUYV10_2X10, + .type = MediaBusFormatInfo::Type::Image, + .bitsPerPixel = 20, + .colourEncoding = PixelFormatInfo::ColourEncodingYUV, + } }, + { MEDIA_BUS_FMT_YVYU10_2X10, + { + .name = "YVYU10_2X10", + .code = MEDIA_BUS_FMT_YVYU10_2X10, + .type = MediaBusFormatInfo::Type::Image, + .bitsPerPixel = 20, + .colourEncoding = PixelFormatInfo::ColourEncodingYUV, + } }, + { MEDIA_BUS_FMT_Y12_1X12, + { + .name = "Y12_1X12", + .code = MEDIA_BUS_FMT_Y12_1X12, + .type = MediaBusFormatInfo::Type::Image, + .bitsPerPixel = 12, + .colourEncoding = PixelFormatInfo::ColourEncodingYUV, + } }, + { MEDIA_BUS_FMT_Y16_1X16, + { + .name = "Y16_1X16", + .code = MEDIA_BUS_FMT_Y16_1X16, + .type = MediaBusFormatInfo::Type::Image, + .bitsPerPixel = 16, + .colourEncoding = PixelFormatInfo::ColourEncodingYUV, + } }, + { MEDIA_BUS_FMT_UYVY8_1X16, + { + .name = "UYVY8_1X16", + .code = MEDIA_BUS_FMT_UYVY8_1X16, + .type = MediaBusFormatInfo::Type::Image, + .bitsPerPixel = 16, + .colourEncoding = PixelFormatInfo::ColourEncodingYUV, + } }, + { MEDIA_BUS_FMT_VYUY8_1X16, + { + .name = "VYUY8_1X16", + .code = MEDIA_BUS_FMT_VYUY8_1X16, + .type = MediaBusFormatInfo::Type::Image, + .bitsPerPixel = 16, + .colourEncoding = PixelFormatInfo::ColourEncodingYUV, + } }, + { MEDIA_BUS_FMT_YUYV8_1X16, + { + .name = "YUYV8_1X16", + .code = MEDIA_BUS_FMT_YUYV8_1X16, + .type = MediaBusFormatInfo::Type::Image, + .bitsPerPixel = 16, + .colourEncoding = PixelFormatInfo::ColourEncodingYUV, + } }, + { MEDIA_BUS_FMT_YVYU8_1X16, + { + .name = "YVYU8_1X16", + .code = MEDIA_BUS_FMT_YVYU8_1X16, + .type = MediaBusFormatInfo::Type::Image, + .bitsPerPixel = 16, + .colourEncoding = PixelFormatInfo::ColourEncodingYUV, + } }, + { MEDIA_BUS_FMT_YDYUYDYV8_1X16, + { + .name = "YDYUYDYV8_1X16", + .code = MEDIA_BUS_FMT_YDYUYDYV8_1X16, + .type = MediaBusFormatInfo::Type::Image, + .bitsPerPixel = 16, + .colourEncoding = PixelFormatInfo::ColourEncodingYUV, + } }, + { MEDIA_BUS_FMT_UYVY10_1X20, + { + .name = "UYVY10_1X20", + .code = MEDIA_BUS_FMT_UYVY10_1X20, + .type = MediaBusFormatInfo::Type::Image, + .bitsPerPixel = 20, + .colourEncoding = PixelFormatInfo::ColourEncodingYUV, + } }, + { MEDIA_BUS_FMT_VYUY10_1X20, + { + .name = "VYUY10_1X20", + .code = MEDIA_BUS_FMT_VYUY10_1X20, + .type = MediaBusFormatInfo::Type::Image, + .bitsPerPixel = 20, + .colourEncoding = PixelFormatInfo::ColourEncodingYUV, + } }, + { MEDIA_BUS_FMT_YUYV10_1X20, + { + .name = "YUYV10_1X20", + .code = MEDIA_BUS_FMT_YUYV10_1X20, + .type = MediaBusFormatInfo::Type::Image, + .bitsPerPixel = 20, + .colourEncoding = PixelFormatInfo::ColourEncodingYUV, + } }, + { MEDIA_BUS_FMT_YVYU10_1X20, + { + .name = "YVYU10_1X20", + .code = MEDIA_BUS_FMT_YVYU10_1X20, + .type = MediaBusFormatInfo::Type::Image, + .bitsPerPixel = 20, + .colourEncoding = PixelFormatInfo::ColourEncodingYUV, + } }, + { MEDIA_BUS_FMT_YUV8_1X24, + { + .name = "YUV8_1X24", + .code = MEDIA_BUS_FMT_YUV8_1X24, + .type = MediaBusFormatInfo::Type::Image, + .bitsPerPixel = 24, + .colourEncoding = PixelFormatInfo::ColourEncodingYUV, + } }, + { MEDIA_BUS_FMT_YUV10_1X30, + { + .name = "YUV10_1X30", + .code = MEDIA_BUS_FMT_YUV10_1X30, + .type = MediaBusFormatInfo::Type::Image, + .bitsPerPixel = 30, + .colourEncoding = PixelFormatInfo::ColourEncodingYUV, + } }, + { MEDIA_BUS_FMT_AYUV8_1X32, + { + .name = "AYUV8_1X32", + .code = MEDIA_BUS_FMT_AYUV8_1X32, + .type = MediaBusFormatInfo::Type::Image, + .bitsPerPixel = 32, + .colourEncoding = PixelFormatInfo::ColourEncodingYUV, + } }, + { MEDIA_BUS_FMT_UYVY12_2X12, + { + .name = "UYVY12_2X12", + .code = MEDIA_BUS_FMT_UYVY12_2X12, + .type = MediaBusFormatInfo::Type::Image, + .bitsPerPixel = 24, + .colourEncoding = PixelFormatInfo::ColourEncodingYUV, + } }, + { MEDIA_BUS_FMT_VYUY12_2X12, + { + .name = "VYUY12_2X12", + .code = MEDIA_BUS_FMT_VYUY12_2X12, + .type = MediaBusFormatInfo::Type::Image, + .bitsPerPixel = 24, + .colourEncoding = PixelFormatInfo::ColourEncodingYUV, + } }, + { MEDIA_BUS_FMT_YUYV12_2X12, + { + .name = "YUYV12_2X12", + .code = MEDIA_BUS_FMT_YUYV12_2X12, + .type = MediaBusFormatInfo::Type::Image, + .bitsPerPixel = 24, + .colourEncoding = PixelFormatInfo::ColourEncodingYUV, + } }, + { MEDIA_BUS_FMT_YVYU12_2X12, + { + .name = "YVYU12_2X12", + .code = MEDIA_BUS_FMT_YVYU12_2X12, + .type = MediaBusFormatInfo::Type::Image, + .bitsPerPixel = 24, + .colourEncoding = PixelFormatInfo::ColourEncodingYUV, + } }, + { MEDIA_BUS_FMT_UYVY12_1X24, + { + .name = "UYVY12_1X24", + .code = MEDIA_BUS_FMT_UYVY12_1X24, + .type = MediaBusFormatInfo::Type::Image, + .bitsPerPixel = 24, + .colourEncoding = PixelFormatInfo::ColourEncodingYUV, + } }, + { MEDIA_BUS_FMT_VYUY12_1X24, + { + .name = "VYUY12_1X24", + .code = MEDIA_BUS_FMT_VYUY12_1X24, + .type = MediaBusFormatInfo::Type::Image, + .bitsPerPixel = 24, + .colourEncoding = PixelFormatInfo::ColourEncodingYUV, + } }, + { MEDIA_BUS_FMT_YUYV12_1X24, + { + .name = "YUYV12_1X24", + .code = MEDIA_BUS_FMT_YUYV12_1X24, + .type = MediaBusFormatInfo::Type::Image, + .bitsPerPixel = 24, + .colourEncoding = PixelFormatInfo::ColourEncodingYUV, + } }, + { MEDIA_BUS_FMT_YVYU12_1X24, + { + .name = "YVYU12_1X24", + .code = MEDIA_BUS_FMT_YVYU12_1X24, + .type = MediaBusFormatInfo::Type::Image, + .bitsPerPixel = 24, + .colourEncoding = PixelFormatInfo::ColourEncodingYUV, + } }, + { MEDIA_BUS_FMT_SBGGR8_1X8, + { + .name = "SBGGR8_1X8", + .code = MEDIA_BUS_FMT_SBGGR8_1X8, + .type = MediaBusFormatInfo::Type::Image, + .bitsPerPixel = 8, + .colourEncoding = PixelFormatInfo::ColourEncodingRAW, + } }, + { MEDIA_BUS_FMT_SGBRG8_1X8, + { + .name = "SGBRG8_1X8", + .code = MEDIA_BUS_FMT_SGBRG8_1X8, + .type = MediaBusFormatInfo::Type::Image, + .bitsPerPixel = 8, + .colourEncoding = PixelFormatInfo::ColourEncodingRAW, + } }, + { MEDIA_BUS_FMT_SGRBG8_1X8, + { + .name = "SGRBG8_1X8", + .code = MEDIA_BUS_FMT_SGRBG8_1X8, + .type = MediaBusFormatInfo::Type::Image, + .bitsPerPixel = 8, + .colourEncoding = PixelFormatInfo::ColourEncodingRAW, + } }, + { MEDIA_BUS_FMT_SRGGB8_1X8, + { + .name = "SRGGB8_1X8", + .code = MEDIA_BUS_FMT_SRGGB8_1X8, + .type = MediaBusFormatInfo::Type::Image, + .bitsPerPixel = 8, + .colourEncoding = PixelFormatInfo::ColourEncodingRAW, + } }, + { MEDIA_BUS_FMT_SBGGR10_ALAW8_1X8, + { + .name = "SBGGR10_ALAW8_1X8", + .code = MEDIA_BUS_FMT_SBGGR10_ALAW8_1X8, + .type = MediaBusFormatInfo::Type::Image, + .bitsPerPixel = 8, + .colourEncoding = PixelFormatInfo::ColourEncodingRAW, + } }, + { MEDIA_BUS_FMT_SGBRG10_ALAW8_1X8, + { + .name = "SGBRG10_ALAW8_1X8", + .code = MEDIA_BUS_FMT_SGBRG10_ALAW8_1X8, + .type = MediaBusFormatInfo::Type::Image, + .bitsPerPixel = 8, + .colourEncoding = PixelFormatInfo::ColourEncodingRAW, + } }, + { MEDIA_BUS_FMT_SGRBG10_ALAW8_1X8, + { + .name = "SGRBG10_ALAW8_1X8", + .code = MEDIA_BUS_FMT_SGRBG10_ALAW8_1X8, + .type = MediaBusFormatInfo::Type::Image, + .bitsPerPixel = 8, + .colourEncoding = PixelFormatInfo::ColourEncodingRAW, + } }, + { MEDIA_BUS_FMT_SRGGB10_ALAW8_1X8, + { + .name = "SRGGB10_ALAW8_1X8", + .code = MEDIA_BUS_FMT_SRGGB10_ALAW8_1X8, + .type = MediaBusFormatInfo::Type::Image, + .bitsPerPixel = 8, + .colourEncoding = PixelFormatInfo::ColourEncodingRAW, + } }, + { MEDIA_BUS_FMT_SBGGR10_DPCM8_1X8, + { + .name = "SBGGR10_DPCM8_1X8", + .code = MEDIA_BUS_FMT_SBGGR10_DPCM8_1X8, + .type = MediaBusFormatInfo::Type::Image, + .bitsPerPixel = 8, + .colourEncoding = PixelFormatInfo::ColourEncodingRAW, + } }, + { MEDIA_BUS_FMT_SGBRG10_DPCM8_1X8, + { + .name = "SGBRG10_DPCM8_1X8", + .code = MEDIA_BUS_FMT_SGBRG10_DPCM8_1X8, + .type = MediaBusFormatInfo::Type::Image, + .bitsPerPixel = 8, + .colourEncoding = PixelFormatInfo::ColourEncodingRAW, + } }, + { MEDIA_BUS_FMT_SGRBG10_DPCM8_1X8, + { + .name = "SGRBG10_DPCM8_1X8", + .code = MEDIA_BUS_FMT_SGRBG10_DPCM8_1X8, + .type = MediaBusFormatInfo::Type::Image, + .bitsPerPixel = 8, + .colourEncoding = PixelFormatInfo::ColourEncodingRAW, + } }, + { MEDIA_BUS_FMT_SRGGB10_DPCM8_1X8, + { + .name = "SRGGB10_DPCM8_1X8", + .code = MEDIA_BUS_FMT_SRGGB10_DPCM8_1X8, + .type = MediaBusFormatInfo::Type::Image, + .bitsPerPixel = 8, + .colourEncoding = PixelFormatInfo::ColourEncodingRAW, + } }, + { MEDIA_BUS_FMT_SBGGR10_2X8_PADHI_BE, + { + .name = "SBGGR10_2X8_PADHI_BE", + .code = MEDIA_BUS_FMT_SBGGR10_2X8_PADHI_BE, + .type = MediaBusFormatInfo::Type::Image, + .bitsPerPixel = 16, + .colourEncoding = PixelFormatInfo::ColourEncodingRAW, + } }, + { MEDIA_BUS_FMT_SBGGR10_2X8_PADHI_LE, + { + .name = "SBGGR10_2X8_PADHI_LE", + .code = MEDIA_BUS_FMT_SBGGR10_2X8_PADHI_LE, + .type = MediaBusFormatInfo::Type::Image, + .bitsPerPixel = 16, + .colourEncoding = PixelFormatInfo::ColourEncodingRAW, + } }, + { MEDIA_BUS_FMT_SBGGR10_2X8_PADLO_BE, + { + .name = "SBGGR10_2X8_PADLO_BE", + .code = MEDIA_BUS_FMT_SBGGR10_2X8_PADLO_BE, + .type = MediaBusFormatInfo::Type::Image, + .bitsPerPixel = 16, + .colourEncoding = PixelFormatInfo::ColourEncodingRAW, + } }, + { MEDIA_BUS_FMT_SBGGR10_2X8_PADLO_LE, + { + .name = "SBGGR10_2X8_PADLO_LE", + .code = MEDIA_BUS_FMT_SBGGR10_2X8_PADLO_LE, + .type = MediaBusFormatInfo::Type::Image, + .bitsPerPixel = 16, + .colourEncoding = PixelFormatInfo::ColourEncodingRAW, + } }, + { MEDIA_BUS_FMT_SBGGR10_1X10, + { + .name = "SBGGR10_1X10", + .code = MEDIA_BUS_FMT_SBGGR10_1X10, + .type = MediaBusFormatInfo::Type::Image, + .bitsPerPixel = 10, + .colourEncoding = PixelFormatInfo::ColourEncodingRAW, + } }, + { MEDIA_BUS_FMT_SGBRG10_1X10, + { + .name = "SGBRG10_1X10", + .code = MEDIA_BUS_FMT_SGBRG10_1X10, + .type = MediaBusFormatInfo::Type::Image, + .bitsPerPixel = 10, + .colourEncoding = PixelFormatInfo::ColourEncodingRAW, + } }, + { MEDIA_BUS_FMT_SGRBG10_1X10, + { + .name = "SGRBG10_1X10", + .code = MEDIA_BUS_FMT_SGRBG10_1X10, + .type = MediaBusFormatInfo::Type::Image, + .bitsPerPixel = 10, + .colourEncoding = PixelFormatInfo::ColourEncodingRAW, + } }, + { MEDIA_BUS_FMT_SRGGB10_1X10, + { + .name = "SRGGB10_1X10", + .code = MEDIA_BUS_FMT_SRGGB10_1X10, + .type = MediaBusFormatInfo::Type::Image, + .bitsPerPixel = 10, + .colourEncoding = PixelFormatInfo::ColourEncodingRAW, + } }, + { MEDIA_BUS_FMT_SBGGR12_1X12, + { + .name = "SBGGR12_1X12", + .code = MEDIA_BUS_FMT_SBGGR12_1X12, + .type = MediaBusFormatInfo::Type::Image, + .bitsPerPixel = 12, + .colourEncoding = PixelFormatInfo::ColourEncodingRAW, + } }, + { MEDIA_BUS_FMT_SGBRG12_1X12, + { + .name = "SGBRG12_1X12", + .code = MEDIA_BUS_FMT_SGBRG12_1X12, + .type = MediaBusFormatInfo::Type::Image, + .bitsPerPixel = 12, + .colourEncoding = PixelFormatInfo::ColourEncodingRAW, + } }, + { MEDIA_BUS_FMT_SGRBG12_1X12, + { + .name = "SGRBG12_1X12", + .code = MEDIA_BUS_FMT_SGRBG12_1X12, + .type = MediaBusFormatInfo::Type::Image, + .bitsPerPixel = 12, + .colourEncoding = PixelFormatInfo::ColourEncodingRAW, + } }, + { MEDIA_BUS_FMT_SRGGB12_1X12, + { + .name = "SRGGB12_1X12", + .code = MEDIA_BUS_FMT_SRGGB12_1X12, + .type = MediaBusFormatInfo::Type::Image, + .bitsPerPixel = 12, + .colourEncoding = PixelFormatInfo::ColourEncodingRAW, + } }, + { MEDIA_BUS_FMT_SBGGR14_1X14, + { + .name = "SBGGR14_1X14", + .code = MEDIA_BUS_FMT_SBGGR14_1X14, + .type = MediaBusFormatInfo::Type::Image, + .bitsPerPixel = 14, + .colourEncoding = PixelFormatInfo::ColourEncodingRAW, + } }, + { MEDIA_BUS_FMT_SGBRG14_1X14, + { + .name = "SGBRG14_1X14", + .code = MEDIA_BUS_FMT_SGBRG14_1X14, + .type = MediaBusFormatInfo::Type::Image, + .bitsPerPixel = 14, + .colourEncoding = PixelFormatInfo::ColourEncodingRAW, + } }, + { MEDIA_BUS_FMT_SGRBG14_1X14, + { + .name = "SGRBG14_1X14", + .code = MEDIA_BUS_FMT_SGRBG14_1X14, + .type = MediaBusFormatInfo::Type::Image, + .bitsPerPixel = 14, + .colourEncoding = PixelFormatInfo::ColourEncodingRAW, + } }, + { MEDIA_BUS_FMT_SRGGB14_1X14, + { + .name = "SRGGB14_1X14", + .code = MEDIA_BUS_FMT_SRGGB14_1X14, + .type = MediaBusFormatInfo::Type::Image, + .bitsPerPixel = 14, + .colourEncoding = PixelFormatInfo::ColourEncodingRAW, + } }, + { MEDIA_BUS_FMT_SBGGR16_1X16, + { .name = "SBGGR16_1X16", + .code = MEDIA_BUS_FMT_SBGGR16_1X16, + .type = MediaBusFormatInfo::Type::Image, + .bitsPerPixel = 16, + .colourEncoding = PixelFormatInfo::ColourEncodingRAW } }, + { MEDIA_BUS_FMT_SGBRG16_1X16, + { .name = "SGBRG16_1X16", + .code = MEDIA_BUS_FMT_SGBRG16_1X16, + .type = MediaBusFormatInfo::Type::Image, + .bitsPerPixel = 16, + .colourEncoding = PixelFormatInfo::ColourEncodingRAW } }, + { MEDIA_BUS_FMT_SGRBG16_1X16, + { .name = "SGRBG16_1X16", + .code = MEDIA_BUS_FMT_SGRBG16_1X16, + .type = MediaBusFormatInfo::Type::Image, + .bitsPerPixel = 16, + .colourEncoding = PixelFormatInfo::ColourEncodingRAW } }, + { MEDIA_BUS_FMT_SRGGB16_1X16, + { .name = "SRGGB16_1X16", + .code = MEDIA_BUS_FMT_SRGGB16_1X16, + .type = MediaBusFormatInfo::Type::Image, + .bitsPerPixel = 16, + .colourEncoding = PixelFormatInfo::ColourEncodingRAW } }, /* \todo Clarify colour encoding for HSV formats */ - { MEDIA_BUS_FMT_AHSV8888_1X32, { - .name = "AHSV8888_1X32", - .code = MEDIA_BUS_FMT_AHSV8888_1X32, - .type = MediaBusFormatInfo::Type::Image, - .bitsPerPixel = 32, - .colourEncoding = PixelFormatInfo::ColourEncodingRGB, - } }, - { MEDIA_BUS_FMT_JPEG_1X8, { - .name = "JPEG_1X8", - .code = MEDIA_BUS_FMT_JPEG_1X8, - .type = MediaBusFormatInfo::Type::Image, - .bitsPerPixel = 8, - .colourEncoding = PixelFormatInfo::ColourEncodingYUV, - } }, - { MEDIA_BUS_FMT_METADATA_FIXED, { - .name = "METADATA_FIXED", - .code = MEDIA_BUS_FMT_METADATA_FIXED, - .type = MediaBusFormatInfo::Type::Metadata, - .bitsPerPixel = 0, - .colourEncoding = PixelFormatInfo::ColourEncodingRAW, - } }, + { MEDIA_BUS_FMT_AHSV8888_1X32, + { + .name = "AHSV8888_1X32", + .code = MEDIA_BUS_FMT_AHSV8888_1X32, + .type = MediaBusFormatInfo::Type::Image, + .bitsPerPixel = 32, + .colourEncoding = PixelFormatInfo::ColourEncodingRGB, + } }, + { MEDIA_BUS_FMT_JPEG_1X8, + { + .name = "JPEG_1X8", + .code = MEDIA_BUS_FMT_JPEG_1X8, + .type = MediaBusFormatInfo::Type::Image, + .bitsPerPixel = 8, + .colourEncoding = PixelFormatInfo::ColourEncodingYUV, + } }, + { MEDIA_BUS_FMT_METADATA_FIXED, + { + .name = "METADATA_FIXED", + .code = MEDIA_BUS_FMT_METADATA_FIXED, + .type = MediaBusFormatInfo::Type::Metadata, + .bitsPerPixel = 0, + .colourEncoding = PixelFormatInfo::ColourEncodingRAW, + } }, }; } /* namespace */ @@ -1037,7 +1116,8 @@ int V4L2Subdevice::open() /* If the subdev supports streams, enable the streams API. */ if (caps_.hasStreams()) { - struct v4l2_subdev_client_capability clientCaps{}; + struct v4l2_subdev_client_capability clientCaps { + }; clientCaps.capabilities = V4L2_SUBDEV_CLIENT_CAP_STREAMS; ret = ioctl(VIDIOC_SUBDEV_S_CLIENT_CAP, &clientCaps); @@ -1376,8 +1456,8 @@ struct v4l2_subdev_routing_legacy { __u32 reserved[6]; }; -#define VIDIOC_SUBDEV_G_ROUTING_LEGACY _IOWR('V', 38, struct v4l2_subdev_routing_legacy) -#define VIDIOC_SUBDEV_S_ROUTING_LEGACY _IOWR('V', 39, struct v4l2_subdev_routing_legacy) +#define VIDIOC_SUBDEV_G_ROUTING_LEGACY _IOWR('V', 38, struct v4l2_subdev_routing_legacy) +#define VIDIOC_SUBDEV_S_ROUTING_LEGACY _IOWR('V', 39, struct v4l2_subdev_routing_legacy) } /* namespace */ @@ -1665,7 +1745,7 @@ std::vector V4L2Subdevice::enumPadCodes(const Stream &stream) std::vector codes; int ret; - for (unsigned int index = 0; ; index++) { + for (unsigned int index = 0;; index++) { struct v4l2_subdev_mbus_code_enum mbusEnum = {}; mbusEnum.pad = stream.pad; mbusEnum.stream = stream.stream;