From: "Ming Qian(OSS)" <ming.qian@oss.nxp.com>
To: Hans Verkuil <hverkuil-cisco@xs4all.nl>,
Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Cc: linux-media@vger.Kernel.org, tfiga@chromium.org,
ribalda@chromium.org, yunkec@google.com, xiahong.bao@nxp.com,
ming.zhou@nxp.com, eagle.zhou@nxp.com, tao.jiang_2@nxp.com,
ming.qian@nxp.com
Subject: Re: [PATCH v2 2/3] v4l2-ctl: Support V4L2_CTRL_TYPE_RECT
Date: Wed, 30 Oct 2024 17:22:31 +0800 [thread overview]
Message-ID: <b67036cf-52ca-4e1d-a5c4-522af261ff93@oss.nxp.com> (raw)
In-Reply-To: <12913e54-9343-42ab-ab1e-a33656e640af@xs4all.nl>
On 2024/10/30 17:19, Hans Verkuil wrote:
> On 30/10/2024 10:03, Laurent Pinchart wrote:
>> On Wed, Oct 30, 2024 at 11:43:06AM +0900, ming.qian@oss.nxp.com wrote:
>>> From: Yunke Cao <yunkec@google.com>
>>>
>>> Tested with VIVID
>>>
>>> ./v4l2-ctl -C rect -d 0
>>> rect: 300x400@200x100
>>>
>>> ./v4l2-ctl -c rect=1000x2000@0x0
>>> ./v4l2-ctl -C rect -d 0
>>> rect: 1000x2000@0x0
>>>
>>> Signed-off-by: Yunke Cao <yunkec@google.com>
>>> Signed-off-by: Ming Qian <ming.qian@oss.nxp.com>
>>> ---
>>> utils/v4l2-ctl/v4l2-ctl-common.cpp | 12 ++++++++++++
>>> 1 file changed, 12 insertions(+)
>>>
>>> diff --git a/utils/v4l2-ctl/v4l2-ctl-common.cpp b/utils/v4l2-ctl/v4l2-ctl-common.cpp
>>> index 40667575fcc7..538e1951cf81 100644
>>> --- a/utils/v4l2-ctl/v4l2-ctl-common.cpp
>>> +++ b/utils/v4l2-ctl/v4l2-ctl-common.cpp
>>> @@ -614,6 +614,10 @@ static void print_value(int fd, const v4l2_query_ext_ctrl &qc, const v4l2_ext_co
>>> case V4L2_CTRL_TYPE_AREA:
>>> printf("%dx%d", ctrl.p_area->width, ctrl.p_area->height);
>>> break;
>>> + case V4L2_CTRL_TYPE_RECT:
>>> + printf("%ux%u@%dx%d", ctrl.p_rect->width, ctrl.p_rect->height,
>>
>> I find this notation ambiguous, it's not immediately clear when reading
>> 10x10@20x20 if we're looking at a 10x10 rectangle positioned at (20,20)
>> or the other way around. media-ctl use (20,20)/10x10 which I think would
>> be a better notation.
>
> Good point, I agree.
>
> Ming Qian, can you also update patch 1/4 of the kernel patch series to
> use the same formatting when logging the V4L2_CTRL_TYPE_RECT value?
>
> Regards,
>
> Hans
Yes, I will
>
>>
>>> + ctrl.p_rect->left, ctrl.p_rect->top);
>>> + break;
>>> default:
>>> printf("unsupported payload type");
>>> break;
>>> @@ -702,6 +706,9 @@ static void print_qctrl(int fd, const v4l2_query_ext_ctrl &qc,
>>> case V4L2_CTRL_TYPE_AREA:
>>> printf("%31s %#8.8x (area) :", s.c_str(), qc.id);
>>> break;
>>> + case V4L2_CTRL_TYPE_RECT:
>>> + printf("%31s %#8.8x (rect) :", s.c_str(), qc.id);
>>> + break;
>>> case V4L2_CTRL_TYPE_HDR10_CLL_INFO:
>>> printf("%31s %#8.8x (hdr10-cll-info):", s.c_str(), qc.id);
>>> break;
>>> @@ -1279,6 +1286,11 @@ void common_set(cv4l_fd &_fd)
>>> sscanf(set_ctrl.second.c_str(), "%ux%u",
>>> &ctrl.p_area->width, &ctrl.p_area->height);
>>> break;
>>> + case V4L2_CTRL_TYPE_RECT:
>>> + sscanf(set_ctrl.second.c_str(), "%ux%u@%dx%d",
>>> + &ctrl.p_rect->width, &ctrl.p_rect->height,
>>> + &ctrl.p_rect->left, &ctrl.p_rect->top);
>>> + break;
>>> default:
>>> fprintf(stderr, "%s: unsupported payload type\n",
>>> qc.name);
>>
>
next prev parent reply other threads:[~2024-10-30 9:22 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-10-30 2:43 [PATCH v2 0/2] Support V4L2_CTRL_TYPE_RECT and V4L2_CTRL_WHICH_MIN/MAX_VAL ming.qian
2024-10-30 2:43 ` [PATCH v2 1/3] v4l-utils: Define V4L2_CTRL_TYPE_RECT ming.qian
2024-10-30 2:43 ` [PATCH v2 2/3] v4l2-ctl: Support V4L2_CTRL_TYPE_RECT ming.qian
2024-10-30 9:03 ` Laurent Pinchart
2024-10-30 9:19 ` Hans Verkuil
2024-10-30 9:22 ` Ming Qian(OSS) [this message]
2024-10-31 9:19 ` Ming Qian(OSS)
2024-10-31 9:34 ` Laurent Pinchart
2024-10-31 9:46 ` Ming Qian(OSS)
2024-10-31 10:09 ` Laurent Pinchart
2024-11-04 1:24 ` Ming Qian(OSS)
2024-11-05 8:30 ` Hans Verkuil
2024-11-05 8:51 ` Laurent Pinchart
2024-11-05 9:01 ` Hans Verkuil
2024-11-05 15:29 ` Laurent Pinchart
2024-10-30 9:21 ` Ming Qian(OSS)
2024-10-30 2:43 ` [PATCH v2 3/3] v4l2-utils: Support V4L2_CTRL_WHICH_MIN/MAX_VAL ming.qian
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=b67036cf-52ca-4e1d-a5c4-522af261ff93@oss.nxp.com \
--to=ming.qian@oss.nxp.com \
--cc=eagle.zhou@nxp.com \
--cc=hverkuil-cisco@xs4all.nl \
--cc=laurent.pinchart@ideasonboard.com \
--cc=linux-media@vger.Kernel.org \
--cc=ming.qian@nxp.com \
--cc=ming.zhou@nxp.com \
--cc=ribalda@chromium.org \
--cc=tao.jiang_2@nxp.com \
--cc=tfiga@chromium.org \
--cc=xiahong.bao@nxp.com \
--cc=yunkec@google.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox