@@ -40,6 +40,7 @@ const std::list<unsigned long> ioctls = {
VIDIOC_G_EXT_CTRLS,
VIDIOC_S_EXT_CTRLS,
VIDIOC_TRY_EXT_CTRLS,
+ VIDIOC_ENUM_FRAMESIZES,
VIDIOC_ENCODER_CMD,
VIDIOC_TRY_ENCODER_CMD,
VIDIOC_CREATE_BUFS,
@@ -966,6 +966,18 @@ void retrace_vidioc_s_ext_ctrls(int fd_retrace, json_object *ioctl_args)
}
}
+void retrace_vidioc_enum_framesizes(int fd_retrace, json_object *ioctl_args)
+{
+ struct v4l2_frmsizeenum *ptr = retrace_v4l2_frmsizeenum_gen(ioctl_args);
+
+ ioctl(fd_retrace, VIDIOC_ENUM_FRAMESIZES, ptr);
+
+ if (is_verbose() || (errno != 0))
+ perror("VIDIOC_ENUM_FRAMESIZES");
+
+ free(ptr);
+}
+
void retrace_vidioc_try_encoder_cmd(int fd_retrace, json_object *ioctl_args)
{
struct v4l2_encoder_cmd *ptr = retrace_v4l2_encoder_cmd_gen(ioctl_args);
@@ -1272,6 +1284,9 @@ void retrace_ioctl(json_object *syscall_obj)
case VIDIOC_S_EXT_CTRLS:
retrace_vidioc_s_ext_ctrls(fd_retrace, ioctl_args_user);
break;
+ case VIDIOC_ENUM_FRAMESIZES:
+ retrace_vidioc_enum_framesizes(fd_retrace, ioctl_args_user);
+ break;
case VIDIOC_TRY_ENCODER_CMD:
retrace_vidioc_try_encoder_cmd(fd_retrace, ioctl_args_user);
break;
@@ -589,6 +589,9 @@ json_object *trace_ioctl_args(unsigned long cmd, void *arg)
case VIDIOC_S_EXT_CTRLS:
trace_v4l2_ext_controls(arg, ioctl_args);
break;
+ case VIDIOC_ENUM_FRAMESIZES:
+ trace_v4l2_frmsizeenum_gen(arg, ioctl_args);
+ break;
case VIDIOC_TRY_ENCODER_CMD:
case VIDIOC_ENCODER_CMD:
trace_v4l2_encoder_cmd_gen(arg, ioctl_args);
@@ -193,7 +193,7 @@ sub get_val_def_name {
}
return "nullptr"; # will print as hex string
}
- if ($member =~ /pixelformat/) {
+ if ($member eq "pixelformat" || $member eq "pixel_format") {
return "v4l2_pix_fmt_val_def";
}
if ($member =~ /cmd/) {
@@ -363,6 +363,15 @@ sub handle_union {
printf $fh_retrace_cpp "\tdefault:\n\t\tbreak;\n\t}\n";
}
+ if ($struct_name eq "v4l2_frmsizeenum") {
+ printf $fh_trace_cpp "\tswitch (p->type) {\n";
+ printf $fh_trace_cpp "\tcase V4L2_FRMSIZE_TYPE_DISCRETE:\n";
+ printf $fh_trace_cpp "\t\ttrace_v4l2_frmsize_discrete_gen(&p->discrete, %s_obj);\n\t\tbreak;\n", $struct_name;
+ printf $fh_trace_cpp "\tcase V4L2_FRMSIZE_TYPE_STEPWISE:\n\tcase V4L2_FRMSIZE_TYPE_CONTINUOUS:\n";
+ printf $fh_trace_cpp "\t\ttrace_v4l2_frmsize_stepwise_gen(&p->stepwise, %s_obj);\n\t\tbreak;\n", $struct_name;
+ printf $fh_trace_cpp "\tdefault:\n\t\tbreak;\n\t}\n";
+ }
+
return $suppress_union;
}
Add tracing and retracing for VIDIOC_ENUM_FRAMESIZES ioctl. Signed-off-by: Deborah Brouwer <deborah.brouwer@collabora.com> --- utils/v4l2-tracer/libv4l2tracer.cpp | 1 + utils/v4l2-tracer/retrace.cpp | 15 +++++++++++++++ utils/v4l2-tracer/trace.cpp | 3 +++ utils/v4l2-tracer/v4l2-tracer-gen.pl | 11 ++++++++++- 4 files changed, 29 insertions(+), 1 deletion(-)