summaryrefslogtreecommitdiffstats
path: root/src/plugins
diff options
context:
space:
mode:
authorTim Blechmann <tim@klingt.org>2024-04-05 15:38:01 +0800
committerTim Blechmann <tim@klingt.org>2024-04-13 20:14:01 +0800
commitea51c3fb9ac0e12d1257e357bae6435eb07eb581 (patch)
tree7caec8e8490cd8b76c7e2a4887e5aa1435a5947a /src/plugins
parent7384b2e8ae4bb9a36c1a1efd288c644ddc35d7be (diff)
GStreamer: improve logging of GST_MESSAGE_ERROR messages
Quality of life improvement for debugging event handlers Pick-to: 6.5 6.7 Change-Id: I12e9311df2aa74db073962ec1e6a520d74299ec7 Reviewed-by: Jøger Hansegård <joger.hansegard@qt.io>
Diffstat (limited to 'src/plugins')
-rw-r--r--src/plugins/multimedia/gstreamer/common/qgst_debug.cpp19
1 files changed, 17 insertions, 2 deletions
diff --git a/src/plugins/multimedia/gstreamer/common/qgst_debug.cpp b/src/plugins/multimedia/gstreamer/common/qgst_debug.cpp
index 67138b057..ee28a5c45 100644
--- a/src/plugins/multimedia/gstreamer/common/qgst_debug.cpp
+++ b/src/plugins/multimedia/gstreamer/common/qgst_debug.cpp
@@ -160,8 +160,23 @@ QDebug operator<<(QDebug dbg, const GstMessage *msg)
QDebugStateSaver saver(dbg);
dbg.nospace();
- dbg << GST_MESSAGE_TYPE_NAME(msg) << ", Source: " << GST_MESSAGE_SRC_NAME(msg)
- << ", Timestamp: " << GST_MESSAGE_TIMESTAMP(msg);
+ switch (msg->type) {
+ case GST_MESSAGE_ERROR: {
+ QUniqueGErrorHandle err;
+ QGString debug;
+ gst_message_parse_error(const_cast<GstMessage *>(msg), &err, &debug);
+
+ dbg << GST_MESSAGE_TYPE_NAME(msg) << ", Source: " << GST_MESSAGE_SRC_NAME(msg)
+ << ", Timestamp: " << GST_MESSAGE_TIMESTAMP(msg) << ", Error: " << err << " (" << debug
+ << ")";
+ break;
+ }
+
+ default: {
+ dbg << GST_MESSAGE_TYPE_NAME(msg) << ", Source: " << GST_MESSAGE_SRC_NAME(msg)
+ << ", Timestamp: " << GST_MESSAGE_TIMESTAMP(msg);
+ }
+ }
return dbg;
}