[Mesa-dev] [PATCH kmscube v2 02/10] add "kmscube" GStreamer debug category
Carlos Rafael Giani
dv at pseudoterminal.org
Tue Apr 11 08:27:43 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 54f4328..8e2d008 100644
--- a/kmscube.c
+++ b/kmscube.c
@@ -32,7 +32,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]))
@@ -77,6 +78,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