From patchwork Mon Sep 12 13:05:09 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Vedant Paranjape X-Patchwork-Id: 17364 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 D9380C0DA4 for ; Mon, 12 Sep 2022 13:05:38 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 3E7F761F96; Mon, 12 Sep 2022 15:05:38 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org; s=mail; t=1662987938; bh=0uIeSjYr9cwJd0SgicyL7Z2GSdkdIPsxBjW8kqzcA2M=; h=To:Date:Subject:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:Cc:From; b=hJLvL6292oCK2T5VWgQxV4WHmJ/vF/syrNvabaILGhEeybrXsgYz6A7xxLjaQO8OM YPvs8gAOVlAABCak900TfMV5fhLwjF08gvD/eJ7JE5HzHfyeQr4CDnjnErTzIP68Dg s3m2HriyJJCidSyBmxShb6WRrLbwNmlFzDn+L56Le+Sc4SI0zWWXDuwQteVeK9U2nr vVnM9zSYpzKAX5LqbjWAjlVyF/mf2+lUwpGkZG8f7t7qRopA//exJeeepKjt0LxYZq Brb1Vx9VLXfPkaMG2RAdLLuc8706hGOnJHUH7T+3VDyQdnqSJG9jRAnakREPI65CKH FV6HyAkd57E0A== Received: from mail-pg1-x52b.google.com (mail-pg1-x52b.google.com [IPv6:2607:f8b0:4864:20::52b]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 47079609A6 for ; Mon, 12 Sep 2022 15:05:37 +0200 (CEST) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="lVW4PDDp"; dkim-atps=neutral Received: by mail-pg1-x52b.google.com with SMTP id v4so8200716pgi.10 for ; Mon, 12 Sep 2022 06:05:37 -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=wMo5O4sCT7W9/K5qIrU5DCbveSDA8Ynv/ciawFU0+Zc=; b=lVW4PDDp2uMK03vCafk0DxV7TxsooA4RTtqa+SexW+g3JnXSi2mOPVfaINN5YP0hhL kFPhjy3vQGrnsoYf29Vtb64kBYzCdOy1LueM68hhm+Fy4GSaaYCndiYmWs/wDr5Z0t5X PHn+c9ihdy1RqT3SC6REe8eTkoYx2ncdYXNGRDXJrs7WZxeqLAjfry9H7bdbZkCsL9Yg zJJEHbALq5Ly8pu0d6XBGEI6+zcSVLLFJgPOTqocn2kfHSj4W0aeYQkUHFS14uKeNzKg 7G7HuJjJBpfba68Yejl9uqP+zPDa3/MmFP7DTryi99Fjh8ThK6R1qtj6y/5OXl1jsn6H bt6A== 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=wMo5O4sCT7W9/K5qIrU5DCbveSDA8Ynv/ciawFU0+Zc=; b=ytUQqUVTQ6aIjDY2AUVmBYddMhwSECt5ROwJ4YNvyYhWRQLib19kzYfHN1DnAg5JqT 9daDWjJJxgYFBia6hNW7glzmf2VDOjS0vz8NeRYzYaIrZ7oflKYyubmG0TrCiRA1NpPq 7C0wDup+LBVd0J5gFqanIMzEplI17ASbOqGDU27K6/eT9jlUnjJtkBymmsR3sN2HiIXm u/zQb4m0Hm8QmAdMxaWHD2OEf+4gDTvjYJwMQwfC/I3vqB9yqtd2I9ITj7xSyY/DIro5 JeaLOKEwUTI1jKMgOhBj/lUvlKvpLXXq4kDoYKtpyCRC7cAWfNPhV3iY1qSiaky9xOJa /d1A== X-Gm-Message-State: ACgBeo2y+NB5BXb5GshKg92n+zoQnLHW7PaoHlVO2EWcWWExswLmcJhV UZMXPxfmRghoae1UO3TVULRKSMQvqGTDIA== X-Google-Smtp-Source: AA6agR4Bqd4/5twUCbzVO6NvZSeirpkkCGgVpLz6FYAVv6ROkrVfFboagQenwi1JEp4OA2ytN+S9oA== X-Received: by 2002:a05:6a00:1704:b0:53b:b450:a51d with SMTP id h4-20020a056a00170400b0053bb450a51dmr27550560pfc.79.1662987934659; Mon, 12 Sep 2022 06:05:34 -0700 (PDT) Received: from veware.localdomain ([111.125.221.181]) by smtp.googlemail.com with ESMTPSA id b7-20020a170903228700b0017509940418sm6012186plh.79.2022.09.12.06.05.32 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 12 Sep 2022 06:05:33 -0700 (PDT) To: libcamera-devel@lists.libcamera.org Date: Mon, 12 Sep 2022 18:35:09 +0530 Message-Id: <20220912130509.184968-1-vedantparanjape160201@gmail.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH v2] 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: 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. Usage of these macros causes gstlibcamera compilation failure if GST_VERSION < 1.18.0. These macros are used only if GST_VERSION >= 1.18.0. Fix 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 Reviewed-by: Kieran Bingham Reviewed-by: Laurent Pinchart --- 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;