From patchwork Sun Jul 3 07:33:56 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rishikesh Donadkar X-Patchwork-Id: 16526 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 8D568BE173 for ; Sun, 3 Jul 2022 07:34:29 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 45CD565650; Sun, 3 Jul 2022 09:34:29 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org; s=mail; t=1656833669; bh=kCce0/Hrh4NafDou48L6iKh47MxvPkotjv5ywVVuOA4=; h=To:Date:In-Reply-To:References:Subject:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:Cc: From; b=j1r3HodhQVE/rCdQI/gxz8ZpoY9Wc9zYnGaj+JsMGr3SRTwLXTek4spAqfg+7CPdC WLgag9vRNn8v7XQoeAzjTnHjYHp6E/YYJN1E+2Xw1S1NJrcjKfQNCGiLMhX6w1dxW+ 18FP8a/CRHVb1QQq/RSB38qnakme8kEnNNfQf4X12GLnfL+ua4mvnixDphWI89TWA3 vCyo8rQEZFSGsib2DUbvJBHx5a9CqIZRo24slSHHiIKlVAQ4aavqJLfUkxNxHZGCyQ y0hGZkiQeHhNGvkZU3/Q4eJucr3kLCICP/qHM5AGmsTHqceV72ZMjEUraI2s9XxQCk FdpQk3uJRWb7Q== Received: from mail-pj1-x1033.google.com (mail-pj1-x1033.google.com [IPv6:2607:f8b0:4864:20::1033]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id A4F9E6564A for ; Sun, 3 Jul 2022 09:34:28 +0200 (CEST) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="o8/RPUxq"; dkim-atps=neutral Received: by mail-pj1-x1033.google.com with SMTP id fz10so390991pjb.2 for ; Sun, 03 Jul 2022 00:34:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=Tb+P9IAJbs/5lWvtGt1UxkTi4iLo+typkPrJkm9ogY4=; b=o8/RPUxq9T87vvQbLIDkKhQ9N9jB7H0mktF0ziXqHXcmUIQCIZ9yQ0P3WIUE1cj0XT fEqy5Zh2hJ/n3I/BU4JpIb7sgyxBYOFQ53fhZ+E64oXTfr58sqDys36YJ6sBX+FuEcXL +Dne9eCpOf9RhT7rYjn/MTk6oVFdS5eRK9rWCNZGYRi5ocW5vxTZmF5cw93WU6Atr/tk rgXyKh85EqKPbs/Z+8SUv1CNBPppPPigHaMOEvfGDjZWmiMsY70aYBHM/BzlNjKZMUIH o+ZaYhUffk0BcbzpV8pcjH5HlebR6PpRa/aMzqwnH/fhxn765Es3rN1rJ97ZczOdcQ1h UWdg== 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:in-reply-to :references:mime-version:content-transfer-encoding; bh=Tb+P9IAJbs/5lWvtGt1UxkTi4iLo+typkPrJkm9ogY4=; b=ux73wW+V37zlnq5LZXl34/IUpVHeYmHS6GYZJuNAvNutBJHrkdy4P6vzLC3/FTiGpS 4/p+nGCAgrJXOp06dGg01UdaUYkQQx21139dKU6glMnsEe9oqUU4RSWhHfjmhYpw3/b6 bvpwgoQ/hZ7HqCVjb7bxAjAfncHbMY+3Vp6rE+2kQZN4VmlwJczeXbTMCeRdHgQEzXJ7 nLTS9WSeyH+vYboM4cGd+E9GpqAYlbqqRaU3EhJJlLo1UjcKG88Oxy12I5RmFpUFAQw1 kCneuVnREL1y47hFVR6BMf1Gp37Yu5HFlvf6q2oqhsOSuQXWM8OZvg7mk5ZFruCh3LNA 9Pzg== X-Gm-Message-State: AJIora8yFl5rL4VrKbgQf+EQnqNQvxtUkyeQqISM7hj1SwBW8c9P9eEr SLMZCpRXLyxqEiu/zpfD57ykQHk7QfvX8QB3 X-Google-Smtp-Source: AGRyM1ticpmnaKsxqD3pBrUJPEMu8LYV3Z6OtFPc4WDhogPQ8oaxYAW9Wh+ZL5qM/HIySp8m6bywxA== X-Received: by 2002:a17:90b:1bcc:b0:1ed:361b:702a with SMTP id oa12-20020a17090b1bcc00b001ed361b702amr29592910pjb.1.1656833667149; Sun, 03 Jul 2022 00:34:27 -0700 (PDT) Received: from localhost.localdomain ([2402:8100:30af:f358:3ebf:ad3f:f834:3344]) by smtp.googlemail.com with ESMTPSA id l11-20020a170903120b00b0016b953872a7sm10300285plh.201.2022.07.03.00.34.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 03 Jul 2022 00:34:26 -0700 (PDT) To: libcamera-devel@lists.libcamera.org Date: Sun, 3 Jul 2022 13:03:56 +0530 Message-Id: <20220703073358.76643-3-rishikeshdonadkar@gmail.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220703073358.76643-1-rishikeshdonadkar@gmail.com> References: <20220703073358.76643-1-rishikeshdonadkar@gmail.com> MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH v1 3/5] gstreamer:Install the colorimetry property 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: , X-Patchwork-Original-From: Rishikesh Donadkar via libcamera-devel From: Rishikesh Donadkar Reply-To: Rishikesh Donadkar Cc: Rishikesh Donadkar , nicolas.dufresne@collabora.com, vedantparanjape160201@gmail.com Errors-To: libcamera-devel-bounces@lists.libcamera.org Sender: "libcamera-devel" Add the colorimetry field in the _GstLibcameraSrc. Add switch cases in gst_libcamera_src_set_property() and gst_libcamera_src_get_property() to access and modify the property. Signed-off-by: Rishikesh Donadkar --- src/gstreamer/gstlibcamerasrc.cpp | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/src/gstreamer/gstlibcamerasrc.cpp b/src/gstreamer/gstlibcamerasrc.cpp index 46fd02d2..120319b3 100644 --- a/src/gstreamer/gstlibcamerasrc.cpp +++ b/src/gstreamer/gstlibcamerasrc.cpp @@ -121,6 +121,7 @@ struct _GstLibcameraSrc { GstTask *task; gchar *camera_name; + gchar *colorimetry; GstLibcameraSrcState *state; GstLibcameraAllocator *allocator; @@ -129,7 +130,8 @@ struct _GstLibcameraSrc { enum { PROP_0, - PROP_CAMERA_NAME + PROP_CAMERA_NAME, + PROP_COLORIMETRY, }; G_DEFINE_TYPE_WITH_CODE(GstLibcameraSrc, gst_libcamera_src, GST_TYPE_ELEMENT, @@ -532,6 +534,10 @@ gst_libcamera_src_set_property(GObject *object, guint prop_id, g_free(self->camera_name); self->camera_name = g_value_dup_string(value); break; + case PROP_COLORIMETRY: + g_free(self->colorimetry); + self->colorimetry = g_value_dup_string(value); + break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID(object, prop_id, pspec); break; @@ -549,6 +555,9 @@ gst_libcamera_src_get_property(GObject *object, guint prop_id, GValue *value, case PROP_CAMERA_NAME: g_value_set_string(value, self->camera_name); break; + case PROP_COLORIMETRY: + g_value_set_string(value, self->colorimetry); + break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID(object, prop_id, pspec); break; @@ -717,4 +726,11 @@ gst_libcamera_src_class_init(GstLibcameraSrcClass *klass) | G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); g_object_class_install_property(object_class, PROP_CAMERA_NAME, spec); + + GParamSpec *spec2 = g_param_spec_string("colorimetry", "Coloirmetry", + "Colorimetry that will be applied to the StreamConfiguration", nullptr, + (GParamFlags)(GST_PARAM_MUTABLE_READY + | G_PARAM_READWRITE + | G_PARAM_STATIC_STRINGS)); + g_object_class_install_property(object_class,PROP_COLORIMETRY,spec2); }