{"id":3644,"url":"https://patchwork.libcamera.org/api/patches/3644/?format=json","web_url":"https://patchwork.libcamera.org/patch/3644/","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":"<20200501023432.90032-3-niklas.soderlund@ragnatech.se>","date":"2020-05-01T02:34:28","name":"[libcamera-devel,v3,2/6] cam: options: Add public method to invalidate options","commit_ref":null,"pull_url":null,"state":"accepted","archived":false,"hash":"a0750afd165d656bc754372bd97fd7b4403449ed","submitter":{"id":5,"url":"https://patchwork.libcamera.org/api/people/5/?format=json","name":"Niklas Söderlund","email":"niklas.soderlund@ragnatech.se"},"delegate":null,"mbox":"https://patchwork.libcamera.org/patch/3644/mbox/","series":[{"id":864,"url":"https://patchwork.libcamera.org/api/series/864/?format=json","web_url":"https://patchwork.libcamera.org/project/libcamera/list/?series=864","date":"2020-05-01T02:34:27","name":"{cam, qcam}: Unify stream option parsing","version":3,"mbox":"https://patchwork.libcamera.org/series/864/mbox/"}],"comments":"https://patchwork.libcamera.org/api/patches/3644/comments/","check":"pending","checks":"https://patchwork.libcamera.org/api/patches/3644/checks/","tags":{},"headers":{"Return-Path":"<niklas.soderlund@ragnatech.se>","Received":["from bin-mail-out-06.binero.net (bin-mail-out-06.binero.net\n\t[195.74.38.229])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 6FB6B6149A\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tFri,  1 May 2020 04:34:43 +0200 (CEST)","from bismarck.berto.se (p4fca2392.dip0.t-ipconnect.de\n\t[79.202.35.146]) by bin-vsp-out-03.atm.binero.net (Halon) with ESMTPA\n\tid 4f4eebda-8b54-11ea-89d0-0050569116f7;\n\tFri, 01 May 2020 04:34:41 +0200 (CEST)"],"X-Halon-ID":"4f4eebda-8b54-11ea-89d0-0050569116f7","Authorized-sender":"niklas@soderlund.pp.se","From":"=?utf-8?q?Niklas_S=C3=B6derlund?= <niklas.soderlund@ragnatech.se>","To":"libcamera-devel@lists.libcamera.org","Date":"Fri,  1 May 2020 04:34:28 +0200","Message-Id":"<20200501023432.90032-3-niklas.soderlund@ragnatech.se>","X-Mailer":"git-send-email 2.26.2","In-Reply-To":"<20200501023432.90032-1-niklas.soderlund@ragnatech.se>","References":"<20200501023432.90032-1-niklas.soderlund@ragnatech.se>","MIME-Version":"1.0","Content-Type":"text/plain; charset=UTF-8","Content-Transfer-Encoding":"8bit","Subject":"[libcamera-devel] [PATCH v3 2/6] cam: options: Add public method to\n\tinvalidate options","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>","X-List-Received-Date":"Fri, 01 May 2020 02:34:43 -0000"},"content":"Extend OptionsBase<T> with a public invalidate() method. This allows for\nfurther examination of the options and if found unsuitable be\ninvalidated. The intended user for this new interface are subclasses of\nKeyValueParser.\n\nSigned-off-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>\nReviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\n---\n src/cam/options.cpp | 6 ++++++\n src/cam/options.h   | 2 ++\n 2 files changed, 8 insertions(+)","diff":"diff --git a/src/cam/options.cpp b/src/cam/options.cpp\nindex 2c56eacf006e9857..77b3cc1f8c5a59e9 100644\n--- a/src/cam/options.cpp\n+++ b/src/cam/options.cpp\n@@ -64,6 +64,12 @@ const OptionValue &OptionsBase<T>::operator[](const T &opt) const\n \treturn values_.find(opt)->second;\n }\n \n+template<typename T>\n+void OptionsBase<T>::invalidate()\n+{\n+\tvalid_ = false;\n+}\n+\n template<typename T>\n bool OptionsBase<T>::parseValue(const T &opt, const Option &option,\n \t\t\t\tconst char *optarg)\ndiff --git a/src/cam/options.h b/src/cam/options.h\nindex ad5c93a4fabd089f..184866195eef990a 100644\n--- a/src/cam/options.h\n+++ b/src/cam/options.h\n@@ -54,6 +54,8 @@ public:\n \tbool isSet(const T &opt) const;\n \tconst OptionValue &operator[](const T &opt) const;\n \n+\tvoid invalidate();\n+\n private:\n \tfriend class KeyValueParser;\n \tfriend class OptionsParser;\n","prefixes":["libcamera-devel","v3","2/6"]}