# GstBufferList

Buffer lists are an object containing a list of buffers.

Buffer lists are created with gst_buffer_list_new and filled with data using gst_buffer_list_insert.

Buffer lists can be pushed on a srcpad with gst_pad_push_list. This is interesting when multiple buffers need to be pushed in one go because it can reduce the amount of overhead for pushing each buffer individually.

## GstBufferList

Opaque list of grouped buffers.

## Gst.BufferList

Opaque list of grouped buffers.

## Gst.BufferList

Opaque list of grouped buffers.

### Constructors

#### gst_buffer_list_new

    GstBufferList *
    gst_buffer_list_new ()

Creates a new, empty GstBufferList.

Returns ( [transfer: full]) –

the new GstBufferList.

#### Gst.BufferList.prototype.new

    function Gst.BufferList.prototype.new(): {
        // javascript wrapper for 'gst_buffer_list_new'
    }

Creates a new, empty Gst.BufferList.

Returns (Gst.BufferList) –

the new Gst.BufferList.

#### Gst.BufferList.new

    def Gst.BufferList.new ():
        #python wrapper for 'gst_buffer_list_new'

Creates a new, empty Gst.BufferList.

Returns (Gst.BufferList) –

the new Gst.BufferList.

#### gst_buffer_list_new_sized

    GstBufferList *
    gst_buffer_list_new_sized (guint size)

Creates a new, empty GstBufferList. The list will have size space preallocated so that memory reallocations can be avoided.

Parameters:

`size` –

an initial reserved size

Returns ( [transfer: full]) –

the new GstBufferList.

#### Gst.BufferList.prototype.new_sized

    function Gst.BufferList.prototype.new_sized(size: Number): {
        // javascript wrapper for 'gst_buffer_list_new_sized'
    }

Creates a new, empty Gst.BufferList. The list will have size space preallocated so that memory reallocations can be avoided.

Parameters:

`size` (Number) –

an initial reserved size

Returns (Gst.BufferList) –

the new Gst.BufferList.

#### Gst.BufferList.new_sized

    def Gst.BufferList.new_sized (size):
        #python wrapper for 'gst_buffer_list_new_sized'

Creates a new, empty Gst.BufferList. The list will have size space preallocated so that memory reallocations can be avoided.

Parameters:

`size` (int) –

an initial reserved size

Returns (Gst.BufferList) –

the new Gst.BufferList.

### Methods

#### gst_buffer_list_calculate_size

    gsize
    gst_buffer_list_calculate_size (GstBufferList * list)

Calculates the size of the data contained in list by adding the size of all buffers.

Parameters:

`list` –

a GstBufferList

Returns –

the size of the data contained in list in bytes.

Since : 1.14

#### Gst.BufferList.prototype.calculate_size

    function Gst.BufferList.prototype.calculate_size(): {
        // javascript wrapper for 'gst_buffer_list_calculate_size'
    }

Calculates the size of the data contained in list by adding the size of all buffers.

Parameters:

`list` (Gst.BufferList) –

a Gst.BufferList

Returns (Number) –

the size of the data contained in list in bytes.

Since : 1.14

#### Gst.BufferList.calculate_size

    def Gst.BufferList.calculate_size (self):
        #python wrapper for 'gst_buffer_list_calculate_size'

Calculates the size of the data contained in list by adding the size of all buffers.

Parameters:

`list` (Gst.BufferList) –

a Gst.BufferList

Returns (int) –

the size of the data contained in list in bytes.

Since : 1.14

#### gst_buffer_list_copy

    GstBufferList *
    gst_buffer_list_copy (const GstBufferList * list)

Creates a shallow copy of the given buffer list. This will make a newly allocated copy of the source list with copies of buffer pointers. The refcount of buffers pointed to will be increased by one.

Parameters:

`list` –

a GstBufferList

Returns ( [transfer: full]) –

a new copy of list.

#### gst_buffer_list_copy_deep

    GstBufferList *
    gst_buffer_list_copy_deep (const GstBufferList * list)

Creates a copy of the given buffer list. This will make a newly allocated copy of the buffers that the source buffer list contains.

Parameters:

`list` –

a GstBufferList

Returns ( [transfer: full]) –

a new copy of list.

Since : 1.6

#### Gst.BufferList.prototype.copy_deep

    function Gst.BufferList.prototype.copy_deep(): {
        // javascript wrapper for 'gst_buffer_list_copy_deep'
    }

Creates a copy of the given buffer list. This will make a newly allocated copy of the buffers that the source buffer list contains.

Parameters:

`list` (Gst.BufferList) –

a Gst.BufferList

Returns (Gst.BufferList) –

