g_assert (!bs->event);
- bs_print ("get_next_buf: pulling buffer\n");
+ bs_print ("get_next_buf: pulling buffer");
nextbuf = gst_pad_pull (bs->pad);
if (GST_IS_EVENT (nextbuf))
if (!nextbuf)
return FALSE;
- bs_print ("get_next_buf: got buffer of %d bytes\n", GST_BUFFER_SIZE (nextbuf));
+ bs_print ("get_next_buf: got buffer of %d bytes", GST_BUFFER_SIZE (nextbuf));
/* first see if there are any buffers in the list at all */
if (bs->buflist) {
- bs_print ("gst_next_buf: there is at least one buffer in the list\n");
+ bs_print ("gst_next_buf: there is at least one buffer in the list");
/* now find the end of the list */
end = g_slist_last (bs->buflist);
/* get the buffer that's there */
/* see if we can marge cheaply */
if (gst_buffer_is_span_fast (lastbuf, nextbuf)) {
- bs_print ("get_next_buf: merging new buffer with last buf on list\n");
+ bs_print ("get_next_buf: merging new buffer with last buf on list");
/* it is, let's merge them (this is really an append, but...) */
end->data = gst_buffer_merge (lastbuf, nextbuf);
/* add to the length of the list */
/* if we can't, we just append this buffer */
}
else {
- bs_print ("get_next_buf: adding new buffer to the end of the list\n");
+ bs_print ("get_next_buf: adding new buffer to the end of the list");
end = g_slist_append (end, nextbuf);
/* also need to increment length of list and buffer count */
bs->listavail += GST_BUFFER_SIZE (nextbuf);
/* if there are no buffers in the list */
}
else {
- bs_print ("get_next_buf: buflist is empty, adding new buffer to list\n");
+ bs_print ("get_next_buf: buflist is empty, adding new buffer to list");
/* put this on the end of the list */
bs->buflist = g_slist_append (bs->buflist, nextbuf);
/* and increment the number of bytes in the list */
{
/* as long as we don't have enough, we get more buffers */
while (bs->listavail < len) {
- bs_print ("fill_bytes: there are %d bytes in the list, we need %d\n", bs->listavail, len);
+ bs_print ("fill_bytes: there are %d bytes in the list, we need %d", bs->listavail, len);
if (!gst_bytestream_get_next_buf (bs))
return FALSE;
}
g_return_val_if_fail (bs != NULL, 0);
g_return_val_if_fail (len > 0, 0);
- bs_print ("peek: asking for %d bytes\n", len);
+ bs_print ("peek: asking for %d bytes", len);
/* make sure we have enough */
- bs_print ("peek: there are %d bytes in the list\n", bs->listavail);
+ bs_print ("peek: there are %d bytes in the list", bs->listavail);
if (len > bs->listavail) {
if (!gst_bytestream_fill_bytes (bs, len)){
/* we must have an event coming up */
return 0;
}
}
- bs_print ("peek: there are now %d bytes in the list\n", bs->listavail);
+ bs_print ("peek: there are now %d bytes in the list", bs->listavail);
}
bs_status (bs);
headbuf = GST_BUFFER (bs->buflist->data);
/* if the requested bytes are in the current buffer */
- bs_print ("peek: headbufavail is %d\n", bs->headbufavail);
+ bs_print ("peek: headbufavail is %d", bs->headbufavail);
if (len <= bs->headbufavail) {
- bs_print ("peek: there are enough bytes in headbuf (need %d, have %d)\n", len, bs->headbufavail);
+ bs_print ("peek: there are enough bytes in headbuf (need %d, have %d)", len, bs->headbufavail);
/* create a sub-buffer of the headbuf */
retbuf = gst_buffer_create_sub (headbuf, GST_BUFFER_SIZE (headbuf) - bs->headbufavail, len);
/* otherwise we need to figure out how to assemble one */
}
else {
- bs_print ("peek: current buffer is not big enough for len %d\n", len);
+ bs_print ("peek: current buffer is not big enough for len %d", len);
retbuf = gst_buffer_new ();
GST_BUFFER_SIZE (retbuf) = len;
g_return_val_if_fail (bs != NULL, 0);
g_return_val_if_fail (len > 0, 0);
- bs_print ("peek_bytes: asking for %d bytes\n", len);
+ bs_print ("peek_bytes: asking for %d bytes", len);
if (bs->assembled) {
g_free (bs->assembled);
bs->assembled = NULL;
}
/* make sure we have enough */
- bs_print ("peek_bytes: there are %d bytes in the list\n", bs->listavail);
+ bs_print ("peek_bytes: there are %d bytes in the list", bs->listavail);
if (len > bs->listavail) {
if (!gst_bytestream_fill_bytes (bs, len)){
/* we must have an event coming up */
return 0;
}
}
- bs_print ("peek_bytes: there are now %d bytes in the list\n", bs->listavail);
+ bs_print ("peek_bytes: there are now %d bytes in the list", bs->listavail);
}
bs_status (bs);
headbuf = GST_BUFFER (bs->buflist->data);
/* if the requested bytes are in the current buffer */
- bs_print ("peek_bytes: headbufavail is %d\n", bs->headbufavail);
+ bs_print ("peek_bytes: headbufavail is %d", bs->headbufavail);
if (len <= bs->headbufavail) {
- bs_print ("peek_bytes: there are enough bytes in headbuf (need %d, have %d)\n", len, bs->headbufavail);
+ bs_print ("peek_bytes: there are enough bytes in headbuf (need %d, have %d)", len, bs->headbufavail);
/* create a sub-buffer of the headbuf */
*data = GST_BUFFER_DATA (headbuf) + (GST_BUFFER_SIZE (headbuf) - bs->headbufavail);
/* otherwise we need to figure out how to assemble one */
}
else {
- bs_print ("peek_bytes: current buffer is not big enough for len %d\n", len);
+ bs_print ("peek_bytes: current buffer is not big enough for len %d", len);
*data = gst_bytestream_assemble (bs, len);
bs->assembled = *data;
/* copy the data from the curbuf */
buf = GST_BUFFER (bs->buflist->data);
- bs_print ("assemble: copying %d bytes from curbuf at %d to *data\n", bs->headbufavail,
+ bs_print ("assemble: copying %d bytes from curbuf at %d to *data", bs->headbufavail,
GST_BUFFER_SIZE (buf) - bs->headbufavail);
memcpy (data, GST_BUFFER_DATA (buf) + GST_BUFFER_SIZE (buf) - bs->headbufavail, bs->headbufavail);
copied += bs->headbufavail;
while (copied < len) {
buf = GST_BUFFER (walk->data);
if (GST_BUFFER_SIZE (buf) < (len - copied)) {
- bs_print ("assemble: copying %d bytes from buf to output offset %d\n", GST_BUFFER_SIZE (buf), copied);
+ bs_print ("assemble: copying %d bytes from buf to output offset %d", GST_BUFFER_SIZE (buf), copied);
memcpy (data + copied, GST_BUFFER_DATA (buf), GST_BUFFER_SIZE (buf));
copied += GST_BUFFER_SIZE (buf);
}
else {
- bs_print ("assemble: copying %d bytes from buf to output offset %d\n", len - copied, copied);
+ bs_print ("assemble: copying %d bytes from buf to output offset %d", len - copied, copied);
memcpy (data + copied, GST_BUFFER_DATA (buf), len - copied);
copied = len;
}
gboolean
gst_bytestream_flush (GstByteStream * bs, guint32 len)
{
- bs_print ("flush: flushing %d bytes\n", len);
+ bs_print ("flush: flushing %d bytes", len);
/* make sure we have enough */
- bs_print ("flush: there are %d bytes in the list\n", bs->listavail);
+ bs_print ("flush: there are %d bytes in the list", bs->listavail);
if (len > bs->listavail) {
if (!gst_bytestream_fill_bytes (bs, len))
return FALSE;
- bs_print ("flush: there are now %d bytes in the list\n", bs->listavail);
+ bs_print ("flush: there are now %d bytes in the list", bs->listavail);
}
gst_bytestream_flush_fast (bs, len);
while (len > 0) {
headbuf = GST_BUFFER (bs->buflist->data);
- bs_print ("flush: analyzing buffer that's %d bytes long, offset %d\n", GST_BUFFER_SIZE (headbuf),
+ bs_print ("flush: analyzing buffer that's %d bytes long, offset %d", GST_BUFFER_SIZE (headbuf),
GST_BUFFER_OFFSET (headbuf));
/* if there's enough to complete the flush */
if (bs->headbufavail > len) {
/* just trim it off */
- bs_print ("flush: trimming %d bytes off end of headbuf\n", len);
+ bs_print ("flush: trimming %d bytes off end of headbuf", len);
bs->headbufavail -= len;
bs->listavail -= len;
len = 0;
/* otherwise we have to trim the whole buffer */
}
else {
- bs_print ("flush: removing head buffer completely\n");
+ bs_print ("flush: removing head buffer completely");
/* remove it from the list */
bs->buflist = g_slist_delete_link (bs->buflist, bs->buflist);
/* trim it from the avail size */
/* record the new headbufavail */
if (bs->buflist) {
bs->headbufavail = GST_BUFFER_SIZE (GST_BUFFER (bs->buflist->data));
- bs_print ("flush: next headbuf is %d bytes\n", bs->headbufavail);
+ bs_print ("flush: next headbuf is %d bytes", bs->headbufavail);
}
else {
- bs_print ("flush: no more bytes at all\n");
+ bs_print ("flush: no more bytes at all");
}
}
- bs_print ("flush: bottom of while(), len is now %d\n", len);
+ bs_print ("flush: bottom of while(), len is now %d", len);
}
}
g_return_val_if_fail (bs != NULL, 0);
- bs_print ("get_timestamp: asking for %d bytes\n", len);
+ bs_print ("get_timestamp: getting timestamp");
/* make sure we have a buffer */
if (bs->listavail == 0) {
- bs_print ("gst_timestamp: fetching a buffer\n");
+ bs_print ("gst_timestamp: fetching a buffer");
if (!gst_bytestream_fill_bytes (bs, 1))
return 0;
}
GSList *walk;
GstBuffer *buf;
- bs_print ("STATUS: head buffer has %d bytes available\n", bs->headbufavail);
- bs_print ("STATUS: list has %d bytes available\n", bs->listavail);
+ bs_print ("STATUS: head buffer has %d bytes available", bs->headbufavail);
+ bs_print ("STATUS: list has %d bytes available", bs->listavail);
walk = bs->buflist;
while (walk) {
buf = GST_BUFFER (walk->data);
walk = g_slist_next (walk);
- bs_print ("STATUS: buffer starts at %d and is %d bytes long\n", GST_BUFFER_OFFSET (buf), GST_BUFFER_SIZE (buf));
+ bs_print ("STATUS: buffer starts at %d and is %d bytes long", GST_BUFFER_OFFSET (buf), GST_BUFFER_SIZE (buf));
}
}