From patchwork Sun Jul 3 07:33:58 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rishikesh Donadkar X-Patchwork-Id: 16528 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 94CD9BE173 for ; Sun, 3 Jul 2022 07:34:41 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 5F08365650; Sun, 3 Jul 2022 09:34:41 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org; s=mail; t=1656833681; bh=Djjw2Xg6w0jHQcyV8UYedjkqFjMlptdQ0h4ErIx2ZfA=; 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=PgCMQqG9Qkix2BVqaCuOF6WaNT7m2gfAkIhVZe6C0dohjeG65pbkHIusdqnXEGFRl 6WFZd5lnz+37a/v0Lvr/nJuZaN38G4/QARCWxITC3JIeOVIGC9kMuqdyyneV0PPSxX 8FIRCVAlDO8NeczL+/fZYrkofpSxUK5OPo+Pe7H5dZ0G0KxuMZXBCj/K4qNZ1QxX7I JJapaWpRc6KinvBotX6xHIgfbdIwopneH0hwwmYoH28tYkxOO+8vcDT/RApVhj4M4l kUUXQSs1P6VQTVDMaNPIp1iocUEdmyd1PQjfuT04d8ed3hZhuBEDVb2+f+TohDQXo5 Ah4gJODI4+1mA== 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 ECB736564D for ; Sun, 3 Jul 2022 09:34:39 +0200 (CEST) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="DCYtK6Se"; dkim-atps=neutral Received: by mail-pj1-x1036.google.com with SMTP id g16-20020a17090a7d1000b001ea9f820449so10482199pjl.5 for ; Sun, 03 Jul 2022 00:34:39 -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=Cr4BjYS4XcdvowXiRLCk7G0cV8EtybZvIBEeGgIpvTQ=; b=DCYtK6Se3YURdLkum/5M/QytcNokNE8E6aGFOphfcwjk32ucuikX7hZtWktOjr6nAV fPLxwaNULKuMn4kqGcSFahyQoT+cMED2I+eRfPLqXgMaQeAHqkZGUptaBE2Zf4AxpLDc d3nYynlwX9QXsHi5VyyiKPErcqxvV/okaSoXvlAOdRd7p/zgJWkyaPo/tR+LQa1voQY6 /LZBp0O86c3X4yushS94DFF/tuTBDNt2/JxYUwCeH+H7aUHowj2/Z3dLCGWEsVEV94kn 6qfx6YQsCTGWFtTuarrWAtAah/qLmF0G1Q/LBanEzNManBXN2fgqMzEmVpLtk8JWnOBb dOUw== 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=Cr4BjYS4XcdvowXiRLCk7G0cV8EtybZvIBEeGgIpvTQ=; b=53zuC9DptCXmi5XhjlLsTkKY3iwycg0dCfynfdtRTyitPErMWENQOwx0TOxJbhv5Wf ItjgVqe566TPmpTAqv66vKyi6JmyEoRxl5rErFLYEGlQL0D1R+N9kd9TlypxDjES1WWj 302J1MvWvRMI+cEj9DNm9IrnYDl6OHmbVgkI7Copl3rU2PadFN9brpaGolKpgQUbRkdU BwWv4bYoUDkGAMjjZTVFO7S5D1IUBd5L2GlxbbMJ4fqeOxuKPx3Y4mwtBRmo/Da6d7Nl 8aGvj7LdYb1UkGrb7dURY7BO//W/sV/mrrjKkJnPhLp6r2g8AmtNJOvDGbsUJvYjpvIb pkZw== X-Gm-Message-State: AJIora89J02ysds9RReKNdEJIKn12tsuCsZd88UipXU+XKAE3GJEe4yV NiFdZlQxxRguQCaj+W7AiHuQvbAbG5k9AcmN X-Google-Smtp-Source: AGRyM1uY0HuqcBdI6hY1wgV/GZpk5DceyU6/fbPMhlAs0KZBfdNhY/O/zCxc7wYzeChwo60z+GB1gg== X-Received: by 2002:a17:90a:4294:b0:1ee:f3f2:9cd0 with SMTP id p20-20020a17090a429400b001eef3f29cd0mr27127788pjg.79.1656833678842; Sun, 03 Jul 2022 00:34:38 -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.35 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 03 Jul 2022 00:34:38 -0700 (PDT) To: libcamera-devel@lists.libcamera.org Date: Sun, 3 Jul 2022 13:03:58 +0530 Message-Id: <20220703073358.76643-5-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 5/5] gstreamer: Change 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/gstlibcamerasrc.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/gstreamer/gstlibcamerasrc.cpp b/src/gstreamer/gstlibcamerasrc.cpp index 120319b3..91668e81 100644 --- a/src/gstreamer/gstlibcamerasrc.cpp +++ b/src/gstreamer/gstlibcamerasrc.cpp @@ -387,6 +387,13 @@ gst_libcamera_src_task_enter(GstTask *task, [[maybe_unused]] GThread *thread, for (gsize i = 0; i < state->srcpads_.size(); i++) { GstPad *srcpad = state->srcpads_[i]; StreamConfiguration &stream_cfg = state->config_->at(i); + gchar *colorimetry; + + g_object_get(self, "colorimetry", &colorimetry, NULL); + if (colorimetry != nullptr) { + std::optional &colorSpace = stream_cfg.colorSpace; + colorspace_form_colorimetry(colorSpace, colorimetry); + } /* Retrieve the supported caps. */ g_autoptr(GstCaps) filter = gst_libcamera_stream_formats_to_caps(stream_cfg.formats());