a new copy of list.

Since : 1.6

#### Gst.BufferList.copy_deep

    def Gst.BufferList.copy_deep (self):
        #python wrapper for 'gst_buffer_list_copy_deep'

Creates a copy of the given buffer list. This will make a newly allocated copy of the buffers that the source buffer list contains.

Parameters:

`list` (Gst.BufferList) –

a Gst.BufferList

Returns (Gst.BufferList) –

a new copy of list.

Since : 1.6

#### gst_buffer_list_foreach

    gboolean
    gst_buffer_list_foreach (GstBufferList * list,
                             GstBufferListFunc func,
                             gpointer user_data)

Calls func with data for each buffer in list.

func can modify the passed buffer pointer or its contents. The return value of func defines if this function returns or if the remaining buffers in the list should be skipped.

Parameters:

`list` –

a GstBufferList

`func` ( [scope call]) –

a GstBufferListFunc to call

`user_data` ( [closure]) –

user data passed to func

Returns –

TRUE when func returned TRUE for each buffer in list or when list is empty.

#### Gst.BufferList.prototype.foreach

    function Gst.BufferList.prototype.foreach(func: Gst.BufferListFunc, user_data: Object): {
        // javascript wrapper for 'gst_buffer_list_foreach'
    }

Calls func with data for each buffer in list.

func can modify the passed buffer pointer or its contents. The return value of func defines if this function returns or if the remaining buffers in the list should be skipped.

Parameters:

`list` (Gst.BufferList) –

a Gst.BufferList

`func` (Gst.BufferListFunc) –

a Gst.BufferListFunc to call

`user_data` (Object) –

user data passed to func

Returns (Number) –

true when func returned true for each buffer in list or when list is empty.

#### Gst.BufferList.foreach

    def Gst.BufferList.foreach (self, func, *user_data):
        #python wrapper for 'gst_buffer_list_foreach'

Calls func with data for each buffer in list.

func can modify the passed buffer pointer or its contents. The return value of func defines if this function returns or if the remaining buffers in the list should be skipped.

Parameters:

`list` (Gst.BufferList) –

a Gst.BufferList

`func` (Gst.BufferListFunc) –

a Gst.BufferListFunc to call

`user_data` (variadic) –

user data passed to func

Returns (bool) –

True when func returned True for each buffer in list or when list is empty.

#### gst_buffer_list_get

    GstBuffer *
    gst_buffer_list_get (GstBufferList * list,
                         guint idx)

Gets the buffer at idx.

You must make sure that idx does not exceed the number of buffers available.

Parameters:

`list` –

a GstBufferList

`idx` –

the index

Returns ( [transfer: none][nullable]) –

the buffer at idx in group or NULL when there is no buffer. The buffer remains valid as long as list is valid and buffer is not removed from the list.

#### Gst.BufferList.prototype.get

    function Gst.BufferList.prototype.get(idx: Number): {
        // javascript wrapper for 'gst_buffer_list_get'
    }

Gets the buffer at idx.

You must make sure that idx does not exceed the number of buffers available.

Parameters:

`list` (Gst.BufferList) –

a Gst.BufferList

`idx` (Number) –

the index

Returns (Gst.Buffer) –

the buffer at idx in group or null when there is no buffer. The buffer remains valid as long as list is valid and buffer is not removed from the list.

#### Gst.BufferList.get

    def Gst.BufferList.get (self, idx):
        #python wrapper for 'gst_buffer_list_get'

Gets the buffer at idx.

You must make sure that idx does not exceed the number of buffers available.

Parameters:

`list` (Gst.BufferList) –

a Gst.BufferList

`idx` (int) –

the index

Returns (Gst.Buffer) –

the buffer at idx in group or None when there is no buffer. The buffer remains valid as long as list is valid and buffer is not removed from the list.

#### gst_buffer_list_get_writable

    GstBuffer *
    gst_buffer_list_get_writable (GstBufferList * list,
                                  guint idx)

Gets the buffer at idx, ensuring it is a writable buffer.

You must make sure that idx does not exceed the number of buffers available.

Parameters:

`list` –

a (writable) GstBufferList

`idx` –

the index

Returns ( [transfer: none][nullable]) –

the buffer at idx in group. The returned buffer remains valid as long as list is valid and the buffer is not removed from the list.

Since : 1.14

#### Gst.BufferList.prototype.get_writable

    function Gst.BufferList.prototype.get_writable(idx: Number): {
        // javascript wrapper for 'gst_buffer_list_get_writable'
    }

Gets the buffer at idx, ensuring it is a writable buffer.

You must make sure that idx does not exceed the number of buffers available.

