{"id":18250,"url":"https://patchwork.libcamera.org/api/patches/18250/?format=json","web_url":"https://patchwork.libcamera.org/patch/18250/","project":{"id":1,"url":"https://patchwork.libcamera.org/api/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":"<20230203094424.25243-6-naush@raspberrypi.com>","date":"2023-02-03T09:44:21","name":"[libcamera-devel,v1,5/8] libcamera: apps: lcc: Make rolesMap global","commit_ref":null,"pull_url":null,"state":"new","archived":false,"hash":"e92f87e1a96cd23db6e69ae667409db1fa788396","submitter":{"id":34,"url":"https://patchwork.libcamera.org/api/people/34/?format=json","name":"Naushir Patuck","email":"naush@raspberrypi.com"},"delegate":null,"mbox":"https://patchwork.libcamera.org/patch/18250/mbox/","series":[{"id":3739,"url":"https://patchwork.libcamera.org/api/series/3739/?format=json","web_url":"https://patchwork.libcamera.org/project/libcamera/list/?series=3739","date":"2023-02-03T09:44:16","name":"Stream hints","version":1,"mbox":"https://patchwork.libcamera.org/series/3739/mbox/"}],"comments":"https://patchwork.libcamera.org/api/patches/18250/comments/","check":"pending","checks":"https://patchwork.libcamera.org/api/patches/18250/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 3781FC329C\n\tfor <parsemail@patchwork.libcamera.org>;\n\tFri,  3 Feb 2023 09:44:35 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id D7470625EB;\n\tFri,  3 Feb 2023 10:44:34 +0100 (CET)","from mail-wr1-x42e.google.com (mail-wr1-x42e.google.com\n\t[IPv6:2a00:1450:4864:20::42e])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id EA24D625EF\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tFri,  3 Feb 2023 10:44:30 +0100 (CET)","by mail-wr1-x42e.google.com with SMTP id h16so4078210wrz.12\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tFri, 03 Feb 2023 01:44:30 -0800 (PST)","from localhost.localdomain ([93.93.133.154])\n\tby smtp.gmail.com with ESMTPSA id\n\tf17-20020a5d50d1000000b002bfe266d710sm1562503wrt.90.2023.02.03.01.44.29\n\t(version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n\tFri, 03 Feb 2023 01:44:29 -0800 (PST)"],"DKIM-Signature":["v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org;\n\ts=mail; t=1675417474;\n\tbh=oJDUAEahPnQTy8VjBnFaA8X0iM7MlZ41x4e3hveQ0hw=;\n\th=To:Date:In-Reply-To:References:Subject:List-Id:List-Unsubscribe:\n\tList-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:\n\tFrom;\n\tb=ZxOpmY8K1sG4vPIzCzztvCtHySu8+o8unfxHmMouWEnsfOL9JTjHmxfCUGjoCOYqy\n\tfuobu+Xs3Z9rQXUhdk+s0+r6a0U2Ng2OMnsDcIuYMthXeLGJR1wuOGgNXepSATZcls\n\tpfU/Fhlaod7kLEZMwBvVV7Gi6NswfvXcVZ7nFqkGcpM++1txQNSHE7GkgEAz17m66T\n\timcib2fTjbatmgD/+ZG6bY56S8PfvHVIa2f+YeVK1YFZbCRg1+DeSA8PW15v5gvbhc\n\tmQUvGO1H/xNcvCSA0DiI7L6EZ7Y5KG5rgLO8t2m9182NQiqtkLfc09pZFy0UD6JBj5\n\tqgDKKmIljjyRQ==","v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=raspberrypi.com; s=google;\n\th=content-transfer-encoding:mime-version:references:in-reply-to\n\t:message-id:date:subject:cc:to:from:from:to:cc:subject:date\n\t:message-id:reply-to;\n\tbh=jWVV/JyEAPl4kBWc5ldf5h6NOU1c89AUGkoy8ucYGBU=;\n\tb=NRb+2/HCd1oet1cyBj66yj8cZF54g/7Q0a75cobvK0oIidV5L5esSjT+1eBX1GY53u\n\tymeDZ3QyVBy5mUmf0SnwVpMFUEpj9wZqoHhbByXRX0/QKGRUbiEEESBNhzfkfxkl+YYr\n\t4MpZPIdsNU+ftjCdITynvgzuJq2IU+iNV61stqL1Cn8FO+z5CWLDfxJUujp6EhBJjkJM\n\tdk1PK3zM15af2nvimEfqPHNkJ9vOPQ3nlWiSrLdSul75X5U+N0Rrvl3WZGnMHOtk6zlL\n\tFq96iKCsdg2Ll+9JZ3TraI+NYqV/CqqiK2e8+7ONsq5bjWYxZmnA+3RoS02hmGO1sedq\n\tewlA=="],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (2048-bit key; \n\tunprotected) header.d=raspberrypi.com\n\theader.i=@raspberrypi.com\n\theader.b=\"NRb+2/HC\"; 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:references:in-reply-to\n\t:message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc\n\t:subject:date:message-id:reply-to;\n\tbh=jWVV/JyEAPl4kBWc5ldf5h6NOU1c89AUGkoy8ucYGBU=;\n\tb=X0CFK0GTwHm5eMQgc62KgMvwHn8kvDAgeBIGLhIyq/fLnK3MuX0HfInlbQxOdfBZWz\n\tIZG/IxGrm2gkreBryXS4ZZhCCsjlgANFa4XwVATNnboa+g6GBVtoS9R0pqfj/6eFuRva\n\tczXcaRvdSa9Rjp5qo0u6y2KwJUWoqGBpAE1Ao5ZrPLf2DKKjS9HpfC+Z/G9lN6G+eCs0\n\tDUuYrkgrxQ9bT3xfxkydocyx9cfH/8zZR1SZrJCHT8dUqLHn4V4LPPSM27032wzGED4l\n\tLAVMzwuqULbIswRQFJB1vDyBEBk47xchG7QiN6Zuso+ixNQyq9lQ1U1KqmeArxfOkn2B\n\tw3+Q==","X-Gm-Message-State":"AO0yUKXTq/z4y0k4xUVetoSznFNol2r9uZ81AmYY749g0MvGMMJ9iBO/\n\thSwi/N9itbB0v9TScquAqRNHTV2ADU6VG1Y6TaEgag==","X-Google-Smtp-Source":"AK7set+b0FVVXL6Tr46NO40Kp8aqeSMuPusH1IxWt9QIfv6Vd2dOlDlcYCfl9lYbpqL96Oz+kUA4Wg==","X-Received":"by 2002:adf:c644:0:b0:2c3:d707:7339 with SMTP id\n\tu4-20020adfc644000000b002c3d7077339mr736984wrg.6.1675417470285; \n\tFri, 03 Feb 2023 01:44:30 -0800 (PST)","To":"libcamera-devel@lists.libcamera.org","Date":"Fri,  3 Feb 2023 09:44:21 +0000","Message-Id":"<20230203094424.25243-6-naush@raspberrypi.com>","X-Mailer":"git-send-email 2.25.1","In-Reply-To":"<20230203094424.25243-1-naush@raspberrypi.com>","References":"<20230203094424.25243-1-naush@raspberrypi.com>","MIME-Version":"1.0","Content-Transfer-Encoding":"8bit","Subject":"[libcamera-devel] [PATCH v1 5/8] libcamera: apps: lcc: Make\n\trolesMap global","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":"Naushir Patuck via libcamera-devel\n\t<libcamera-devel@lists.libcamera.org>","Reply-To":"Naushir Patuck <naush@raspberrypi.com>","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"},"content":"Move rolesMap out of the nameParameters() function to allow use with\nother functions in the file. Additionally enclose all global variables\nin an unnamed namespace.\n\nSigned-off-by: Naushir Patuck <naush@raspberrypi.com>\n---\n src/apps/lc-compliance/capture_test.cpp | 18 +++++++++++-------\n 1 file changed, 11 insertions(+), 7 deletions(-)","diff":"diff --git a/src/apps/lc-compliance/capture_test.cpp b/src/apps/lc-compliance/capture_test.cpp\nindex 1dcfcf92fc8c..37138dfb3d2e 100644\n--- a/src/apps/lc-compliance/capture_test.cpp\n+++ b/src/apps/lc-compliance/capture_test.cpp\n@@ -15,6 +15,15 @@\n \n using namespace libcamera;\n \n+namespace {\n+\n+std::map<StreamRole, std::string> rolesMap = {\n+\t{ StreamRole::Raw, \"Raw\" },\n+\t{ StreamRole::StillCapture, \"StillCapture\" },\n+\t{ StreamRole::VideoRecording, \"VideoRecording\" },\n+\t{ StreamRole::Viewfinder, \"Viewfinder\" }\n+};\n+\n const std::vector<int> NUMREQUESTS = { 1, 2, 3, 5, 8, 13, 21, 34, 55, 89 };\n const std::vector<StreamRole> ROLES = {\n \tStreamRole::Raw,\n@@ -23,6 +32,8 @@ const std::vector<StreamRole> ROLES = {\n \tStreamRole::Viewfinder\n };\n \n+} /* namespace */\n+\n class SingleStream : public testing::TestWithParam<std::tuple<StreamRole, int>>\n {\n public:\n@@ -59,13 +70,6 @@ void SingleStream::TearDown()\n \n std::string SingleStream::nameParameters(const testing::TestParamInfo<SingleStream::ParamType> &info)\n {\n-\tstd::map<StreamRole, std::string> rolesMap = {\n-\t\t{ StreamRole::Raw, \"Raw\" },\n-\t\t{ StreamRole::StillCapture, \"StillCapture\" },\n-\t\t{ StreamRole::VideoRecording, \"VideoRecording\" },\n-\t\t{ StreamRole::Viewfinder, \"Viewfinder\" }\n-\t};\n-\n \tstd::string roleName = rolesMap[std::get<0>(info.param)];\n \tstd::string numRequestsName = std::to_string(std::get<1>(info.param));\n \n","prefixes":["libcamera-devel","v1","5/8"]}