From patchwork Thu Jul 7 09:44:02 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rishikesh Donadkar X-Patchwork-Id: 16570 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 7D3CDBE173 for ; Thu, 7 Jul 2022 09:45:21 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 38F086331B; Thu, 7 Jul 2022 11:45:21 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org; s=mail; t=1657187121; bh=vwLNOOd8KqMTxpbDa0Qo8PIPOBBLsA9MbL8bOUFd5bc=; 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=c7+X+akrMYm83DdfQvfR9dn/ZztTjphxI4gWcUTnS1+zvoDD6Cq+PhSiDPJEeKZ+k hKOZcEJVO5ys8MCpEEhH4OyPVbpKC1DQz1bxM1+ZfyWOR5pyHsLI08LCN9tLu0X0Sx i8iMIR8WHZdQN1vfy4e/XNsNAU4HsbZnNZOqLZouDdVDSvwllEy/BVjyziboZ3grPt j4+K+pXCwm3Dx5+WVcOtcF/Q0BJqk3xv2Da7yipj/EFAbvfsJdu9Ybe/VJETbv0C8T 0GiZHKqth+u6BYeyqfvLV5IP19hJV7qq9Qgri3dUwX7qjB85y0QsX29/E6kd9Ute2O nCaDnEq3kwzaA== Received: from mail-pg1-x535.google.com (mail-pg1-x535.google.com [IPv6:2607:f8b0:4864:20::535]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id DCA6B60401 for ; Thu, 7 Jul 2022 11:45:19 +0200 (CEST) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="XbS8N8r4"; dkim-atps=neutral Received: by mail-pg1-x535.google.com with SMTP id 145so17474144pga.12 for ; Thu, 07 Jul 2022 02:45:19 -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=3iRgLuDezP4t290LfGG98rmzMB3RzYpumLdoyBdEnyM=; b=XbS8N8r46T2BCZQ2JwwgZFyGs/pbKqO3Vaoh+/YlxDmSxgdmYpNytmTLgUCIo5tQgn Gs3YLIrUQI3ca7KNdF/LZjppHfkU/qj7zBDpPDaUE63+4DGo0ga2oV5IJH6lOsNf5hC8 E1mLg4BwEG3VfIUt9COSyi5O6iY8fjCf+am8f20oQVt8BP8isaVFB4fTGKQ7xWlvMaQO OYteGB9OMyzuO1hO9nJLqWdA9n1K3iw+H6KlkS2yrfjjFQfHZyWFtfIQrkvgi02rMgnZ 7Adb3gYjBfHXEP8wjS6A/OlvB75yF435Lq0lCxxpWZJwlepcqLzWMb4ughb1GidwApco t7Lg== 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=3iRgLuDezP4t290LfGG98rmzMB3RzYpumLdoyBdEnyM=; b=joe3RT11fO5IrBreNxDB3a+WQyCII6VMToblop0I9Ts6GQgXuY0aTDAlhB1eGPbjZ9 WSW75SoXEYu9gGeuHRnPDLjUfqNLOsFV0uayiRRdeMncvDrvJp/8ilFcQvgOXlKH763O N5sHUWPkBW/By/3YMfHA7XrvQW87Lvdv1yRs+2gvBjabJMmvxso8rENIuiSM5E9Wq4fA Qax1Eb9Oyd2Z+ibPp1NQwSMwTBGhRC/SwIWnXkesFY30wLGpqOVMtdZC4mkYSlCuDea8 uxLwafsYJ2GGUmHD6x/A7EjPfcsJpSkZHRvrPpFoNYEpdontZ8T4IPOCH+/QhsDjTV8+ I22g== X-Gm-Message-State: AJIora/n1qpb6PEB3/PHhyVLnCfznmAzqwns4Bccr7K9f/nX46Me4Nyn 4F6IGrPaQsd4OsJTUxTIIMUUi39KJvs= X-Google-Smtp-Source: AGRyM1v93LrDd18u1VziFU5zxhVjk82rfLiKx2+fmip/DGGCJFmGycTghD2L1DP+QkU4Kqer1H56Nw== X-Received: by 2002:a17:90b:3e8a:b0:1ef:6a5e:e55a with SMTP id rj10-20020a17090b3e8a00b001ef6a5ee55amr4246968pjb.112.1657187118229; Thu, 07 Jul 2022 02:45:18 -0700 (PDT) Received: from localhost.localdomain ([2402:8100:30ae:d446:13ee:d079:112a:ac10]) by smtp.googlemail.com with ESMTPSA id p2-20020a1709027ec200b00168f08d0d12sm24530712plb.89.2022.07.07.02.45.15 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 07 Jul 2022 02:45:18 -0700 (PDT) To: libcamera-devel@lists.libcamera.org Date: Thu, 7 Jul 2022 15:14:02 +0530 Message-Id: <20220707094402.28730-5-rishikeshdonadkar@gmail.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220707094402.28730-1-rishikeshdonadkar@gmail.com> References: <20220707094402.28730-1-rishikeshdonadkar@gmail.com> MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH v2 4/4] 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 pass that to the function colorspace_form_colorimetry() which will set the colorspace corresponding to the requested colorimetry in the stream configuration. Signed-off-by: Rishikesh Donadkar --- src/gstreamer/gstlibcamera-utils.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/gstreamer/gstlibcamera-utils.cpp b/src/gstreamer/gstlibcamera-utils.cpp index feefead9..229a29cd 100644 --- a/src/gstreamer/gstlibcamera-utils.cpp +++ b/src/gstreamer/gstlibcamera-utils.cpp @@ -279,6 +279,13 @@ 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 = gst_structure_get_string(s, "colorimetry"); + std::optional &colorSpace = stream_cfg.colorSpace; + colorspace_form_colorimetry(colorSpace, colorimetry); + } + gint width, height; gst_structure_get_int(s, "width", &width); gst_structure_get_int(s, "height", &height);