+ g_return_if_fail (idx < list->n_buffers);
+ g_return_if_fail (idx + length <= list->n_buffers);
+ g_return_if_fail (gst_buffer_list_is_writable (list));
+
+ gst_buffer_list_remove_range_internal (list, idx, length, TRUE);
+}
+
+/**
+ * gst_buffer_list_copy_deep:
+ * @list: a #GstBufferList
+ *
+ * Create a copy of the given buffer list. This will make a newly allocated
+ * copy of the buffer that the source buffer list contains.
+ *
+ * Returns: (transfer full): a new copy of @list.
+ *
+ * Since: 1.6
+ */
+GstBufferList *
+gst_buffer_list_copy_deep (const GstBufferList * list)
+{
+ guint i, len;
+ GstBufferList *result = NULL;
+
+ g_return_val_if_fail (GST_IS_BUFFER_LIST (list), NULL);
+
+ result = gst_buffer_list_new ();
+
+ len = list->n_buffers;
+ for (i = 0; i < len; i++) {
+ GstBuffer *old = list->buffers[i];
+ GstBuffer *new = gst_buffer_copy_deep (old);
+
+ if (G_LIKELY (new)) {
+ gst_buffer_list_insert (result, i, new);
+ } else {
+ g_warning
+ ("Failed to deep copy buffer %p while deep "
+ "copying buffer list %p. Buffer list copy "
+ "will be incomplete", old, list);
+ }
+ }
+
+ return result;
+}
+
+/**
+ * gst_buffer_list_calculate_size:
+ * @list: a #GstBufferList
+ *
+ * Calculates the size of the data contained in buffer list by adding the
+ * size of all buffers.
+ *
+ * Returns: the size of the data contained in buffer list in bytes.
+ *
+ * Since: 1.14
+ */
+gsize
+gst_buffer_list_calculate_size (GstBufferList * list)
+{
+ GstBuffer **buffers;
+ gsize size = 0;
+ guint i, n;
+
+ g_return_val_if_fail (GST_IS_BUFFER_LIST (list), 0);
+
+ n = list->n_buffers;
+ buffers = list->buffers;
+
+ for (i = 0; i < n; ++i)
+ size += gst_buffer_get_size (buffers[i]);