HEADERS, do not merge!!!!
PATCH 1/4 HEADERS, do not merge!!!!
--- contrib/freebsd/include/linux/videodev2.h | 1 + include/linux/videodev2.h | 1 + 2 files changed, 2 insertions(+)
contrib/freebsd/include/linux/videodev2.h +1 -0
@@ -1713,6 +1713,7 @@ struct v4l2_ext_control {uint16_t *p_u16;uint32_t *p_u32;void *ptr; +struct v4l2_area *p_area; }; } __attribute__ ((packed));
include/linux/videodev2.h +1 -0
@@ -1678,6 +1678,7 @@ struct v4l2_ext_control {__u8 *p_u8;__u16 *p_u16;__u32 *p_u32; +struct v4l2_area *p_area;void *ptr; }; } __attribute__ ((packed));
Signature · 1 line
2.24.0.rc1
PATCH 2/4 v4l2-ctl: Support query V4L2_CTRL_TYPE_AREA controls
Tested with vivid:
$ v4l2-ctl -l | grep area
area 0x0098f90b (area) : flags=has-payload--- utils/v4l2-ctl/v4l2-ctl-common.cpp | 3 +++ 1 file changed, 3 insertions(+)
utils/v4l2-ctl/v4l2-ctl-common.cpp +3 -0
@@ -458,6 +458,9 @@ static void print_qctrl(int fd, struct v4l2_query_ext_ctrl *queryctrl, queryctrl->minimum, queryctrl->maximum, queryctrl->step, queryctrl->default_value); break; + case V4L2_CTRL_TYPE_AREA: + printf("%31s %#8.8x (area) :", s.c_str(), queryctrl->id); + break; default: printf("%31s %#8.8x (unknown): type=%x", s.c_str(), queryctrl->id, queryctrl->type);
Signature · 1 line
2.24.0.rc1
PATCH 3/4 v4l2-ctl: Support getting V4L2_CTRL_TYPE_AREA controls
In reply to Ricardo Ribalda DelgadoTested with vivid:
v4l2-ctl -C area -d /dev/video1
area: 51966x727837
--- utils/v4l2-ctl/v4l2-ctl-common.cpp | 5 +++++ 1 file changed, 5 insertions(+)
utils/v4l2-ctl/v4l2-ctl-common.cpp +5 -0
@@ -1150,6 +1150,11 @@ void common_get(cv4l_fd &_fd) printf("%s: '%s'\n", name.c_str(), safename(ctrl.string).c_str()); break; + case V4L2_CTRL_TYPE_AREA: + printf("%s: %dx%d\n", name.c_str(), + ctrl.p_area->width, + ctrl.p_area->height); + break; default: fprintf(stderr, "%s: unsupported payload type\n", qc.name);
Signature · 1 line
2.24.0.rc1
PATCH 4/4 v4l2-ctl: Support setting V4L2_CTRL_TYPE_AREA controls
In reply to Ricardo Ribalda Delgado$ v4l2-ctl -d /dev/video1 -c area=123123x233
--- utils/v4l2-ctl/v4l2-ctl-common.cpp | 4 ++++ 1 file changed, 4 insertions(+)
utils/v4l2-ctl/v4l2-ctl-common.cpp +4 -0
@@ -973,6 +973,10 @@ void common_set(cv4l_fd &_fd) strncpy(ctrl.string, iter->second.c_str(), qc.maximum); ctrl.string[qc.maximum] = 0; break; + case V4L2_CTRL_TYPE_AREA: + sscanf(iter->second.c_str(), "%dx%d", + &ctrl.p_area->width, &ctrl.p_area->height); + break; default: fprintf(stderr, "%s: unsupported payload type\n", qc.name);
Signature · 1 line
2.24.0.rc1
Re: [PATCH 4/4] v4l2-ctl: Support setting V4L2_CTRL_TYPE_AREA controls
Quoted 12 lines · Ricardo Ribalda Delgado
$ v4l2-ctl -d /dev/video1 -c area=123123x233Signed-off-by Ricardo Ribalda Delgado <[email protected]>--- utils/v4l2-ctl/v4l2-ctl-common.cpp | 4 ++++ 1 file changed, 4 insertions(+)utils/v4l2-ctl/v4l2-ctl-common.cpp +0
-0
utils/v4l2-ctl/v4l2-ctl-common.cpp void common_set(cv4l_fd &_fd) · line 977
Quoted 5 lines
utils/v4l2-ctl/v4l2-ctl-common.cpp +2
-0@@ -973,6 +973,10 @@ void common_set(cv4l_fd &_fd) strncpy(ctrl.string, iter->second.c_str(), qc.maximum); ctrl.string[qc.maximum] = 0; break; + case V4L2_CTRL_TYPE_AREA: + sscanf(iter->second.c_str(), "%dx%d",
Use %ux%u since these are unsigned values.
Regards,
Hans
Quoted 6 lines
utils/v4l2-ctl/v4l2-ctl-common.cpp +2
-0+ &ctrl.p_area->width, &ctrl.p_area->height); + break; default: fprintf(stderr, "%s: unsupported payload type\n", qc.name);
Re: [PATCH 4/4] v4l2-ctl: Support setting V4L2_CTRL_TYPE_AREA controls
Hi Hans
Sure I will fix this. Shall I resend it once you have updated the headers on v4l-utils?
Best regards
Quoted 33 lines · Hans Verkuil
Quoted 12 lines · Ricardo Ribalda Delgado
$ v4l2-ctl -d /dev/video1 -c area=123123x233Signed-off-by Ricardo Ribalda Delgado <[email protected]>--- utils/v4l2-ctl/v4l2-ctl-common.cpp | 4 ++++ 1 file changed, 4 insertions(+)utils/v4l2-ctl/v4l2-ctl-common.cpp +0
-0utils/v4l2-ctl/v4l2-ctl-common.cpp void common_set(cv4l_fd &_fd) · line 977
Quoted 5 lines
utils/v4l2-ctl/v4l2-ctl-common.cpp +2
-0@@ -973,6 +973,10 @@ void common_set(cv4l_fd &_fd) strncpy(ctrl.string, iter->second.c_str(), qc.maximum); ctrl.string[qc.maximum] = 0; break; + case V4L2_CTRL_TYPE_AREA: + sscanf(iter->second.c_str(), "%dx%d",Use %ux%u since these are unsigned values.
Regards,
Hans
Quoted 6 lines
utils/v4l2-ctl/v4l2-ctl-common.cpp +2
-0+ &ctrl.p_area->width, &ctrl.p_area->height); + break; default: fprintf(stderr, "%s: unsupported payload type\n", qc.name);
Re: [PATCH 4/4] v4l2-ctl: Support setting V4L2_CTRL_TYPE_AREA controls
Quoted 4 lines · Ricardo Ribalda Delgado
Hi Hans
Sure I will fix this. Shall I resend it once you have updated the headers on v4l-utils?
Don't wait for that, just resend. I can merge this as soon as the new headers are in.
Regards,
Hans
Quoted 37 lines
Best regards
Quoted 33 lines · Hans Verkuil
Quoted 12 lines · Ricardo Ribalda Delgado
$ v4l2-ctl -d /dev/video1 -c area=123123x233Signed-off-by Ricardo Ribalda Delgado <[email protected]>--- utils/v4l2-ctl/v4l2-ctl-common.cpp | 4 ++++ 1 file changed, 4 insertions(+)utils/v4l2-ctl/v4l2-ctl-common.cpp +0
-0utils/v4l2-ctl/v4l2-ctl-common.cpp void common_set(cv4l_fd &_fd) · line 977
Quoted 5 lines
utils/v4l2-ctl/v4l2-ctl-common.cpp +2
-0@@ -973,6 +973,10 @@ void common_set(cv4l_fd &_fd) strncpy(ctrl.string, iter->second.c_str(), qc.maximum); ctrl.string[qc.maximum] = 0; break; + case V4L2_CTRL_TYPE_AREA: + sscanf(iter->second.c_str(), "%dx%d",Use %ux%u since these are unsigned values.
Regards,
Hans
Quoted 6 lines
utils/v4l2-ctl/v4l2-ctl-common.cpp +2
-0+ &ctrl.p_area->width, &ctrl.p_area->height); + break; default: fprintf(stderr, "%s: unsupported payload type\n", qc.name);