{"id":21813,"url":"https://patchwork.libcamera.org/api/1.1/patches/21813/?format=json","web_url":"https://patchwork.libcamera.org/patch/21813/","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":"<20241105105445.1468954-2-chenghaoyang@chromium.org>","date":"2024-11-05T10:49:21","name":"[1/1] libcamera: Add v4l2_subdev_format in V4L2SubdeviceFormat","commit_ref":null,"pull_url":null,"state":"rejected","archived":false,"hash":"0a8e5d09be6785bcbad7ba483c0bd03b96f0dcd1","submitter":{"id":117,"url":"https://patchwork.libcamera.org/api/1.1/people/117/?format=json","name":"Cheng-Hao Yang","email":"chenghaoyang@chromium.org"},"delegate":null,"mbox":"https://patchwork.libcamera.org/patch/21813/mbox/","series":[{"id":4769,"url":"https://patchwork.libcamera.org/api/1.1/series/4769/?format=json","web_url":"https://patchwork.libcamera.org/project/libcamera/list/?series=4769","date":"2024-11-05T10:49:20","name":"Add v4l2_subdev_format in V4L2SubdeviceFormat","version":1,"mbox":"https://patchwork.libcamera.org/series/4769/mbox/"}],"comments":"https://patchwork.libcamera.org/api/patches/21813/comments/","check":"pending","checks":"https://patchwork.libcamera.org/api/patches/21813/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 CF6A3BDB1C\n\tfor <parsemail@patchwork.libcamera.org>;\n\tTue,  5 Nov 2024 10:54:56 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 8CA41653F8;\n\tTue,  5 Nov 2024 11:54:56 +0100 (CET)","from mail-oo1-xc2d.google.com (mail-oo1-xc2d.google.com\n\t[IPv6:2607:f8b0:4864:20::c2d])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id B58DF653F2\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tTue,  5 Nov 2024 11:54:52 +0100 (CET)","by mail-oo1-xc2d.google.com with SMTP id\n\t006d021491bc7-5ebc0e13d25so1841597eaf.1\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tTue, 05 Nov 2024 02:54:52 -0800 (PST)","from chenghaoyang-low.c.googlers.com.com\n\t(27.247.221.35.bc.googleusercontent.com. [35.221.247.27])\n\tby smtp.gmail.com with ESMTPSA id\n\t41be03b00d2f7-7ee45a002d4sm8817612a12.70.2024.11.05.02.54.50\n\t(version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n\tTue, 05 Nov 2024 02:54:50 -0800 (PST)"],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (1024-bit key;\n\tunprotected) header.d=chromium.org header.i=@chromium.org\n\theader.b=\"U3jieQ0G\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=chromium.org; s=google; t=1730804091; x=1731408891;\n\tdarn=lists.libcamera.org; \n\th=content-transfer-encoding:mime-version:references:in-reply-to\n\t:message-id:date:subject:cc:to:from:from:to:cc:subject:date\n\t:message-id:reply-to;\n\tbh=GPNOOB5CqS8CnviVkvudD57XLF0SY3nf9n1KG6svXtA=;\n\tb=U3jieQ0GJI25dSv/RLT+lOeRhWAQWrw/lSUlqydsdFkeiBSdOVrTgXzKnolcQDypNr\n\tKYSeR2Y+SuoI+xQ9zwAZhUnPmOlUYxOKYsAiBGOk+66grmWrwJkrNfQlf4sC0La6WLua\n\tpp53ohBu5KMVuDv4uUvjUJozzDoO+1bcQYdv0=","X-Google-DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20230601; t=1730804091; x=1731408891;\n\th=content-transfer-encoding:mime-version:references:in-reply-to\n\t:message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc\n\t:subject:date:message-id:reply-to;\n\tbh=GPNOOB5CqS8CnviVkvudD57XLF0SY3nf9n1KG6svXtA=;\n\tb=Zz0zUxUAXgfEZwhykbV9GrsWoJMGaPs8r81DgLSPp9RWxcoKpQSxZXiqOtQNBe3z/V\n\tyQa9NCiXPEkcXcFKrEhwoM9N5TPh0+ggP9RcwmP3xHY6+vohYcJ55DcCHXTW2TY3Z5VO\n\tOvPBwqDs+iPAzAMdrCXUU8XNyfGpI0yPaiU8SjWY6vVCxllXypjiSPZWLJo+baQqKtqh\n\tCCw+MRetJKUgnPftUdutvuM8xaE1wdZKa2wKi6a9PVI+sNrozpfch7WocpOU1aSPeOSt\n\tY33aVo3FyW9yHi+qqoBXPnejfIeCw1WWAdnLP5S6tBuMYLj+TF8w5GpVjEdImqcskMLP\n\tNU7w==","X-Gm-Message-State":"AOJu0YyDIvqnuqvTKgnEqHwZ0CdtIebDD3h45vujp7rsfUwGJgD98yvl\n\txORN11MpDfBYz1tt8mkKlHJSVH9ZxeKpaExj1BF3byM6H99bSaRp7WO8S2DjUzBtUATyGUgrgoM\n\t=","X-Google-Smtp-Source":"AGHT+IEEGpVnwBY1rKux5F510y/sG6ZwM8zVF9ztUDaYH8X3GGPegK/fJxkrRVZwD71SZH2yGVuv5g==","X-Received":"by 2002:a05:6820:220e:b0:5e5:d0c8:8030 with SMTP id\n\t006d021491bc7-5ec6db6ce9amr9264321eaf.3.1730804091160; \n\tTue, 05 Nov 2024 02:54:51 -0800 (PST)","From":"Harvey Yang <chenghaoyang@chromium.org>","To":"libcamera-devel@lists.libcamera.org","Cc":"Han-Lin Chen <hanlinchen@chromium.org>,\n\tHarvey Yang <chenghaoyang@chromium.org>","Subject":"[PATCH 1/1] libcamera: Add v4l2_subdev_format in V4L2SubdeviceFormat","Date":"Tue,  5 Nov 2024 10:49:21 +0000","Message-ID":"<20241105105445.1468954-2-chenghaoyang@chromium.org>","X-Mailer":"git-send-email 2.47.0.199.ga7371fff76-goog","In-Reply-To":"<20241105105445.1468954-1-chenghaoyang@chromium.org>","References":"<20241105105445.1468954-1-chenghaoyang@chromium.org>","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":"From: Han-Lin Chen <hanlinchen@chromium.org>\n\nAdd v4l2_subdev_format in V4L2SubdeviceFormat and set the value when\nsetFormat() and getFormat().\n\nSigned-off-by: Han-Lin Chen <hanlinchen@chromium.org>\nCo-developed-by: Harvey Yang <chenghaoyang@chromium.org>\nSigned-off-by: Harvey Yang <chenghaoyang@chromium.org>\n---\n include/libcamera/internal/v4l2_subdevice.h |  2 ++\n src/libcamera/pipeline/simple/simple.cpp    |  2 +-\n src/libcamera/sensor/camera_sensor.cpp      |  1 +\n src/libcamera/v4l2_subdevice.cpp            | 10 ++++++++++\n 4 files changed, 14 insertions(+), 1 deletion(-)","diff":"diff --git a/include/libcamera/internal/v4l2_subdevice.h b/include/libcamera/internal/v4l2_subdevice.h\nindex 194382f84..d81296ee6 100644\n--- a/include/libcamera/internal/v4l2_subdevice.h\n+++ b/include/libcamera/internal/v4l2_subdevice.h\n@@ -66,6 +66,8 @@ struct V4L2SubdeviceFormat {\n \tstd::optional<ColorSpace> colorSpace;\n \n \tconst std::string toString() const;\n+\n+\tstruct v4l2_subdev_format subdevFmt;\n };\n \n std::ostream &operator<<(std::ostream &out, const V4L2SubdeviceFormat &f);\ndiff --git a/src/libcamera/pipeline/simple/simple.cpp b/src/libcamera/pipeline/simple/simple.cpp\nindex 3ddce71d3..6ec055596 100644\n--- a/src/libcamera/pipeline/simple/simple.cpp\n+++ b/src/libcamera/pipeline/simple/simple.cpp\n@@ -1063,7 +1063,7 @@ CameraConfiguration::Status SimpleCameraConfiguration::validate()\n \n \tLOG(SimplePipeline, Debug)\n \t\t<< \"Picked \"\n-\t\t<< V4L2SubdeviceFormat{ pipeConfig_->code, pipeConfig_->sensorSize, {} }\n+\t\t<< V4L2SubdeviceFormat{ pipeConfig_->code, pipeConfig_->sensorSize, {}, {} }\n \t\t<< \" -> \" << pipeConfig_->captureSize\n \t\t<< \"-\" << pipeConfig_->captureFormat\n \t\t<< \" for max stream size \" << maxStreamSize;\ndiff --git a/src/libcamera/sensor/camera_sensor.cpp b/src/libcamera/sensor/camera_sensor.cpp\nindex 1b224f198..ac96b4843 100644\n--- a/src/libcamera/sensor/camera_sensor.cpp\n+++ b/src/libcamera/sensor/camera_sensor.cpp\n@@ -744,6 +744,7 @@ V4L2SubdeviceFormat CameraSensor::getFormat(const std::vector<unsigned int> &mbu\n \t\t.code = bestCode,\n \t\t.size = *bestSize,\n \t\t.colorSpace = ColorSpace::Raw,\n+\t\t.subdevFmt = {},\n \t};\n \n \treturn format;\ndiff --git a/src/libcamera/v4l2_subdevice.cpp b/src/libcamera/v4l2_subdevice.cpp\nindex 9f2ec4798..677714890 100644\n--- a/src/libcamera/v4l2_subdevice.cpp\n+++ b/src/libcamera/v4l2_subdevice.cpp\n@@ -808,6 +808,14 @@ const MediaBusFormatInfo &MediaBusFormatInfo::info(uint32_t code)\n  * resulting color space is acceptable.\n  */\n \n+/**\n+ * \\var V4L2SubdeviceFormat::subdevFmt\n+ * \\brief The whole v4l2_subdev_format after calling setFormat()/getFormat()\n+ *\n+ * It's used in some pipeline handlers that need extra information apart from\n+ * the existing fields.\n+ */\n+\n /**\n  * \\brief Assemble and return a string describing the format\n  * \\return A string describing the V4L2SubdeviceFormat\n@@ -1266,6 +1274,7 @@ int V4L2Subdevice::getFormat(const Stream &stream, V4L2SubdeviceFormat *format,\n \tformat->size.height = subdevFmt.format.height;\n \tformat->code = subdevFmt.format.code;\n \tformat->colorSpace = toColorSpace(subdevFmt.format);\n+\tformat->subdevFmt = subdevFmt;\n \n \treturn 0;\n }\n@@ -1324,6 +1333,7 @@ int V4L2Subdevice::setFormat(const Stream &stream, V4L2SubdeviceFormat *format,\n \tformat->size.height = subdevFmt.format.height;\n \tformat->code = subdevFmt.format.code;\n \tformat->colorSpace = toColorSpace(subdevFmt.format);\n+\tformat->subdevFmt = subdevFmt;\n \n \treturn 0;\n }\n","prefixes":["1/1"]}