From patchwork Fri Nov 26 10:40:38 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Plowman X-Patchwork-Id: 14796 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 26967BF415 for ; Fri, 26 Nov 2021 10:41:02 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 151FD60546; Fri, 26 Nov 2021 11:41:01 +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="K7/oFw8c"; dkim-atps=neutral Received: from mail-wr1-x431.google.com (mail-wr1-x431.google.com [IPv6:2a00:1450:4864:20::431]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 56889604FA for ; Fri, 26 Nov 2021 11:40:59 +0100 (CET) Received: by mail-wr1-x431.google.com with SMTP id t9so714592wrx.7 for ; Fri, 26 Nov 2021 02:40:59 -0800 (PST) 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=VhDJ3nqxcX4M/X5wppInEIqciPy980+SOMRK9jVKfcw=; b=K7/oFw8c1za4P/7qqnCYUCPG9/cyOrnu24rEfKKOia0+oJYRqvPo2ufYC/qaxi3+VS CDnq1BkvJqKHYxQZq1q6717O7cL//nItDfWUv6oPbDK9RRZHf3hQ1TO8xx5ufu5ZqyDg Qa79DF+ucCaaNmesImsvws2XZpO7Ssy05d0Zf9OREMzWG1ugvr/lPsE2L3pae7oVLnw5 drFCHDhvPwPQErDrbSbwU4RLcPNnxmj/6wVoWdboku0/KqdKZ9MCJ3j0VKUhpaR3XUO9 orqiLv2OIQy6Ym/uohJ+La3EF6SfT3GUB4fxvd3JeQ1qiOl30XyIH/cZRbAMuGdYoCfh nQBA== 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=VhDJ3nqxcX4M/X5wppInEIqciPy980+SOMRK9jVKfcw=; b=eTZSpw45o6MNgTkL2tttvdbNq3AX45S4UZvM2VkP0aVEELxt4XxSXr5vqBr8qdHOsW s/VQmykWDtno7IPaavTfolvGYgUVRQvk3EZ2l1h0J0bcj9ZMkdsux7vUthE62iuBHN+o ymUSptTyUGJvPGgzOihDyzVmtR7BQjgzt8km/Av9EXG94oEY5/2mEOMxYrl0YFFxtreW 33tWFgu5f/BqLXwXmAFXHLwqcsJi0wYEw9tJcQ0AkNcYD0zjafrEsNaIwrtYdFaeI/sV 0hT0LudintDMDEm1bZxNWr5kAui6Tkoi+O2MoOL8kOF5Fo/srNARNmPWDq+L30tp/0JD almw== X-Gm-Message-State: AOAM5338J859utfnm8yl6grMvnAX4xXW0LZWaKE2mqzO1Mdl9IiqNreO XiBX/ZVXtlNGqx88qFmsyqwjpw== X-Google-Smtp-Source: ABdhPJyptTBaWKWfPxNwpNu5NdJ/sKZBbTDCx2j8PZbwPT9O5orJQmhdE3e0BRmIYq2+xAe+J8I1aA== X-Received: by 2002:adf:dc0a:: with SMTP id t10mr13094195wri.8.1637923258984; Fri, 26 Nov 2021 02:40:58 -0800 (PST) Received: from pi4-davidp.pitowers.org ([2a00:1098:3142:14:e4a2:3070:eea4:e434]) by smtp.gmail.com with ESMTPSA id y7sm5106795wrw.55.2021.11.26.02.40.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 26 Nov 2021 02:40:58 -0800 (PST) From: David Plowman To: Laurent Pinchart , Kieran Bingham , Hans Verkuil , Tomasz Figa , Jacopo Mondi , Naushir Patuck , libcamera-devel@lists.libcamera.org Date: Fri, 26 Nov 2021 10:40:38 +0000 Message-Id: <20211126104045.4756-1-david.plowman@raspberrypi.com> X-Mailer: git-send-email 2.30.2 MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH v7 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 everyone Here's version 7 of the colour space patches. Mostly it's just tidying up, improving documentation and making things a bit clearer, so thank you very much for all those suggestions. The other change is that I've decided to leave it up to the caller to check what has happened when you try to set a colour space. As some have pointed out, some pads already don't have colour spaces, and there might be more in future. I think it's only really the pipeline handler that understands this context, so it's best so leave it to the pipeline handler to check. I also decided to leave the to/fromColorSpace methods public. I could imagine a day in the future when a pipeline handler might want to check (for example) that V4L2 understands the ColorSpace it wants to use, and these methods give a handy way to do that. Thanks again for all the reviews so far! Best regards 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 | 72 +++++ 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 | 3 + src/libcamera/camera.cpp | 38 +++ src/libcamera/camera_sensor.cpp | 1 + src/libcamera/color_space.cpp | 305 ++++++++++++++++++ src/libcamera/meson.build | 1 + .../pipeline/raspberrypi/raspberrypi.cpp | 42 +++ src/libcamera/stream.cpp | 19 ++ src/libcamera/v4l2_device.cpp | 192 +++++++++++ src/libcamera/v4l2_subdevice.cpp | 25 +- src/libcamera/v4l2_videodevice.cpp | 32 ++ 16 files changed, 743 insertions(+), 1 deletion(-) create mode 100644 include/libcamera/color_space.h create mode 100644 src/libcamera/color_space.cpp