From 6cec421f92ae9b9b3f9a8af7c2e41926748e4c70 Mon Sep 17 00:00:00 2001 From: columbarius Date: Sat, 5 Mar 2022 12:35:46 +0100 Subject: [PATCH] screencast: improve logging for pipewire events We should log buffer add and remove events in the debug loglevel, since they signal starts, stops and renegotiations of the buffer transfer. Additionaly logging the negotiated pwr_format should help classify issues from the DEBUG loglevel. --- src/screencast/pipewire_screencast.c | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/src/screencast/pipewire_screencast.c b/src/screencast/pipewire_screencast.c index 1149d97..2a0eb75 100644 --- a/src/screencast/pipewire_screencast.c +++ b/src/screencast/pipewire_screencast.c @@ -182,6 +182,13 @@ static void pwr_handle_stream_param_changed(void *data, uint32_t id, data_type = 1<buffer_type, data_type); + logprint(DEBUG, "pipewire: format: %u", cast->pwr_format.format); + logprint(DEBUG, "pipewire: modifier: %lu", cast->pwr_format.modifier); + logprint(DEBUG, "pipewire: size: (%u, %u)", cast->pwr_format.size.width, cast->pwr_format.size.height); + logprint(DEBUG, "pipewire: max_framerate: (%u / %u)", cast->pwr_format.max_framerate.num, cast->pwr_format.max_framerate.denom); + params[0] = build_buffer(&b, blocks, cast->screencopy_frame_info[cast->buffer_type].size, cast->screencopy_frame_info[cast->buffer_type].stride, data_type); @@ -197,7 +204,7 @@ static void pwr_handle_stream_add_buffer(void *data, struct pw_buffer *buffer) { struct xdpw_screencast_instance *cast = data; struct spa_data *d; - logprint(TRACE, "pipewire: add buffer event handle"); + logprint(DEBUG, "pipewire: add buffer event handle"); d = buffer->buffer->datas; @@ -244,7 +251,7 @@ static void pwr_handle_stream_add_buffer(void *data, struct pw_buffer *buffer) { static void pwr_handle_stream_remove_buffer(void *data, struct pw_buffer *buffer) { struct xdpw_screencast_instance *cast = data; - logprint(TRACE, "pipewire: remove buffer event handle"); + logprint(DEBUG, "pipewire: remove buffer event handle"); struct xdpw_buffer *xdpw_buffer = buffer->user_data; if (xdpw_buffer) { @@ -313,8 +320,11 @@ void xdpw_pwr_enqueue_buffer(struct xdpw_screencast_instance *cast) { logprint(TRACE, "********************"); logprint(TRACE, "pipewire: fd %u", d[0].fd); - logprint(TRACE, "pipewire: size %d", d[0].maxsize); + logprint(TRACE, "pipewire: maxsize %d", d[0].maxsize); + logprint(TRACE, "pipewire: size %d", d[0].chunk->size); logprint(TRACE, "pipewire: stride %d", d[0].chunk->stride); + logprint(TRACE, "pipewire: offset %d", d[0].chunk->offset); + logprint(TRACE, "pipewire: chunk flags %d", d[0].chunk->flags); logprint(TRACE, "pipewire: width %d", cast->current_frame.xdpw_buffer->width); logprint(TRACE, "pipewire: height %d", cast->current_frame.xdpw_buffer->height); logprint(TRACE, "pipewire: y_invert %d", cast->current_frame.y_invert);