From patchwork Fri Feb 25 14:14:03 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nejc Galof X-Patchwork-Id: 15390 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 137B0BF415 for ; Fri, 25 Feb 2022 14:14:23 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 55E2661171; Fri, 25 Feb 2022 15:14:21 +0100 (CET) Authentication-Results: lancelot.ideasonboard.com; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="QDzSchE/"; dkim-atps=neutral Received: from mail-wr1-x42c.google.com (mail-wr1-x42c.google.com [IPv6:2a00:1450:4864:20::42c]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id BC723601FE for ; Fri, 25 Feb 2022 15:14:19 +0100 (CET) Received: by mail-wr1-x42c.google.com with SMTP id n14so4720849wrq.7 for ; Fri, 25 Feb 2022 06:14:19 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:subject:date:message-id:in-reply-to:references; bh=ycMeKL8IMyr8fWY9hvjhAADL5kAkW88rwt7sRGgwXDw=; b=QDzSchE/mNXmAksC1liOGD9fDpCWaAcaBCNAKEGuUG/G9Yq0FhCbCr9pztUuxlrLAY CdyqtusmUaesWGCBO5p5ihJHj2lgBVab4Ghw46d1s8RmUHMaR3aVXlT8+k1OD1XiXrtK pFa8ODOJaw8Sc3uIRa4HNxH6Gkmno6bjFfh0udHU699kd+4VpqXTrJn6lIsEF67mh8DD tzRw6nn+DL4ag9v8Q2qTlyzflSFbEyqXhAz+D321snV+4g7RupKdrkWXUNxgA4/s5a2W L/XLIQM9bGFk7uwiIkiBKCUhVp/t0dCP41UdsiDTUPuw+7pXTcCkmsZUBG60LXiO+V34 30pg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references; bh=ycMeKL8IMyr8fWY9hvjhAADL5kAkW88rwt7sRGgwXDw=; b=XKUjxMwECnL9Y/Ol1BoQHCxTBQ7UqHd+JnPJObkIEIe7B3mwHg9U+47+F3TvSWcPlI UiA2BOV9kz4izYhssTQvyH+A9Exvs4BpEQNI96Xb5Il2DOfXWLDl1kfmhZrMoyiZw363 xpUJbwAbXV85OZEqKVit3KQHLSVlMTWzHvMXyDy+ZJtOB2ePLmQOlpHJ3FJRYMSRrWRi pK2W5tptwtSTBFbMz5pLEaUKeOEzI47+CkuR2QFPN7HfX5REnVKRohYQirS3KXqjXuv0 7AppLfz8lLhYw4wM7Lbn9olMCCyLrCOU5jYg7mJeaHoAnNjCZFJxQC/JtWbhpsVEujm/ u6qw== X-Gm-Message-State: AOAM532k2ut3wWHxJJly68D8SnqDlhrTquBPxtvQAf4aR6d2pp2Ptucr H12cdSnwzSsHU/NjdKeOsPRnhTATEfF4zg== X-Google-Smtp-Source: ABdhPJxXT1F6/mKNs/Op854B4gMLkuCZ22kJB92S0Y56Cz7MiEpm6G//s0gO1T5Nlu03xADI3K+oXw== X-Received: by 2002:a5d:4dce:0:b0:1ed:9fd1:53a2 with SMTP id f14-20020a5d4dce000000b001ed9fd153a2mr6291875wru.212.1645798459461; Fri, 25 Feb 2022 06:14:19 -0800 (PST) Received: from e28887faee29.8.8.8.8 ([91.224.238.83]) by smtp.gmail.com with ESMTPSA id i22-20020a05600c355600b0037bee3a4e00sm5963810wmq.47.2022.02.25.06.14.18 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 25 Feb 2022 06:14:19 -0800 (PST) From: Nejc Galof To: libcamera-devel@lists.libcamera.org Date: Fri, 25 Feb 2022 15:14:03 +0100 Message-Id: <20220225141403.53678-2-galof.nejc@gmail.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20220225141403.53678-1-galof.nejc@gmail.com> References: <20220225141403.53678-1-galof.nejc@gmail.com> Subject: [libcamera-devel] [PATCH 2/2] Fixed naming, delete unused include and simplify frameDuration calculation 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: , Errors-To: libcamera-devel-bounces@lists.libcamera.org Sender: "libcamera-devel" Signed-off-by: Nejc Galof --- src/v4l2/v4l2_camera.h | 2 -- src/v4l2/v4l2_camera_proxy.cpp | 7 +++---- src/v4l2/v4l2_camera_proxy.h | 2 +- 3 files changed, 4 insertions(+), 7 deletions(-) diff --git a/src/v4l2/v4l2_camera.h b/src/v4l2/v4l2_camera.h index 9e6c895a..4c203e31 100644 --- a/src/v4l2/v4l2_camera.h +++ b/src/v4l2/v4l2_camera.h @@ -10,8 +10,6 @@ #include #include -#include - #include #include #include diff --git a/src/v4l2/v4l2_camera_proxy.cpp b/src/v4l2/v4l2_camera_proxy.cpp index 8da42068..493c41c0 100644 --- a/src/v4l2/v4l2_camera_proxy.cpp +++ b/src/v4l2/v4l2_camera_proxy.cpp @@ -758,7 +758,7 @@ int V4L2CameraProxy::vidioc_streamoff(V4L2CameraFile *file, int *arg) return ret; } -int V4L2CameraProxy::vidioc_s_param(V4L2CameraFile *file, struct v4l2_streamparm *arg) +int V4L2CameraProxy::vidioc_s_parm(V4L2CameraFile *file, struct v4l2_streamparm *arg) { LOG(V4L2Compat, Debug) << "[" << file->description() << "] " << __func__ << "()"; @@ -767,8 +767,7 @@ int V4L2CameraProxy::vidioc_s_param(V4L2CameraFile *file, struct v4l2_streamparm return -EINVAL; struct v4l2_fract *timeperframe = &arg->parm.capture.timeperframe; - utils::Duration frameDuration = 1s * (static_cast(timeperframe->numerator) / - static_cast(timeperframe->denominator)); + utils::Duration frameDuration = 1.0s * timeperframe->numerator / timeperframe->denominator; int64_t uDuration = frameDuration.get(); vcam_->controls().set(controls::FrameDurationLimits, { uDuration, uDuration }); @@ -875,7 +874,7 @@ int V4L2CameraProxy::ioctl(V4L2CameraFile *file, unsigned long request, void *ar ret = vidioc_streamoff(file, static_cast(arg)); break; case VIDIOC_S_PARM: - ret = vidioc_s_param(file, static_cast(arg)); + ret = vidioc_s_parm(file, static_cast(arg)); break; default: ret = -ENOTTY; diff --git a/src/v4l2/v4l2_camera_proxy.h b/src/v4l2/v4l2_camera_proxy.h index 30a3f492..c1aeaff9 100644 --- a/src/v4l2/v4l2_camera_proxy.h +++ b/src/v4l2/v4l2_camera_proxy.h @@ -65,7 +65,7 @@ private: int vidioc_expbuf(V4L2CameraFile *file, struct v4l2_exportbuffer *arg); int vidioc_streamon(V4L2CameraFile *file, int *arg); int vidioc_streamoff(V4L2CameraFile *file, int *arg); - int vidioc_s_param(V4L2CameraFile *file, struct v4l2_streamparm *arg); + int vidioc_s_parm(V4L2CameraFile *file, struct v4l2_streamparm *arg); bool hasOwnership(V4L2CameraFile *file); int acquire(V4L2CameraFile *file);