Parameters:

`list` (Gst.BufferList) –

a (writable) Gst.BufferList

`idx` (Number) –

the index

Returns (Gst.Buffer) –

the buffer at idx in group. The returned buffer remains valid as long as list is valid and the buffer is not removed from the list.

Since : 1.14

#### Gst.BufferList.get_writable

    def Gst.BufferList.get_writable (self, idx):
        #python wrapper for 'gst_buffer_list_get_writable'

Gets the buffer at idx, ensuring it is a writable buffer.

You must make sure that idx does not exceed the number of buffers available.

Parameters:

`list` (Gst.BufferList) –

a (writable) Gst.BufferList

`idx` (int) –

the index

Returns (Gst.Buffer) –

the buffer at idx in group. The returned buffer remains valid as long as list is valid and the buffer is not removed from the list.

Since : 1.14

#### gst_buffer_list_insert

    gst_buffer_list_insert (GstBufferList * list,
                            gint idx,
                            GstBuffer * buffer)

Inserts buffer at idx in list. Other buffers are moved to make room for this new buffer.

A -1 value for idx will append the buffer at the end.

Parameters:

`list` –

a GstBufferList

`idx` –

the index

`buffer` ( [transfer: full]) –

a GstBuffer

#### Gst.BufferList.prototype.insert

    function Gst.BufferList.prototype.insert(idx: Number, buffer: Gst.Buffer): {
        // javascript wrapper for 'gst_buffer_list_insert'
    }

Inserts buffer at idx in list. Other buffers are moved to make room for this new buffer.

A -1 value for idx will append the buffer at the end.

Parameters:

`list` (Gst.BufferList) –

a Gst.BufferList

`idx` (Number) –

the index

`buffer` (Gst.Buffer) –

a Gst.Buffer

#### Gst.BufferList.insert

    def Gst.BufferList.insert (self, idx, buffer):
        #python wrapper for 'gst_buffer_list_insert'

Inserts buffer at idx in list. Other buffers are moved to make room for this new buffer.

A -1 value for idx will append the buffer at the end.

Parameters:

`list` (Gst.BufferList) –

a Gst.BufferList

`idx` (int) –

the index

`buffer` (Gst.Buffer) –

a Gst.Buffer

#### gst_buffer_list_length

    guint
    gst_buffer_list_length (GstBufferList * list)

Returns the number of buffers in list.

Parameters:

`list` –

a GstBufferList

Returns –

the number of buffers in the buffer list

#### Gst.BufferList.prototype.length

    function Gst.BufferList.prototype.length(): {
        // javascript wrapper for 'gst_buffer_list_length'
    }

Returns the number of buffers in list.

Parameters:

`list` (Gst.BufferList) –

a Gst.BufferList

Returns (Number) –

the number of buffers in the buffer list

#### Gst.BufferList.length

    def Gst.BufferList.length (self):
        #python wrapper for 'gst_buffer_list_length'

Returns the number of buffers in list.

Parameters:

`list` (Gst.BufferList) –

a Gst.BufferList

Returns (int) –

the number of buffers in the buffer list

#### gst_buffer_list_ref

    GstBufferList *
    gst_buffer_list_ref (GstBufferList * list)

Increases the refcount of the given buffer list by one.

Note that the refcount affects the writability of list and its data, see gst_buffer_list_make_writable. It is important to note that keeping additional references to GstBufferList instances can potentially increase the number of memcpy operations in a pipeline.

Parameters:

`list` –

a GstBufferList

Returns ( [transfer: full]) –

list

#### gst_buffer_list_remove

    gst_buffer_list_remove (GstBufferList * list,
                            guint idx,
                            guint length)

Removes length buffers starting from idx in list. The following buffers are moved to close the gap.

Parameters:

`list` –

a GstBufferList

`idx` –

the index

`length` –

the amount to remove

#### Gst.BufferList.prototype.remove

    function Gst.BufferList.prototype.remove(idx: Number, length: Number): {
        // javascript wrapper for 'gst_buffer_list_remove'
    }

Removes length buffers starting from idx in list. The following buffers are moved to close the gap.

Parameters:

`list` (Gst.BufferList) –

a Gst.BufferList

`idx` (Number) –

the index

`length` (Number) –

the amount to remove

#### Gst.BufferList.remove

    def Gst.BufferList.remove (self, idx, length):
        #python wrapper for 'gst_buffer_list_remove'

Removes length buffers starting from idx in list. The following buffers are moved to close the gap.

Parameters:

`list` (Gst.BufferList) –

a Gst.BufferList

`idx` (int) –

the index

`length` (int) –

the amount to remove

