From 5f4c0cdd1e2d889b597dd4f242d250b25b501086 Mon Sep 17 00:00:00 2001 From: Wim Taymans Date: Fri, 28 Mar 2025 16:08:57 +0100 Subject: [PATCH] improve debug and error reporting a little --- spa/plugins/videoconvert/videoconvert-ffmpeg.c | 4 ++-- src/gst/gstpipewirepool.c | 6 +++++- src/gst/gstpipewiresrc.c | 2 +- 3 files changed, 8 insertions(+), 4 deletions(-) diff --git a/spa/plugins/videoconvert/videoconvert-ffmpeg.c b/spa/plugins/videoconvert/videoconvert-ffmpeg.c index e9d52e6ef..9c96e5b34 100644 --- a/spa/plugins/videoconvert/videoconvert-ffmpeg.c +++ b/spa/plugins/videoconvert/videoconvert-ffmpeg.c @@ -1725,8 +1725,8 @@ impl_node_port_use_buffers(void *object, SPA_META_Header, sizeof(struct spa_meta_header)); if (n_datas != port->blocks) { - spa_log_error(this->log, "%p: invalid blocks %d on buffer %d", - this, n_datas, i); + spa_log_error(this->log, "%p: invalid blocks %d on buffer %d, expected %d", + this, n_datas, i, port->blocks); return -EINVAL; } if (SPA_FLAG_IS_SET(flags, SPA_NODE_BUFFERS_FLAG_ALLOC)) { diff --git a/src/gst/gstpipewirepool.c b/src/gst/gstpipewirepool.c index ec0b9bc59..f2a925c94 100644 --- a/src/gst/gstpipewirepool.c +++ b/src/gst/gstpipewirepool.c @@ -62,7 +62,7 @@ void gst_pipewire_pool_wrap_buffer (GstPipeWirePool *pool, struct pw_buffer *b) uint32_t i; GstPipeWirePoolData *data; - GST_DEBUG_OBJECT (pool, "wrap buffer"); + GST_DEBUG_OBJECT (pool, "wrap buffer, datas:%d", b->buffer->n_datas); data = g_slice_new (GstPipeWirePoolData); @@ -89,6 +89,10 @@ void gst_pipewire_pool_wrap_buffer (GstPipeWirePool *pool, struct pw_buffer *b) gmem = gst_memory_new_wrapped (0, d->data, d->maxsize, 0, d->maxsize, NULL, NULL); } + else { + GST_WARNING_OBJECT (pool, "unknown data type (%s %d)", + spa_debug_type_find_short_name(spa_type_data_type, d->type), d->type); + } if (gmem) gst_buffer_insert_memory (buf, i, gmem); } diff --git a/src/gst/gstpipewiresrc.c b/src/gst/gstpipewiresrc.c index 01f73c9c7..86c39f2b7 100644 --- a/src/gst/gstpipewiresrc.c +++ b/src/gst/gstpipewiresrc.c @@ -686,7 +686,7 @@ static GstBuffer *dequeue_buffer(GstPipeWireSrc *pwsrc) } if (b->buffer->n_datas != gst_buffer_n_memory(data->buf)) { - GST_ERROR_OBJECT(pwsrc, "n_datas != n_memory"); + GST_ERROR_OBJECT(pwsrc, "n_datas != n_memory, (%d != %d)", b->buffer->n_datas, gst_buffer_n_memory(data->buf)); } for (i = 0; i < b->buffer->n_datas; i++) {