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-tracer: remove compress_frame_count
Author:  Deborah Brouwer <deborah.brou...@collabora.com>
Date:    Mon Nov 13 12:06:15 2023 -0800

The trace context attempts to keep track of the number of compressed
frames received to avoid tracing the same decoded frame more than once.
However, this shared context only works if both the OUTPUT and CAPTURE
queues are run in the same process. If they are run in different
processes, then they will each have their own separate context and no
decoded frames will be traced.

Remove the compressed_frame_count since it is not functioning as expected.

Signed-off-by: Deborah Brouwer <deborah.brou...@collabora.com>
Signed-off-by: Hans Verkuil <hverkuil-ci...@xs4all.nl>

 utils/v4l2-tracer/trace-helper.cpp | 23 ++++++++++-------------
 utils/v4l2-tracer/trace.cpp        |  1 -
 utils/v4l2-tracer/trace.h          |  1 -
 3 files changed, 10 insertions(+), 15 deletions(-)

---

http://git.linuxtv.org/cgit.cgi/v4l-utils.git/commit/?id=7fe58102ebd5489ae7b4a02b30eda52a892fcf3a
diff --git a/utils/v4l2-tracer/trace-helper.cpp 
b/utils/v4l2-tracer/trace-helper.cpp
index b63363137164..f58671df7dbf 100644
--- a/utils/v4l2-tracer/trace-helper.cpp
+++ b/utils/v4l2-tracer/trace-helper.cpp
@@ -288,10 +288,8 @@ void s_ext_ctrls_setup(struct v4l2_ext_controls 
*ext_controls)
                         * received to avoid losing frames although this will 
still sometimes result
                         * in frames out of order.
                         */
-                       if ((ctrl.p_h264_decode_params->flags & 
V4L2_H264_DECODE_PARAM_FLAG_IDR_PIC) != 0U) {
-                               if (ctx_trace.compressed_frame_count != 0)
-                                       trace_mem_decoded();
-                       }
+                       if ((ctrl.p_h264_decode_params->flags & 
V4L2_H264_DECODE_PARAM_FLAG_IDR_PIC) != 0U)
+                               trace_mem_decoded();
 
                        /*
                         * When pic_order_cnt_lsb wraps around to zero, adjust 
the total count using
@@ -337,15 +335,16 @@ void qbuf_setup(struct v4l2_buffer *buf)
        if (buf->type == V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE ||
            buf->type == V4L2_BUF_TYPE_VIDEO_OUTPUT) {
                trace_mem_encoded(buf_fd, buf_offset);
-               ctx_trace.compressed_frame_count = 
ctx_trace.compressed_frame_count + 1;
        }
 
        if (buf->type == V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE ||
            buf->type == V4L2_BUF_TYPE_VIDEO_CAPTURE) {
-
-               /* If the capture buffer is queued for reuse, trace it before 
it is reused. */
-               if (ctx_trace.compressed_frame_count != 0)
-                       trace_mem_decoded();
+               /*
+                * If the capture buffer is queued for reuse, trace it before 
it is reused.
+                * Capture buffers can't be traced using dqbuf because the 
buffer is mmapped
+                * after the call to dqbuf.
+                */
+               trace_mem_decoded();
 
                /* H264 sets display order in controls, otherwise display just 
in the order queued. */
                if (ctx_trace.compression_format != V4L2_PIX_FMT_H264_SLICE)
@@ -373,10 +372,8 @@ void streamoff_cleanup(v4l2_buf_type buf_type)
         * because they were not queued for reuse.
         */
        if (buf_type == V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE ||
-           buf_type == V4L2_BUF_TYPE_VIDEO_CAPTURE) {
-               if (ctx_trace.compressed_frame_count != 0)
-                       trace_mem_decoded();
-       }
+           buf_type == V4L2_BUF_TYPE_VIDEO_CAPTURE)
+               trace_mem_decoded();
 }
 
 void g_fmt_setup_trace(struct v4l2_format *format)
diff --git a/utils/v4l2-tracer/trace.cpp b/utils/v4l2-tracer/trace.cpp
index f81f68d15ff2..31447f24eac4 100644
--- a/utils/v4l2-tracer/trace.cpp
+++ b/utils/v4l2-tracer/trace.cpp
@@ -204,7 +204,6 @@ void trace_mem_decoded(void)
                if (!it->address || it == ctx_trace.buffers.end() || 
it->bytesused < expected_length)
                        break;
        }
-       ctx_trace.compressed_frame_count = ctx_trace.compressed_frame_count - 
displayed_count;
 }
 
 json_object *trace_v4l2_plane(struct v4l2_plane *ptr, __u32 memory)
diff --git a/utils/v4l2-tracer/trace.h b/utils/v4l2-tracer/trace.h
index 1e8b17e717e7..272f6c3cfa06 100644
--- a/utils/v4l2-tracer/trace.h
+++ b/utils/v4l2-tracer/trace.h
@@ -36,7 +36,6 @@ struct trace_context {
                struct h264_info h264;
        } fmt;
        std::string trace_filename;
-       int compressed_frame_count;
        std::list<long> decode_order;
        std::list<struct buffer_trace> buffers;
        std::unordered_map<int, std::string> devices; /* key:fd, value: path of 
the device */

_______________________________________________
linuxtv-commits mailing list
linuxtv-commits@linuxtv.org
https://www.linuxtv.org/cgi-bin/mailman/listinfo/linuxtv-commits

Reply via email to