From patchwork Sun Jul 3 07:33:55 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rishikesh Donadkar X-Patchwork-Id: 16525 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 0CCD3BE173 for ; Sun, 3 Jul 2022 07:34:21 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id CCF706564D; Sun, 3 Jul 2022 09:34:20 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org; s=mail; t=1656833660; bh=HBN0zhzfgevyKBGy8V3w5seZyiIHkcYKXESY1RADJgw=; 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=XNoU8eTJgvYqsbLrbeIgaL94xmdLYRO9HkBoxMOC8HVwDQWNu4z1ngcQJdr2tVNLy 8vtX3mlTSMP4mmnJMKQhEfoQRIzYj6Yz4GkKM8XY5fVpvN08y4sllTrTuv16H5cLVN 8OplWEARt7n+TyJQbab3JOpIFKGTlCRjgrjpyO+/UcH+sZ57THLOzee8f+VrIEOqmW QzWz3B7aMwSgxtkzXwXAaRlu3eyCbOdR86Df7IK5ETrFXwTjwLHE0Gp8Bf+VaGvCXW Eet1nu26qmNRQ9CuRug1adAzP6CcuT0vwoeEaIm42d05/TzISVktFVCfpFhQqhqhTN RbcFrvGktxaIg== Received: from mail-pj1-x1036.google.com (mail-pj1-x1036.google.com [IPv6:2607:f8b0:4864:20::1036]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 850AA6564A for ; Sun, 3 Jul 2022 09:34:19 +0200 (CEST) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="d1fYrcIo"; dkim-atps=neutral Received: by mail-pj1-x1036.google.com with SMTP id g16-20020a17090a7d1000b001ea9f820449so10481855pjl.5 for ; Sun, 03 Jul 2022 00:34: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=BVRpnbi43YEWEksgXVhZVaj+0wwRHaTrgC6U8PWM9hQ=; b=d1fYrcIoHdBUfE2bv32UPUR3bhQtKByakijqFmwF3vghaGFbBs/5TIC+RkLMHriUrc KE10m4R5xPykFrVD8/YrUbuZS5PwOz07CzMHN1Hxp9BBkSPy3PNMoBoDX8rZbUOh3yJX j8M38zpn31lWMlw9d/LAJ7AhePGEcf+0/FWJbG96A1Whn9fthCIncEP4CFODemV7trL9 bBxLRzb7bXUcpkPYrldLveD179yyW2W/8y4R3KGJcogHIfyvKEO8QmoezvlPYIXXeUqS pkw1wVOEYLedP1jwj0HK2J/EauNs1c4gkogY6V9hkBBJcSKZa+6nAnxFSPtOf+AWLIzD XE6Q== 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=BVRpnbi43YEWEksgXVhZVaj+0wwRHaTrgC6U8PWM9hQ=; b=B2kvatwpz2P4sWD9ShpUhrx1gPipBxbHAq4WLZue7eShuGQ3bHPagZRRN9P3YJ+CkN YFgrVJWlqLynKL4JTmBtaKcey8cRKIO1xkJyPyBEUPIGjv5gjR30Bpb6ETshIoKi80dW 1pozEnNzkvyf5AkaGLpiyalqwdBFZX6TVJJYeX5u8Jdg7MgXU588rdEVKcGktUSR4T0R lNWzo+/zHl0A7CSJlHWaEqztWCDEHwz9w53sQvOPvkbFNwhpz8wSAaQJH7xXbnpWIyDt CKsS4c/1uptfOjvBiXTnuytDsQ1XtRHc7ELHLJFUd916ZAiNed4qkJLd/r0nBPHZsF3h votQ== X-Gm-Message-State: AJIora8j0gQg7+qSLdU/tFgaraqg4QgZEnCmBW8RCTzAXp6heNdUvh6S aYdTXgqNhBAISIUz11t9F6cEqcJaEUDwCwaP X-Google-Smtp-Source: AGRyM1vuACPD+Mt34E+de2Z2oNJsvKPNok2SvvuqJBsUPEhVZcjZWZ/eBc4OBIdoSUyvtvLW70adlw== X-Received: by 2002:a17:90b:3850:b0:1ed:7d1:f0a with SMTP id nl16-20020a17090b385000b001ed07d10f0amr27903943pjb.67.1656833657952; Sun, 03 Jul 2022 00:34:17 -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.15 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 03 Jul 2022 00:34:17 -0700 (PDT) To: libcamera-devel@lists.libcamera.org Date: Sun, 3 Jul 2022 13:03:55 +0530 Message-Id: <20220703073358.76643-2-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 2/5] gstreamer: Update the obtained colorimetry in caps. 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 as a result conversion in the previous patch and update the colorimetry in the gstreamer caps. 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 20c39919..690a9f43 100644 --- a/src/gstreamer/gstlibcamera-utils.cpp +++ b/src/gstreamer/gstlibcamera-utils.cpp @@ -205,10 +205,17 @@ gst_libcamera_stream_configuration_to_caps(const StreamConfiguration &stream_cfg { GstCaps *caps = gst_caps_new_empty(); GstStructure *s = bare_structure_from_format(stream_cfg.pixelFormat); + const gchar *colorimetry; + std::optional colorspace = stream_cfg.colorSpace; + if (colorspace) + colorimetry = colorimerty_from_colorspace(colorspace); + else + colorimetry = g_strdup("Unset"); gst_structure_set(s, "width", G_TYPE_INT, stream_cfg.size.width, "height", G_TYPE_INT, stream_cfg.size.height, + "colorimetry", G_TYPE_STRING, colorimetry, nullptr); gst_caps_append_structure(caps, s);