#### gst_buffer_list_unref

    gst_buffer_list_unref (GstBufferList * list)

Decreases the refcount of the buffer list. If the refcount reaches 0, the buffer list will be freed.

Parameters:

`list` ( [transfer: full]) –

a GstBufferList

### Functions

#### gst_buffer_list_replace

    gboolean
    gst_buffer_list_replace (GstBufferList ** old_list,
                             GstBufferList * new_list)

Modifies a pointer to a GstBufferList to point to a different GstBufferList. The modification is done atomically (so this is useful for ensuring thread safety in some cases), and the reference counts are updated appropriately (the old buffer list is unreffed, the new is reffed).

Either new_list or the GstBufferList pointed to by old_list may be NULL.

Parameters:

`old_list` ( [inout][transfer: full][nullable]) –

pointer to a pointer to a GstBufferList to be replaced.

`new_list` ( [transfer: none][allow-none]) –

pointer to a GstBufferList that will replace the buffer list pointed to by old_list.

Returns –

TRUE if new_list was different from old_list

Since : 1.16

#### Gst.prototype.buffer_list_replace

    function Gst.prototype.buffer_list_replace(old_list: Gst.BufferList, new_list: Gst.BufferList): {
        // javascript wrapper for 'gst_buffer_list_replace'
    }

Modifies a pointer to a Gst.BufferList to point to a different Gst.BufferList. The modification is done atomically (so this is useful for ensuring thread safety in some cases), and the reference counts are updated appropriately (the old buffer list is unreffed, the new is reffed).

Either new_list or the Gst.BufferList pointed to by old_list may be null.

Parameters:

`old_list` (Gst.BufferList) –

pointer to a pointer to a Gst.BufferList to be replaced.

`new_list` (Gst.BufferList) –

pointer to a Gst.BufferList that will replace the buffer list pointed to by old_list.

Returns a tuple made of:

(Number ) –

true if new_list was different from old_list

`old_list` (Gst.BufferList ) –

true if new_list was different from old_list

Since : 1.16

#### Gst.buffer_list_replace

    def Gst.buffer_list_replace (old_list, new_list):
        #python wrapper for 'gst_buffer_list_replace'

Modifies a pointer to a Gst.BufferList to point to a different Gst.BufferList. The modification is done atomically (so this is useful for ensuring thread safety in some cases), and the reference counts are updated appropriately (the old buffer list is unreffed, the new is reffed).

Either new_list or the Gst.BufferList pointed to by old_list may be None.

Parameters:

`old_list` (Gst.BufferList) –

pointer to a pointer to a Gst.BufferList to be replaced.

`new_list` (Gst.BufferList) –

pointer to a Gst.BufferList that will replace the buffer list pointed to by old_list.

Returns a tuple made of:

(bool ) –

True if new_list was different from old_list

`old_list` (Gst.BufferList ) –

True if new_list was different from old_list

Since : 1.16

#### gst_buffer_list_take

    gboolean
    gst_buffer_list_take (GstBufferList ** old_list,
                          GstBufferList * new_list)

Modifies a pointer to a GstBufferList to point to a different GstBufferList. This function is similar to gst_buffer_list_replace except that it takes ownership of new_list.

Parameters:

`old_list` ( [inout][transfer: full]) –

pointer to a pointer to a GstBufferList to be replaced.

`new_list` ( [transfer: full][allow-none]) –

pointer to a GstBufferList that will replace the bufferlist pointed to by old_list.

Returns –

TRUE if new_list was different from old_list

Since : 1.16

#### Gst.prototype.buffer_list_take

    function Gst.prototype.buffer_list_take(old_list: Gst.BufferList, new_list: Gst.BufferList): {
        // javascript wrapper for 'gst_buffer_list_take'
    }

Modifies a pointer to a Gst.BufferList to point to a different Gst.BufferList. This function is similar to Gst.prototype.buffer_list_replace except that it takes ownership of new_list.

Parameters:

`old_list` (Gst.BufferList) –

pointer to a pointer to a Gst.BufferList to be replaced.

`new_list` (Gst.BufferList) –

pointer to a Gst.BufferList that will replace the bufferlist pointed to by old_list.

Returns a tuple made of:

(Number ) –

true if new_list was different from old_list

`old_list` (Gst.BufferList ) –

true if new_list was different from old_list

Since : 1.16

#### Gst.buffer_list_take

    def Gst.buffer_list_take (old_list, new_list):
        #python wrapper for 'gst_buffer_list_take'

Modifies a pointer to a Gst.BufferList to point to a different Gst.BufferList. This function is similar to Gst.buffer_list_replace except that it takes ownership of new_list.

