From patchwork Mon Jul 11 15:37:10 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rishikesh Donadkar X-Patchwork-Id: 16591 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 5F5A2BE173 for ; Mon, 11 Jul 2022 15:38:28 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 1FCCC6331D; Mon, 11 Jul 2022 17:38:28 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org; s=mail; t=1657553908; bh=crWHhz3Z/TyJBTdD9UfIlmkwgS1bUHOkBd+HziOtpWg=; 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=AxVM/KLSwUn3DXMnm5ueseAgHdpu0EQzUfSFJ75zK9vJ9RLiBO6xay5JQIbu7MQtY Wx6kt3B4wOgYIeiy+NxrR/DWiVpJ0DBjOUc3EDt+oQNoAlCZ0OnGeToQPiSSB5m74a lDjqP625lHqCkzQ1nJxx3mYLNUzM+dv/6ZNytx/SGH2Pkm8LKKih+07zntEV6sYZ0A eQh9Z8YxIQIB+tee1tQsfrCLOEnwgYoi2LUf7vyOc30gZRWx6ga62mLKohJO8uc0ac Md3qatH8JiBkUij4yWrtXLFLwhekMv/DmG/xar6cnS3DAdM5goFWj7deklodnXtzm5 b5IR5rYa9i1kQ== Received: from mail-pg1-x530.google.com (mail-pg1-x530.google.com [IPv6:2607:f8b0:4864:20::530]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 4DC176330B for ; Mon, 11 Jul 2022 17:38:27 +0200 (CEST) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="EtfxjAAQ"; dkim-atps=neutral Received: by mail-pg1-x530.google.com with SMTP id 72so5088677pge.0 for ; Mon, 11 Jul 2022 08:38:27 -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=74dT/n8SbP1yPRYZvYWmschUwxbjdspMpv5yNwnz6tw=; b=EtfxjAAQsqXaQBBt+mDvLIAKURueW3GtVSjYo4a76P4yPjgAglXkWeaT3QRqW1zIhr hD6a4wklfQn9m9KiPCkQb2GSPvMjC4CDTmzm7SRJ6dXbk+FS5maivXtRQdcpFCvmuU0N 8LI+k4PRL2PVn85jito41+pm0iSVZ09/OkpTkpcyLKT6Sk4VsI/obPsNLoOIti7sOUJF i0wGWqktmS+/5fAYqv4m1m5lCI3TVddt1IOljyw7qH/qv5Eg/XufDOQDVuqF2IOGzp8J BQggEGoumKsI8NNUuSxdbYs88Rp/Edgqs/ozHGbAm/o9e386yOCmHi6hN3fiYJQs1nrf wAAw== 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=74dT/n8SbP1yPRYZvYWmschUwxbjdspMpv5yNwnz6tw=; b=5vHUrwfysKMAugsjQK6UqRyGu8+sGzKZgvvwBtGAvFlTuG9182SEGIWwQoDxd2W/u5 TydYqsK9zEcA0AQ8zIP8hvh0KfWv2J7VyesKTTfbxIh8FbEw0k2jpgcQPXM10f60zFF7 nbQzQPFAwdAoqQJgqXAtjkDJgOuxVlFHGOxnfzHkRYM8C5rXv01v+yzfafL4o5z+5Oos KUF8GovhbWXxQfTKz2rpYhi5tRpWAfart/MueydW+PA7e8wvNlt7ebGRWZOqPcPCc+e7 ve2i4U+CSJeLdIzlYpU475Ywu1cNMqlrCj3JFRIaonTVnSvBSfp0AJABbh0zvKIsYNOj MHwQ== X-Gm-Message-State: AJIora/cu2rB9PsX8titFGEMnzvo3fcCx4uT7LnvFzRt81loB2PNLdeP TlXJ+4J0sRKKnr0S/DeW/d/lxzRfVr8= X-Google-Smtp-Source: AGRyM1ufZNF84vi8NQYBdFGlUsE5/yew/InDOvnVvtCpK2Wx8xX5RPUWEV6qpto9s2P/hrTKiblqkQ== X-Received: by 2002:a63:4b20:0:b0:401:ae11:2593 with SMTP id y32-20020a634b20000000b00401ae112593mr16814568pga.375.1657553905289; Mon, 11 Jul 2022 08:38:25 -0700 (PDT) Received: from localhost.localdomain ([103.124.170.70]) by smtp.googlemail.com with ESMTPSA id u18-20020a17090a891200b001ef87123615sm4891268pjn.37.2022.07.11.08.38.23 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 11 Jul 2022 08:38:25 -0700 (PDT) To: libcamera-devel@lists.libcamera.org Date: Mon, 11 Jul 2022 21:07:10 +0530 Message-Id: <20220711153711.36679-5-rishikeshdonadkar@gmail.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220711153711.36679-1-rishikeshdonadkar@gmail.com> References: <20220711153711.36679-1-rishikeshdonadkar@gmail.com> MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH v3 4/5] gstreamer: Configure the colorSpace in the Stream configuration. 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" Get the colorimetry if requested in the gstreamer pipeline and convert it to colorspace using the function colorspace_from_colorimetry() Set the colorspace as a result of conversion in the StreamConfiguration. Signed-off-by: Rishikesh Donadkar --- src/gstreamer/gstlibcamera-utils.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/gstreamer/gstlibcamera-utils.cpp b/src/gstreamer/gstlibcamera-utils.cpp index 5b3bfd70..b3fc9ff4 100644 --- a/src/gstreamer/gstlibcamera-utils.cpp +++ b/src/gstreamer/gstlibcamera-utils.cpp @@ -278,6 +278,14 @@ gst_libcamera_configure_stream_from_caps(StreamConfiguration &stream_cfg, g_critical("Unsupported media type: %s", gst_structure_get_name(s)); } + /* Configure colorSpace */ + if (gst_structure_has_field(s, "colorimetry")) { + const gchar *colorimetry_in_caps = gst_structure_get_string(s, "colorimetry"); + std::optional colorSpace = colorspace_from_colorimetry(colorimetry_in_caps); + if (colorSpace) + stream_cfg.colorSpace = colorSpace; + } + gint width, height; gst_structure_get_int(s, "width", &width); gst_structure_get_int(s, "height", &height);