Gst.Buffer.prototype.insert_memory

function insert_memory(idx:Number, mem:Gst.Memory):void {
    // Gjs wrapper for gst_buffer_insert_memory()
}

Insert the memory block mem to buffer at idx. This function takes ownership of mem and thus doesn't increase its refcount.

Only Gst.buffer_get_max_memory can be added to a buffer. If more memory is added, existing memory blocks will automatically be merged to make room for the new memory.

idx

the index to add the memory at, or -1 to append it to the end

mem

a Gst.Memory.