Parameters:

`old_list` (Gst.BufferList) –

pointer to a pointer to a Gst.BufferList to be replaced.

`new_list` (Gst.BufferList) –

pointer to a Gst.BufferList that will replace the bufferlist pointed to by old_list.

Returns a tuple made of:

(bool ) –

True if new_list was different from old_list

`old_list` (Gst.BufferList ) –

True if new_list was different from old_list

Since : 1.16

## Functions

### gst_clear_buffer_list

    gst_clear_buffer_list (GstBufferList ** list_ptr)

Clears a reference to a GstBufferList.

list_ptr must not be NULL.

If the reference is NULL then this function does nothing. Otherwise, the reference count of the list is decreased and the pointer is set to NULL.

Parameters:

`list_ptr` –

a pointer to a GstBufferList reference

Since : 1.16

## Function Macros

### GST_BUFFER_LIST_CAST

    #define GST_BUFFER_LIST_CAST(obj) ((GstBufferList *)obj)

### gst_buffer_list_add

    #define gst_buffer_list_add(l,b) gst_buffer_list_insert((l),-1,(b));

Append b at the end of l.

Parameters:

`l` –

a GstBufferList

`b` –

a GstBuffer

### gst_buffer_list_is_writable

    #define gst_buffer_list_is_writable(list) gst_mini_object_is_writable (GST_MINI_OBJECT_CAST (list))

Tests if you can safely add buffers and groups into a buffer list.

Parameters:

`list` –

a GstBufferList

### gst_buffer_list_make_writable

    #define gst_buffer_list_make_writable(list) GST_BUFFER_LIST_CAST (gst_mini_object_make_writable (GST_MINI_OBJECT_CAST (list)))

Makes a writable buffer list from the given buffer list. If the source buffer list is already writable, this will simply return the same buffer list. A copy will otherwise be made using gst_buffer_list_copy.

Parameters:

`list` ( [transfer: full]) –

a GstBufferList

Returns ( [transfer: full]) –

a writable list, which may or may not be the same as list

## Callbacks

### GstBufferListFunc

    gboolean
    (*GstBufferListFunc) (GstBuffer ** buffer,
                          guint idx,
                          gpointer user_data)

A function that will be called from gst_buffer_list_foreach. The buffer field will point to a the reference of the buffer at idx.

When this function returns TRUE, the next buffer will be returned. When FALSE is returned, gst_buffer_list_foreach will return.

When buffer is set to NULL, the item will be removed from the bufferlist. When buffer has been made writable, the new buffer reference can be assigned to buffer. This function is responsible for unreffing the old buffer when removing or modifying.

Parameters:

`buffer` ( [out][nullable]) –

pointer to the buffer

`idx` –

the index of buffer

`user_data` –

user data passed to gst_buffer_list_foreach

Returns –

FALSE when gst_buffer_list_foreach should stop

### Gst.BufferListFunc

    function Gst.BufferListFunc(idx: Number, user_data: Object): {
        // javascript wrapper for 'GstBufferListFunc'
    }

A function that will be called from Gst.BufferList.prototype.foreach. The buffer field will point to a the reference of the buffer at idx.

When this function returns true, the next buffer will be returned. When false is returned, Gst.BufferList.prototype.foreach will return.

When buffer is set to null, the item will be removed from the bufferlist. When buffer has been made writable, the new buffer reference can be assigned to buffer. This function is responsible for unreffing the old buffer when removing or modifying.

Parameters:

`idx` (Number) –

the index of buffer

`user_data` (Object) –

user data passed to Gst.BufferList.prototype.foreach

Returns a tuple made of:

(Number ) –

false when Gst.BufferList.prototype.foreach should stop

`buffer` (Gst.Buffer ) –

false when Gst.BufferList.prototype.foreach should stop

### Gst.BufferListFunc

    def Gst.BufferListFunc (idx, *user_data):
        #python wrapper for 'GstBufferListFunc'

A function that will be called from Gst.BufferList.foreach. The buffer field will point to a the reference of the buffer at idx.

When this function returns True, the next buffer will be returned. When False is returned, Gst.BufferList.foreach will return.

When buffer is set to None, the item will be removed from the bufferlist. When buffer has been made writable, the new buffer reference can be assigned to buffer. This function is responsible for unreffing the old buffer when removing or modifying.

Parameters:

`idx` (int) –

the index of buffer

`user_data` (variadic) –

user data passed to Gst.BufferList.foreach

Returns a tuple made of:

(bool ) –

False when Gst.BufferList.foreach should stop

`buffer` (Gst.Buffer ) –

False when Gst.BufferList.foreach should stop

The results of the search are