From patchwork Tue Jun 13 10:34:48 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Robert Mader X-Patchwork-Id: 18731 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 703B5BD78E for ; Tue, 13 Jun 2023 10:36:26 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id BBD8D61E50; Tue, 13 Jun 2023 12:36:25 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org; s=mail; t=1686652585; bh=SAjE1pehfjyZ7xe9OopD9HQp07sLt1dAhB6PgRIIh8s=; h=To:Date:Subject:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:Cc:From; b=FH5R8Y3PmqWctcunAgiQadTtmQRjGy2ZbJQshccpbUo25ulvJzOJWMgfBj2ot7+0c QqPZLoa8Y87wgtsuvkRvqJOv5OBSTdJMJmOiuBPnUO2QY4MFrir84/IeiGeEf59aHI 9AdltjtsOuQvHYJazRel3nimVZl931oct/lSA3/zk4F76g4bRyk9huEe2YSvZedxc1 YAm8Qy2J+mTn9bG2y/NWf5A8CzwNrJPxCfq6RwimghgaDNt7y8CYuSOyc6ZhLp3Kz+ umABnR+JdOehQlqdsF/l7N4QdTNLHJ0xQyr/oVFWBjGF/Y88Fudl6Sa8G4ireDcmZV OqnwBQ3Za8cdg== Received: from madras.collabora.co.uk (madras.collabora.co.uk [IPv6:2a00:1098:0:82:1000:25:2eeb:e5ab]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 8259261E49 for ; Tue, 13 Jun 2023 12:36:24 +0200 (CEST) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (2048-bit key; unprotected) header.d=collabora.com header.i=@collabora.com header.b="TJ5witY9"; dkim-atps=neutral Received: from thinkpad-t460p.fritz.box (unknown [IPv6:2001:4090:a243:8015:93c:83c3:533:d433]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: rmader) by madras.collabora.co.uk (Postfix) with ESMTPSA id 156846606EFD; Tue, 13 Jun 2023 11:36:24 +0100 (BST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1686652584; bh=SAjE1pehfjyZ7xe9OopD9HQp07sLt1dAhB6PgRIIh8s=; h=From:To:Cc:Subject:Date:From; b=TJ5witY9PKgLVlezMkA71Vlgx1HJlSN8rt+HruKcIscgeyVmd2lE+k0TtJYl/FgFl Fpm+rbsTtRBTu7jSPunR/EQprtHETfr6cu5meOfPX0txZFhpROuV4bWUO+6XZXim8d f/ABw70hEAvlu/MqxoDviBNzS/DTMMO8oqYiqqZS3EGy6yaVGJCytCSu1TuYPzCde7 WZ2Ks3VUuLMNcbDWrOSdD35wMYYY0M37DLEDfvZztrr/fuEDLH5zSHShuhQGTJYSRF 5Psfp0PuIxqPLRzctuWXeBYU10qsiFH7oHdnFYNOpvYoGcF9cgUREiNOdW7ObS/fX3 vyGXlL5edo8Lw== To: libcamera-devel@lists.libcamera.org Date: Tue, 13 Jun 2023 12:34:48 +0200 Message-ID: <20230613103519.91370-1-robert.mader@collabora.com> X-Mailer: git-send-email 2.41.0 MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH 0/2] gstreamer: src: Add transform property 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: Robert Mader via libcamera-devel From: Robert Mader Reply-To: Robert Mader Cc: Robert Mader Errors-To: libcamera-devel-bounces@lists.libcamera.org Sender: "libcamera-devel" This allows users to request a transform using the Gstreamer equivalent. If the combined transform of the requested one and a possible rotation from the camera properties is not fully supported by the sensor, the remaining transform will be passed down to downstream elements as tag. The later is common for 90/270 degree rotations. Thus, a side effect of this feature is that libcamerasrc now behaves similar to pipewiresrc in regards to rotated cameras in e.g. phones, allowing apps to compensate accordingly. To test the transform property: gst-launch-1.0 libcamerasrc transform=90r ! videoconvert ! videoflip video-direction=auto ! gtksink To test cameras with rotation not supported by sensor, such as the ones of the Pinephone Pro, compare the out put of the following: gst-launch-1.0 libcamerasrc ! videoconvert ! videoflip video-direction=auto ! gtksink gst-launch-1.0 pipewiresrc ! videoconvert ! videoflip video-direction=auto ! gtksink Robert Mader (2): gstreamer: src: Style change gstreamer: src: Add transform property src/gstreamer/gstlibcamera-utils.cpp | 72 ++++++++++++++++++++++++++++ src/gstreamer/gstlibcamera-utils.h | 5 ++ src/gstreamer/gstlibcamerasrc.cpp | 56 ++++++++++++++++++---- 3 files changed, 125 insertions(+), 8 deletions(-)