From eb25b058f994f4d71131f478f8859cd40ebd2bc1 Mon Sep 17 00:00:00 2001 From: Enrico Jorns Date: Wed, 28 Jan 2015 08:58:26 +0100 Subject: [PATCH] v4l2: Remove usage and definition of LOG_CAPS macro Unlike former definitions of LOG_CAPS, the current implementation simply expands to GST_DEBUG_OBJECT. The LOG_CAPS macro is rarely used and most uses duplicate already existing GST_DEBUG_OBJECT lines. Therefore, the caps are often printed twice which unnecessarily clutters the debug log. Replace LOG_CAPS calls with GST_DEBUG_OBJECT, remove LOG_CAPS calls, and delete the definition of LOG_CAPS. https://bugzilla.gnome.org/show_bug.cgi?id=776899 --- sys/v4l2/gstv4l2object.c | 1 - sys/v4l2/gstv4l2sink.c | 2 +- sys/v4l2/gstv4l2src.c | 5 ----- sys/v4l2/v4l2_calls.h | 2 -- 4 files changed, 1 insertion(+), 9 deletions(-) diff --git a/sys/v4l2/gstv4l2object.c b/sys/v4l2/gstv4l2object.c index fa17ffa..47a8dd7 100644 --- a/sys/v4l2/gstv4l2object.c +++ b/sys/v4l2/gstv4l2object.c @@ -3909,7 +3909,6 @@ gst_v4l2_object_get_caps (GstV4l2Object * v4l2object, GstCaps * filter) } GST_INFO_OBJECT (v4l2object->element, "probed caps: %" GST_PTR_FORMAT, ret); - LOG_CAPS (v4l2object->element, ret); return ret; } diff --git a/sys/v4l2/gstv4l2sink.c b/sys/v4l2/gstv4l2sink.c index b5f34eb..1d457b5 100644 --- a/sys/v4l2/gstv4l2sink.c +++ b/sys/v4l2/gstv4l2sink.c @@ -497,7 +497,7 @@ gst_v4l2sink_set_caps (GstBaseSink * bsink, GstCaps * caps) GstV4l2Sink *v4l2sink = GST_V4L2SINK (bsink); GstV4l2Object *obj = v4l2sink->v4l2object; - LOG_CAPS (v4l2sink, caps); + GST_DEBUG_OBJECT (v4l2sink, "caps: %" GST_PTR_FORMAT, caps); if (!GST_V4L2_IS_OPEN (obj)) { GST_DEBUG_OBJECT (v4l2sink, "device is not open"); diff --git a/sys/v4l2/gstv4l2src.c b/sys/v4l2/gstv4l2src.c index 0149814..cf10de7 100644 --- a/sys/v4l2/gstv4l2src.c +++ b/sys/v4l2/gstv4l2src.c @@ -298,7 +298,6 @@ gst_v4l2src_negotiate (GstBaseSrc * basesrc) /* first see what is possible on our source pad */ thiscaps = gst_pad_query_caps (GST_BASE_SRC_PAD (basesrc), NULL); GST_DEBUG_OBJECT (basesrc, "caps of src: %" GST_PTR_FORMAT, thiscaps); - LOG_CAPS (basesrc, thiscaps); /* nothing or anything is allowed, we're done */ if (thiscaps == NULL || gst_caps_is_any (thiscaps)) @@ -307,8 +306,6 @@ gst_v4l2src_negotiate (GstBaseSrc * basesrc) /* get the peer caps without a filter as we'll filter ourselves later on */ peercaps = gst_pad_peer_query_caps (GST_BASE_SRC_PAD (basesrc), NULL); GST_DEBUG_OBJECT (basesrc, "caps of peer: %" GST_PTR_FORMAT, peercaps); - LOG_CAPS (basesrc, peercaps); - if (peercaps && !gst_caps_is_any (peercaps)) { GstCaps *icaps = NULL; @@ -317,7 +314,6 @@ gst_v4l2src_negotiate (GstBaseSrc * basesrc) GST_CAPS_INTERSECT_FIRST); GST_DEBUG_OBJECT (basesrc, "intersect: %" GST_PTR_FORMAT, icaps); - LOG_CAPS (basesrc, icaps); if (icaps) { /* If there are multiple intersections pick the one with the smallest * resolution strictly bigger then the first peer caps */ @@ -369,7 +365,6 @@ gst_v4l2src_negotiate (GstBaseSrc * basesrc) if (!gst_caps_is_empty (caps)) { caps = gst_v4l2src_fixate (basesrc, caps); GST_DEBUG_OBJECT (basesrc, "fixated to: %" GST_PTR_FORMAT, caps); - LOG_CAPS (basesrc, caps); if (gst_caps_is_any (caps)) { /* hmm, still anything, so element can do anything and diff --git a/sys/v4l2/v4l2_calls.h b/sys/v4l2/v4l2_calls.h index 0437ebf..6f32d6e 100644 --- a/sys/v4l2/v4l2_calls.h +++ b/sys/v4l2/v4l2_calls.h @@ -135,6 +135,4 @@ gboolean gst_v4l2_set_controls (GstV4l2Object * v4l2object, gboolean gst_v4l2_get_capabilities (GstV4l2Object * v4l2object); -#define LOG_CAPS(obj, caps) GST_DEBUG_OBJECT (obj, "%s: %" GST_PTR_FORMAT, #caps, caps) - #endif /* __V4L2_CALLS_H__ */ -- 2.7.4