mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-23 18:21:04 +00:00
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.
This commit is contained in:
parent
4bd5d8837a
commit
14083178b8
11 changed files with 172 additions and 5 deletions
|
@ -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)
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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)
|
||||
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -1078,6 +1078,8 @@ gst_video_scale_transform_frame (GstVideoFilter * filter,
|
|||
GstVideoScale *videoscale = GST_VIDEO_SCALE_CAST (filter);
|
||||
GstFlowReturn ret = GST_FLOW_OK;
|
||||
|
||||
GST_CAT_DEBUG_OBJECT (GST_CAT_PERFORMANCE, filter, "doing video scaling");
|
||||
|
||||
gst_video_converter_frame (videoscale->convert, in_frame, out_frame);
|
||||
|
||||
return ret;
|
||||
|
|
|
@ -1186,8 +1186,6 @@ convert_hline_generic (paintinfo * p, GstVideoFrame * frame, int y)
|
|||
|
||||
for (i = 0; i < n_lines; i++) {
|
||||
idx = CLAMP (y + i + offset, 0, height - 1);
|
||||
|
||||
GST_DEBUG ("line %d, %d, idx %d", i, y + i + offset, idx);
|
||||
lines[i] = p->lines[idx % n_lines];
|
||||
}
|
||||
|
||||
|
@ -1198,7 +1196,6 @@ convert_hline_generic (paintinfo * p, GstVideoFrame * frame, int y)
|
|||
idx = y + i + offset;
|
||||
if (idx > height - 1)
|
||||
break;
|
||||
GST_DEBUG ("pack line %d", idx);
|
||||
finfo->pack_func (finfo, GST_VIDEO_PACK_FLAG_NONE,
|
||||
lines[i], 0, frame->data, frame->info.stride,
|
||||
frame->info.chroma_site, idx, width);
|
||||
|
|
Loading…
Reference in a new issue