From patchwork Sat Apr 25 20:56:39 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Laurent Pinchart X-Patchwork-Id: 3543 X-Patchwork-Delegate: laurent.pinchart@ideasonboard.com Return-Path: Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [IPv6:2001:4b98:dc2:55:216:3eff:fef7:d647]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id B00DF62E55 for ; Sat, 25 Apr 2020 22:56:59 +0200 (CEST) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (1024-bit key; unprotected) header.d=ideasonboard.com header.i=@ideasonboard.com header.b="W60XNR2b"; dkim-atps=neutral Received: from pendragon.bb.dnainternet.fi (81-175-216-236.bb.dnainternet.fi [81.175.216.236]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id 3B015564; Sat, 25 Apr 2020 22:56:59 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1587848219; bh=vhWaM15xgjS3IHFmWEkHWTr0/iGBGgVlT8pxyKQ2/6Q=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=W60XNR2b6XVydXGRAYYkwejvUo0/HwUgm78XVXvwNfOghix8aOZ4ERoGfFEtZ7wUR tQUgNwyIqlPtO13UqGvrJwHWEwd6208jL7yEj0uQtbG8YaxGdt4NfhV95Fjy8odA2u j6zOBBVtFj+lZMAuX4kwPgtv5ty2NXk0im3koFA4= From: Laurent Pinchart To: libcamera-devel@lists.libcamera.org Date: Sat, 25 Apr 2020 23:56:39 +0300 Message-Id: <20200425205639.30566-2-laurent.pinchart@ideasonboard.com> X-Mailer: git-send-email 2.25.3 In-Reply-To: <20200425205639.30566-1-laurent.pinchart@ideasonboard.com> References: <20200425205639.30566-1-laurent.pinchart@ideasonboard.com> MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH 2/2] [DNI] test: Test serialization of Rectangle and Size controls 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-List-Received-Date: Sat, 25 Apr 2020 20:56:59 -0000 This patch should be rebased on real controls once available. Signed-off-by: Laurent Pinchart --- src/libcamera/control_ids.yaml | 18 ++++++++++++++++++ test/serialization/control_serialization.cpp | 5 +++++ 2 files changed, 23 insertions(+) diff --git a/src/libcamera/control_ids.yaml b/src/libcamera/control_ids.yaml index 4befec746a59..b1ae03e5b0ff 100644 --- a/src/libcamera/control_ids.yaml +++ b/src/libcamera/control_ids.yaml @@ -50,4 +50,22 @@ controls: type: int32_t description: Specify a fixed gain parameter + - TheRectangle: + type: Rectangle + description: A Rectangle property + + - TheRectangles: + type: Rectangle + description: A Rectangle array property + size: [n] + + - TheSize: + type: Size + description: A Size property + + - TheSizes: + type: Size + description: A Size array property + size: [n] + ... diff --git a/test/serialization/control_serialization.cpp b/test/serialization/control_serialization.cpp index 2989b52774fb..789e0d83f4e4 100644 --- a/test/serialization/control_serialization.cpp +++ b/test/serialization/control_serialization.cpp @@ -45,6 +45,11 @@ protected: list.set(controls::Brightness, 255); list.set(controls::Contrast, 128); list.set(controls::Saturation, 50); + list.set(controls::TheRectangle, Rectangle{ 100, 100, 640, 480 }); + list.set(controls::TheRectangles, { Rectangle{ 100, 100, 640, 480 }, + Rectangle{ 200, 200, 1280, 720 } }); + list.set(controls::TheSize, Size{ 640, 480 }); + list.set(controls::TheSizes, { Size{ 640, 480 }, Size{ 1280, 720 } }); /* * Serialize the control list, this should fail as the control