Gst.BufferList

Fields

None

Methods

class

new ()

class

new_sized (size)

calculate_size ()

copy_deep ()

foreach (func, *user_data)

get (idx)

get_writable (idx)

insert (idx, buffer)

length ()

remove (idx, length)

Details

class Gst.BufferList

Buffer lists are an object containing a list of buffers.

Buffer lists are created with Gst.BufferList.new() and filled with data using Gst.BufferList.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.

classmethod new()[source]
Returns:

the new Gst.BufferList.

Return type:

Gst.BufferList

Creates a new, empty Gst.BufferList.

classmethod new_sized(size)[source]
Parameters:

size (int) – an initial reserved size

Returns:

the new Gst.BufferList.

Return type:

Gst.BufferList

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

calculate_size()[source]
Returns:

the size of the data contained in self in bytes.

Return type:

int

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

New in version 1.14.

copy_deep()[source]
Returns:

a new copy of self.

Return type:

Gst.BufferList

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

New in version 1.6.

foreach(func, *user_data)[source]
Parameters:
Returns:

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

Return type:

bool

Calls func with data for each buffer in self.

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.

get(idx)[source]
Parameters:

idx (int) – the index

Returns:

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

Return type:

Gst.Buffer or None

Gets the buffer at idx.

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

get_writable(idx)[source]
Parameters:

idx (int) – the index

Returns:

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

Return type:

Gst.Buffer or None

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.

New in version 1.14.

insert(idx, buffer)[source]
Parameters:

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

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

length()[source]
Returns:

the number of buffers in the buffer list

Return type:

int

Returns the number of buffers in self.

remove(idx, length)[source]
Parameters:
  • idx (int) – the index

  • length (int) – the amount to remove

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