Message ID | cover.1691096157.git.soyer@irl.hu (mailing list archive) |
---|---|
Headers |
Received: from vger.kernel.org ([23.128.96.18]) by www.linuxtv.org with esmtp (Exim 4.92) (envelope-from <linux-media-owner@vger.kernel.org>) id 1qRgJY-009cSH-31; Thu, 03 Aug 2023 21:57:00 +0000 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231445AbjHCV46 (ORCPT <rfc822;mkrufky@linuxtv.org> + 1 other); Thu, 3 Aug 2023 17:56:58 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49722 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231597AbjHCV4y (ORCPT <rfc822;linux-media@vger.kernel.org>); Thu, 3 Aug 2023 17:56:54 -0400 Received: from irl.hu (irl.hu [95.85.9.111]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id EEF163C2D; Thu, 3 Aug 2023 14:56:51 -0700 (PDT) Received: from fedori.lan (51b69adf.dsl.pool.telekom.hu [::ffff:81.182.154.223]) (AUTH: CRAM-MD5 soyer@irl.hu, ) by irl.hu with ESMTPSA id 0000000000072E2E.0000000064CC1C45.0001D182; Thu, 03 Aug 2023 23:29:41 +0200 From: =?utf-8?b?R2VyZ8WRIEvDtnRlbGVz?= <soyer@irl.hu> To: Mauro Carvalho Chehab <mchehab@kernel.org>, Laurent Pinchart <laurent.pinchart@ideasonboard.com> Cc: linux-media@vger.kernel.org, linux-kernel@vger.kernel.org, =?utf-8?b?R2VyZ8WRIEvDtnRlbGVz?= <soyer@irl.hu> Subject: [RFC PATCH 0/2] media: v4l2: map UVC_CT_ROLL_ABSOLUTE_CONTROL Date: Thu, 3 Aug 2023 23:28:56 +0200 Message-ID: <cover.1691096157.git.soyer@irl.hu> X-Mailer: git-send-email 2.41.0 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,SPF_HELO_PASS, SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: <linux-media.vger.kernel.org> X-Mailing-List: linux-media@vger.kernel.org X-LSpam-Score: -2.4 (--) X-LSpam-Report: No, score=-2.4 required=5.0 tests=BAYES_00=-1.9,HEADER_FROM_DIFFERENT_DOMAINS=0.5,MAILING_LIST_MULTI=-1,RCVD_IN_DNSWL_NONE=-0.0001 autolearn=ham autolearn_force=no |
Series |
media: v4l2: map UVC_CT_ROLL_ABSOLUTE_CONTROL
|
|
Message
Gergo Koteles
Aug. 3, 2023, 9:28 p.m. UTC
Hi, Logitech Streamcam can be mounted in 'portrait mode' as well. It reports the current roll (-90, 0, 90, 180) with UVC_CT_ROLL_ABSOLUTE_CONTROL. This RFC defines V4L2_CID_ROLL_ABSOLUTE, and maps UVC_CT_ROLL_ABSOLUTE_CONTROL to make it available to userspace. Then, the userspace can rotate the stream based on the roll. Is it better to use V4L2_CID_CAMERA_SENSOR_ROTATION for this? The value set matches that control. If yes, is it worth mapping UVC_CT_ROLL_ABSOLUTE_CONTROL to V4L2_CID_CAMERA_SENSOR_ROTATION for this camera only? Any feedback is greately appreciated. Gergő Köteles (2): media: v4l2: ctrls: Add ROLL_ABSOLUTE control media: v4l2: map UVC_CT_ROLL_ABSOLUTE_CONTROL .../userspace-api/media/v4l/ext-ctrls-camera.rst | 5 +++++ drivers/media/usb/uvc/uvc_ctrl.c | 9 +++++++++ drivers/media/v4l2-core/v4l2-ctrls-defs.c | 1 + include/uapi/linux/v4l2-controls.h | 2 ++ 4 files changed, 17 insertions(+) base-commit: 06c2afb862f9da8dc5efa4b6076a0e48c3fbaaa5
Comments
Hi Gergő, Interesting work! I would guess that there are a lot of cameras with an accelerometer or gyroscope that could report the rotation. On 8/3/23 23:28, Gergő Köteles wrote: > Hi, > > Logitech Streamcam can be mounted in 'portrait mode' as well. > It reports the current roll (-90, 0, 90, 180) with > UVC_CT_ROLL_ABSOLUTE_CONTROL. > > This RFC defines V4L2_CID_ROLL_ABSOLUTE, and maps > UVC_CT_ROLL_ABSOLUTE_CONTROL to make it available to > userspace. > Then, the userspace can rotate the stream based on the roll. Should we also discuss pitch and yaw while we are at it? As far as I know there are controls to set pan and tilt of a PTZ camera, but there are no controls that report those angles. > Is it better to use V4L2_CID_CAMERA_SENSOR_ROTATION for this? IMHO that would make sense. Best regards, Michael > The value set matches that control. > If yes, is it worth mapping UVC_CT_ROLL_ABSOLUTE_CONTROL to > V4L2_CID_CAMERA_SENSOR_ROTATION for this camera only? > > Any feedback is greately appreciated. > > > Gergő Köteles (2): > media: v4l2: ctrls: Add ROLL_ABSOLUTE control > media: v4l2: map UVC_CT_ROLL_ABSOLUTE_CONTROL > > .../userspace-api/media/v4l/ext-ctrls-camera.rst | 5 +++++ > drivers/media/usb/uvc/uvc_ctrl.c | 9 +++++++++ > drivers/media/v4l2-core/v4l2-ctrls-defs.c | 1 + > include/uapi/linux/v4l2-controls.h | 2 ++ > 4 files changed, 17 insertions(+) > > > base-commit: 06c2afb862f9da8dc5efa4b6076a0e48c3fbaaa5
Hi Michael, On Fri, 2023-08-04 at 20:45 +0200, Michael Riesch wrote: > Hi Gergő, > > Interesting work! I would guess that there are a lot of cameras with an > accelerometer or gyroscope that could report the rotation. > I think only the Streamcam in the UVC world, but who knows. :) > On 8/3/23 23:28, Gergő Köteles wrote: > > Hi, > > > > Logitech Streamcam can be mounted in 'portrait mode' as well. > > It reports the current roll (-90, 0, 90, 180) with > > UVC_CT_ROLL_ABSOLUTE_CONTROL. > > > > This RFC defines V4L2_CID_ROLL_ABSOLUTE, and maps > > UVC_CT_ROLL_ABSOLUTE_CONTROL to make it available to > > userspace. > > Then, the userspace can rotate the stream based on the roll. > > Should we also discuss pitch and yaw while we are at it? > They are there with V4L2_CID_PAN_ABSOLUTE and V4L2_CID_TILT_ABSOLUTE. > As far as I know there are controls to set pan and tilt of a PTZ camera, > but there are no controls that report those angles. > Aren't real PTZ cameras using the CT_PANTILT_ABSOLUTE_CONTROL for panning and tilting? Or just to move the crop window? > > Is it better to use V4L2_CID_CAMERA_SENSOR_ROTATION for this? > > IMHO that would make sense. > > Best regards, > Michael > > > The value set matches that control. > > If yes, is it worth mapping UVC_CT_ROLL_ABSOLUTE_CONTROL to > > V4L2_CID_CAMERA_SENSOR_ROTATION for this camera only? > > > > Any feedback is greately appreciated. > > > > > > Gergő Köteles (2): > > media: v4l2: ctrls: Add ROLL_ABSOLUTE control > > media: v4l2: map UVC_CT_ROLL_ABSOLUTE_CONTROL > > > > .../userspace-api/media/v4l/ext-ctrls-camera.rst | 5 +++++ > > drivers/media/usb/uvc/uvc_ctrl.c | 9 +++++++++ > > drivers/media/v4l2-core/v4l2-ctrls-defs.c | 1 + > > include/uapi/linux/v4l2-controls.h | 2 ++ > > 4 files changed, 17 insertions(+) > > > > > > base-commit: 06c2afb862f9da8dc5efa4b6076a0e48c3fbaaa5