debug: add some performance debug
authorWim Taymans <wim.taymans@collabora.co.uk>
Thu, 9 Feb 2012 14:28:54 +0000 (15:28 +0100)
committerWim Taymans <wim.taymans@collabora.co.uk>
Thu, 9 Feb 2012 14:28:54 +0000 (15:28 +0100)
gst-libs/gst/video/video.c
gst/videoconvert/gstvideoconvert.c
gst/videoscale/gstvideoscale.c

index 311da67..d15551f 100644 (file)
@@ -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;
index 69646bf..89b41d3 100644 (file)
@@ -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);
index 65d24cb..0acc554 100644 (file)
@@ -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 ();