{"id":2942,"url":"https://patchwork.libcamera.org/api/1.1/patches/2942/?format=json","web_url":"https://patchwork.libcamera.org/patch/2942/","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":"<20200229164254.23604-26-laurent.pinchart@ideasonboard.com>","date":"2020-02-29T16:42:48","name":"[libcamera-devel,25/31] libcamera: control_serializer: Simplify serialization of ControlValue","commit_ref":null,"pull_url":null,"state":"superseded","archived":false,"hash":"303c963025e37823dd258b0342d82ae1acbc383c","submitter":{"id":2,"url":"https://patchwork.libcamera.org/api/1.1/people/2/?format=json","name":"Laurent Pinchart","email":"laurent.pinchart@ideasonboard.com"},"delegate":null,"mbox":"https://patchwork.libcamera.org/patch/2942/mbox/","series":[{"id":696,"url":"https://patchwork.libcamera.org/api/1.1/series/696/?format=json","web_url":"https://patchwork.libcamera.org/project/libcamera/list/?series=696","date":"2020-02-29T16:42:23","name":"libcamera: Add support for array controls","version":1,"mbox":"https://patchwork.libcamera.org/series/696/mbox/"}],"comments":"https://patchwork.libcamera.org/api/patches/2942/comments/","check":"pending","checks":"https://patchwork.libcamera.org/api/patches/2942/checks/","tags":{},"headers":{"Return-Path":"<laurent.pinchart@ideasonboard.com>","Received":["from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[IPv6:2001:4b98:dc2:55:216:3eff:fef7:d647])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 2412E6279E\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tSat, 29 Feb 2020 17:43:31 +0100 (CET)","from pendragon.bb.dnainternet.fi (81-175-216-236.bb.dnainternet.fi\n\t[81.175.216.236])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id B4F1DA28\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tSat, 29 Feb 2020 17:43:30 +0100 (CET)"],"DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1582994610;\n\tbh=GN++EwtLbNzNVWBcuyBmbQ/OJB1OHW3zU6QAvEQhw0U=;\n\th=From:To:Subject:Date:In-Reply-To:References:From;\n\tb=eFJ875+dMRTwa4KRMDVv7XOHzHtt9lFyZLoOpYfiDXS18sw6Q+L7Q3/DU7L9jNfYZ\n\t50wGHNJ3YMrVnACGZjtqVp2fodwcrXWFEIju9AvG2ZeSdiz1SrgzCwJsJYLLckEf7x\n\t6JGg7rX6u1HHcXpuBKbZralaTlPEhUs4o1/7+eSg=","From":"Laurent Pinchart <laurent.pinchart@ideasonboard.com>","To":"libcamera-devel@lists.libcamera.org","Date":"Sat, 29 Feb 2020 18:42:48 +0200","Message-Id":"<20200229164254.23604-26-laurent.pinchart@ideasonboard.com>","X-Mailer":"git-send-email 2.24.1","In-Reply-To":"<20200229164254.23604-1-laurent.pinchart@ideasonboard.com>","References":"<20200229164254.23604-1-laurent.pinchart@ideasonboard.com>","MIME-Version":"1.0","Content-Transfer-Encoding":"8bit","Subject":"[libcamera-devel] [PATCH 25/31] libcamera: control_serializer:\n\tSimplify serialization of ControlValue","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":"Sat, 29 Feb 2020 16:43:36 -0000"},"content":"Use the ControlValue::data() function to access raw data stored in the\ncontrol value and simplify serialization.\n\nSigned-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\n---\n src/libcamera/control_serializer.cpp | 35 +---------------------------\n 1 file changed, 1 insertion(+), 34 deletions(-)","diff":"diff --git a/src/libcamera/control_serializer.cpp b/src/libcamera/control_serializer.cpp\nindex 5537c5466025..dc87b96f384b 100644\n--- a/src/libcamera/control_serializer.cpp\n+++ b/src/libcamera/control_serializer.cpp\n@@ -146,40 +146,7 @@ size_t ControlSerializer::binarySize(const ControlList &list)\n void ControlSerializer::store(const ControlValue &value,\n \t\t\t      ByteStreamBuffer &buffer)\n {\n-\tswitch (value.type()) {\n-\tcase ControlTypeBool: {\n-\t\tbool data = value.get<bool>();\n-\t\tbuffer.write(&data);\n-\t\tbreak;\n-\t}\n-\n-\tcase ControlTypeInteger8: {\n-\t\tint8_t data = value.get<int8_t>();\n-\t\tbuffer.write(&data);\n-\t\tbreak;\n-\t}\n-\n-\tcase ControlTypeInteger32: {\n-\t\tint32_t data = value.get<int32_t>();\n-\t\tbuffer.write(&data);\n-\t\tbreak;\n-\t}\n-\n-\tcase ControlTypeInteger64: {\n-\t\tuint64_t data = value.get<int64_t>();\n-\t\tbuffer.write(&data);\n-\t\tbreak;\n-\t}\n-\n-\tcase ControlTypeFloat: {\n-\t\tfloat data = value.get<float>();\n-\t\tbuffer.write(&data);\n-\t\tbreak;\n-\t}\n-\n-\tdefault:\n-\t\tbreak;\n-\t}\n+\tbuffer.write(value.data());\n }\n \n void ControlSerializer::store(const ControlRange &range,\n","prefixes":["libcamera-devel","25/31"]}