From patchwork Fri Sep 9 21:39:51 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Vedant Paranjape X-Patchwork-Id: 17357 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 29935C3272 for ; Fri, 9 Sep 2022 21:40:24 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 514AB620AB; Fri, 9 Sep 2022 23:40:23 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org; s=mail; t=1662759623; bh=QcgpbSGKMVYJLmdqhCw7TGxtFOg7oUuh9giJp5aBYks=; h=To:Date:Subject:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:Cc:From; b=n5+YxMScgFcbR5qeL4CHsSjIybuEjUHWBXBlCxuPmcoZPpdrk/BPqxHm0J/KSqcAO qWtc4VmqLUvTMplKrAv2FVQEDfeRCLhIQtISnPpAOC50d+oeB4pQOj+MiJxhu0+wSn yxlsPlc1pTT34AdtgkaY1W7m1wl9KZAcX6eQPot4iAVRVrQ0G+kLaeoyOyrKklH3X/ W5cKMA29hDEC+4Fr2C3oEspwbmDZ6TgstniSGAqTPDKCnUDv5Jw/Aavkq9/AI0bq9S JnZMmHmw5ZxFMEs0YpIN02vSAO6NVhEBEfiEtwVEMbE146YQYn9Oyw51X9a2wj0dNl YGN0kO0YZFjZA== Received: from mail-pf1-x42f.google.com (mail-pf1-x42f.google.com [IPv6:2607:f8b0:4864:20::42f]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 2601D62046 for ; Fri, 9 Sep 2022 23:40:22 +0200 (CEST) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="m9W4qqAp"; dkim-atps=neutral Received: by mail-pf1-x42f.google.com with SMTP id y136so2860764pfb.3 for ; Fri, 09 Sep 2022 14:40:22 -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=M+0w8HiqVCRXKnUvQ4zgSHaSwqij8X9Em+9OVUIvXnk=; b=m9W4qqAp3Pg0svti7tqbK6bc2K1LON5LtF0F54CNWtEPJOzNTOO0tuhQ3bG7/hzF7Z ZjobrMxf/XUCkGY/EDNczF4pPxJQ1p6P5RWiFYSeCOUGZr6tMWZtJFApUFInNEfcCAOk MUPzQeFBn75FM5EJhsD6wgnDOZiKGzJl1wLvZFGaI4rzqHqcRoMmjimpstfIwbdmlVo4 qfBdSKPHhlnsiaqBMWCaxnNcO/2rx3Nc3RbcFtZv6mOECo6NAeo1dnTtgENQuEaKll4Z cQx58+MlnSgw3bPwrkOUv845qCIIje+1r9INHQViMuhhGOmB2Yu2dHdHecloYDfbOCMz WeVA== 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=M+0w8HiqVCRXKnUvQ4zgSHaSwqij8X9Em+9OVUIvXnk=; b=kvuM6bNCDDmYL+g7ZkYG7/DHeTMEGifEOUzs4ZnUIviL3fa13JBsPGZ+ugQyc0Ejm2 mQMLcc1oPW3/3Qj1jqoXtLOOtYLf4lG2JRf1hmSKTIU6AP8ihGqFI1extEvT/Q7Lsiot NjCg6q9CoEeEOdoai64F/BUTXh16ShvuYZrvqbyrVG3EyWr+Km0eOs9FVEmwGpxJm/0l XyDWHG746M99YwEMuWpRpyLnuo/76gTM2jq0ecr+dDrYFh9XJLdVMoK/V/iX79e5WxFG 1eiKglBtDp0wcZqYb6LexsTgwFoWoFULKlzsl0CHL31hpA4HWfbVQRxAkyoGivg6JfM2 GUZA== X-Gm-Message-State: ACgBeo1hyC1MS1QS7R6loRtrH/DkbjKLT1YPXkL7LDvjSi9d42McvawJ fUn8MmH6eMidHDz+aJvErUNaIT8wrtTtzg== X-Google-Smtp-Source: AA6agR7f7AK4SG9DtKEv+4MSM9zCdZI4fs1nUWdBHcConNaHLA1rep8ajtDpfJf9eQIynB6QCD2tQA== X-Received: by 2002:a05:6a00:124d:b0:538:295a:1c48 with SMTP id u13-20020a056a00124d00b00538295a1c48mr16043752pfi.72.1662759619663; Fri, 09 Sep 2022 14:40:19 -0700 (PDT) Received: from veware.localdomain ([111.125.221.115]) by smtp.googlemail.com with ESMTPSA id x7-20020aa79ac7000000b0053804c5b4aesm186062pfp.208.2022.09.09.14.40.16 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 09 Sep 2022 14:40:18 -0700 (PDT) To: libcamera-devel@lists.libcamera.org Date: Sat, 10 Sep 2022 03:09:51 +0530 Message-Id: <20220909213951.591934-1-vedantparanjape160201@gmail.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH] gstreamer: Check gstreamer version before using newer macros 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: Vedant Paranjape via libcamera-devel From: Vedant Paranjape Reply-To: Vedant Paranjape Cc: nicolas.dufresne@collabora.com, Vedant Paranjape Errors-To: libcamera-devel-bounces@lists.libcamera.org Sender: "libcamera-devel" GST_VIDEO_TRANSFER_BT601 and GST_VIDEO_TRANSFER_BT2020_10 macros are defined in GST Version 1.18.0. Use of these macros breaks libcamera if GST_VERSION < 1.18.0, these macros are used only if GST_VERSION >= 1.18.0. Fixes the following compilation error: ../src/gstreamer/gstlibcamera-utils.cpp:157:7: error: ‘GST_VIDEO_TRANSFER_BT601’ was not declared in this scope; did you mean ‘GST_VIDEO_TRANSFER_BT709’? 157 | case GST_VIDEO_TRANSFER_BT601: | ^~~~~~~~~~~~~~~~~~~~~~~~ | GST_VIDEO_TRANSFER_BT709 ../src/gstreamer/gstlibcamera-utils.cpp:159:7: error: ‘GST_VIDEO_TRANSFER_BT2020_10’ was not declared in this scope; did you mean ‘GST_VIDEO_TRANSFER_BT2020_12’? 159 | case GST_VIDEO_TRANSFER_BT2020_10: | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~ | GST_VIDEO_TRANSFER_BT2020_12 Signed-off-by: Vedant Paranjape Reviewed-by: Umang Jain Tested-by: Rishikesh Donadkar Reviewed-by: Rishikesh Donadkar --- src/gstreamer/gstlibcamera-utils.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/gstreamer/gstlibcamera-utils.cpp b/src/gstreamer/gstlibcamera-utils.cpp index 4df5dd6c14fd..244a4a79845d 100644 --- a/src/gstreamer/gstlibcamera-utils.cpp +++ b/src/gstreamer/gstlibcamera-utils.cpp @@ -154,9 +154,11 @@ colorspace_from_colorimetry(const GstVideoColorimetry &colorimetry) case GST_VIDEO_TRANSFER_SRGB: colorspace->transferFunction = ColorSpace::TransferFunction::Srgb; break; +#if GST_CHECK_VERSION(1, 18, 0) case GST_VIDEO_TRANSFER_BT601: - case GST_VIDEO_TRANSFER_BT2020_12: case GST_VIDEO_TRANSFER_BT2020_10: +#endif + case GST_VIDEO_TRANSFER_BT2020_12: case GST_VIDEO_TRANSFER_BT709: colorspace->transferFunction = ColorSpace::TransferFunction::Rec709; break;