From patchwork Mon Apr 25 14:46:14 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hanlin Chen X-Patchwork-Id: 15704 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 49890C3256 for ; Mon, 25 Apr 2022 14:46:26 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 84DCB6563A; Mon, 25 Apr 2022 16:46:25 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org; s=mail; t=1650897985; bh=7lCKJ3QYZixIQ/xUvkbjF75+hkPjGbVrCvTDvsqhwOg=; h=To:Date:Subject:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:From; b=B6vkhbK+6Uir0vmnGHetdVIn9v2QC6eaE6U9lhny5EIxHTw64L8nnLM25tqL6Tgrn cmbn6xif6Lc+vmRD2Fwhb+djV2SOF5W5vpPdKjTLxaJiL/aK+k5n31XhI/qvpBBlZY ut/AVkUGXsHWKROJPJBpdPIV/RPugLgudFaDca3JMLrSSvz1LxohAiqXWZ46pSHtMI a1WZ/D79gTMe5A88bB8umUpTy6gtygcHgXiMBce11+hEyP7rdu3qY7zumfK7jrfXJW ijCxL+b1BBv5phL1Hx75opqYdLUFqbbWwisO09tskJJCFLqK+CrpnPkwzui8Kq8tg1 WmVKbipEiis/Q== Received: from mail-pg1-x52c.google.com (mail-pg1-x52c.google.com [IPv6:2607:f8b0:4864:20::52c]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id DDD7A6042F for ; Mon, 25 Apr 2022 16:46:23 +0200 (CEST) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.b="WogHRc1B"; dkim-atps=neutral Received: by mail-pg1-x52c.google.com with SMTP id bg9so13596226pgb.9 for ; Mon, 25 Apr 2022 07:46:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=NzXNaowYkGtlrBTulceG3HCr0e2dYwJ79+CKIBm4mDM=; b=WogHRc1BOKBOlTlbTtzO3pFp2o+aNJ3iQ+a1+ehJz4S1o676WKY7jCkLnGxH9Iim2+ joc0eXp/CjlNRnYBPjZq+BcRmfx8oHrf4hIvT3l2F4V1kVD1PdG7435wxZNE8CN6YxVO R2/xwDWHghfj8JEVXfZjgyyEuQ02DtLOeN5JE= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=NzXNaowYkGtlrBTulceG3HCr0e2dYwJ79+CKIBm4mDM=; b=W96dhsT51S0mWPx+BDFifOOorOnk0jlSgZOTT+zDKlcsynxFKmRrnIa+iUIso9/yjS u0pYz4EOjUA0zSpTmjIf0NHEy+hJqo2g5htaYShy0+iL64hmxSi0bAI6xdVm6ktTTZpC ltYWrakFcEj+41Dq/mDOSRot56O6Um4RxYnuh9pEGgCVD6viBcqTujHHLex8D4krIwDg ujOsHeaz/zWkmbU4ClV7rBFtq5G9a/KBVkUPg+Faq9XlOGpKKtiYS6W21ms48vsIfnpL BvjMeEWkYWwAcxfKlGGRWYo4jgW2KIUx54rV8YUdM34Wl6asl81KUfOQ/uRxmsBAvbGb qHtw== X-Gm-Message-State: AOAM5330oXqQyn8TOqUFiQfsCn+Vmg2nL3bA3D14A0yOC6VFiUYefPa9 9d0+kDQKpE7nsC1RRSSKHm23AOPbkUzugw== X-Google-Smtp-Source: ABdhPJzLtL570VsUojLtDTMAhpjCeIQ5hptZ3UrQ8BlrOtc5FdTMuVQnTlLdbvfv1uA1VpJZ9RM3UA== X-Received: by 2002:a05:6a00:1a05:b0:50c:f9b5:6c7e with SMTP id g5-20020a056a001a0500b0050cf9b56c7emr14601502pfv.55.1650897982065; Mon, 25 Apr 2022 07:46:22 -0700 (PDT) Received: from localhost ([2401:fa00:1:17:38a2:b0a:67fa:9b05]) by smtp.gmail.com with UTF8SMTPSA id b10-20020a63d80a000000b003ab5ca7531fsm2501947pgh.65.2022.04.25.07.46.21 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 25 Apr 2022 07:46:21 -0700 (PDT) To: libcamera-devel@lists.libcamera.org Date: Mon, 25 Apr 2022 22:46:14 +0800 Message-Id: <20220425144617.2549778-1-hanlinchen@chromium.org> X-Mailer: git-send-email 2.36.0.rc2.479.g8af0fa9b8e-goog MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH v5 0/3] Introduce YamlParser for YAML files 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: Han-Lin Chen via libcamera-devel From: Hanlin Chen Reply-To: Han-Lin Chen Errors-To: libcamera-devel-bounces@lists.libcamera.org Sender: "libcamera-devel" Hi, Patch v5 including following changes: 1. Add unit test for YamlParser. 2. Remove the peek semantic for event and always consume next event 3. Remove assert for invalid operations. Change it to return an empty object. 4. Resolving other comments. Han-Lin Chen (3): libcamera: Introduce YamlParser as a helper to parse yaml files test: Add YamlParser test android: camera_hal_config: Use YamlParser to parse android HAL config README.rst | 4 +- include/libcamera/internal/meson.build | 1 + include/libcamera/internal/yaml_parser.h | 87 +++ src/android/camera_hal_config.cpp | 334 +++-------- src/android/meson.build | 1 - src/libcamera/meson.build | 3 + src/libcamera/yaml_parser.cpp | 679 +++++++++++++++++++++++ test/meson.build | 1 + test/yaml-parser.cpp | 496 +++++++++++++++++ 9 files changed, 1343 insertions(+), 263 deletions(-) create mode 100644 include/libcamera/internal/yaml_parser.h create mode 100644 src/libcamera/yaml_parser.cpp create mode 100644 test/yaml-parser.cpp