From: Sarah Gershuni <sarah556726@gmail.com>
To: linux-media@vger.kernel.org
Cc: Sarah Gershuni <sarah556726@gmail.com>
Subject: [PATCH v4l-utils 1/2] add plane_bytesperline to trace_context
Date: Mon, 16 Mar 2026 15:22:22 +0200 [thread overview]
Message-ID: <20260316132223.7337-2-sarah556726@gmail.com> (raw)
In-Reply-To: <20260316132223.7337-1-sarah556726@gmail.com>
Add plane_bytesperline array to trace_context to store stride per plane for
multiplanar formats. Update g_fmt_setup_trace to initialize the array.
Signed-off-by: Sarah Gershuni <sarah556726@gmail.com>
---
utils/v4l2-tracer/trace-helper.cpp | 15 +++++++++++++--
utils/v4l2-tracer/trace.h | 1 +
2 files changed, 14 insertions(+), 2 deletions(-)
diff --git a/utils/v4l2-tracer/trace-helper.cpp b/utils/v4l2-tracer/trace-helper.cpp
index 9e5747a2..6c296dbf 100644
--- a/utils/v4l2-tracer/trace-helper.cpp
+++ b/utils/v4l2-tracer/trace-helper.cpp
@@ -399,16 +399,27 @@ void g_fmt_setup_trace(struct v4l2_format *format)
ctx_trace.width = format->fmt.pix.width;
ctx_trace.height = format->fmt.pix.height;
ctx_trace.pixelformat = format->fmt.pix.pixelformat;
+ ctx_trace.plane_bytesperline[0] = format->fmt.pix.bytesperline;
}
if (format->type == V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE) {
ctx_trace.width = format->fmt.pix_mp.width;
ctx_trace.height = format->fmt.pix_mp.height;
ctx_trace.pixelformat = format->fmt.pix_mp.pixelformat;
+
+ for (unsigned i = 0; i < format->fmt.pix_mp.num_planes; i++){
+ ctx_trace.plane_bytesperline[i] = format->fmt.pix_mp.plane_fmt[i].bytesperline;
+ }
}
- if (format->type == V4L2_BUF_TYPE_VIDEO_OUTPUT)
+ if (format->type == V4L2_BUF_TYPE_VIDEO_OUTPUT){
ctx_trace.compression_format = format->fmt.pix.pixelformat;
- if (format->type == V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE)
+ ctx_trace.plane_bytesperline[0] = format->fmt.pix.bytesperline;
+ }
+ if (format->type == V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE){
ctx_trace.compression_format = format->fmt.pix_mp.pixelformat;
+ for (unsigned i = 0; i < format->fmt.pix_mp.num_planes; i++){
+ ctx_trace.plane_bytesperline[i] = format->fmt.pix_mp.plane_fmt[i].bytesperline;
+ }
+ }
}
void s_fmt_setup(struct v4l2_format *format)
diff --git a/utils/v4l2-tracer/trace.h b/utils/v4l2-tracer/trace.h
index a74a5f3f..7f166287 100644
--- a/utils/v4l2-tracer/trace.h
+++ b/utils/v4l2-tracer/trace.h
@@ -32,6 +32,7 @@ struct trace_context {
__u32 pixelformat;
std::string media_device;
__u32 compression_format;
+ __u32 plane_bytesperline[VIDEO_MAX_PLANES];
union {
struct h264_info h264;
} fmt;
--
2.43.0
next prev parent reply other threads:[~2026-03-16 13:24 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-03-16 13:22 [PATCH v4l-utils 0/2] v4l2-tracer: fix expected frame length calculation Sarah Gershuni
2026-03-16 13:22 ` Sarah Gershuni [this message]
2026-03-16 13:22 ` [PATCH v4l-utils 2/2] calculate expected length using v4l2-fwht info Sarah Gershuni
2026-03-17 12:10 ` Hans Verkuil
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=20260316132223.7337-2-sarah556726@gmail.com \
--to=sarah556726@gmail.com \
--cc=linux-media@vger.kernel.org \
/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