buffer: implement COPY_MERGE

This commit is contained in:
Wim Taymans 2011-03-29 17:17:46 +02:00
parent 4e32ac8463
commit edbfc492bb

View file

@ -169,6 +169,9 @@ _span_memory (GstBuffer * buffer, gsize offset, gsize size)
/* not enough room, span buffers */ /* not enough room, span buffers */
mem[0] = GST_BUFFER_MEM_ARRAY (buffer); mem[0] = GST_BUFFER_MEM_ARRAY (buffer);
len[0] = GST_BUFFER_MEM_LEN (buffer); len[0] = GST_BUFFER_MEM_LEN (buffer);
if (len[0] == 1)
return;
span = _gst_buffer_arr_span (mem, len, 1, offset, size); span = _gst_buffer_arr_span (mem, len, 1, offset, size);
/* unref old buffers */ /* unref old buffers */
@ -324,6 +327,9 @@ gst_buffer_copy_into (GstBuffer * dest, GstBuffer * src,
left -= tocopy; left -= tocopy;
} }
} }
if (flags & GST_BUFFER_COPY_MERGE) {
_span_memory (dest, 0, size);
}
} }
for (walk = GST_BUFFER_META (src); walk; walk = walk->next) { for (walk = GST_BUFFER_META (src); walk; walk = walk->next) {