Fix and clarify debug statements

Fixes build on MacOSX

Signed-off-by: Edward Hervey <edward.hervey@collabora.co.uk>
This commit is contained in:
Josep Torra 2011-08-10 11:01:58 +02:00 committed by Edward Hervey
parent 2d4ddc3a08
commit 178bdccb76
14 changed files with 82 additions and 65 deletions

View file

@ -512,7 +512,8 @@ gst_buffer_new_allocate (const GstAllocator * allocator, gsize size,
if (mem != NULL) if (mem != NULL)
_memory_add (newbuf, -1, mem); _memory_add (newbuf, -1, mem);
GST_CAT_LOG (GST_CAT_BUFFER, "new %p of size %d from allocator %p", newbuf, GST_CAT_LOG (GST_CAT_BUFFER,
"new buffer %p of size %" G_GSIZE_FORMAT " from allocator %p", newbuf,
size, allocator); size, allocator);
#endif #endif
@ -563,7 +564,8 @@ gst_buffer_new_allocate (const GstAllocator * allocator, gsize size,
/* ERRORS */ /* ERRORS */
no_memory: no_memory:
{ {
GST_CAT_WARNING (GST_CAT_BUFFER, "failed to allocate %d bytes", size); GST_CAT_WARNING (GST_CAT_BUFFER,
"failed to allocate %" G_GSIZE_FORMAT " bytes", size);
return NULL; return NULL;
} }
} }

View file

@ -597,7 +597,7 @@ gst_allocator_register (const gchar * name, const GstMemoryInfo * info)
INSTALL_FALLBACK (is_span); INSTALL_FALLBACK (is_span);
#undef INSTALL_FALLBACK #undef INSTALL_FALLBACK
GST_DEBUG ("register \"%s\" of size %" G_GSIZE_FORMAT, name); GST_DEBUG ("registering allocator \"%s\"", name);
g_static_rw_lock_writer_lock (&lock); g_static_rw_lock_writer_lock (&lock);
g_hash_table_insert (allocators, (gpointer) name, (gpointer) allocator); g_hash_table_insert (allocators, (gpointer) name, (gpointer) allocator);

View file

