From 71d80c475154881d8787db5b9e85f5ebfe3fcc73 Mon Sep 17 00:00:00 2001 From: Thomas Vander Stichele Date: Sun, 15 Jan 2006 10:06:40 +0000 Subject: [PATCH] sys/: move all regularly occurring messages to GST_LOG level add some more object logs Original commit message from CVS: * sys/ximage/ximagesink.c: (gst_ximage_buffer_finalize), (gst_ximagesink_ximage_new), (gst_ximagesink_ximage_put), (gst_ximagesink_buffer_alloc): * sys/xvimage/xvimagesink.c: (gst_xvimage_buffer_finalize), (gst_xvimagesink_xvimage_put), (gst_xvimagesink_show_frame), (gst_xvimagesink_buffer_alloc): move all regularly occurring messages to GST_LOG level add some more object logs --- ChangeLog | 11 +++++++++++ sys/ximage/ximagesink.c | 21 +++++++++++---------- sys/xvimage/xvimagesink.c | 21 +++++++++++---------- 3 files changed, 33 insertions(+), 20 deletions(-) diff --git a/ChangeLog b/ChangeLog index 962defdec..317a583e4 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,14 @@ +2006-01-15 Thomas Vander Stichele + + * sys/ximage/ximagesink.c: (gst_ximage_buffer_finalize), + (gst_ximagesink_ximage_new), (gst_ximagesink_ximage_put), + (gst_ximagesink_buffer_alloc): + * sys/xvimage/xvimagesink.c: (gst_xvimage_buffer_finalize), + (gst_xvimagesink_xvimage_put), (gst_xvimagesink_show_frame), + (gst_xvimagesink_buffer_alloc): + move all regularly occurring messages to GST_LOG level + add some more object logs + 2006-01-14 Thomas Vander Stichele * ext/ogg/gstoggmux.c: (gst_ogg_mux_collected): diff --git a/sys/ximage/ximagesink.c b/sys/ximage/ximagesink.c index 0981f8ddb..0e3b7790d 100644 --- a/sys/ximage/ximagesink.c +++ b/sys/ximage/ximagesink.c @@ -215,7 +215,7 @@ gst_ximage_buffer_finalize (GstXImageBuffer * ximage) gst_ximagesink_ximage_destroy (ximagesink, ximage); } else { /* In that case we can reuse the image and add it to our image pool. */ - GST_DEBUG_OBJECT (ximagesink, "recycling image %p in pool", ximage); + GST_LOG_OBJECT (ximagesink, "recycling image %p in pool", ximage); /* need to increment the refcount again to recycle */ gst_buffer_ref (GST_BUFFER (ximage)); g_mutex_lock (ximagesink->pool_lock); @@ -405,7 +405,7 @@ gst_ximagesink_ximage_new (GstXImageSink * ximagesink, GstCaps * caps) /* we have to use the returned bytes_per_line for our shm size */ ximage->size = ximage->ximage->bytes_per_line * ximage->ximage->height; - GST_DEBUG_OBJECT (ximagesink, "XShm image size is %d, width %d, stride %d", + GST_LOG_OBJECT (ximagesink, "XShm image size is %d, width %d, stride %d", ximage->size, ximage->width, ximage->ximage->bytes_per_line); ximage->SHMInfo.shmid = shmget (IPC_PRIVATE, ximage->size, @@ -564,17 +564,17 @@ gst_ximagesink_ximage_put (GstXImageSink * ximagesink, GstXImageBuffer * ximage) g_return_if_fail (GST_IS_XIMAGESINK (ximagesink)); - /* We take the flow_lock. If expose is in there we don't want to run + /* We take the flow_lock. If expose is in there we don't want to run concurrently from the data flow thread */ g_mutex_lock (ximagesink->flow_lock); - /* Store a reference to the last image we put, loose the previous one */ + /* Store a reference to the last image we put, lose the previous one */ if (ximage && ximagesink->cur_image != ximage) { if (ximagesink->cur_image) { - GST_DEBUG_OBJECT (ximagesink, "unreffing %p", ximagesink->cur_image); + GST_LOG_OBJECT (ximagesink, "unreffing %p", ximagesink->cur_image); gst_buffer_unref (ximagesink->cur_image); } - GST_DEBUG_OBJECT (ximagesink, "reffing %p as our current image", ximage); + GST_LOG_OBJECT (ximagesink, "reffing %p as our current image", ximage); ximagesink->cur_image = GST_XIMAGE_BUFFER (gst_buffer_ref (ximage)); } @@ -1424,8 +1424,9 @@ gst_ximagesink_buffer_alloc (GstBaseSink * bsink, guint64 offset, guint size, ximagesink = GST_XIMAGESINK (bsink); - GST_DEBUG ("a buffer of %d bytes was requested with caps %" GST_PTR_FORMAT - " and offset %llu", size, caps, offset); + GST_LOG_OBJECT (ximagesink, + "a buffer of %d bytes was requested with caps %" GST_PTR_FORMAT + " and offset %" G_GUINT64_FORMAT, size, caps, offset); desired_caps = gst_caps_copy (caps); @@ -1454,11 +1455,11 @@ gst_ximagesink_buffer_alloc (GstBaseSink * bsink, guint64 offset, guint size, g_mutex_unlock (ximagesink->flow_lock); if (ximagesink->keep_aspect) { - GST_DEBUG_OBJECT (ximagesink, "enforcing aspect ratio in reverse caps " + GST_LOG_OBJECT (ximagesink, "enforcing aspect ratio in reverse caps " "negotiation"); gst_video_sink_center_rect (src, dst, &result, TRUE); } else { - GST_DEBUG_OBJECT (ximagesink, "trying to resize to window geometry " + GST_LOG_OBJECT (ximagesink, "trying to resize to window geometry " "ignoring aspect ratio"); result.x = result.y = 0; result.w = dst.w; diff --git a/sys/xvimage/xvimagesink.c b/sys/xvimage/xvimagesink.c index fb99da31d..8b2e299f6 100644 --- a/sys/xvimage/xvimagesink.c +++ b/sys/xvimage/xvimagesink.c @@ -275,13 +275,14 @@ gst_xvimage_buffer_finalize (GstXvImageBuffer * xvimage) /* If our geometry changed we can't reuse that image. */ if ((xvimage->width != xvimagesink->video_width) || (xvimage->height != xvimagesink->video_height)) { - GST_DEBUG ("destroy image as its size changed %dx%d vs current %dx%d", + GST_LOG_OBJECT (xvimage, + "destroy image as its size changed %dx%d vs current %dx%d", xvimage->width, xvimage->height, xvimagesink->video_width, xvimagesink->video_height); gst_xvimage_buffer_destroy (xvimage); } else { /* In that case we can reuse the image and add it to our image pool. */ - GST_DEBUG ("recycling image in pool"); + GST_LOG_OBJECT (xvimage, "recycling image in pool"); /* need to increment the refcount again to recycle */ gst_buffer_ref (GST_BUFFER (xvimage)); g_mutex_lock (xvimagesink->pool_lock); @@ -588,17 +589,17 @@ gst_xvimagesink_xvimage_put (GstXvImageSink * xvimagesink, g_return_if_fail (GST_IS_XVIMAGESINK (xvimagesink)); g_return_if_fail (xvimagesink->xwindow != NULL); - /* We take the flow_lock. If expose is in there we don't want to run + /* We take the flow_lock. If expose is in there we don't want to run concurrently from the data flow thread */ g_mutex_lock (xvimagesink->flow_lock); - /* Store a reference to the last image we put, loose the previous one */ + /* Store a reference to the last image we put, lose the previous one */ if (xvimage && xvimagesink->cur_image != xvimage) { if (xvimagesink->cur_image) { - GST_DEBUG_OBJECT (xvimagesink, "unreffing %p", xvimagesink->cur_image); + GST_LOG_OBJECT (xvimagesink, "unreffing %p", xvimagesink->cur_image); gst_buffer_unref (xvimagesink->cur_image); } - GST_DEBUG_OBJECT (xvimagesink, "reffing %p as our current image", xvimage); + GST_LOG_OBJECT (xvimagesink, "reffing %p as our current image", xvimage); xvimagesink->cur_image = GST_XVIMAGE_BUFFER (gst_buffer_ref (xvimage)); } @@ -1761,10 +1762,10 @@ gst_xvimagesink_show_frame (GstBaseSink * bsink, GstBuffer * buf) /* If this buffer has been allocated using our buffer management we simply put the ximage which is in the PRIVATE pointer */ if (GST_IS_XVIMAGE_BUFFER (buf)) { - GST_DEBUG ("fast put of bufferpool buffer"); + GST_LOG_OBJECT (xvimagesink, "fast put of bufferpool buffer"); gst_xvimagesink_xvimage_put (xvimagesink, GST_XVIMAGE_BUFFER (buf)); } else { - GST_DEBUG ("slow copy into bufferpool buffer"); + GST_LOG_OBJECT (xvimagesink, "slow copy into bufferpool buffer"); /* Else we have to copy the data into our private image, */ /* if we have one... */ if (!xvimagesink->xvimage) { @@ -1790,7 +1791,7 @@ gst_xvimagesink_show_frame (GstBaseSink * bsink, GstBuffer * buf) no_image: { /* No image available. That's very bad ! */ - GST_DEBUG ("could not create image"); + GST_WARNING_OBJECT (xvimagesink, "could not create image"); GST_ELEMENT_ERROR (xvimagesink, CORE, NEGOTIATION, (NULL), ("Failed creating an XvImage in xvimagesink chain function.")); return GST_FLOW_ERROR; @@ -1829,7 +1830,7 @@ gst_xvimagesink_buffer_alloc (GstBaseSink * bsink, guint64 offset, guint size, xvimage = NULL; } else { /* We found a suitable image */ - GST_DEBUG_OBJECT (xvimagesink, "found usable image in pool"); + GST_LOG_OBJECT (xvimagesink, "found usable image in pool"); break; } } -- 2.34.1