This is an automatic generated email to let you know that the following patch were queued at the http://git.linuxtv.org/cgit.cgi/v4l-utils.git tree:
Subject: v4l2-ctl: Add --get/--set-ctrl support for INTEGER and INTEGER64 arrays Author: Daniel Lundberg Pedersen <[email protected]> Date: Thu May 25 15:35:59 2023 +0200 Add support for INTEGER and INTEGER64 arrays. Also print error if trying to print unkown array type Signed-off-by: Daniel Lundberg Pedersen <[email protected]> Signed-off-by: Hans Verkuil <[email protected]> utils/v4l2-ctl/v4l2-ctl-common.cpp | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) --- http://git.linuxtv.org/cgit.cgi/v4l-utils.git/commit/?id=dcbaba173ec7446487fa042902627ad64143eb53 diff --git a/utils/v4l2-ctl/v4l2-ctl-common.cpp b/utils/v4l2-ctl/v4l2-ctl-common.cpp index a1cc93c825c8..a14632a93913 100644 --- a/utils/v4l2-ctl/v4l2-ctl-common.cpp +++ b/utils/v4l2-ctl/v4l2-ctl-common.cpp @@ -472,6 +472,26 @@ static void print_array(const v4l2_query_ext_ctrl &qc, const v4l2_ext_control &c } printf("\n"); break; + case V4L2_CTRL_TYPE_INTEGER: + for (i = from; i <= to; i++) { + printf("%10i", ctrl.p_s32[idx + i]); + if (i < to) + printf(", "); + } + printf("\n"); + break; + case V4L2_CTRL_TYPE_INTEGER64: + for (i = from; i <= to; i++) { + printf("%12lli", ctrl.p_s64[idx + i]); + if (i < to) + printf(", "); + } + printf("\n"); + break; + default: + fprintf(stderr, "%s: unsupported array type\n", + qc.name); + break; } } } @@ -1149,6 +1169,18 @@ void common_set(cv4l_fd &_fd) if (idx_in_subset(qc, subset, divide, i)) ctrl.p_u32[i] = v; break; + case V4L2_CTRL_TYPE_INTEGER: + v = strtol(set_ctrl.second.c_str(), nullptr, 0); + for (i = 0; i < qc.elems; i++) + if (idx_in_subset(qc, subset, divide, i)) + ctrl.p_s32[i] = v; + break; + case V4L2_CTRL_TYPE_INTEGER64: + v = strtol(set_ctrl.second.c_str(), nullptr, 0); + for (i = 0; i < qc.elems; i++) + if (idx_in_subset(qc, subset, divide, i)) + ctrl.p_s64[i] = v; + break; case V4L2_CTRL_TYPE_STRING: strncpy(ctrl.string, set_ctrl.second.c_str(), qc.maximum); ctrl.string[qc.maximum] = 0; _______________________________________________ linuxtv-commits mailing list [email protected] https://www.linuxtv.org/cgi-bin/mailman/listinfo/linuxtv-commits
