From patchwork Thu Nov 4 13:57:58 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Plowman X-Patchwork-Id: 14457 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 97907BDB1C for ; Thu, 4 Nov 2021 13:58:25 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id A24976034A; Thu, 4 Nov 2021 14:58:24 +0100 (CET) Authentication-Results: lancelot.ideasonboard.com; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=raspberrypi.com header.i=@raspberrypi.com header.b="ZMTxzb2S"; dkim-atps=neutral Received: from mail-wm1-x32a.google.com (mail-wm1-x32a.google.com [IPv6:2a00:1450:4864:20::32a]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 7959B60128 for ; Thu, 4 Nov 2021 14:58:23 +0100 (CET) Received: by mail-wm1-x32a.google.com with SMTP id z200so4605981wmc.1 for ; Thu, 04 Nov 2021 06:58:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=raspberrypi.com; s=google; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=OGhBopQLmTgCRTw4zwjmL+TmK9CHbij8/zfdvyDPTHg=; b=ZMTxzb2SbhDbPfEn8TMMp3cEqmip6LK0odY3F7zKH3HIm7Z/wLMWiex9UxULzQtpdp Deq0L/iHmLmlME7b4dfuamt2W9VVZne6bguoMLsU670pEeRnDD5LWx0OCUW9kIjYjsn3 TVECEdugjNw/NiuSZgQdSbbzWBDU+PXfKxJk9HsIRBUzWNhjPLxquEZvJhqgQYrLz9br FXIntG/ZvqEborIlvtRvNIFd92eOdqhxxZi/BgX2JDeJv4tHv8WuI5RdP0HYI2AIIZ+k 7wwmBLbojmqzA97Bv8RmHz6IlH5nCl3Q9Qhf2VeUXZZeUGPSLpfSJISc37tlDJ5vRaCl lLNA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=OGhBopQLmTgCRTw4zwjmL+TmK9CHbij8/zfdvyDPTHg=; b=RjHAK/JW4uyWIAEpGsMd/8xGUHfxuIxePvF8V05cazLAoPjTmKOX1JfPxU2p94cCND Z/7/S+3L/mKAHdOm6EpYa+MBVSYDoZ+53QfJ604sVLDktYRFVfDFVooKM8GSDRPoOJPn fa5LNBmodZtSdA4pQs61gFiUpWYulihUPCKCY7BrIsDJHyRLjwi7mOg4IL64QnZcNv78 8H0hj0RjBjWaCy0+Sm4SoPgSMZ2CXTJk/qt6i1IfyBhVxt83g678YuBr3sBsnrpZpj2E Hda9LGlkebOYHbImi3uJ4VtpM5+tsIJks/0RJtExeVALr/+kwnyuD3eN8gUWW96htbbj 6Ijg== X-Gm-Message-State: AOAM533VzTQVfqGl/Oem7vNvITX9yIhvmNKsd9BtUn7qLDmGxtm3/GpP A3PPaXCFKQT7jGzDh+EkLgGEk+UaEvbsnw== X-Google-Smtp-Source: ABdhPJwk3QqcwNdhVYUKDCk1sAdiDkDoZJOCT78CqNhGefKfvwefVbGcArpCDVFTqkdMzY9syAK+YA== X-Received: by 2002:a1c:6a0e:: with SMTP id f14mr22814616wmc.58.1636034302853; Thu, 04 Nov 2021 06:58:22 -0700 (PDT) Received: from pi4-davidp.pitowers.org ([2a00:1098:3142:14:1ce1:9965:4328:89c4]) by smtp.gmail.com with ESMTPSA id i20sm2264736wmq.41.2021.11.04.06.58.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 04 Nov 2021 06:58:22 -0700 (PDT) From: David Plowman To: libcamera-devel@lists.libcamera.org Date: Thu, 4 Nov 2021 13:57:58 +0000 Message-Id: <20211104135805.5269-1-david.plowman@raspberrypi.com> X-Mailer: git-send-email 2.20.1 MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH v5 0/7] Colour spaces 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" Hi again Here's v5, which is different to v4 only in that I've rebased the Raspberry Pi PH changes (the final commit) on top of its recent media-controller-ification. It's not a big change, but things are very slightly different there now. This has shown up one little niggle, which is that the V4L2 subdevice now complains about retrieving an undefined colour space - from the metadata pad! Currently I've left the warning in but added the pad number in the message. The metadata pad is easy to spot in practice because it always has a non-zero pad number. But is there a proper way to know this? Thanks David David Plowman (7): libcamera: Add ColorSpace class libcamera: Add ColorSpace fields to StreamConfiguration libcamera: Convert between ColorSpace class and V4L2 formats libcamera: Support passing ColorSpaces to V4L2 video devices libcamera: Support passing ColorSpaces to V4L2 subdevices libcamera: Add validateColorSpaces to CameraConfiguration class libcamera: pipeline: raspberrypi: Support color spaces include/libcamera/camera.h | 2 + include/libcamera/color_space.h | 88 ++++++ include/libcamera/internal/v4l2_device.h | 7 + include/libcamera/internal/v4l2_subdevice.h | 2 + include/libcamera/internal/v4l2_videodevice.h | 2 + include/libcamera/meson.build | 1 + include/libcamera/stream.h | 4 + src/libcamera/camera.cpp | 51 ++++ src/libcamera/camera_sensor.cpp | 1 + src/libcamera/color_space.cpp | 257 ++++++++++++++++++ src/libcamera/meson.build | 1 + .../pipeline/raspberrypi/raspberrypi.cpp | 42 +++ src/libcamera/stream.cpp | 25 ++ src/libcamera/v4l2_device.cpp | 171 ++++++++++++ src/libcamera/v4l2_subdevice.cpp | 42 ++- src/libcamera/v4l2_videodevice.cpp | 67 ++++- 16 files changed, 758 insertions(+), 5 deletions(-) create mode 100644 include/libcamera/color_space.h create mode 100644 src/libcamera/color_space.cpp