From patchwork Thu Jun 20 21:36:05 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Joel Selvaraj X-Patchwork-Id: 20357 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 3474ABD87C for ; Thu, 20 Jun 2024 21:46:13 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 3364D654A3; Thu, 20 Jun 2024 23:46:12 +0200 (CEST) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="WZcNaf3S"; dkim-atps=neutral Received: from mail-oi1-x22e.google.com (mail-oi1-x22e.google.com [IPv6:2607:f8b0:4864:20::22e]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id E9133619ED for ; Thu, 20 Jun 2024 23:36:20 +0200 (CEST) Received: by mail-oi1-x22e.google.com with SMTP id 5614622812f47-3d1b5f32065so62763b6e.2 for ; Thu, 20 Jun 2024 14:36:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1718919379; x=1719524179; darn=lists.libcamera.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=DLF92AZxWIk7gpMFVXyqP8eEjkEPCmT567VydCuUUxU=; b=WZcNaf3Sd/qO8HqHOlCIXhRNQHElCt8Yj7NaCvRUHW0hNqk8KkA81hRVWzvx3UmoTR LmAcbfpWYiIfuyz/ATSRmFGF2NgFY7WS7F89SoXbk+5+a8x4Hdr/OzZ4TR+rklow4HCc vOHsurR8eeJXGCjJPMDlt8fAOo4YFSStdDBD0Zs6BlLqKeZDjGYE6syLow/Cf1B20b9e lOxmQwpka8DTi7K9HfZPuosLm9NVpP5Wu44kPbsv1gDjrD/ufJ9Bfv0RwW/V9IWZoWzf sPXWrEVbiJvqxEC2DU8EoYX+0okBGCDu9gPD+qrYLDNPeEkiEvUlcUamLXqsPb9nJetY 2uQg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1718919379; x=1719524179; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=DLF92AZxWIk7gpMFVXyqP8eEjkEPCmT567VydCuUUxU=; b=umdjNEbaiznbJMgN5SqoMrIVE4eaQBaq0Yt4EfZhDrZi68Hg9f+wlcEgTK6LBCdvnH vX0niWZrpx8gQPBEDMR534KHgaSTcB+2OcSmH0fVz14Gs6SxqdpRyxlGwkGvyHeG8/Sg QUJvN8d99xD99WDwsxNIxW5TmDuMr3A2k5M7D7MgoM0P+x2voebO+dFz/Jo2EG8w/KD7 SZI7L8JnTXkAxrq9BRJhs4Qp/noXhAeiFOMAs7uCBDjjTqGg7vMsk4rzYfwD7ot3zAhj F25vo0I246xtWfomtHvInwmOSLv9pX8pVQVt2KWKE0mhJb9IKV6LQgH0NFbDjd6FBBs5 Qb9g== X-Gm-Message-State: AOJu0Yx/6NeD86nYz5KpAAqhR9/bqs18DIlCUQxnulruNCOeo1hTPF03 Z4ms0NOPg1N3CEol7IL2osBY3miXqe+SWEzv3Og49rmx3RptQdHzKur2m31X X-Google-Smtp-Source: AGHT+IEUVdy4wP0EqSG7tnPdwbnsZvSLeGclzKMByUOTdLVEIFOhVucMzQvp2aDlG3Irey1I9Jzoig== X-Received: by 2002:a05:6808:150f:b0:3d2:2356:d271 with SMTP id 5614622812f47-3d51b9654ebmr8130272b6e.1.1718919378631; Thu, 20 Jun 2024 14:36:18 -0700 (PDT) Received: from localhost.localdomain ([67.6.32.220]) by smtp.gmail.com with ESMTPSA id 46e09a7af769-7009c65d116sm60530a34.57.2024.06.20.14.36.17 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 20 Jun 2024 14:36:18 -0700 (PDT) From: Joel Selvaraj To: libcamera-devel@lists.libcamera.org Cc: Joel Selvaraj Subject: [PATCH 0/2] qcam: rotate the viewfinder output as per camera properties Date: Thu, 20 Jun 2024 16:36:05 -0500 Message-ID: <20240620213607.32583-1-joelselvaraj.oss@gmail.com> X-Mailer: git-send-email 2.45.2 MIME-Version: 1.0 X-Mailman-Approved-At: Thu, 20 Jun 2024 23:46:10 +0200 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" Devicetrees may specify the rotation at which the camera is mounted in the hardware. If available, this gets populated in camera properties. Rotate the viewfinder output accordingly in qcam qt and opengl renderers. However, sometimes devicetrees may not specify the rotation or incorrectly specify it. So, also introduce a command line argument to quickly test different rotations. This also helps in quickly identifying the rotation at which the camera is mounted in the device if kernel developer already doesn't know it. Joel Selvaraj (2): qcam: rotate the viewfinder output as per camera properties qcam: introduce a command line argument to rotate the viewfinder output include/libcamera/orientation.h | 2 ++ src/apps/qcam/main.cpp | 3 +++ src/apps/qcam/main_window.cpp | 28 +++++++++++++++++++- src/apps/qcam/main_window.h | 1 + src/apps/qcam/viewfinder.h | 4 ++- src/apps/qcam/viewfinder_gl.cpp | 46 ++++++++++++++++++++++++++++++--- src/apps/qcam/viewfinder_gl.h | 4 ++- src/apps/qcam/viewfinder_qt.cpp | 18 +++++++++++-- src/apps/qcam/viewfinder_qt.h | 5 +++- src/libcamera/orientation.cpp | 34 ++++++++++++++++++++++++ 10 files changed, 136 insertions(+), 9 deletions(-)