From patchwork Mon Sep 19 02:57:08 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rishikesh Donadkar X-Patchwork-Id: 17378 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 D534EC0DA4 for ; Mon, 19 Sep 2022 02:57:29 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 4C76B6218E; Mon, 19 Sep 2022 04:57:29 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org; s=mail; t=1663556249; bh=QpfT3FzLWcazZJ6aCgtVgde1GD2yXxKzljSu2r0Oq+g=; h=To:Date:Subject:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:Cc:From; b=rD0eyqs21Kyak2KwyQYpnJxitLVDjeqM9DLkNKZAcuBCZA+VbPfNHsc/i8+GXtpTy DwlnKWyd/0ODWP/usH7kLlxHVspANPnEt+IsC7vPRDSYo8wlwrqpLryJGvFbA2x1D8 HubQfD0JiswmQJqTvYaO2FveEwpQJ1VYCjQRM8scOrLNldQV9dZbJV3ron7ejJwxRc CkBSfHbJtgIGy/oJIkrWZofVSdqbGb+0vIzcH//sk3QPpJSDgpBAu1emewQnfUYX0S MIAU4W5mtydlJR8wH/35V2k0OBm7IuIjyG4C16jPXbc30retyAETiC9R6v7FUzZD+u 7mGOcOuurASWw== Received: from mail-pg1-x52c.google.com (mail-pg1-x52c.google.com [IPv6:2607:f8b0:4864:20::52c]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 96E7D61F7F for ; Mon, 19 Sep 2022 04:57:27 +0200 (CEST) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="DmOgplhC"; dkim-atps=neutral Received: by mail-pg1-x52c.google.com with SMTP id f193so1357575pgc.0 for ; Sun, 18 Sep 2022 19:57:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date; bh=aXflS0/6ntledaHUPmpLXTLiLzhYuA8b1OQ1jTv1KVQ=; b=DmOgplhCxzALXjcKB3W1pQS+lMGpfugONECyn+TmzcPT9A10DvehCk3sXDMXFhA/+l 65i44mYEUe/3hvwxNyubEaqSHogSnbcqUmlgI4Prv0hdFgPtTGaY/UuA9AY/jXIYBKQe EUClKdGcT3/n/j0tFLtCpKFhI35qxm88QS5R/c6bx1kdUSwyE/NRZWWOVeqcGv1xhFGU NRTIKbpBN2eumOVznXKW2tigRdcceQCskVZPVuH+bWoNH+9iyv4bYCwTUnic+pyu49Jp UlqsAkZziINzdPfT/uVUtUbmI+/HHiRFQj0X3u2RqAsbrhmppI8Bfmp5P2NRM3NozigX urTQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date; bh=aXflS0/6ntledaHUPmpLXTLiLzhYuA8b1OQ1jTv1KVQ=; b=f6rRki6cYnx+tX4a9+EFKAblr0TyYT799NWo9kun7x7kIRmyJb/Vuir7qZveVgr02T mPTlL1XNCu+aLs5Z4xza9e9z0kq21eTpUnh8H5YA7DBEA0wSH3Oc5PEFXDFlNRGkI44n vnWSxagLU2IpxkYW0jLbvs3N0pzXJkexDShgA4aurLPkm4AlzED0+dXYJcFHmR4khcBl m6nAVRWJdmwO6xuQc87KaLXPqrm6Z9U0VxrdcFV+/hMoHb3e2TbIGYe+ViZ0WObW9pO8 B5vXpU5kWMgxF8HqYb/dE1QKdDnUBx6R07/9tugYDqrl7fh9/WYwuEflg7kiSyY2xYTV Ykxw== X-Gm-Message-State: ACrzQf2AGbSUqA2xrKsJM3SLJAFBvQ44iYbAiNQHBcjUqyNi67nMYyf3 RNCkd6AMBrJ/Y6GD3o48uLrTBDfUxbc= X-Google-Smtp-Source: AMsMyM4y6UlmoqTNPZxSLqLRXsj3CJDxNK6iHkmJ5zVMWcqjshqkKrlwqpVgN7jm0iDPYHlo/gzVcQ== X-Received: by 2002:a63:191d:0:b0:434:4bb3:e016 with SMTP id z29-20020a63191d000000b004344bb3e016mr14332694pgl.133.1663556245541; Sun, 18 Sep 2022 19:57:25 -0700 (PDT) Received: from localhost.localdomain ([49.36.97.74]) by smtp.googlemail.com with ESMTPSA id a3-20020a656403000000b0042b291a89bfsm17303922pgv.11.2022.09.18.19.57.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 18 Sep 2022 19:57:25 -0700 (PDT) To: libcamera-devel@lists.libcamera.org Date: Mon, 19 Sep 2022 08:27:08 +0530 Message-Id: <20220919025709.34528-1-rishikeshdonadkar@gmail.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH v6 0/1] Provide multiple colorimetry for libcamerasrc. 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: nicolas.dufresne@collabora.com, vedantparanjape160201@gmail.com Errors-To: libcamera-devel-bounces@lists.libcamera.org Sender: "libcamera-devel" GStreamer pipeline supports passing multiple colorimetry as a comma separated list. For Example : gst-launch-1.0 libcamerasrc ! "video/x-raw,colorimetry={bt2020,bt709,sRGB}" ! glimagesink In this case, if supported by the camera one of bt2020, bt709, sRGB should be applied. This series aims to adds multiple colorimetry support to the libcamera gstreamer element. --- changes from v1 to v2: - Moved the function colorspace_from_colorimetry() from PATCH 1/2 to PATCH 2/2. changes from v2 to v3: - Rebase on top of [v3 PATCH 4/4] gstreamer: Provide colorimetry <> ColorSpace mappings. - Use the comparator utility function gst_video_colorimetry_is_equal() to cut down code. - Rename dup_stream_cfg to pristine_stream_cfg. - Log the colorimetry that is selected from the list. - Change the API for the function gst_libcamera_configure_stream_from_caps() to pass pass state->config_ here instead of taking it in a holder variable reference. changes from v3 to v4: - Discard the approach form expanding the colorimetry list through caps normalization. Instead enumerate the colorimetry list and try out the colorimetry. - Add error checking for invalid colorimetry. changes for v4 to v5: - Use gboolean instead of int. Return true/false. - Add else if for the mutually exclusive conditions. - Add final else to trace if anything other than a string or a list is passed in the colorimetry field by the user. changes from v5 to v6: - Compare colorspace instead of colorimetry, this will reduce the colorimetry<->colorspace conversion. - Compare the colorspace applied directly with the colorimetry requested in the caps. --- ---- Test results(on RPi 4 + OV5647): gst-launch-1.0 libcamerasrc ! "video/x-raw,colorimetry={bt2020,bt709,sRGB}" ! glimagesink Selected colorimetry bt709 gst-launch-1.0 libcamerasrc ! "video/x-raw,colorimetry={sRGB,bt601,bt2020,bt709}" ! glimagesink Negotiation fails on bt601. gst-launch-1.0 libcamerasrc ! "video/x-raw,colorimetry={sRGB,bt601,bt2020,bt709,2:4:5:4}" ! glimagesink Selected colorimetry bt601. gst-launch-1.0 libcamerasrc ! "video/x-raw,colorimetry={sRGB,bt709,bt2020,bt601}" ! glimagesink Selected colorimetry bt709 ---- Rishikesh Donadkar (1): gstreamer: Provide multiple colorimetry support for libcamerasrc src/gstreamer/gstlibcamera-utils.cpp | 49 +++++++++++++++++++++++----- src/gstreamer/gstlibcamera-utils.h | 4 ++- src/gstreamer/gstlibcamerasrc.cpp | 2 +- 3 files changed, 44 insertions(+), 11 deletions(-)