From d4ac2d54beb2b175e9ea9a90b1169fce24e8af3d Mon Sep 17 00:00:00 2001 From: Thomas Vander Stichele Date: Wed, 7 Jul 2004 14:15:28 +0000 Subject: [PATCH] debugging and cleanups Original commit message from CVS: debugging and cleanups --- ChangeLog | 7 +++++++ gst/autoplug/gstspideridentity.c | 9 +++++---- gst/gstbuffer.h | 32 ++++++++++++++++---------------- gst/gstpad.c | 4 ++-- 4 files changed, 30 insertions(+), 22 deletions(-) diff --git a/ChangeLog b/ChangeLog index 4553b958cd..037943909c 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2004-07-07 Thomas Vander Stichele + + * gst/autoplug/gstspideridentity.c: (gst_spider_identity_chain): + * gst/gstbuffer.h: + * gst/gstpad.c: + cleanups and debugging + 2004-07-07 Ronald Bultje * configure.ac: diff --git a/gst/autoplug/gstspideridentity.c b/gst/autoplug/gstspideridentity.c index 1e638d88c8..e7331b3187 100644 --- a/gst/autoplug/gstspideridentity.c +++ b/gst/autoplug/gstspideridentity.c @@ -173,10 +173,9 @@ gst_spider_identity_chain (GstPad * pad, GstBuffer * buf) { GstSpiderIdentity *ident; - /*g_print ("chaining on pad %s:%s with buffer %p\n", GST_DEBUG_PAD_NAME (pad), buf); */ - g_return_if_fail (pad != NULL); g_return_if_fail (GST_IS_PAD (pad)); + if (buf == NULL) return; @@ -209,8 +208,10 @@ gst_spider_identity_chain (GstPad * pad, GstBuffer * buf) } if ((ident->src != NULL) && (GST_PAD_PEER (ident->src) != NULL)) { - /* g_print("pushing buffer %p (refcount %d - buffersize %d) to pad %s:%s\n", buf, GST_BUFFER_REFCOUNT (buf), GST_BUFFER_SIZE (buf), GST_DEBUG_PAD_NAME (ident->src)); */ - GST_LOG ("push %p %" G_GINT64_FORMAT, buf, GST_BUFFER_OFFSET (buf)); + GST_LOG_OBJECT (ident, "pushing buffer %p " + "(refcount %d, size %u, offset %" G_GINT64_FORMAT ") ", + buf, GST_BUFFER_REFCOUNT_VALUE (buf), + GST_BUFFER_SIZE (buf), GST_BUFFER_OFFSET (buf)); gst_pad_push (ident->src, GST_DATA (buf)); } else if (GST_IS_BUFFER (buf)) { gst_buffer_unref (buf); diff --git a/gst/gstbuffer.h b/gst/gstbuffer.h index e268ddaf70..f61a232364 100644 --- a/gst/gstbuffer.h +++ b/gst/gstbuffer.h @@ -37,10 +37,10 @@ typedef void (*GstBufferFreeDataFunc) (GstBuffer *buffer); extern GType _gst_buffer_type; -#define GST_TYPE_BUFFER (gst_buffer_get_type()) +#define GST_TYPE_BUFFER (gst_buffer_get_type()) -#define GST_BUFFER(buf) ((GstBuffer *)(buf)) -#define GST_IS_BUFFER(buf) (GST_DATA_TYPE(buf) == GST_TYPE_BUFFER) +#define GST_BUFFER(buf) ((GstBuffer *)(buf)) +#define GST_IS_BUFFER(buf) (GST_DATA_TYPE(buf) == GST_TYPE_BUFFER) #define GST_BUFFER_REFCOUNT(buf) GST_DATA_REFCOUNT(buf) #define GST_BUFFER_REFCOUNT_VALUE(buf) GST_DATA_REFCOUNT_VALUE(buf) @@ -81,20 +81,20 @@ typedef enum { GST_BUFFER_KEY_UNIT, /* sync point in the stream */ GST_BUFFER_DONTKEEP, GST_BUFFER_IN_CAPS, - GST_BUFFER_FLAG_LAST = GST_DATA_FLAG_LAST + 8 + GST_BUFFER_FLAG_LAST = GST_DATA_FLAG_LAST + 8 } GstBufferFlag; struct _GstBuffer { - GstData data_type; + GstData data_type; /* pointer to data and its size */ - guint8 *data; /* pointer to buffer data */ - guint size; /* size of buffer data */ + guint8 *data; /* pointer to buffer data */ + guint size; /* size of buffer data */ guint maxsize; /* max size of this buffer */ /* timestamp */ - GstClockTime timestamp; - GstClockTime duration; + GstClockTime timestamp; + GstClockTime duration; /* media specific offset * for video frames, this could be the number of frames, @@ -107,18 +107,18 @@ struct _GstBuffer { guint64 offset_end; GstBufferFreeDataFunc free_data; - gpointer buffer_private; + gpointer buffer_private; gpointer _gst_reserved[GST_PADDING]; }; /* allocation */ GType gst_buffer_get_type (void); -GstBuffer* gst_buffer_new (void); +GstBuffer* gst_buffer_new (void); GstBuffer* gst_buffer_new_and_alloc (guint size); -#define gst_buffer_set_data(buf, data, size) \ -G_STMT_START { \ +#define gst_buffer_set_data(buf, data, size) \ +G_STMT_START { \ GST_BUFFER_DATA (buf) = data; \ GST_BUFFER_SIZE (buf) = size; \ } G_STMT_END @@ -138,15 +138,15 @@ GstBuffer* gst_buffer_create_sub (GstBuffer *parent, guint offset, guint size); /* merge, span, or append two buffers, intelligently */ GstBuffer* gst_buffer_merge (GstBuffer *buf1, GstBuffer *buf2); -GstBuffer* gst_buffer_join (GstBuffer *buf1, GstBuffer *buf2); +GstBuffer* gst_buffer_join (GstBuffer *buf1, GstBuffer *buf2); gboolean gst_buffer_is_span_fast (GstBuffer *buf1, GstBuffer *buf2); GstBuffer* gst_buffer_span (GstBuffer *buf1, guint32 offset, GstBuffer *buf2, guint32 len); /* --- private --- */ void _gst_buffer_initialize (void); -void gst_buffer_default_free (GstBuffer *buffer); -GstBuffer* gst_buffer_default_copy (GstBuffer *buffer); +void gst_buffer_default_free (GstBuffer *buffer); +GstBuffer* gst_buffer_default_copy (GstBuffer *buffer); G_END_DECLS diff --git a/gst/gstpad.c b/gst/gstpad.c index 3d855550d7..1dde963152 100644 --- a/gst/gstpad.c +++ b/gst/gstpad.c @@ -39,8 +39,8 @@ GST_DEBUG_CATEGORY_STATIC (debug_dataflow); GST_CAT_DEBUG_OBJECT (debug_dataflow, obj, "%s event %p (type %d)", notice, data, \ GST_EVENT_TYPE (data)); \ } else { \ - GST_CAT_LOG_OBJECT (debug_dataflow, obj, "%s buffer %p (size %d)", notice, data, \ - GST_BUFFER_SIZE (data)); \ + GST_CAT_LOG_OBJECT (debug_dataflow, obj, "%s buffer %p (size %u, refcount %d)", notice, data, \ + GST_BUFFER_SIZE (data), GST_BUFFER_REFCOUNT_VALUE (data)); \ } \ }G_STMT_END #define GST_CAT_DEFAULT GST_CAT_PADS -- 2.34.1