[Mesa-dev] [PATCH v3 02/12] add "kmscube" GStreamer debug category

Carlos Rafael Giani dv at pseudoterminal.org
Wed Apr 26 18:56:14 UTC 2017


Without this, the various GST_* log macros won't output anything.
To enable, add "kmscube:<loglevel>" to the GST_DEBUG environment variable.
Example:   GST_DEBUG=kmscube:5

Signed-off-by: Carlos Rafael Giani <dv at pseudoterminal.org>
---
 gst-decoder.c | 3 +++
 kmscube.c     | 4 +++-
 2 files changed, 6 insertions(+), 1 deletion(-)

diff --git a/gst-decoder.c b/gst-decoder.c
index 1140213..22dc068 100644
--- a/gst-decoder.c
+++ b/gst-decoder.c
@@ -39,6 +39,9 @@
 #include <gst/app/gstappsink.h>
 #include <gst/video/gstvideometa.h>
 
+GST_DEBUG_CATEGORY_EXTERN(kmscube_debug);
+#define GST_CAT_DEFAULT kmscube_debug
+
 struct decoder {
 	GMainLoop          *loop;
 	GstElement         *pipeline;
diff --git a/kmscube.c b/kmscube.c
index 6dcfd2f..3a2c4dd 100644
--- a/kmscube.c
+++ b/kmscube.c
@@ -33,7 +33,8 @@
 #include "drm-common.h"
 
 #ifdef HAVE_GST
-#  include <gst/gst.h>
+#include <gst/gst.h>
+GST_DEBUG_CATEGORY(kmscube_debug);
 #endif
 
 #define ARRAY_SIZE(arr) (sizeof(arr) / sizeof((arr)[0]))
@@ -81,6 +82,7 @@ int main(int argc, char *argv[])
 
 #ifdef HAVE_GST
 	gst_init(&argc, &argv);
+	GST_DEBUG_CATEGORY_INIT(kmscube_debug, "kmscube", 0, "kmscube video pipeline");
 #endif
 
 	while ((opt = getopt_long_only(argc, argv, shortopts, longopts, NULL)) != -1) {
-- 
2.7.4



More information about the mesa-dev mailing list