{"id":17357,"url":"https://patchwork.libcamera.org/api/1.1/patches/17357/?format=json","web_url":"https://patchwork.libcamera.org/patch/17357/","project":{"id":1,"url":"https://patchwork.libcamera.org/api/1.1/projects/1/?format=json","name":"libcamera","link_name":"libcamera","list_id":"libcamera_core","list_email":"libcamera-devel@lists.libcamera.org","web_url":"","scm_url":"","webscm_url":""},"msgid":"<20220909213951.591934-1-vedantparanjape160201@gmail.com>","date":"2022-09-09T21:39:51","name":"[libcamera-devel] gstreamer: Check gstreamer version before using newer macros","commit_ref":"046f83e8df1ec0d58bc6ed80f71dc2ce6d8f7c58","pull_url":null,"state":"accepted","archived":false,"hash":"2901fad26f621a507e2214a8977e311f9783daeb","submitter":{"id":85,"url":"https://patchwork.libcamera.org/api/1.1/people/85/?format=json","name":"Vedant Paranjape","email":"vedantparanjape160201@gmail.com"},"delegate":null,"mbox":"https://patchwork.libcamera.org/patch/17357/mbox/","series":[{"id":3478,"url":"https://patchwork.libcamera.org/api/1.1/series/3478/?format=json","web_url":"https://patchwork.libcamera.org/project/libcamera/list/?series=3478","date":"2022-09-09T21:39:51","name":"[libcamera-devel] gstreamer: Check gstreamer version before using newer macros","version":1,"mbox":"https://patchwork.libcamera.org/series/3478/mbox/"}],"comments":"https://patchwork.libcamera.org/api/patches/17357/comments/","check":"pending","checks":"https://patchwork.libcamera.org/api/patches/17357/checks/","tags":{},"headers":{"Return-Path":"<libcamera-devel-bounces@lists.libcamera.org>","X-Original-To":"parsemail@patchwork.libcamera.org","Delivered-To":"parsemail@patchwork.libcamera.org","Received":["from lancelot.ideasonboard.com (lancelot.ideasonboard.com\n\t[92.243.16.209])\n\tby patchwork.libcamera.org (Postfix) with ESMTPS id 29935C3272\n\tfor <parsemail@patchwork.libcamera.org>;\n\tFri,  9 Sep 2022 21:40:24 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 514AB620AB;\n\tFri,  9 Sep 2022 23:40:23 +0200 (CEST)","from mail-pf1-x42f.google.com (mail-pf1-x42f.google.com\n\t[IPv6:2607:f8b0:4864:20::42f])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 2601D62046\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tFri,  9 Sep 2022 23:40:22 +0200 (CEST)","by mail-pf1-x42f.google.com with SMTP id y136so2860764pfb.3\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tFri, 09 Sep 2022 14:40:22 -0700 (PDT)","from veware.localdomain ([111.125.221.115])\n\tby smtp.googlemail.com with ESMTPSA id\n\tx7-20020aa79ac7000000b0053804c5b4aesm186062pfp.208.2022.09.09.14.40.16\n\t(version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n\tFri, 09 Sep 2022 14:40:18 -0700 (PDT)"],"DKIM-Signature":["v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org;\n\ts=mail; t=1662759623;\n\tbh=QcgpbSGKMVYJLmdqhCw7TGxtFOg7oUuh9giJp5aBYks=;\n\th=To:Date:Subject:List-Id:List-Unsubscribe:List-Archive:List-Post:\n\tList-Help:List-Subscribe:From:Reply-To:Cc:From;\n\tb=n5+YxMScgFcbR5qeL4CHsSjIybuEjUHWBXBlCxuPmcoZPpdrk/BPqxHm0J/KSqcAO\n\tqWtc4VmqLUvTMplKrAv2FVQEDfeRCLhIQtISnPpAOC50d+oeB4pQOj+MiJxhu0+wSn\n\tyxlsPlc1pTT34AdtgkaY1W7m1wl9KZAcX6eQPot4iAVRVrQ0G+kLaeoyOyrKklH3X/\n\tW5cKMA29hDEC+4Fr2C3oEspwbmDZ6TgstniSGAqTPDKCnUDv5Jw/Aavkq9/AI0bq9S\n\tJnZMmHmw5ZxFMEs0YpIN02vSAO6NVhEBEfiEtwVEMbE146YQYn9Oyw51X9a2wj0dNl\n\tYGN0kO0YZFjZA==","v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112;\n\th=content-transfer-encoding:mime-version:message-id:date:subject:cc\n\t:to:from:from:to:cc:subject:date;\n\tbh=M+0w8HiqVCRXKnUvQ4zgSHaSwqij8X9Em+9OVUIvXnk=;\n\tb=m9W4qqAp3Pg0svti7tqbK6bc2K1LON5LtF0F54CNWtEPJOzNTOO0tuhQ3bG7/hzF7Z\n\tZjobrMxf/XUCkGY/EDNczF4pPxJQ1p6P5RWiFYSeCOUGZr6tMWZtJFApUFInNEfcCAOk\n\tMUPzQeFBn75FM5EJhsD6wgnDOZiKGzJl1wLvZFGaI4rzqHqcRoMmjimpstfIwbdmlVo4\n\tqfBdSKPHhlnsiaqBMWCaxnNcO/2rx3Nc3RbcFtZv6mOECo6NAeo1dnTtgENQuEaKll4Z\n\tcQx58+MlnSgw3bPwrkOUv845qCIIje+1r9INHQViMuhhGOmB2Yu2dHdHecloYDfbOCMz\n\tWeVA=="],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (2048-bit key; \n\tunprotected) header.d=gmail.com header.i=@gmail.com\n\theader.b=\"m9W4qqAp\"; dkim-atps=neutral","X-Google-DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20210112;\n\th=content-transfer-encoding:mime-version:message-id:date:subject:cc\n\t:to:from:x-gm-message-state:from:to:cc:subject:date;\n\tbh=M+0w8HiqVCRXKnUvQ4zgSHaSwqij8X9Em+9OVUIvXnk=;\n\tb=kvuM6bNCDDmYL+g7ZkYG7/DHeTMEGifEOUzs4ZnUIviL3fa13JBsPGZ+ugQyc0Ejm2\n\tmQMLcc1oPW3/3Qj1jqoXtLOOtYLf4lG2JRf1hmSKTIU6AP8ihGqFI1extEvT/Q7Lsiot\n\tNjCg6q9CoEeEOdoai64F/BUTXh16ShvuYZrvqbyrVG3EyWr+Km0eOs9FVEmwGpxJm/0l\n\tXyDWHG746M99YwEMuWpRpyLnuo/76gTM2jq0ecr+dDrYFh9XJLdVMoK/V/iX79e5WxFG\n\t1eiKglBtDp0wcZqYb6LexsTgwFoWoFULKlzsl0CHL31hpA4HWfbVQRxAkyoGivg6JfM2\n\tGUZA==","X-Gm-Message-State":"ACgBeo1hyC1MS1QS7R6loRtrH/DkbjKLT1YPXkL7LDvjSi9d42McvawJ\n\tfUn8MmH6eMidHDz+aJvErUNaIT8wrtTtzg==","X-Google-Smtp-Source":"AA6agR7f7AK4SG9DtKEv+4MSM9zCdZI4fs1nUWdBHcConNaHLA1rep8ajtDpfJf9eQIynB6QCD2tQA==","X-Received":"by 2002:a05:6a00:124d:b0:538:295a:1c48 with SMTP id\n\tu13-20020a056a00124d00b00538295a1c48mr16043752pfi.72.1662759619663; \n\tFri, 09 Sep 2022 14:40:19 -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","Content-Type":"text/plain; charset=UTF-8","Content-Transfer-Encoding":"8bit","Subject":"[libcamera-devel] [PATCH] gstreamer: Check gstreamer version before\n\tusing newer macros","X-BeenThere":"libcamera-devel@lists.libcamera.org","X-Mailman-Version":"2.1.29","Precedence":"list","List-Id":"<libcamera-devel.lists.libcamera.org>","List-Unsubscribe":"<https://lists.libcamera.org/options/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=unsubscribe>","List-Archive":"<https://lists.libcamera.org/pipermail/libcamera-devel/>","List-Post":"<mailto:libcamera-devel@lists.libcamera.org>","List-Help":"<mailto:libcamera-devel-request@lists.libcamera.org?subject=help>","List-Subscribe":"<https://lists.libcamera.org/listinfo/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=subscribe>","From":"Vedant Paranjape via libcamera-devel\n\t<libcamera-devel@lists.libcamera.org>","Reply-To":"Vedant Paranjape <vedantparanjape160201@gmail.com>","Cc":"nicolas.dufresne@collabora.com,\n\tVedant Paranjape <vedantparanjape160201@gmail.com>","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"},"content":"GST_VIDEO_TRANSFER_BT601 and GST_VIDEO_TRANSFER_BT2020_10 macros are\ndefined in GST Version 1.18.0.\n\nUse of these macros breaks libcamera if GST_VERSION < 1.18.0, these\nmacros are used only if GST_VERSION >= 1.18.0. Fixes the following\ncompilation error:\n\n../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’?\n  157 |  case GST_VIDEO_TRANSFER_BT601:\n      |       ^~~~~~~~~~~~~~~~~~~~~~~~\n      |       GST_VIDEO_TRANSFER_BT709\n../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’?\n  159 |  case GST_VIDEO_TRANSFER_BT2020_10:\n      |       ^~~~~~~~~~~~~~~~~~~~~~~~~~~~\n      |       GST_VIDEO_TRANSFER_BT2020_12\n\nSigned-off-by: Vedant Paranjape <vedantparanjape160201@gmail.com>\n---\n src/gstreamer/gstlibcamera-utils.cpp | 4 +++-\n 1 file changed, 3 insertions(+), 1 deletion(-)","diff":"diff --git a/src/gstreamer/gstlibcamera-utils.cpp b/src/gstreamer/gstlibcamera-utils.cpp\nindex 4df5dd6c14fd..244a4a79845d 100644\n--- a/src/gstreamer/gstlibcamera-utils.cpp\n+++ b/src/gstreamer/gstlibcamera-utils.cpp\n@@ -154,9 +154,11 @@ colorspace_from_colorimetry(const GstVideoColorimetry &colorimetry)\n \tcase GST_VIDEO_TRANSFER_SRGB:\n \t\tcolorspace->transferFunction = ColorSpace::TransferFunction::Srgb;\n \t\tbreak;\n+#if GST_CHECK_VERSION(1, 18, 0)\n \tcase GST_VIDEO_TRANSFER_BT601:\n-\tcase GST_VIDEO_TRANSFER_BT2020_12:\n \tcase GST_VIDEO_TRANSFER_BT2020_10:\n+#endif\n+\tcase GST_VIDEO_TRANSFER_BT2020_12:\n \tcase GST_VIDEO_TRANSFER_BT709:\n \t\tcolorspace->transferFunction = ColorSpace::TransferFunction::Rec709;\n \t\tbreak;\n","prefixes":["libcamera-devel"]}