@ -112,7 +112,8 @@ meta_timing_copy (GstBuffer * copybuf, GstMetaTiming * meta,
{ {
GstMetaTiming *timing; GstMetaTiming *timing;
GST_DEBUG ("trans called from buffer %p to %p, meta %p, %u-%u", buffer, GST_DEBUG ("trans called from buffer %p to %p, meta %p,"
"offset %" G_GSIZE_FORMAT ", size %" G_GSIZE_FORMAT, buffer,
copybuf, meta, offset, size); copybuf, meta, offset, size);
timing = gst_buffer_add_meta_timing (copybuf); timing = gst_buffer_add_meta_timing (copybuf);

View file

@ -2336,7 +2336,7 @@ filter_done:
GST_PTR_FORMAT, result, result, filter, filter); GST_PTR_FORMAT, result, result, filter, filter);
result = gst_caps_intersect_full (filter, result, GST_CAPS_INTERSECT_FIRST); result = gst_caps_intersect_full (filter, result, GST_CAPS_INTERSECT_FIRST);
GST_CAT_DEBUG_OBJECT (GST_CAT_CAPS, pad, "result %p %" GST_PTR_FORMAT, GST_CAT_DEBUG_OBJECT (GST_CAT_CAPS, pad, "result %p %" GST_PTR_FORMAT,
result); result, result);
} else { } else {
GST_CAT_DEBUG_OBJECT (GST_CAT_CAPS, pad, GST_CAT_DEBUG_OBJECT (GST_CAT_CAPS, pad,
"using caps %p %" GST_PTR_FORMAT, result, result); "using caps %p %" GST_PTR_FORMAT, result, result);

View file

@ -265,7 +265,8 @@ copy_into_unchecked (GstAdapter * adapter, guint8 * dest, gsize skip,
} }
/* copy partial buffer */ /* copy partial buffer */
csize = MIN (bsize - skip, size); csize = MIN (bsize - skip, size);
GST_DEBUG ("%u %u %u", bsize, skip, csize); GST_DEBUG ("bsize %" G_GSIZE_FORMAT ", skip %" G_GSIZE_FORMAT ", csize %"
G_GSIZE_FORMAT, bsize, skip, csize);
gst_buffer_extract (buf, skip, dest, csize); gst_buffer_extract (buf, skip, dest, csize);
size -= csize; size -= csize;
dest += csize; dest += csize;
@ -305,13 +306,13 @@ gst_adapter_push (GstAdapter * adapter, GstBuffer * buf)
/* Note: merging buffers at this point is premature. */ /* Note: merging buffers at this point is premature. */
if (G_UNLIKELY (adapter->buflist == NULL)) { if (G_UNLIKELY (adapter->buflist == NULL)) {
GST_LOG_OBJECT (adapter, "pushing first %u bytes", size); GST_LOG_OBJECT (adapter, "pushing first %" G_GSIZE_FORMAT " bytes", size);
adapter->buflist = adapter->buflist_end = g_slist_append (NULL, buf); adapter->buflist = adapter->buflist_end = g_slist_append (NULL, buf);
update_timestamp (adapter, buf); update_timestamp (adapter, buf);
} else { } else {
/* Otherwise append to the end, and advance our end pointer */ /* Otherwise append to the end, and advance our end pointer */
GST_LOG_OBJECT (adapter, "pushing %u bytes at end, size now %u", size, GST_LOG_OBJECT (adapter, "pushing %" G_GSIZE_FORMAT " bytes at end, "
adapter->size); "size now %" G_GSIZE_FORMAT, size, adapter->size);
adapter->buflist_end = g_slist_append (adapter->buflist_end, buf); adapter->buflist_end = g_slist_append (adapter->buflist_end, buf);
adapter->buflist_end = g_slist_next (adapter->buflist_end); adapter->buflist_end = g_slist_next (adapter->buflist_end);
} }
@ -349,8 +350,8 @@ gst_adapter_try_to_merge_up (GstAdapter * adapter, gsize size)
return ret; return ret;
/* Merge the head buffer and the next in line */ /* Merge the head buffer and the next in line */
GST_LOG_OBJECT (adapter, GST_LOG_OBJECT (adapter, "Merging buffers of size %" G_GSIZE_FORMAT " & %"
"Merging buffers of size %u & %u in search of target %u", G_GSIZE_FORMAT " in search of target %" G_GSIZE_FORMAT,
hsize, gst_buffer_get_size (cur), size); hsize, gst_buffer_get_size (cur), size);
head = gst_buffer_join (head, cur); head = gst_buffer_join (head, cur);
@ -438,7 +439,7 @@ gst_adapter_map (GstAdapter * adapter, gsize size)
/* Gonna need to copy stuff out */ /* Gonna need to copy stuff out */
if (G_UNLIKELY (adapter->assembled_size < size)) { if (G_UNLIKELY (adapter->assembled_size < size)) {
adapter->assembled_size = (size / DEFAULT_SIZE + 1) * DEFAULT_SIZE; adapter->assembled_size = (size / DEFAULT_SIZE + 1) * DEFAULT_SIZE;
GST_DEBUG_OBJECT (adapter, "resizing internal buffer to %u", GST_DEBUG_OBJECT (adapter, "resizing internal buffer to %" G_GSIZE_FORMAT,
adapter->assembled_size); adapter->assembled_size);
if (toreuse == 0) { if (toreuse == 0) {
GST_CAT_DEBUG (GST_CAT_PERFORMANCE, "alloc new buffer"); GST_CAT_DEBUG (GST_CAT_PERFORMANCE, "alloc new buffer");
@ -448,13 +449,14 @@ gst_adapter_map (GstAdapter * adapter, gsize size)
adapter->assembled_data = g_malloc (adapter->assembled_size); adapter->assembled_data = g_malloc (adapter->assembled_size);
} else { } else {
/* we are going to reuse all data, realloc then */ /* we are going to reuse all data, realloc then */
GST_CAT_DEBUG (GST_CAT_PERFORMANCE, "reusing %u bytes", toreuse); GST_CAT_DEBUG (GST_CAT_PERFORMANCE, "reusing %" G_GSIZE_FORMAT " bytes",
toreuse);
adapter->assembled_data = adapter->assembled_data =
g_realloc (adapter->assembled_data, adapter->assembled_size); g_realloc (adapter->assembled_data, adapter->assembled_size);
} }
} }
GST_CAT_DEBUG (GST_CAT_PERFORMANCE, "copy remaining %u bytes from adapter", GST_CAT_DEBUG (GST_CAT_PERFORMANCE, "copy remaining %" G_GSIZE_FORMAT
tocopy); " bytes from adapter", tocopy);
data = adapter->assembled_data; data = adapter->assembled_data;
copy_into_unchecked (adapter, data + toreuse, skip + toreuse, tocopy); copy_into_unchecked (adapter, data + toreuse, skip + toreuse, tocopy);
adapter->assembled_len = size; adapter->assembled_len = size;
@ -529,7 +531,7 @@ gst_adapter_flush_unchecked (GstAdapter * adapter, gsize flush)
GstAdapterPrivate *priv; GstAdapterPrivate *priv;
GSList *g; GSList *g;
GST_LOG_OBJECT (adapter, "flushing %u bytes", flush); GST_LOG_OBJECT (adapter, "flushing %" G_GSIZE_FORMAT " bytes", flush);
priv = adapter->priv; priv = adapter->priv;
@ -603,18 +605,19 @@ gst_adapter_take_internal (GstAdapter * adapter, gsize nbytes)
/* we reuse already allocated memory but only when we're going to reuse /* we reuse already allocated memory but only when we're going to reuse
* something from it because else we are worse than the malloc and copy * something from it because else we are worse than the malloc and copy
* case below */ * case below */
GST_LOG_OBJECT (adapter, "reusing %u bytes of assembled data", toreuse); GST_LOG_OBJECT (adapter, "reusing %" G_GSIZE_FORMAT " bytes of assembled"
" data", toreuse);
/* we have enough free space in the assembled array */ /* we have enough free space in the assembled array */
data = adapter->assembled_data; data = adapter->assembled_data;
/* flush after this function should set the assembled_size to 0 */ /* flush after this function should set the assembled_size to 0 */
adapter->assembled_data = g_malloc (adapter->assembled_size); adapter->assembled_data = g_malloc (adapter->assembled_size);
} else { } else {
GST_LOG_OBJECT (adapter, "allocating %u bytes", nbytes); GST_LOG_OBJECT (adapter, "allocating %" G_GSIZE_FORMAT " bytes", nbytes);
/* not enough bytes in the assembled array, just allocate new space */ /* not enough bytes in the assembled array, just allocate new space */
data = g_malloc (nbytes); data = g_malloc (nbytes);
/* reuse what we can from the already assembled data */ /* reuse what we can from the already assembled data */
if (toreuse) { if (toreuse) {
GST_LOG_OBJECT (adapter, "reusing %u bytes", toreuse); GST_LOG_OBJECT (adapter, "reusing %" G_GSIZE_FORMAT " bytes", toreuse);
memcpy (data, adapter->assembled_data, toreuse); memcpy (data, adapter->assembled_data, toreuse);
} }
} }
@ -693,7 +696,8 @@ gst_adapter_take_buffer (GstAdapter * adapter, gsize nbytes)
g_return_val_if_fail (GST_IS_ADAPTER (adapter), NULL); g_return_val_if_fail (GST_IS_ADAPTER (adapter), NULL);
g_return_val_if_fail (nbytes > 0, NULL); g_return_val_if_fail (nbytes > 0, NULL);
GST_LOG_OBJECT (adapter, "taking buffer of %u bytes", nbytes); GST_LOG_OBJECT (adapter, "taking buffer of %" G_GSIZE_FORMAT " bytes",
nbytes);
/* we don't have enough data, return NULL. This is unlikely /* we don't have enough data, return NULL. This is unlikely
* as one usually does an _available() first instead of grabbing a * as one usually does an _available() first instead of grabbing a
@ -707,13 +711,13 @@ gst_adapter_take_buffer (GstAdapter * adapter, gsize nbytes)
/* our head buffer has enough data left, return it */ /* our head buffer has enough data left, return it */
if (skip == 0 && hsize == nbytes) { if (skip == 0 && hsize == nbytes) {
GST_LOG_OBJECT (adapter, "providing buffer of %d bytes as head buffer", GST_LOG_OBJECT (adapter, "providing buffer of %" G_GSIZE_FORMAT " bytes"
nbytes); " as head buffer", nbytes);
buffer = gst_buffer_ref (cur); buffer = gst_buffer_ref (cur);
goto done; goto done;
} else if (hsize >= nbytes + skip) { } else if (hsize >= nbytes + skip) {
GST_LOG_OBJECT (adapter, "providing buffer of %d bytes via region copy", GST_LOG_OBJECT (adapter, "providing buffer of %" G_GSIZE_FORMAT " bytes"
nbytes); " via region copy", nbytes);
buffer = gst_buffer_copy_region (cur, GST_BUFFER_COPY_ALL, skip, nbytes); buffer = gst_buffer_copy_region (cur, GST_BUFFER_COPY_ALL, skip, nbytes);
goto done; goto done;
} }
@ -722,8 +726,8 @@ gst_adapter_take_buffer (GstAdapter * adapter, gsize nbytes)
/* Merged something, let's try again for sub-buffering */ /* Merged something, let's try again for sub-buffering */
cur = adapter->buflist->data; cur = adapter->buflist->data;
if (gst_buffer_get_size (cur) >= nbytes + skip) { if (gst_buffer_get_size (cur) >= nbytes + skip) {
GST_LOG_OBJECT (adapter, "providing buffer of %d bytes via sub-buffer", GST_LOG_OBJECT (adapter, "providing buffer of %" G_GSIZE_FORMAT " bytes"
nbytes); " via sub-buffer", nbytes);
buffer = gst_buffer_copy_region (cur, GST_BUFFER_COPY_ALL, skip, nbytes); buffer = gst_buffer_copy_region (cur, GST_BUFFER_COPY_ALL, skip, nbytes);
goto done; goto done;
} }
@ -770,7 +774,7 @@ gst_adapter_take_list (GstAdapter * adapter, gsize nbytes)
g_return_val_if_fail (GST_IS_ADAPTER (adapter), NULL); g_return_val_if_fail (GST_IS_ADAPTER (adapter), NULL);
g_return_val_if_fail (nbytes <= adapter->size, NULL); g_return_val_if_fail (nbytes <= adapter->size, NULL);
GST_LOG_OBJECT (adapter, "taking %u bytes", nbytes); GST_LOG_OBJECT (adapter, "taking %" G_GSIZE_FORMAT " bytes", nbytes);
while (nbytes > 0) { while (nbytes > 0) {
cur = adapter->buflist->data; cur = adapter->buflist->data;

View file

@ -996,7 +996,7 @@ gst_base_parse_sink_eventfunc (GstBaseParse * parse, GstEvent * event)
event = gst_event_new_segment (&out_segment); event = gst_event_new_segment (&out_segment);
GST_DEBUG_OBJECT (parse, "Converted incoming segment to TIME. " GST_DEBUG_OBJECT (parse, "Converted incoming segment to TIME. %"
GST_SEGMENT_FORMAT, in_segment); GST_SEGMENT_FORMAT, in_segment);
} else if (in_segment->format != GST_FORMAT_TIME) { } else if (in_segment->format != GST_FORMAT_TIME) {
@ -1646,7 +1646,7 @@ gst_base_parse_handle_and_push_frame (GstBaseParse * parse,
GST_LOG_OBJECT (parse, GST_LOG_OBJECT (parse,
"parsing frame at offset %" G_GUINT64_FORMAT "parsing frame at offset %" G_GUINT64_FORMAT
" (%#" G_GINT64_MODIFIER "x) of size %d", " (%#" G_GINT64_MODIFIER "x) of size %" G_GSIZE_FORMAT,
GST_BUFFER_OFFSET (buffer), GST_BUFFER_OFFSET (buffer), GST_BUFFER_OFFSET (buffer), GST_BUFFER_OFFSET (buffer),
gst_buffer_get_size (buffer)); gst_buffer_get_size (buffer));
@ -1767,7 +1767,7 @@ gst_base_parse_push_frame (GstBaseParse * parse, GstBaseParseFrame * frame)
buffer = frame->buffer; buffer = frame->buffer;
GST_LOG_OBJECT (parse, GST_LOG_OBJECT (parse,
"processing buffer of size %d with ts %" GST_TIME_FORMAT "processing buffer of size %" G_GSIZE_FORMAT " with ts %" GST_TIME_FORMAT
", duration %" GST_TIME_FORMAT, gst_buffer_get_size (buffer), ", duration %" GST_TIME_FORMAT, gst_buffer_get_size (buffer),
GST_TIME_ARGS (GST_BUFFER_TIMESTAMP (buffer)), GST_TIME_ARGS (GST_BUFFER_TIMESTAMP (buffer)),
GST_TIME_ARGS (GST_BUFFER_DURATION (buffer))); GST_TIME_ARGS (GST_BUFFER_DURATION (buffer)));
@ -2062,7 +2062,7 @@ gst_base_parse_process_fragment (GstBaseParse * parse, gboolean push_only)
parse->priv->buffers_pending = g_slist_reverse (parse->priv->buffers_pending); parse->priv->buffers_pending = g_slist_reverse (parse->priv->buffers_pending);
while (parse->priv->buffers_pending) { while (parse->priv->buffers_pending) {
buf = GST_BUFFER_CAST (parse->priv->buffers_pending->data); buf = GST_BUFFER_CAST (parse->priv->buffers_pending->data);
GST_LOG_OBJECT (parse, "adding pending buffer (size %d)", GST_LOG_OBJECT (parse, "adding pending buffer (size %" G_GSIZE_FORMAT ")",
gst_buffer_get_size (buf)); gst_buffer_get_size (buf));
gst_adapter_push (parse->priv->adapter, buf); gst_adapter_push (parse->priv->adapter, buf);
parse->priv->buffers_pending = parse->priv->buffers_pending =
@ -2148,7 +2148,7 @@ push:
/* any trailing unused no longer usable (ideally none) */ /* any trailing unused no longer usable (ideally none) */
if (G_UNLIKELY (gst_adapter_available (parse->priv->adapter))) { if (G_UNLIKELY (gst_adapter_available (parse->priv->adapter))) {
GST_DEBUG_OBJECT (parse, "discarding %d trailing bytes", GST_DEBUG_OBJECT (parse, "discarding %" G_GSIZE_FORMAT " trailing bytes",
gst_adapter_available (parse->priv->adapter)); gst_adapter_available (parse->priv->adapter));
gst_adapter_clear (parse->priv->adapter); gst_adapter_clear (parse->priv->adapter);
} }
@ -2190,7 +2190,8 @@ gst_base_parse_chain (GstPad * pad, GstBuffer * buffer)
frame = &parse->priv->frame; frame = &parse->priv->frame;
if (G_LIKELY (buffer)) { if (G_LIKELY (buffer)) {
GST_LOG_OBJECT (parse, "buffer size: %d, offset = %" G_GINT64_FORMAT, GST_LOG_OBJECT (parse,
"buffer size: %" G_GSIZE_FORMAT ", offset = %" G_GINT64_FORMAT,
gst_buffer_get_size (buffer), GST_BUFFER_OFFSET (buffer)); gst_buffer_get_size (buffer), GST_BUFFER_OFFSET (buffer));
if (G_UNLIKELY (parse->priv->passthrough)) { if (G_UNLIKELY (parse->priv->passthrough)) {
gst_base_parse_frame_init (frame); gst_base_parse_frame_init (frame);
@ -2277,8 +2278,8 @@ gst_base_parse_chain (GstPad * pad, GstBuffer * buffer)
gst_buffer_replace (&frame->buffer, NULL); gst_buffer_replace (&frame->buffer, NULL);
if (res) { if (res) {
if (gst_adapter_available (parse->priv->adapter) < fsize) { if (gst_adapter_available (parse->priv->adapter) < fsize) {
GST_DEBUG_OBJECT (parse, GST_DEBUG_OBJECT (parse, "found valid frame but not enough data"
"found valid frame but not enough data available (only %d bytes)", " available (only %" G_GSIZE_FORMAT " bytes)",
gst_adapter_available (parse->priv->adapter)); gst_adapter_available (parse->priv->adapter));
gst_buffer_unref (tmpbuf); gst_buffer_unref (tmpbuf);
goto done; goto done;
@ -2443,8 +2444,8 @@ gst_base_parse_pull_range (GstBaseParse * parse, guint size,
if (gst_buffer_get_size (parse->priv->cache) < size) { if (gst_buffer_get_size (parse->priv->cache) < size) {
GST_DEBUG_OBJECT (parse, "Returning short buffer at offset %" GST_DEBUG_OBJECT (parse, "Returning short buffer at offset %"
G_GUINT64_FORMAT ": wanted %u bytes, got %u bytes", parse->priv->offset, G_GUINT64_FORMAT ": wanted %u bytes, got %" G_GSIZE_FORMAT " bytes",
size, gst_buffer_get_size (parse->priv->cache)); parse->priv->offset, size, gst_buffer_get_size (parse->priv->cache));
*buffer = parse->priv->cache; *buffer = parse->priv->cache;
parse->priv->cache = NULL; parse->priv->cache = NULL;
@ -3331,7 +3332,7 @@ gst_base_parse_find_frame (GstBaseParse * parse, gint64 * pos,
buf = frame.buffer; buf = frame.buffer;
GST_LOG_OBJECT (parse, GST_LOG_OBJECT (parse,
"peek parsing frame at offset %" G_GUINT64_FORMAT "peek parsing frame at offset %" G_GUINT64_FORMAT
" (%#" G_GINT64_MODIFIER "x) of size %d", " (%#" G_GINT64_MODIFIER "x) of size %" G_GSIZE_FORMAT,
GST_BUFFER_OFFSET (buf), GST_BUFFER_OFFSET (buf), GST_BUFFER_OFFSET (buf), GST_BUFFER_OFFSET (buf),
gst_buffer_get_size (buf)); gst_buffer_get_size (buf));

View file

@ -1327,7 +1327,7 @@ no_function:
} }
alloc_failed: alloc_failed:
{ {
GST_DEBUG_OBJECT (src, "Failed to allocate buffer", size); GST_DEBUG_OBJECT (src, "Failed to allocate buffer of %u bytes", size);
return ret; return ret;
} }
not_ok: not_ok:

View file

@ -535,7 +535,8 @@ gst_base_transform_transform_size (GstBaseTransform * trans,
klass = GST_BASE_TRANSFORM_GET_CLASS (trans); klass = GST_BASE_TRANSFORM_GET_CLASS (trans);
GST_DEBUG_OBJECT (trans, "asked to transform size %d for caps %" GST_DEBUG_OBJECT (trans,
"asked to transform size %" G_GSIZE_FORMAT " for caps %"
GST_PTR_FORMAT " to size for caps %" GST_PTR_FORMAT " in direction %s", GST_PTR_FORMAT " to size for caps %" GST_PTR_FORMAT " in direction %s",
size, caps, othercaps, direction == GST_PAD_SRC ? "SRC" : "SINK"); size, caps, othercaps, direction == GST_PAD_SRC ? "SRC" : "SINK");
@ -555,8 +556,9 @@ gst_base_transform_transform_size (GstBaseTransform * trans,
if (!gst_base_transform_get_unit_size (trans, caps, &inunitsize)) if (!gst_base_transform_get_unit_size (trans, caps, &inunitsize))
goto no_in_size; goto no_in_size;
GST_DEBUG_OBJECT (trans, "input size %d, input unit size %d", size, GST_DEBUG_OBJECT (trans,
inunitsize); "input size %" G_GSIZE_FORMAT ", input unit size %" G_GSIZE_FORMAT,
size, inunitsize);
/* input size must be a multiple of the unit_size of the input caps */ /* input size must be a multiple of the unit_size of the input caps */
if (inunitsize == 0 || (size % inunitsize != 0)) if (inunitsize == 0 || (size % inunitsize != 0))
@ -572,7 +574,8 @@ gst_base_transform_transform_size (GstBaseTransform * trans,
/* the output size is the unit_size times the amount of units on the /* the output size is the unit_size times the amount of units on the
* input */ * input */
*othersize = units * outunitsize; *othersize = units * outunitsize;
GST_DEBUG_OBJECT (trans, "transformed size to %d", *othersize); GST_DEBUG_OBJECT (trans, "transformed size to %" G_GSIZE_FORMAT,
*othersize);
ret = TRUE; ret = TRUE;
} }
@ -587,8 +590,8 @@ no_in_size:
} }
no_multiple: no_multiple:
{ {
GST_DEBUG_OBJECT (trans, "Size %u is not a multiple of unit size %u", size, GST_DEBUG_OBJECT (trans, "Size %" G_GSIZE_FORMAT " is not a multiple of"
inunitsize); "unit size %" G_GSIZE_FORMAT, size, inunitsize);
g_warning ("%s: size %" G_GSIZE_FORMAT " is not a multiple of unit size %" g_warning ("%s: size %" G_GSIZE_FORMAT " is not a multiple of unit size %"
G_GSIZE_FORMAT, GST_ELEMENT_NAME (trans), size, inunitsize); G_GSIZE_FORMAT, GST_ELEMENT_NAME (trans), size, inunitsize);
return FALSE; return FALSE;
@ -1435,7 +1438,7 @@ default_prepare_output_buffer (GstBaseTransform * trans,
goto unknown_size; goto unknown_size;
} }
} }
GST_DEBUG_OBJECT (trans, "doing alloc of size %u", outsize); GST_DEBUG_OBJECT (trans, "doing alloc of size %" G_GSIZE_FORMAT, outsize);
*outbuf = *outbuf =
gst_buffer_new_allocate (priv->allocator, outsize, priv->alignment); gst_buffer_new_allocate (priv->allocator, outsize, priv->alignment);
} }
@ -1529,31 +1532,36 @@ gst_base_transform_get_unit_size (GstBaseTransform * trans, GstCaps * caps,
/* see if we have the result cached */ /* see if we have the result cached */
if (trans->cache_caps1 == caps) { if (trans->cache_caps1 == caps) {
*size = trans->cache_caps1_size; *size = trans->cache_caps1_size;
GST_DEBUG_OBJECT (trans, "returned %d from first cache", *size); GST_DEBUG_OBJECT (trans,
"returned %" G_GSIZE_FORMAT " from first cache", *size);
return TRUE; return TRUE;
} }
if (trans->cache_caps2 == caps) { if (trans->cache_caps2 == caps) {
*size = trans->cache_caps2_size; *size = trans->cache_caps2_size;
GST_DEBUG_OBJECT (trans, "returned %d from second cached", *size); GST_DEBUG_OBJECT (trans,
"returned %" G_GSIZE_FORMAT " from second cached", *size);
return TRUE; return TRUE;
} }
bclass = GST_BASE_TRANSFORM_GET_CLASS (trans); bclass = GST_BASE_TRANSFORM_GET_CLASS (trans);
if (bclass->get_unit_size) { if (bclass->get_unit_size) {
res = bclass->get_unit_size (trans, caps, size); res = bclass->get_unit_size (trans, caps, size);
GST_DEBUG_OBJECT (trans, "caps %" GST_PTR_FORMAT GST_DEBUG_OBJECT (trans,
") has unit size %d, result %s", caps, *size, res ? "TRUE" : "FALSE"); "caps %" GST_PTR_FORMAT ") has unit size %" G_GSIZE_FORMAT ", res %s",
caps, *size, res ? "TRUE" : "FALSE");
if (res) { if (res) {
/* and cache the values */ /* and cache the values */
if (trans->cache_caps1 == NULL) { if (trans->cache_caps1 == NULL) {
gst_caps_replace (&trans->cache_caps1, caps); gst_caps_replace (&trans->cache_caps1, caps);
trans->cache_caps1_size = *size; trans->cache_caps1_size = *size;
GST_DEBUG_OBJECT (trans, "caching %d in first cache", *size); GST_DEBUG_OBJECT (trans,
"caching %" G_GSIZE_FORMAT " in first cache", *size);
} else if (trans->cache_caps2 == NULL) { } else if (trans->cache_caps2 == NULL) {
gst_caps_replace (&trans->cache_caps2, caps); gst_caps_replace (&trans->cache_caps2, caps);
trans->cache_caps2_size = *size; trans->cache_caps2_size = *size;
GST_DEBUG_OBJECT (trans, "caching %d in second cache", *size); GST_DEBUG_OBJECT (trans,
"caching %" G_GSIZE_FORMAT " in second cache", *size);
} else { } else {
GST_DEBUG_OBJECT (trans, "no free spot to cache unit_size"); GST_DEBUG_OBJECT (trans, "no free spot to cache unit_size");
} }

View file

@ -508,8 +508,8 @@ gst_check_element_push_buffer_list (const gchar * element_name,
newdata = gst_buffer_map (new, &newsize, NULL, GST_MAP_READ); newdata = gst_buffer_map (new, &newsize, NULL, GST_MAP_READ);
origdata = gst_buffer_map (orig, &origsize, NULL, GST_MAP_READ); origdata = gst_buffer_map (orig, &origsize, NULL, GST_MAP_READ);
GST_LOG ("orig buffer: size %u", origsize); GST_LOG ("orig buffer: size %" G_GSIZE_FORMAT, origsize);
GST_LOG ("new buffer: size %u", newsize); GST_LOG ("new buffer: size %" G_GSIZE_FORMAT, newsize);
GST_MEMDUMP ("orig buffer", origdata, origsize); GST_MEMDUMP ("orig buffer", origdata, origsize);
GST_MEMDUMP ("new buffer", newdata, newsize); GST_MEMDUMP ("new buffer", newdata, newsize);

View file

@ -235,8 +235,8 @@ gst_fd_sink_render (GstBaseSink * sink, GstBuffer * buffer)
again: again:
#ifndef HAVE_WIN32 #ifndef HAVE_WIN32
do { do {
GST_DEBUG_OBJECT (fdsink, "going into select, have %d bytes to write", GST_DEBUG_OBJECT (fdsink, "going into select, have %" G_GSIZE_FORMAT
size); " bytes to write", size);
retval = gst_poll_wait (fdsink->fdset, GST_CLOCK_TIME_NONE); retval = gst_poll_wait (fdsink->fdset, GST_CLOCK_TIME_NONE);
} while (retval == -1 && (errno == EINTR || errno == EAGAIN)); } while (retval == -1 && (errno == EINTR || errno == EAGAIN));
@ -248,8 +248,8 @@ again:
} }
#endif #endif
GST_DEBUG_OBJECT (fdsink, "writing %d bytes to file descriptor %d", size, GST_DEBUG_OBJECT (fdsink, "writing %" G_GSIZE_FORMAT " bytes to"
fdsink->fd); " file descriptor %d", size, fdsink->fd);
written = write (fdsink->fd, ptr, left); written = write (fdsink->fd, ptr, left);

View file

@ -632,7 +632,8 @@ gst_file_sink_render (GstBaseSink * sink, GstBuffer * buffer)
data = gst_buffer_map (buffer, &size, NULL, GST_MAP_READ); data = gst_buffer_map (buffer, &size, NULL, GST_MAP_READ);
GST_DEBUG_OBJECT (filesink, "writing %u bytes at %" G_GUINT64_FORMAT, GST_DEBUG_OBJECT (filesink,
"writing %" G_GSIZE_FORMAT " bytes at %" G_GUINT64_FORMAT,
size, filesink->current_pos); size, filesink->current_pos);
if (size > 0 && data != NULL) { if (size > 0 && data != NULL) {

View file

@ -931,8 +931,8 @@ gst_queue_chain (GstPad * pad, GstBuffer * buffer)
timestamp = GST_BUFFER_TIMESTAMP (buffer); timestamp = GST_BUFFER_TIMESTAMP (buffer);
duration = GST_BUFFER_DURATION (buffer); duration = GST_BUFFER_DURATION (buffer);
GST_CAT_LOG_OBJECT (queue_dataflow, queue, GST_CAT_LOG_OBJECT (queue_dataflow, queue, "received buffer %p of size %"
"received buffer %p of size %d, time %" GST_TIME_FORMAT ", duration %" G_GSIZE_FORMAT ", time %" GST_TIME_FORMAT ", duration %"
GST_TIME_FORMAT, buffer, gst_buffer_get_size (buffer), GST_TIME_FORMAT, buffer, gst_buffer_get_size (buffer),
GST_TIME_ARGS (timestamp), GST_TIME_ARGS (duration)); GST_TIME_ARGS (timestamp), GST_TIME_ARGS (duration));

View file

@ -2123,8 +2123,8 @@ gst_queue2_chain (GstPad * pad, GstBuffer * buffer)
queue = GST_QUEUE2 (GST_OBJECT_PARENT (pad)); queue = GST_QUEUE2 (GST_OBJECT_PARENT (pad));
GST_CAT_LOG_OBJECT (queue_dataflow, queue, GST_CAT_LOG_OBJECT (queue_dataflow, queue, "received buffer %p of size %"
"received buffer %p of size %d, time %" GST_TIME_FORMAT ", duration %" G_GSIZE_FORMAT ", time %" GST_TIME_FORMAT ", duration %"
GST_TIME_FORMAT, buffer, gst_buffer_get_size (buffer), GST_TIME_FORMAT, buffer, gst_buffer_get_size (buffer),
GST_TIME_ARGS (GST_BUFFER_TIMESTAMP (buffer)), GST_TIME_ARGS (GST_BUFFER_TIMESTAMP (buffer)),
GST_TIME_ARGS (GST_BUFFER_DURATION (buffer))); GST_TIME_ARGS (GST_BUFFER_DURATION (buffer)));
@ -2792,7 +2792,7 @@ gst_queue2_src_activate_pull (GstPad * pad, gboolean active)
result = gst_queue2_open_temp_location_file (queue); result = gst_queue2_open_temp_location_file (queue);
} else if (!queue->ring_buffer) { } else if (!queue->ring_buffer) {
queue->ring_buffer = g_malloc (queue->ring_buffer_max_size); queue->ring_buffer = g_malloc (queue->ring_buffer_max_size);
result = ! !queue->ring_buffer; result = !!queue->ring_buffer;
} else { } else {
result = TRUE; result = TRUE;
} }

View file

@ -633,7 +633,7 @@ gst_type_find_element_setcaps (GstTypeFindElement * typefind, GstCaps * caps)
buffer = gst_adapter_take_buffer (typefind->adapter, avail); buffer = gst_adapter_take_buffer (typefind->adapter, avail);
GST_OBJECT_UNLOCK (typefind); GST_OBJECT_UNLOCK (typefind);
GST_DEBUG_OBJECT (typefind, "Pushing buffer: %d", avail); GST_DEBUG_OBJECT (typefind, "Pushing buffer: %" G_GSIZE_FORMAT, avail);
gst_pad_push (typefind->src, buffer); gst_pad_push (typefind->src, buffer);
} }