summaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
authorStefan Kost <ensonic@users.sf.net>2009-09-11 22:15:01 +0300
committerStefan Kost <ensonic@users.sf.net>2009-09-11 22:19:23 +0300
commit1a945a32ccae14b2828cacdd5d11560039df5d74 (patch)
treefb1302831400e405be6b8062259fc0b47a7db635 /sys
parent0c50816aaaa27f30a368ca21260b1766e2e1bf4a (diff)
v4l2: log buffer copies on queue underrun in perf category
v4l2src has a slow path where it does buffer-copies when it runs out of queued buffers. Log this to performance category to help monitoring it.
Diffstat (limited to 'sys')
-rw-r--r--sys/v4l2/gstv4l2.c2
-rw-r--r--sys/v4l2/v4l2src_calls.c5
2 files changed, 7 insertions, 0 deletions
diff --git a/sys/v4l2/gstv4l2.c b/sys/v4l2/gstv4l2.c
index 409526cb..99287b31 100644
--- a/sys/v4l2/gstv4l2.c
+++ b/sys/v4l2/gstv4l2.c
@@ -38,11 +38,13 @@
/* used in v4l2_calls.c and v4l2src_calls.c */
GST_DEBUG_CATEGORY (v4l2_debug);
+GST_DEBUG_CATEGORY (GST_CAT_PERFORMANCE);
static gboolean
plugin_init (GstPlugin * plugin)
{
GST_DEBUG_CATEGORY_INIT (v4l2_debug, "v4l2", 0, "V4L2 API calls");
+ GST_DEBUG_CATEGORY_GET (GST_CAT_PERFORMANCE, "GST_PERFORMANCE");
if (!gst_element_register (plugin, "v4l2src", GST_RANK_PRIMARY,
GST_TYPE_V4L2SRC) ||
diff --git a/sys/v4l2/v4l2src_calls.c b/sys/v4l2/v4l2src_calls.c
index 9142ac47..73de3025 100644
--- a/sys/v4l2/v4l2src_calls.c
+++ b/sys/v4l2/v4l2src_calls.c
@@ -49,6 +49,7 @@
GST_DEBUG_CATEGORY_EXTERN (v4l2src_debug);
#define GST_CAT_DEFAULT v4l2src_debug
+GST_DEBUG_CATEGORY_EXTERN (GST_CAT_PERFORMANCE);
/* lalala... */
#define GST_V4L2_SET_ACTIVE(element) (element)->buffer = GINT_TO_POINTER (-1)
@@ -157,6 +158,10 @@ gst_v4l2src_grab_frame (GstV4l2Src * v4l2src, GstBuffer ** buf)
|| !gst_v4l2_buffer_pool_available_buffers (pool);
if (G_UNLIKELY (need_copy)) {
+ if (!v4l2src->always_copy) {
+ GST_CAT_LOG_OBJECT (GST_CAT_PERFORMANCE, v4l2src,
+ "running out of buffers, making a copy to reuse current one");
+ }
*buf = gst_buffer_copy (pool_buffer);
GST_BUFFER_FLAG_UNSET (*buf, GST_BUFFER_FLAG_READONLY);
/* this will requeue */