summaryrefslogtreecommitdiff
path: root/gst-libs
diff options
context:
space:
mode:
authorWim Taymans <wtaymans@redhat.com>2015-07-15 12:45:10 +0200
committerWim Taymans <wtaymans@redhat.com>2015-07-15 12:47:42 +0200
commit14083178b8c837a217825637cfcbb122e17e5d5a (patch)
tree09bed717a67f46f3163e4a8a0c4588cc26f7d426 /gst-libs
parent4bd5d8837a0403f39aff9f7fe9f3b4f8b39c7db9 (diff)
video: improve logging
Add logging categories for most video objects. Remove some useless debug lines in video-info and videotestsrc. Add a performance debug line in the video scaler.
Diffstat (limited to 'gst-libs')
-rw-r--r--gst-libs/gst/video/gstvideometa.c21
-rw-r--r--gst-libs/gst/video/gstvideopool.c7
-rw-r--r--gst-libs/gst/video/video-chroma.c23
-rw-r--r--gst-libs/gst/video/video-color.c22
-rw-r--r--gst-libs/gst/video/video-converter.c23
-rw-r--r--gst-libs/gst/video/video-info.c24
-rw-r--r--gst-libs/gst/video/video-resampler.c23
-rw-r--r--gst-libs/gst/video/video-scaler.c23
-rw-r--r--gst-libs/gst/video/videooverlay.c6
9 files changed, 170 insertions, 2 deletions
diff --git a/gst-libs/gst/video/gstvideometa.c b/gst-libs/gst/video/gstvideometa.c
index b6bb3d7d1..30c259c00 100644
--- a/gst-libs/gst/video/gstvideometa.c
+++ b/gst-libs/gst/video/gstvideometa.c
@@ -21,6 +21,27 @@
#include <string.h>
+#ifndef GST_DISABLE_GST_DEBUG
+#define GST_CAT_DEFAULT ensure_debug_category()
+static GstDebugCategory *
+ensure_debug_category (void)
+{
+ static gsize cat_gonce = 0;
+
+ if (g_once_init_enter (&cat_gonce)) {
+ gsize cat_done;
+
+ cat_done = (gsize) _gst_debug_category_new ("videometa", 0, "videometa");
+
+ g_once_init_leave (&cat_gonce, cat_done);
+ }
+
+ return (GstDebugCategory *) cat_gonce;
+}
+#else
+#define ensure_debug_category() /* NOOP */
+#endif /* GST_DISABLE_GST_DEBUG */
+
static gboolean
gst_video_meta_transform (GstBuffer * dest, GstMeta * meta,
GstBuffer * buffer, GQuark type, gpointer data)
diff --git a/gst-libs/gst/video/gstvideopool.c b/gst-libs/gst/video/gstvideopool.c
index 6b9d7dd91..4c98ddf85 100644
--- a/gst-libs/gst/video/gstvideopool.c
+++ b/gst-libs/gst/video/gstvideopool.c
@@ -20,6 +20,10 @@
#include "gst/video/gstvideometa.h"
#include "gst/video/gstvideopool.h"
+
+GST_DEBUG_CATEGORY_STATIC (gst_video_pool_debug);
+#define GST_CAT_DEFAULT gst_video_pool_debug
+
/**
* SECTION:gstvideopool
* @short_description: GstBufferPool for raw video buffers
@@ -277,6 +281,9 @@ gst_video_buffer_pool_class_init (GstVideoBufferPoolClass * klass)
gstbufferpool_class->get_options = video_buffer_pool_get_options;
gstbufferpool_class->set_config = video_buffer_pool_set_config;
gstbufferpool_class->alloc_buffer = video_buffer_pool_alloc;
+
+ GST_DEBUG_CATEGORY_INIT (gst_video_pool_debug, "videopool", 0,
+ "videopool object");
}
static void
diff --git a/gst-libs/gst/video/video-chroma.c b/gst-libs/gst/video/video-chroma.c
index 337c9747e..0996f7a5d 100644
--- a/gst-libs/gst/video/video-chroma.c
+++ b/gst-libs/gst/video/video-chroma.c
@@ -27,6 +27,7 @@
#include "video-orc.h"
#include "video-format.h"
+
/**
* SECTION:gstvideochroma
* @short_description: Functions and utility object for operating on chroma video planes
@@ -39,6 +40,28 @@
*
*/
+#ifndef GST_DISABLE_GST_DEBUG
+#define GST_CAT_DEFAULT ensure_debug_category()
+static GstDebugCategory *
+ensure_debug_category (void)
+{
+ static gsize cat_gonce = 0;
+
+ if (g_once_init_enter (&cat_gonce)) {
+ gsize cat_done;
+
+ cat_done = (gsize) _gst_debug_category_new ("video-chroma", 0,
+ "video-chroma object");
+
+ g_once_init_leave (&cat_gonce, cat_done);
+ }
+
+ return (GstDebugCategory *) cat_gonce;
+}
+#else
+#define ensure_debug_category() /* NOOP */
+#endif /* GST_DISABLE_GST_DEBUG */
+
typedef struct
{
const gchar *name;
diff --git a/gst-libs/gst/video/video-color.c b/gst-libs/gst/video/video-color.c
index 8892e92f8..519962d91 100644
--- a/gst-libs/gst/video/video-color.c
+++ b/gst-libs/gst/video/video-color.c
@@ -29,6 +29,28 @@
#include "video-color.h"
+#ifndef GST_DISABLE_GST_DEBUG
+#define GST_CAT_DEFAULT ensure_debug_category()
+static GstDebugCategory *
+ensure_debug_category (void)
+{
+ static gsize cat_gonce = 0;
+
+ if (g_once_init_enter (&cat_gonce)) {
+ gsize cat_done;
+
+ cat_done = (gsize) _gst_debug_category_new ("video-color", 0,
+ "video-color object");
+
+ g_once_init_leave (&cat_gonce, cat_done);
+ }
+
+ return (GstDebugCategory *) cat_gonce;
+}
+#else
+#define ensure_debug_category() /* NOOP */
+#endif /* GST_DISABLE_GST_DEBUG */
+
typedef struct
{
const gchar *name;
diff --git a/gst-libs/gst/video/video-converter.c b/gst-libs/gst/video/video-converter.c
index 2fd5c64c8..31d51e43f 100644
--- a/gst-libs/gst/video/video-converter.c
+++ b/gst-libs/gst/video/video-converter.c
@@ -95,6 +95,29 @@
* 9 : a -> b -> c -> d -> e* -> f* -> g* -> h -> i -> j -> k
* 10 : a -> b -> c -> d -> e* -> f* -> g* -> h -> i -> j -> k
*/
+
+#ifndef GST_DISABLE_GST_DEBUG
+#define GST_CAT_DEFAULT ensure_debug_category()
+static GstDebugCategory *
+ensure_debug_category (void)
+{
+ static gsize cat_gonce = 0;
+
+ if (g_once_init_enter (&cat_gonce)) {
+ gsize cat_done;
+
+ cat_done = (gsize) _gst_debug_category_new ("video-converter", 0,
+ "video-converter object");
+
+ g_once_init_leave (&cat_gonce, cat_done);
+ }
+
+ return (GstDebugCategory *) cat_gonce;
+}
+#else
+#define ensure_debug_category() /* NOOP */
+#endif /* GST_DISABLE_GST_DEBUG */
+
typedef struct _GstLineCache GstLineCache;
#define SCALE (8)
diff --git a/gst-libs/gst/video/video-info.c b/gst-libs/gst/video/video-info.c
index 8dd81096a..20090d4d6 100644
--- a/gst-libs/gst/video/video-info.c
+++ b/gst-libs/gst/video/video-info.c
@@ -29,6 +29,28 @@
#include "video-info.h"
#include "video-tile.h"
+#ifndef GST_DISABLE_GST_DEBUG
+#define GST_CAT_DEFAULT ensure_debug_category()
+static GstDebugCategory *
+ensure_debug_category (void)
+{
+ static gsize cat_gonce = 0;
+
+ if (g_once_init_enter (&cat_gonce)) {
+ gsize cat_done;
+
+ cat_done = (gsize) _gst_debug_category_new ("video-info", 0,
+ "video-info structure");
+
+ g_once_init_leave (&cat_gonce, cat_done);
+ }
+
+ return (GstDebugCategory *) cat_gonce;
+}
+#else
+#define ensure_debug_category() /* NOOP */
+#endif /* GST_DISABLE_GST_DEBUG */
+
/**
* gst_video_info_copy:
* @info: a #GstVideoInfo
@@ -666,8 +688,6 @@ fill_planes (GstVideoInfo * info)
cr_h = GST_ROUND_UP_2 (cr_h);
info->offset[2] = info->offset[1] + info->stride[1] * cr_h;
info->size = info->offset[2] + info->stride[2] * cr_h;
- GST_DEBUG ("%d %d %d", GST_VIDEO_INFO_IS_INTERLACED (info),
- (int) info->offset[2], (int) info->size);
break;
case GST_VIDEO_FORMAT_Y41B:
info->stride[0] = GST_ROUND_UP_4 (width);
diff --git a/gst-libs/gst/video/video-resampler.c b/gst-libs/gst/video/video-resampler.c
index 3024e544b..07dddc98e 100644
--- a/gst-libs/gst/video/video-resampler.c
+++ b/gst-libs/gst/video/video-resampler.c
@@ -27,6 +27,28 @@
#include "video-resampler.h"
+#ifndef GST_DISABLE_GST_DEBUG
+#define GST_CAT_DEFAULT ensure_debug_category()
+static GstDebugCategory *
+ensure_debug_category (void)
+{
+ static gsize cat_gonce = 0;
+
+ if (g_once_init_enter (&cat_gonce)) {
+ gsize cat_done;
+
+ cat_done = (gsize) _gst_debug_category_new ("video-resampler", 0,
+ "video-resampler object");
+
+ g_once_init_leave (&cat_gonce, cat_done);
+ }
+
+ return (GstDebugCategory *) cat_gonce;
+}
+#else
+#define ensure_debug_category() /* NOOP */
+#endif /* GST_DISABLE_GST_DEBUG */
+
/**
* SECTION:gstvideoresampler
* @short_description: Utility structure for resampler information
@@ -36,6 +58,7 @@
*
*/
+
#define DEFAULT_OPT_CUBIC_B (1.0 / 3.0)
#define DEFAULT_OPT_CUBIC_C (1.0 / 3.0)
diff --git a/gst-libs/gst/video/video-scaler.c b/gst-libs/gst/video/video-scaler.c
index 4390f2655..18bd09c9b 100644
--- a/gst-libs/gst/video/video-scaler.c
+++ b/gst-libs/gst/video/video-scaler.c
@@ -43,6 +43,29 @@
#include "video-orc.h"
#include "video-scaler.h"
+#ifndef GST_DISABLE_GST_DEBUG
+#define GST_CAT_DEFAULT ensure_debug_category()
+static GstDebugCategory *
+ensure_debug_category (void)
+{
+ static gsize cat_gonce = 0;
+
+ if (g_once_init_enter (&cat_gonce)) {
+ gsize cat_done;
+
+ cat_done = (gsize) _gst_debug_category_new ("video-scaler", 0,
+ "video-scaler object");
+
+ g_once_init_leave (&cat_gonce, cat_done);
+ }
+
+ return (GstDebugCategory *) cat_gonce;
+}
+
+#else
+#define ensure_debug_category() /* NOOP */
+#endif /* GST_DISABLE_GST_DEBUG */
+
#define SCALE_U8 12
#define SCALE_U8_ROUND (1 << (SCALE_U8 -1))
#define SCALE_U8_LQ 6
diff --git a/gst-libs/gst/video/videooverlay.c b/gst-libs/gst/video/videooverlay.c
index ad7da93a6..cd232bacb 100644
--- a/gst-libs/gst/video/videooverlay.c
+++ b/gst-libs/gst/video/videooverlay.c
@@ -312,6 +312,9 @@
#include "videooverlay.h"
+GST_DEBUG_CATEGORY_STATIC (gst_video_overlay_debug);
+#define GST_CAT_DEFAULT gst_video_overlay_debug
+
GType
gst_video_overlay_get_type (void)
{
@@ -332,6 +335,9 @@ gst_video_overlay_get_type (void)
gst_video_overlay_type = g_type_register_static (G_TYPE_INTERFACE,
"GstVideoOverlay", &gst_video_overlay_info, 0);
+
+ GST_DEBUG_CATEGORY_INIT (gst_video_overlay_debug, "videooverlay", 0,
+ "videooverlay interface");
}
return gst_video_overlay_type;