From f31d5d75056f839f5529bcc975b9afbcd7b16de6 Mon Sep 17 00:00:00 2001 From: Wim Taymans Date: Thu, 9 Feb 2012 15:28:54 +0100 Subject: [PATCH] debug: add some performance debug --- gst-libs/gst/video/video.c | 2 ++ gst/videoconvert/gstvideoconvert.c | 13 ++++++------- gst/videoscale/gstvideoscale.c | 14 +++++++++++--- 3 files changed, 19 insertions(+), 10 deletions(-) diff --git a/gst-libs/gst/video/video.c b/gst-libs/gst/video/video.c index 311da67..d15551f 100644 --- a/gst-libs/gst/video/video.c +++ b/gst-libs/gst/video/video.c @@ -1154,6 +1154,8 @@ gst_video_frame_copy (GstVideoFrame * dest, const GstVideoFrame * src) n_planes = dinfo->finfo->n_planes; + GST_DEBUG ("doing video frame copy"); + for (i = 0; i < n_planes; i++) { guint w, h, j; guint8 *sp, *dp; diff --git a/gst/videoconvert/gstvideoconvert.c b/gst/videoconvert/gstvideoconvert.c index 69646bf..89b41d3 100644 --- a/gst/videoconvert/gstvideoconvert.c +++ b/gst/videoconvert/gstvideoconvert.c @@ -47,7 +47,8 @@ GST_DEBUG_CATEGORY (videoconvert_debug); #define GST_CAT_DEFAULT videoconvert_debug -GST_DEBUG_CATEGORY (videoconvert_performance); +GST_DEBUG_CATEGORY_STATIC (GST_CAT_PERFORMANCE); + enum { @@ -385,17 +386,15 @@ gst_video_convert_transform_frame (GstVideoFilter * filter, space = GST_VIDEO_CONVERT_CAST (filter); - GST_DEBUG ("from %s -> to %s", GST_VIDEO_INFO_NAME (&filter->in_info), + GST_CAT_DEBUG_OBJECT (GST_CAT_PERFORMANCE, filter, + "doing colorspace conversion from %s -> to %s", + GST_VIDEO_INFO_NAME (&filter->in_info), GST_VIDEO_INFO_NAME (&filter->out_info)); videoconvert_convert_set_dither (space->convert, space->dither); videoconvert_convert_convert (space->convert, out_frame, in_frame); - /* baseclass copies timestamps */ - GST_DEBUG ("from %s -> to %s done", GST_VIDEO_INFO_NAME (&filter->in_info), - GST_VIDEO_INFO_NAME (&filter->out_info)); - return GST_FLOW_OK; } @@ -404,7 +403,7 @@ plugin_init (GstPlugin * plugin) { GST_DEBUG_CATEGORY_INIT (videoconvert_debug, "videoconvert", 0, "Colorspace Converter"); - GST_DEBUG_CATEGORY_GET (videoconvert_performance, "GST_PERFORMANCE"); + GST_DEBUG_CATEGORY_GET (GST_CAT_PERFORMANCE, "GST_PERFORMANCE"); return gst_element_register (plugin, "videoconvert", GST_RANK_NONE, GST_TYPE_VIDEO_CONVERT); diff --git a/gst/videoscale/gstvideoscale.c b/gst/videoscale/gstvideoscale.c index 65d24cb..0acc554 100644 --- a/gst/videoscale/gstvideoscale.c +++ b/gst/videoscale/gstvideoscale.c @@ -87,6 +87,7 @@ /* debug variable definition */ GST_DEBUG_CATEGORY (video_scale_debug); +GST_DEBUG_CATEGORY_STATIC (GST_CAT_PERFORMANCE); #define DEFAULT_PROP_METHOD GST_VIDEO_SCALE_BILINEAR #define DEFAULT_PROP_ADD_BORDERS FALSE @@ -492,9 +493,12 @@ gst_video_scale_set_info (GstVideoFilter * filter, GstCaps * in, g_free (videoscale->tmp_buf); videoscale->tmp_buf = g_malloc (out_info->width * 8 * 4); - gst_base_transform_set_passthrough (GST_BASE_TRANSFORM (filter), - (in_info->width == out_info->width - && in_info->height == out_info->height)); + if (in_info->width == out_info->width && in_info->height == out_info->height) { + gst_base_transform_set_passthrough (GST_BASE_TRANSFORM (filter), TRUE); + } else { + GST_CAT_DEBUG_OBJECT (GST_CAT_PERFORMANCE, filter, "setup videoscaling"); + gst_base_transform_set_passthrough (GST_BASE_TRANSFORM (filter), FALSE); + } GST_DEBUG_OBJECT (videoscale, "from=%dx%d (par=%d/%d dar=%d/%d), size %" G_GSIZE_FORMAT " -> to=%dx%d (par=%d/%d dar=%d/%d borders=%d:%d), " @@ -1083,6 +1087,9 @@ gst_video_scale_transform_frame (GstVideoFilter * filter, videoscale->borders_w, videoscale->borders_h); } + GST_CAT_DEBUG_OBJECT (GST_CAT_PERFORMANCE, filter, + "doing videoscale format %s", GST_VIDEO_INFO_NAME (&filter->in_info)); + switch (format) { case GST_VIDEO_FORMAT_RGBx: case GST_VIDEO_FORMAT_xRGB: @@ -1369,6 +1376,7 @@ plugin_init (GstPlugin * plugin) GST_DEBUG_CATEGORY_INIT (video_scale_debug, "videoscale", 0, "videoscale element"); + GST_DEBUG_CATEGORY_GET (GST_CAT_PERFORMANCE, "GST_PERFORMANCE"); vs_4tap_init (); -- 2.7.4