if (mem != NULL)
_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);
#endif
/* ERRORS */
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;
}
}
INSTALL_FALLBACK (is_span);
#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_hash_table_insert (allocators, (gpointer) name, (gpointer) allocator);
{
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);
timing = gst_buffer_add_meta_timing (copybuf);
GST_PTR_FORMAT, result, result, filter, filter);
result = gst_caps_intersect_full (filter, result, GST_CAPS_INTERSECT_FIRST);
GST_CAT_DEBUG_OBJECT (GST_CAT_CAPS, pad, "result %p %" GST_PTR_FORMAT,
- result);
+ result, result);
} else {
GST_CAT_DEBUG_OBJECT (GST_CAT_CAPS, pad,
"using caps %p %" GST_PTR_FORMAT, result, result);
}
/* copy partial buffer */
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);
size -= csize;
dest += csize;
/* Note: merging buffers at this point is premature. */
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);
update_timestamp (adapter, buf);
} else {
/* Otherwise append to the end, and advance our end pointer */
- GST_LOG_OBJECT (adapter, "pushing %u bytes at end, size now %u", size,
- adapter->size);
+ GST_LOG_OBJECT (adapter, "pushing %" G_GSIZE_FORMAT " bytes at end, "
+ "size now %" G_GSIZE_FORMAT, size, adapter->size);
adapter->buflist_end = g_slist_append (adapter->buflist_end, buf);
adapter->buflist_end = g_slist_next (adapter->buflist_end);
}
return ret;
/* Merge the head buffer and the next in line */
- GST_LOG_OBJECT (adapter,
- "Merging buffers of size %u & %u in search of target %u",
+ GST_LOG_OBJECT (adapter, "Merging buffers of size %" G_GSIZE_FORMAT " & %"
+ G_GSIZE_FORMAT " in search of target %" G_GSIZE_FORMAT,
hsize, gst_buffer_get_size (cur), size);
head = gst_buffer_join (head, cur);
/* Gonna need to copy stuff out */
if (G_UNLIKELY (adapter->assembled_size < 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);
if (toreuse == 0) {
GST_CAT_DEBUG (GST_CAT_PERFORMANCE, "alloc new buffer");
adapter->assembled_data = g_malloc (adapter->assembled_size);
} else {
/* 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 =
g_realloc (adapter->assembled_data, adapter->assembled_size);
}
}
- GST_CAT_DEBUG (GST_CAT_PERFORMANCE, "copy remaining %u bytes from adapter",
- tocopy);
+ GST_CAT_DEBUG (GST_CAT_PERFORMANCE, "copy remaining %" G_GSIZE_FORMAT
+ " bytes from adapter", tocopy);
data = adapter->assembled_data;
copy_into_unchecked (adapter, data + toreuse, skip + toreuse, tocopy);
adapter->assembled_len = size;
GstAdapterPrivate *priv;
GSList *g;
- GST_LOG_OBJECT (adapter, "flushing %u bytes", flush);
+ GST_LOG_OBJECT (adapter, "flushing %" G_GSIZE_FORMAT " bytes", flush);
priv = adapter->priv;
/* 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
* 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 */
data = adapter->assembled_data;
/* flush after this function should set the assembled_size to 0 */
adapter->assembled_data = g_malloc (adapter->assembled_size);
} 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 */
data = g_malloc (nbytes);
/* reuse what we can from the already assembled data */
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);
}
}
g_return_val_if_fail (GST_IS_ADAPTER (adapter), 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
* as one usually does an _available() first instead of grabbing a
/* our head buffer has enough data left, return it */
if (skip == 0 && hsize == nbytes) {
- GST_LOG_OBJECT (adapter, "providing buffer of %d bytes as head buffer",
- nbytes);
+ GST_LOG_OBJECT (adapter, "providing buffer of %" G_GSIZE_FORMAT " bytes"
+ " as head buffer", nbytes);
buffer = gst_buffer_ref (cur);
goto done;
} else if (hsize >= nbytes + skip) {
- GST_LOG_OBJECT (adapter, "providing buffer of %d bytes via region copy",
- nbytes);
+ GST_LOG_OBJECT (adapter, "providing buffer of %" G_GSIZE_FORMAT " bytes"
+ " via region copy", nbytes);
buffer = gst_buffer_copy_region (cur, GST_BUFFER_COPY_ALL, skip, nbytes);
goto done;
}
/* Merged something, let's try again for sub-buffering */
cur = adapter->buflist->data;
if (gst_buffer_get_size (cur) >= nbytes + skip) {
- GST_LOG_OBJECT (adapter, "providing buffer of %d bytes via sub-buffer",
- nbytes);
+ GST_LOG_OBJECT (adapter, "providing buffer of %" G_GSIZE_FORMAT " bytes"
+ " via sub-buffer", nbytes);
buffer = gst_buffer_copy_region (cur, GST_BUFFER_COPY_ALL, skip, nbytes);
goto done;
}
g_return_val_if_fail (GST_IS_ADAPTER (adapter), 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) {
cur = adapter->buflist->data;
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);
} else if (in_segment->format != GST_FORMAT_TIME) {
GST_LOG_OBJECT (parse,
"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_get_size (buffer));
buffer = frame->buffer;
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),
GST_TIME_ARGS (GST_BUFFER_TIMESTAMP (buffer)),
GST_TIME_ARGS (GST_BUFFER_DURATION (buffer)));
parse->priv->buffers_pending = g_slist_reverse (parse->priv->buffers_pending);
while (parse->priv->buffers_pending) {
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_adapter_push (parse->priv->adapter, buf);
parse->priv->buffers_pending =
/* any trailing unused no longer usable (ideally none) */
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_clear (parse->priv->adapter);
}
frame = &parse->priv->frame;
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));
if (G_UNLIKELY (parse->priv->passthrough)) {
gst_base_parse_frame_init (frame);
gst_buffer_replace (&frame->buffer, NULL);
if (res) {
if (gst_adapter_available (parse->priv->adapter) < fsize) {
- GST_DEBUG_OBJECT (parse,
- "found valid frame but not enough data available (only %d bytes)",
+ GST_DEBUG_OBJECT (parse, "found valid frame but not enough data"
+ " available (only %" G_GSIZE_FORMAT " bytes)",
gst_adapter_available (parse->priv->adapter));
gst_buffer_unref (tmpbuf);
goto done;
if (gst_buffer_get_size (parse->priv->cache) < size) {
GST_DEBUG_OBJECT (parse, "Returning short buffer at offset %"
- G_GUINT64_FORMAT ": wanted %u bytes, got %u bytes", parse->priv->offset,
- size, gst_buffer_get_size (parse->priv->cache));
+ G_GUINT64_FORMAT ": wanted %u bytes, got %" G_GSIZE_FORMAT " bytes",
+ parse->priv->offset, size, gst_buffer_get_size (parse->priv->cache));
*buffer = parse->priv->cache;
parse->priv->cache = NULL;
buf = frame.buffer;
GST_LOG_OBJECT (parse,
"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_get_size (buf));
}
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;
}
not_ok:
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",
size, caps, othercaps, direction == GST_PAD_SRC ? "SRC" : "SINK");
if (!gst_base_transform_get_unit_size (trans, caps, &inunitsize))
goto no_in_size;
- GST_DEBUG_OBJECT (trans, "input size %d, input unit size %d", size,
- inunitsize);
+ GST_DEBUG_OBJECT (trans,
+ "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 */
if (inunitsize == 0 || (size % inunitsize != 0))
/* the output size is the unit_size times the amount of units on the
* input */
*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;
}
}
no_multiple:
{
- GST_DEBUG_OBJECT (trans, "Size %u is not a multiple of unit size %u", size,
- inunitsize);
+ GST_DEBUG_OBJECT (trans, "Size %" G_GSIZE_FORMAT " is not a multiple of"
+ "unit size %" G_GSIZE_FORMAT, size, inunitsize);
g_warning ("%s: size %" G_GSIZE_FORMAT " is not a multiple of unit size %"
G_GSIZE_FORMAT, GST_ELEMENT_NAME (trans), size, inunitsize);
return FALSE;
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 =
gst_buffer_new_allocate (priv->allocator, outsize, priv->alignment);
}
/* see if we have the result cached */
if (trans->cache_caps1 == caps) {
*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;
}
if (trans->cache_caps2 == caps) {
*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;
}
bclass = GST_BASE_TRANSFORM_GET_CLASS (trans);
if (bclass->get_unit_size) {
res = bclass->get_unit_size (trans, caps, size);
- GST_DEBUG_OBJECT (trans, "caps %" GST_PTR_FORMAT
- ") has unit size %d, result %s", caps, *size, res ? "TRUE" : "FALSE");
+ GST_DEBUG_OBJECT (trans,
+ "caps %" GST_PTR_FORMAT ") has unit size %" G_GSIZE_FORMAT ", res %s",
+ caps, *size, res ? "TRUE" : "FALSE");
if (res) {
/* and cache the values */
if (trans->cache_caps1 == NULL) {
gst_caps_replace (&trans->cache_caps1, caps);
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) {
gst_caps_replace (&trans->cache_caps2, caps);
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 {
GST_DEBUG_OBJECT (trans, "no free spot to cache unit_size");
}
newdata = gst_buffer_map (new, &newsize, NULL, GST_MAP_READ);
origdata = gst_buffer_map (orig, &origsize, NULL, GST_MAP_READ);
- GST_LOG ("orig buffer: size %u", origsize);
- GST_LOG ("new buffer: size %u", newsize);
+ GST_LOG ("orig buffer: size %" G_GSIZE_FORMAT, origsize);
+ GST_LOG ("new buffer: size %" G_GSIZE_FORMAT, newsize);
GST_MEMDUMP ("orig buffer", origdata, origsize);
GST_MEMDUMP ("new buffer", newdata, newsize);
again:
#ifndef HAVE_WIN32
do {
- GST_DEBUG_OBJECT (fdsink, "going into select, have %d bytes to write",
- size);
+ GST_DEBUG_OBJECT (fdsink, "going into select, have %" G_GSIZE_FORMAT
+ " bytes to write", size);
retval = gst_poll_wait (fdsink->fdset, GST_CLOCK_TIME_NONE);
} while (retval == -1 && (errno == EINTR || errno == EAGAIN));
}
#endif
- GST_DEBUG_OBJECT (fdsink, "writing %d bytes to file descriptor %d", size,
- fdsink->fd);
+ GST_DEBUG_OBJECT (fdsink, "writing %" G_GSIZE_FORMAT " bytes to"
+ " file descriptor %d", size, fdsink->fd);
written = write (fdsink->fd, ptr, left);
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);
if (size > 0 && data != NULL) {
timestamp = GST_BUFFER_TIMESTAMP (buffer);
duration = GST_BUFFER_DURATION (buffer);
- GST_CAT_LOG_OBJECT (queue_dataflow, queue,
- "received buffer %p of size %d, time %" GST_TIME_FORMAT ", duration %"
+ GST_CAT_LOG_OBJECT (queue_dataflow, queue, "received buffer %p of size %"
+ G_GSIZE_FORMAT ", time %" GST_TIME_FORMAT ", duration %"
GST_TIME_FORMAT, buffer, gst_buffer_get_size (buffer),
GST_TIME_ARGS (timestamp), GST_TIME_ARGS (duration));
queue = GST_QUEUE2 (GST_OBJECT_PARENT (pad));
- GST_CAT_LOG_OBJECT (queue_dataflow, queue,
- "received buffer %p of size %d, time %" GST_TIME_FORMAT ", duration %"
+ GST_CAT_LOG_OBJECT (queue_dataflow, queue, "received buffer %p of size %"
+ G_GSIZE_FORMAT ", time %" GST_TIME_FORMAT ", duration %"
GST_TIME_FORMAT, buffer, gst_buffer_get_size (buffer),
GST_TIME_ARGS (GST_BUFFER_TIMESTAMP (buffer)),
GST_TIME_ARGS (GST_BUFFER_DURATION (buffer)));
result = gst_queue2_open_temp_location_file (queue);
} else if (!queue->ring_buffer) {
queue->ring_buffer = g_malloc (queue->ring_buffer_max_size);
- result = ! !queue->ring_buffer;
+ result = !!queue->ring_buffer;
} else {
result = TRUE;
}
buffer = gst_adapter_take_buffer (typefind->adapter, avail);
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);
}