GstBufferPool

A GstBufferPool is an object that can be used to pre-allocate and recycle buffers of the same size and with the same properties.

A GstBufferPool is created with gst_buffer_pool_new.

Once a pool is created, it needs to be configured. A call to gst_buffer_pool_get_config returns the current configuration structure from the pool. With gst_buffer_pool_config_set_params and gst_buffer_pool_config_set_allocator the bufferpool parameters and allocator can be configured. Other properties can be configured in the pool depending on the pool implementation.

A bufferpool can have extra options that can be enabled with gst_buffer_pool_config_add_option. The available options can be retrieved with gst_buffer_pool_get_options. Some options allow for additional configuration properties to be set.

After the configuration structure has been configured, gst_buffer_pool_set_config updates the configuration in the pool. This can fail when the configuration structure is not accepted.

After the pool has been configured, it can be activated with gst_buffer_pool_set_active. This will preallocate the configured resources in the pool.

When the pool is active, gst_buffer_pool_acquire_buffer can be used to retrieve a buffer from the pool.

Buffers allocated from a bufferpool will automatically be returned to the pool with gst_buffer_pool_release_buffer when their refcount drops to 0.

The bufferpool can be deactivated again with gst_buffer_pool_set_active. All further gst_buffer_pool_acquire_buffer calls will return an error. When all buffers are returned to the pool they will be freed.

GstBufferPool

GObject
    ╰──GInitiallyUnowned
        ╰──GstObject
            ╰──GstBufferPool

The structure of a GstBufferPool. Use the associated macros to access the public variables.

Members

object (GstObject) –

the parent structure

flushing (gint) –

whether the pool is currently gathering back outstanding buffers


Class structure

GstBufferPoolClass

The GstBufferPool class.

Fields
object_class (GstObjectClass) –

Object parent class


Gst.BufferPoolClass

The Gst.BufferPool class.

Attributes
object_class (Gst.ObjectClass) –

Object parent class


Gst.BufferPoolClass

The Gst.BufferPool class.

Attributes
object_class (Gst.ObjectClass) –

Object parent class


Gst.BufferPool

GObject.Object
    ╰──GObject.InitiallyUnowned
        ╰──Gst.Object
            ╰──Gst.BufferPool

The structure of a Gst.BufferPool. Use the associated macros to access the public variables.

Members

object (Gst.Object) –

the parent structure

flushing (Number) –

whether the pool is currently gathering back outstanding buffers


Gst.BufferPool

GObject.Object
    ╰──GObject.InitiallyUnowned
        ╰──Gst.Object
            ╰──Gst.BufferPool

The structure of a Gst.BufferPool. Use the associated macros to access the public variables.

Members

object (Gst.Object) –

the parent structure

flushing (int) –

whether the pool is currently gathering back outstanding buffers


Constructors

gst_buffer_pool_new

GstBufferPool *
gst_buffer_pool_new ()

Creates a new GstBufferPool instance.

Returns ( [transfer: full])

a new GstBufferPool instance


Gst.BufferPool.prototype.new

function Gst.BufferPool.prototype.new(): {
    // javascript wrapper for 'gst_buffer_pool_new'
}

Creates a new Gst.BufferPool instance.

Returns (Gst.BufferPool)

a new Gst.BufferPool instance


Gst.BufferPool.new

def Gst.BufferPool.new ():
    #python wrapper for 'gst_buffer_pool_new'

Creates a new Gst.BufferPool instance.

Returns (Gst.BufferPool)

a new Gst.BufferPool instance


Methods

gst_buffer_pool_acquire_buffer

GstFlowReturn
gst_buffer_pool_acquire_buffer (GstBufferPool * pool,
                                GstBuffer ** buffer,
                                GstBufferPoolAcquireParams * params)

Acquires a buffer from pool. buffer should point to a memory location that can hold a pointer to the new buffer. When the pool is empty, this function will by default block until a buffer is released into the pool again or when the pool is set to flushing or deactivated.

params can contain optional parameters to influence the allocation.

Parameters:

pool

a GstBufferPool

buffer ( [out][transfer: full][nullable])

a location for a GstBuffer

params ( [transfer: none][nullable])

parameters.

Returns

a GstFlowReturn such as GST_FLOW_FLUSHING when the pool is inactive.


Gst.BufferPool.prototype.acquire_buffer

function Gst.BufferPool.prototype.acquire_buffer(params: Gst.BufferPoolAcquireParams): {
    // javascript wrapper for 'gst_buffer_pool_acquire_buffer'
}

Acquires a buffer from pool. buffer should point to a memory location that can hold a pointer to the new buffer. When the pool is empty, this function will by default block until a buffer is released into the pool again or when the pool is set to flushing or deactivated.

params can contain optional parameters to influence the allocation.

Parameters:

parameters.

Returns a tuple made of:

a Gst.FlowReturn such as Gst.FlowReturn.FLUSHING when the pool is inactive.

buffer (Gst.Buffer )

a Gst.FlowReturn such as Gst.FlowReturn.FLUSHING when the pool is inactive.


Gst.BufferPool.acquire_buffer

def Gst.BufferPool.acquire_buffer (self, params):
    #python wrapper for 'gst_buffer_pool_acquire_buffer'

Acquires a buffer from pool. buffer should point to a memory location that can hold a pointer to the new buffer. When the pool is empty, this function will by default block until a buffer is released into the pool again or when the pool is set to flushing or deactivated.

params can contain optional parameters to influence the allocation.

Parameters:

parameters.

Returns a tuple made of:

a Gst.FlowReturn such as Gst.FlowReturn.FLUSHING when the pool is inactive.

buffer (Gst.Buffer )

a Gst.FlowReturn such as Gst.FlowReturn.FLUSHING when the pool is inactive.


gst_buffer_pool_get_config

GstStructure *
gst_buffer_pool_get_config (GstBufferPool * pool)

Gets a copy of the current configuration of the pool. This configuration can be modified and used for the gst_buffer_pool_set_config call.

Parameters:

pool

a GstBufferPool

Returns ( [transfer: full])

a copy of the current configuration of pool.


Gst.BufferPool.prototype.get_config

function Gst.BufferPool.prototype.get_config(): {
    // javascript wrapper for 'gst_buffer_pool_get_config'
}

Gets a copy of the current configuration of the pool. This configuration can be modified and used for the Gst.BufferPool.prototype.set_config call.

Parameters:

Returns (Gst.Structure)

a copy of the current configuration of pool.


Gst.BufferPool.get_config

def Gst.BufferPool.get_config (self):
    #python wrapper for 'gst_buffer_pool_get_config'

Gets a copy of the current configuration of the pool. This configuration can be modified and used for the Gst.BufferPool.set_config call.

Parameters:

Returns (Gst.Structure)

a copy of the current configuration of pool.


gst_buffer_pool_get_options

const gchar **
gst_buffer_pool_get_options (GstBufferPool * pool)

Gets a NULL terminated array of string with supported bufferpool options for pool. An option would typically be enabled with gst_buffer_pool_config_add_option.

Parameters:

pool

a GstBufferPool

Returns ( [arrayzero-terminated=1][transfer: none])

a NULL terminated array of strings.


Gst.BufferPool.prototype.get_options

function Gst.BufferPool.prototype.get_options(): {
    // javascript wrapper for 'gst_buffer_pool_get_options'
}

Gets a null terminated array of string with supported bufferpool options for pool. An option would typically be enabled with Gst.BufferPool.prototype.config_add_option.

Parameters:

Returns ([ String ])

a null terminated array of strings.


Gst.BufferPool.get_options

def Gst.BufferPool.get_options (self):
    #python wrapper for 'gst_buffer_pool_get_options'

Gets a None terminated array of string with supported bufferpool options for pool. An option would typically be enabled with Gst.BufferPool.config_add_option.

Parameters:

Returns ([ str ])

a None terminated array of strings.


gst_buffer_pool_has_option

gboolean
gst_buffer_pool_has_option (GstBufferPool * pool,
                            const gchar * option)

Checks if the bufferpool supports option.

Parameters:

pool

a GstBufferPool

option

an option

Returns

TRUE if the buffer pool contains option.


Gst.BufferPool.prototype.has_option

function Gst.BufferPool.prototype.has_option(option: String): {
    // javascript wrapper for 'gst_buffer_pool_has_option'
}

Checks if the bufferpool supports option.

Parameters:

option (String)

an option

Returns (Number)

true if the buffer pool contains option.


Gst.BufferPool.has_option

def Gst.BufferPool.has_option (self, option):
    #python wrapper for 'gst_buffer_pool_has_option'

Checks if the bufferpool supports option.

Parameters:

option (str)

an option

Returns (bool)

True if the buffer pool contains option.


gst_buffer_pool_is_active

gboolean
gst_buffer_pool_is_active (GstBufferPool * pool)

Checks if pool is active. A pool can be activated with the gst_buffer_pool_set_active call.

Parameters:

pool

a GstBufferPool

Returns

TRUE when the pool is active.


Gst.BufferPool.prototype.is_active

function Gst.BufferPool.prototype.is_active(): {
    // javascript wrapper for 'gst_buffer_pool_is_active'
}

Checks if pool is active. A pool can be activated with the Gst.BufferPool.prototype.set_active call.

Parameters:

Returns (Number)

true when the pool is active.


Gst.BufferPool.is_active

def Gst.BufferPool.is_active (self):
    #python wrapper for 'gst_buffer_pool_is_active'

Checks if pool is active. A pool can be activated with the Gst.BufferPool.set_active call.

Parameters:

Returns (bool)

True when the pool is active.


gst_buffer_pool_release_buffer

gst_buffer_pool_release_buffer (GstBufferPool * pool,
                                GstBuffer * buffer)

Releases buffer to pool. buffer should have previously been allocated from pool with gst_buffer_pool_acquire_buffer.

This function is usually called automatically when the last ref on buffer disappears.

Parameters:

pool

a GstBufferPool

buffer ( [transfer: full])

a GstBuffer


Gst.BufferPool.prototype.release_buffer

function Gst.BufferPool.prototype.release_buffer(buffer: Gst.Buffer): {
    // javascript wrapper for 'gst_buffer_pool_release_buffer'
}

Releases buffer to pool. buffer should have previously been allocated from pool with Gst.BufferPool.prototype.acquire_buffer.

This function is usually called automatically when the last ref on buffer disappears.

Parameters:

buffer (Gst.Buffer)

a Gst.Buffer


Gst.BufferPool.release_buffer

def Gst.BufferPool.release_buffer (self, buffer):
    #python wrapper for 'gst_buffer_pool_release_buffer'

Releases buffer to pool. buffer should have previously been allocated from pool with Gst.BufferPool.acquire_buffer.

This function is usually called automatically when the last ref on buffer disappears.

Parameters:

buffer (Gst.Buffer)

a Gst.Buffer


gst_buffer_pool_set_active

gboolean
gst_buffer_pool_set_active (GstBufferPool * pool,
                            gboolean active)

Controls the active state of pool. When the pool is inactive, new calls to gst_buffer_pool_acquire_buffer will return with GST_FLOW_FLUSHING.

Activating the bufferpool will preallocate all resources in the pool based on the configuration of the pool.

Deactivating will free the resources again when there are no outstanding buffers. When there are outstanding buffers, they will be freed as soon as they are all returned to the pool.

Parameters:

pool

a GstBufferPool

active

the new active state

Returns

FALSE when the pool was not configured or when preallocation of the buffers failed.


Gst.BufferPool.prototype.set_active

function Gst.BufferPool.prototype.set_active(active: Number): {
    // javascript wrapper for 'gst_buffer_pool_set_active'
}

Controls the active state of pool. When the pool is inactive, new calls to Gst.BufferPool.prototype.acquire_buffer will return with Gst.FlowReturn.FLUSHING.

Activating the bufferpool will preallocate all resources in the pool based on the configuration of the pool.

Deactivating will free the resources again when there are no outstanding buffers. When there are outstanding buffers, they will be freed as soon as they are all returned to the pool.

Parameters:

active (Number)

the new active state

Returns (Number)

false when the pool was not configured or when preallocation of the buffers failed.


Gst.BufferPool.set_active

def Gst.BufferPool.set_active (self, active):
    #python wrapper for 'gst_buffer_pool_set_active'

Controls the active state of pool. When the pool is inactive, new calls to Gst.BufferPool.acquire_buffer will return with Gst.FlowReturn.FLUSHING.

Activating the bufferpool will preallocate all resources in the pool based on the configuration of the pool.

Deactivating will free the resources again when there are no outstanding buffers. When there are outstanding buffers, they will be freed as soon as they are all returned to the pool.

Parameters:

active (bool)

the new active state

Returns (bool)

False when the pool was not configured or when preallocation of the buffers failed.


gst_buffer_pool_set_config

gboolean
gst_buffer_pool_set_config (GstBufferPool * pool,
                            GstStructure * config)

Sets the configuration of the pool. If the pool is already configured, and the configuration hasn't changed, this function will return TRUE. If the pool is active, this method will return FALSE and active configuration will remain. Buffers allocated from this pool must be returned or else this function will do nothing and return FALSE.

config is a GstStructure that contains the configuration parameters for the pool. A default and mandatory set of parameters can be configured with gst_buffer_pool_config_set_params, gst_buffer_pool_config_set_allocator and gst_buffer_pool_config_add_option.

If the parameters in config can not be set exactly, this function returns FALSE and will try to update as much state as possible. The new state can then be retrieved and refined with gst_buffer_pool_get_config.

This function takes ownership of config.

Parameters:

pool

a GstBufferPool

config ( [transfer: full])

a GstStructure

Returns

TRUE when the configuration could be set.


Gst.BufferPool.prototype.set_config

function Gst.BufferPool.prototype.set_config(config: Gst.Structure): {
    // javascript wrapper for 'gst_buffer_pool_set_config'
}

Sets the configuration of the pool. If the pool is already configured, and the configuration hasn't changed, this function will return true. If the pool is active, this method will return false and active configuration will remain. Buffers allocated from this pool must be returned or else this function will do nothing and return false.

config is a Gst.Structure that contains the configuration parameters for the pool. A default and mandatory set of parameters can be configured with Gst.BufferPool.prototype.config_set_params, Gst.BufferPool.prototype.config_set_allocator and Gst.BufferPool.prototype.config_add_option.

If the parameters in config can not be set exactly, this function returns false and will try to update as much state as possible. The new state can then be retrieved and refined with Gst.BufferPool.prototype.get_config.

This function takes ownership of config.

Parameters:

config (Gst.Structure)

a Gst.Structure

Returns (Number)

true when the configuration could be set.


Gst.BufferPool.set_config

def Gst.BufferPool.set_config (self, config):
    #python wrapper for 'gst_buffer_pool_set_config'

Sets the configuration of the pool. If the pool is already configured, and the configuration hasn't changed, this function will return True. If the pool is active, this method will return False and active configuration will remain. Buffers allocated from this pool must be returned or else this function will do nothing and return False.

config is a Gst.Structure that contains the configuration parameters for the pool. A default and mandatory set of parameters can be configured with Gst.BufferPool.config_set_params, Gst.BufferPool.config_set_allocator and Gst.BufferPool.config_add_option.

If the parameters in config can not be set exactly, this function returns False and will try to update as much state as possible. The new state can then be retrieved and refined with Gst.BufferPool.get_config.

This function takes ownership of config.

Parameters:

config (Gst.Structure)

a Gst.Structure

Returns (bool)

True when the configuration could be set.


gst_buffer_pool_set_flushing

gst_buffer_pool_set_flushing (GstBufferPool * pool,
                              gboolean flushing)

Enables or disables the flushing state of a pool without freeing or allocating buffers.

Parameters:

pool

a GstBufferPool

flushing

whether to start or stop flushing

Since : 1.4


Gst.BufferPool.prototype.set_flushing

function Gst.BufferPool.prototype.set_flushing(flushing: Number): {
    // javascript wrapper for 'gst_buffer_pool_set_flushing'
}

Enables or disables the flushing state of a pool without freeing or allocating buffers.

Parameters:

flushing (Number)

whether to start or stop flushing

Since : 1.4


Gst.BufferPool.set_flushing

def Gst.BufferPool.set_flushing (self, flushing):
    #python wrapper for 'gst_buffer_pool_set_flushing'

Enables or disables the flushing state of a pool without freeing or allocating buffers.

Parameters:

flushing (bool)

whether to start or stop flushing

Since : 1.4


Functions

gst_buffer_pool_config_add_option

gst_buffer_pool_config_add_option (GstStructure * config,
                                   const gchar * option)

Enables the option in config. This will instruct the bufferpool to enable the specified option on the buffers that it allocates.

The options supported by pool can be retrieved with gst_buffer_pool_get_options.

Parameters:

config

a GstBufferPool configuration

option

an option to add


Gst.BufferPool.prototype.config_add_option

function Gst.BufferPool.prototype.config_add_option(config: Gst.Structure, option: String): {
    // javascript wrapper for 'gst_buffer_pool_config_add_option'
}

Enables the option in config. This will instruct the bufferpool to enable the specified option on the buffers that it allocates.

The options supported by pool can be retrieved with Gst.BufferPool.prototype.get_options.

Parameters:

config (Gst.Structure)

a Gst.BufferPool configuration

option (String)

an option to add


Gst.BufferPool.config_add_option

def Gst.BufferPool.config_add_option (config, option):
    #python wrapper for 'gst_buffer_pool_config_add_option'

Enables the option in config. This will instruct the bufferpool to enable the specified option on the buffers that it allocates.

The options supported by pool can be retrieved with Gst.BufferPool.get_options.

Parameters:

config (Gst.Structure)

a Gst.BufferPool configuration

option (str)

an option to add


gst_buffer_pool_config_get_allocator

gboolean
gst_buffer_pool_config_get_allocator (GstStructure * config,
                                      GstAllocator ** allocator,
                                      GstAllocationParams * params)

Gets the allocator and params from config.

Parameters:

config ( [transfer: none])

a GstBufferPool configuration

allocator ( [out][optional][nullable][transfer: none])

a GstAllocator, or NULL

params ( [out][optional])

GstAllocationParams, or NULL

Returns

TRUE, if the values are set.


Gst.BufferPool.prototype.config_get_allocator

function Gst.BufferPool.prototype.config_get_allocator(config: Gst.Structure): {
    // javascript wrapper for 'gst_buffer_pool_config_get_allocator'
}

Gets the allocator and params from config.

Parameters:

config (Gst.Structure)

a Gst.BufferPool configuration

Returns a tuple made of:

(Number )

true, if the values are set.

allocator (Gst.Allocator )

true, if the values are set.

params (Gst.AllocationParams )

true, if the values are set.


Gst.BufferPool.config_get_allocator

def Gst.BufferPool.config_get_allocator (config):
    #python wrapper for 'gst_buffer_pool_config_get_allocator'

Gets the allocator and params from config.

Parameters:

config (Gst.Structure)

a Gst.BufferPool configuration

Returns a tuple made of:

(bool )

True, if the values are set.

allocator (Gst.Allocator )

True, if the values are set.

params (Gst.AllocationParams )

True, if the values are set.


gst_buffer_pool_config_get_option

const gchar *
gst_buffer_pool_config_get_option (GstStructure * config,
                                   guint index)

Parses an available config and gets the option at index of the options API array.

Parameters:

config

a GstBufferPool configuration

index

position in the option array to read

Returns ( [nullable])

the option at index.


Gst.BufferPool.prototype.config_get_option

function Gst.BufferPool.prototype.config_get_option(config: Gst.Structure, index: Number): {
    // javascript wrapper for 'gst_buffer_pool_config_get_option'
}

Parses an available config and gets the option at index of the options API array.

Parameters:

config (Gst.Structure)

a Gst.BufferPool configuration

index (Number)

position in the option array to read

Returns (String)

the option at index.


Gst.BufferPool.config_get_option

def Gst.BufferPool.config_get_option (config, index):
    #python wrapper for 'gst_buffer_pool_config_get_option'

Parses an available config and gets the option at index of the options API array.

Parameters:

config (Gst.Structure)

a Gst.BufferPool configuration

index (int)

position in the option array to read

Returns (str)

the option at index.


gst_buffer_pool_config_get_params

gboolean
gst_buffer_pool_config_get_params (GstStructure * config,
                                   GstCaps ** caps,
                                   guint * size,
                                   guint * min_buffers,
                                   guint * max_buffers)

Gets the configuration values from config.

Parameters:

config ( [transfer: none])

a GstBufferPool configuration

caps ( [out][transfer: none][optional][nullable])

the caps of buffers

size ( [out][optional])

the size of each buffer, not including prefix and padding

min_buffers ( [out][optional])

the minimum amount of buffers to allocate.

max_buffers ( [out][optional])

the maximum amount of buffers to allocate or 0 for unlimited.

Returns

TRUE if all parameters could be fetched.


Gst.BufferPool.prototype.config_get_params

function Gst.BufferPool.prototype.config_get_params(config: Gst.Structure): {
    // javascript wrapper for 'gst_buffer_pool_config_get_params'
}

Gets the configuration values from config.

Parameters:

config (Gst.Structure)

a Gst.BufferPool configuration

Returns a tuple made of:

(Number )

true if all parameters could be fetched.

caps (Gst.Caps )

true if all parameters could be fetched.

size (Number )

true if all parameters could be fetched.

min_buffers (Number )

true if all parameters could be fetched.

max_buffers (Number )

true if all parameters could be fetched.


Gst.BufferPool.config_get_params

def Gst.BufferPool.config_get_params (config):
    #python wrapper for 'gst_buffer_pool_config_get_params'

Gets the configuration values from config.

Parameters:

config (Gst.Structure)

a Gst.BufferPool configuration

Returns a tuple made of:

(bool )

True if all parameters could be fetched.

caps (Gst.Caps )

True if all parameters could be fetched.

size (int )

True if all parameters could be fetched.

min_buffers (int )

True if all parameters could be fetched.

max_buffers (int )

True if all parameters could be fetched.


gst_buffer_pool_config_has_option

gboolean
gst_buffer_pool_config_has_option (GstStructure * config,
                                   const gchar * option)

Checks if config contains option.

Parameters:

config

a GstBufferPool configuration

option

an option

Returns

TRUE if the options array contains option.


Gst.BufferPool.prototype.config_has_option

function Gst.BufferPool.prototype.config_has_option(config: Gst.Structure, option: String): {
    // javascript wrapper for 'gst_buffer_pool_config_has_option'
}

Checks if config contains option.

Parameters:

config (Gst.Structure)

a Gst.BufferPool configuration

option (String)

an option

Returns (Number)

true if the options array contains option.


Gst.BufferPool.config_has_option

def Gst.BufferPool.config_has_option (config, option):
    #python wrapper for 'gst_buffer_pool_config_has_option'

Checks if config contains option.

Parameters:

config (Gst.Structure)

a Gst.BufferPool configuration

option (str)

an option

Returns (bool)

True if the options array contains option.


gst_buffer_pool_config_n_options

guint
gst_buffer_pool_config_n_options (GstStructure * config)

Retrieves the number of values currently stored in the options array of the config structure.

Parameters:

config

a GstBufferPool configuration

Returns

the options array size as a guint.


Gst.BufferPool.prototype.config_n_options

function Gst.BufferPool.prototype.config_n_options(config: Gst.Structure): {
    // javascript wrapper for 'gst_buffer_pool_config_n_options'
}

Retrieves the number of values currently stored in the options array of the config structure.

Parameters:

config (Gst.Structure)

a Gst.BufferPool configuration

Returns (Number)

the options array size as a Number.


Gst.BufferPool.config_n_options

def Gst.BufferPool.config_n_options (config):
    #python wrapper for 'gst_buffer_pool_config_n_options'

Retrieves the number of values currently stored in the options array of the config structure.

Parameters:

config (Gst.Structure)

a Gst.BufferPool configuration

Returns (int)

the options array size as a int.


gst_buffer_pool_config_set_allocator

gst_buffer_pool_config_set_allocator (GstStructure * config,
                                      GstAllocator * allocator,
                                      const GstAllocationParams * params)

Sets the allocator and params on config.

One of allocator and params can be NULL, but not both. When allocator is NULL, the default allocator of the pool will use the values in param to perform its allocation. When param is NULL, the pool will use the provided allocator with its default GstAllocationParams.

A call to gst_buffer_pool_set_config can update the allocator and params with the values that it is able to do. Some pools are, for example, not able to operate with different allocators or cannot allocate with the values specified in params. Use gst_buffer_pool_get_config to get the currently used values.

Parameters:

config

a GstBufferPool configuration

allocator ( [nullable])

a GstAllocator

params ( [nullable])

GstAllocationParams


Gst.BufferPool.prototype.config_set_allocator

function Gst.BufferPool.prototype.config_set_allocator(config: Gst.Structure, allocator: Gst.Allocator, params: Gst.AllocationParams): {
    // javascript wrapper for 'gst_buffer_pool_config_set_allocator'
}

Sets the allocator and params on config.

One of allocator and params can be null, but not both. When allocator is null, the default allocator of the pool will use the values in param to perform its allocation. When param is null, the pool will use the provided allocator with its default Gst.AllocationParams.

A call to Gst.BufferPool.prototype.set_config can update the allocator and params with the values that it is able to do. Some pools are, for example, not able to operate with different allocators or cannot allocate with the values specified in params. Use Gst.BufferPool.prototype.get_config to get the currently used values.

Parameters:

config (Gst.Structure)

a Gst.BufferPool configuration

allocator (Gst.Allocator)

a Gst.Allocator


Gst.BufferPool.config_set_allocator

def Gst.BufferPool.config_set_allocator (config, allocator, params):
    #python wrapper for 'gst_buffer_pool_config_set_allocator'

Sets the allocator and params on config.

One of allocator and params can be None, but not both. When allocator is None, the default allocator of the pool will use the values in param to perform its allocation. When param is None, the pool will use the provided allocator with its default Gst.AllocationParams.

A call to Gst.BufferPool.set_config can update the allocator and params with the values that it is able to do. Some pools are, for example, not able to operate with different allocators or cannot allocate with the values specified in params. Use Gst.BufferPool.get_config to get the currently used values.

Parameters:

config (Gst.Structure)

a Gst.BufferPool configuration

allocator (Gst.Allocator)

a Gst.Allocator


gst_buffer_pool_config_set_params

gst_buffer_pool_config_set_params (GstStructure * config,
                                   GstCaps * caps,
                                   guint size,
                                   guint min_buffers,
                                   guint max_buffers)

Configures config with the given parameters.

Parameters:

config

a GstBufferPool configuration

caps ( [nullable])

caps for the buffers

size

the size of each buffer, not including prefix and padding

min_buffers

the minimum amount of buffers to allocate.

max_buffers

the maximum amount of buffers to allocate or 0 for unlimited.


Gst.BufferPool.prototype.config_set_params

function Gst.BufferPool.prototype.config_set_params(config: Gst.Structure, caps: Gst.Caps, size: Number, min_buffers: Number, max_buffers: Number): {
    // javascript wrapper for 'gst_buffer_pool_config_set_params'
}

Configures config with the given parameters.

Parameters:

config (Gst.Structure)

a Gst.BufferPool configuration

caps (Gst.Caps)

caps for the buffers

size (Number)

the size of each buffer, not including prefix and padding

min_buffers (Number)

the minimum amount of buffers to allocate.

max_buffers (Number)

the maximum amount of buffers to allocate or 0 for unlimited.


Gst.BufferPool.config_set_params

def Gst.BufferPool.config_set_params (config, caps, size, min_buffers, max_buffers):
    #python wrapper for 'gst_buffer_pool_config_set_params'

Configures config with the given parameters.

Parameters:

config (Gst.Structure)

a Gst.BufferPool configuration

caps (Gst.Caps)

caps for the buffers

size (int)

the size of each buffer, not including prefix and padding

min_buffers (int)

the minimum amount of buffers to allocate.

max_buffers (int)

the maximum amount of buffers to allocate or 0 for unlimited.


gst_buffer_pool_config_validate_params

gboolean
gst_buffer_pool_config_validate_params (GstStructure * config,
                                        GstCaps * caps,
                                        guint size,
                                        guint min_buffers,
                                        guint max_buffers)

Validates that changes made to config are still valid in the context of the expected parameters. This function is a helper that can be used to validate changes made by a pool to a config when gst_buffer_pool_set_config returns FALSE. This expects that caps haven't changed and that min_buffers aren't lower then what we initially expected. This does not check if options or allocator parameters are still valid, won't check if size have changed, since changing the size is valid to adapt padding.

Parameters:

config ( [transfer: none])

a GstBufferPool configuration

caps ( [nullable][transfer: none])

the excepted caps of buffers

size

the expected size of each buffer, not including prefix and padding

min_buffers

the expected minimum amount of buffers to allocate.

max_buffers

the expect maximum amount of buffers to allocate or 0 for unlimited.

Returns

TRUE, if the parameters are valid in this context.

Since : 1.4


Gst.BufferPool.prototype.config_validate_params

function Gst.BufferPool.prototype.config_validate_params(config: Gst.Structure, caps: Gst.Caps, size: Number, min_buffers: Number, max_buffers: Number): {
    // javascript wrapper for 'gst_buffer_pool_config_validate_params'
}

Validates that changes made to config are still valid in the context of the expected parameters. This function is a helper that can be used to validate changes made by a pool to a config when Gst.BufferPool.prototype.set_config returns false. This expects that caps haven't changed and that min_buffers aren't lower then what we initially expected. This does not check if options or allocator parameters are still valid, won't check if size have changed, since changing the size is valid to adapt padding.

Parameters:

config (Gst.Structure)

a Gst.BufferPool configuration

caps (Gst.Caps)

the excepted caps of buffers

size (Number)

the expected size of each buffer, not including prefix and padding

min_buffers (Number)

the expected minimum amount of buffers to allocate.

max_buffers (Number)

the expect maximum amount of buffers to allocate or 0 for unlimited.

Returns (Number)

true, if the parameters are valid in this context.

Since : 1.4


Gst.BufferPool.config_validate_params

def Gst.BufferPool.config_validate_params (config, caps, size, min_buffers, max_buffers):
    #python wrapper for 'gst_buffer_pool_config_validate_params'

Validates that changes made to config are still valid in the context of the expected parameters. This function is a helper that can be used to validate changes made by a pool to a config when Gst.BufferPool.set_config returns False. This expects that caps haven't changed and that min_buffers aren't lower then what we initially expected. This does not check if options or allocator parameters are still valid, won't check if size have changed, since changing the size is valid to adapt padding.

Parameters:

config (Gst.Structure)

a Gst.BufferPool configuration

caps (Gst.Caps)

the excepted caps of buffers

size (int)

the expected size of each buffer, not including prefix and padding

min_buffers (int)

the expected minimum amount of buffers to allocate.

max_buffers (int)

the expect maximum amount of buffers to allocate or 0 for unlimited.

Returns (bool)

True, if the parameters are valid in this context.

Since : 1.4


Virtual Methods

acquire_buffer

GstFlowReturn
acquire_buffer (GstBufferPool * pool,
                GstBuffer ** buffer,
                GstBufferPoolAcquireParams * params)

Get a new buffer from the pool. The default implementation will take a buffer from the queue and optionally wait for a buffer to be released when there are no buffers available.

Parameters:

pool

the GstBufferPool

buffer ( [out][transfer: full][nullable])

a location for a GstBuffer

params ( [transfer: none][nullable])

parameters.

Returns

a GstFlowReturn such as GST_FLOW_FLUSHING when the pool is inactive.


vfunc_acquire_buffer

function vfunc_acquire_buffer(pool: Gst.BufferPool, params: Gst.BufferPoolAcquireParams): {
    // javascript implementation of the 'acquire_buffer' virtual method
}

Get a new buffer from the pool. The default implementation will take a buffer from the queue and optionally wait for a buffer to be released when there are no buffers available.

Parameters:

parameters.

Returns a tuple made of:

a Gst.FlowReturn such as Gst.FlowReturn.FLUSHING when the pool is inactive.

buffer (Gst.Buffer )

a Gst.FlowReturn such as Gst.FlowReturn.FLUSHING when the pool is inactive.


do_acquire_buffer

def do_acquire_buffer (pool, params):
    #python implementation of the 'acquire_buffer' virtual method

Get a new buffer from the pool. The default implementation will take a buffer from the queue and optionally wait for a buffer to be released when there are no buffers available.

Parameters:

parameters.

Returns a tuple made of:

a Gst.FlowReturn such as Gst.FlowReturn.FLUSHING when the pool is inactive.

buffer (Gst.Buffer )

a Gst.FlowReturn such as Gst.FlowReturn.FLUSHING when the pool is inactive.


alloc_buffer

GstFlowReturn
alloc_buffer (GstBufferPool * pool,
              GstBuffer ** buffer,
              GstBufferPoolAcquireParams * params)

Allocate a buffer. the default implementation allocates buffers from the configured memory allocator and with the configured parameters. All metadata that is present on the allocated buffer will be marked as GST_META_FLAG_POOLED and GST_META_FLAG_LOCKED and will not be removed from the buffer in reset_buffer. The buffer should have the GST_BUFFER_FLAG_TAG_MEMORY cleared.

Parameters:

pool

the GstBufferPool

buffer ( [out][transfer: full][nullable])

a location for a GstBuffer

params ( [transfer: none][nullable])

parameters.

Returns

a GstFlowReturn to indicate whether the allocation was successful.


vfunc_alloc_buffer

function vfunc_alloc_buffer(pool: Gst.BufferPool, params: Gst.BufferPoolAcquireParams): {
    // javascript implementation of the 'alloc_buffer' virtual method
}

Allocate a buffer. the default implementation allocates buffers from the configured memory allocator and with the configured parameters. All metadata that is present on the allocated buffer will be marked as Gst.MetaFlags.POOLED and Gst.MetaFlags.LOCKED and will not be removed from the buffer in vfunc_reset_buffer. The buffer should have the Gst.BufferFlags.TAG_MEMORY cleared.

Parameters:

parameters.

Returns a tuple made of:

a Gst.FlowReturn to indicate whether the allocation was successful.

buffer (Gst.Buffer )

a Gst.FlowReturn to indicate whether the allocation was successful.


do_alloc_buffer

def do_alloc_buffer (pool, params):
    #python implementation of the 'alloc_buffer' virtual method

Allocate a buffer. the default implementation allocates buffers from the configured memory allocator and with the configured parameters. All metadata that is present on the allocated buffer will be marked as Gst.MetaFlags.POOLED and Gst.MetaFlags.LOCKED and will not be removed from the buffer in do_reset_buffer. The buffer should have the Gst.BufferFlags.TAG_MEMORY cleared.

Parameters:

parameters.

Returns a tuple made of:

a Gst.FlowReturn to indicate whether the allocation was successful.

buffer (Gst.Buffer )

a Gst.FlowReturn to indicate whether the allocation was successful.


flush_start

flush_start (GstBufferPool * pool)

Enter the flushing state.

Parameters:

pool

the GstBufferPool

Since : 1.4


vfunc_flush_start

function vfunc_flush_start(pool: Gst.BufferPool): {
    // javascript implementation of the 'flush_start' virtual method
}

Enter the flushing state.

Parameters:

Since : 1.4


do_flush_start

def do_flush_start (pool):
    #python implementation of the 'flush_start' virtual method

Enter the flushing state.

Parameters:

Since : 1.4


flush_stop

flush_stop (GstBufferPool * pool)

Leave the flushing state.

Parameters:

pool

the GstBufferPool

Since : 1.4


vfunc_flush_stop

function vfunc_flush_stop(pool: Gst.BufferPool): {
    // javascript implementation of the 'flush_stop' virtual method
}

Leave the flushing state.

Parameters:

Since : 1.4


do_flush_stop

def do_flush_stop (pool):
    #python implementation of the 'flush_stop' virtual method

Leave the flushing state.

Parameters:

Since : 1.4


free_buffer

free_buffer (GstBufferPool * pool,
             GstBuffer * buffer)

Free a buffer. The default implementation unrefs the buffer.

Parameters:

pool

the GstBufferPool

buffer

the GstBuffer to free


vfunc_free_buffer

function vfunc_free_buffer(pool: Gst.BufferPool, buffer: Gst.Buffer): {
    // javascript implementation of the 'free_buffer' virtual method
}

Free a buffer. The default implementation unrefs the buffer.

Parameters:

buffer (Gst.Buffer)

the Gst.Buffer to free


do_free_buffer

def do_free_buffer (pool, buffer):
    #python implementation of the 'free_buffer' virtual method

Free a buffer. The default implementation unrefs the buffer.

Parameters:

buffer (Gst.Buffer)

the Gst.Buffer to free


get_options

const gchar **
get_options (GstBufferPool * pool)

Get a list of options supported by this pool

Parameters:

pool

the GstBufferPool

Returns ( [arrayzero-terminated=1][transfer: none])

a NULL terminated array of strings.


vfunc_get_options

function vfunc_get_options(pool: Gst.BufferPool): {
    // javascript implementation of the 'get_options' virtual method
}

Get a list of options supported by this pool

Parameters:

Returns ([ String ])

a null terminated array of strings.


do_get_options

def do_get_options (pool):
    #python implementation of the 'get_options' virtual method

Get a list of options supported by this pool

Parameters:

Returns ([ str ])

a None terminated array of strings.


release_buffer

release_buffer (GstBufferPool * pool,
                GstBuffer * buffer)

Release a buffer back in the pool. The default implementation will put the buffer back in the queue and notify any blocking acquire_buffer calls when the GST_BUFFER_FLAG_TAG_MEMORY is not set on the buffer. If GST_BUFFER_FLAG_TAG_MEMORY is set, the buffer will be freed with free_buffer.

Parameters:

pool

the GstBufferPool

buffer

the GstBuffer to release


vfunc_release_buffer

function vfunc_release_buffer(pool: Gst.BufferPool, buffer: Gst.Buffer): {
    // javascript implementation of the 'release_buffer' virtual method
}

Release a buffer back in the pool. The default implementation will put the buffer back in the queue and notify any blocking vfunc_acquire_buffer calls when the Gst.BufferFlags.TAG_MEMORY is not set on the buffer. If Gst.BufferFlags.TAG_MEMORY is set, the buffer will be freed with vfunc_free_buffer.

Parameters:

buffer (Gst.Buffer)

the Gst.Buffer to release


do_release_buffer

def do_release_buffer (pool, buffer):
    #python implementation of the 'release_buffer' virtual method

Release a buffer back in the pool. The default implementation will put the buffer back in the queue and notify any blocking do_acquire_buffer calls when the Gst.BufferFlags.TAG_MEMORY is not set on the buffer. If Gst.BufferFlags.TAG_MEMORY is set, the buffer will be freed with do_free_buffer.

Parameters:

buffer (Gst.Buffer)

the Gst.Buffer to release


reset_buffer

reset_buffer (GstBufferPool * pool,
              GstBuffer * buffer)

Reset the buffer to its state when it was freshly allocated. The default implementation will clear the flags, timestamps and will remove the metadata without the GST_META_FLAG_POOLED flag (even the metadata with GST_META_FLAG_LOCKED). If the GST_BUFFER_FLAG_TAG_MEMORY was set, this function can also try to restore the memory and clear the GST_BUFFER_FLAG_TAG_MEMORY again.

Parameters:

pool

the GstBufferPool

buffer

the GstBuffer to reset


vfunc_reset_buffer

function vfunc_reset_buffer(pool: Gst.BufferPool, buffer: Gst.Buffer): {
    // javascript implementation of the 'reset_buffer' virtual method
}

Reset the buffer to its state when it was freshly allocated. The default implementation will clear the flags, timestamps and will remove the metadata without the Gst.MetaFlags.POOLED flag (even the metadata with Gst.MetaFlags.LOCKED). If the Gst.BufferFlags.TAG_MEMORY was set, this function can also try to restore the memory and clear the Gst.BufferFlags.TAG_MEMORY again.

Parameters:

buffer (Gst.Buffer)

the Gst.Buffer to reset


do_reset_buffer

def do_reset_buffer (pool, buffer):
    #python implementation of the 'reset_buffer' virtual method

Reset the buffer to its state when it was freshly allocated. The default implementation will clear the flags, timestamps and will remove the metadata without the Gst.MetaFlags.POOLED flag (even the metadata with Gst.MetaFlags.LOCKED). If the Gst.BufferFlags.TAG_MEMORY was set, this function can also try to restore the memory and clear the Gst.BufferFlags.TAG_MEMORY again.

Parameters:

buffer (Gst.Buffer)

the Gst.Buffer to reset


set_config

gboolean
set_config (GstBufferPool * pool,
            GstStructure * config)

Apply the bufferpool configuration. The default configuration will parse the default config parameters.

Parameters:

pool

the GstBufferPool

config

the required configuration

Returns

whether the configuration could be set.


vfunc_set_config

function vfunc_set_config(pool: Gst.BufferPool, config: Gst.Structure): {
    // javascript implementation of the 'set_config' virtual method
}

Apply the bufferpool configuration. The default configuration will parse the default config parameters.

Parameters:

config (Gst.Structure)

the required configuration

Returns (Number)

whether the configuration could be set.


do_set_config

def do_set_config (pool, config):
    #python implementation of the 'set_config' virtual method

Apply the bufferpool configuration. The default configuration will parse the default config parameters.

Parameters:

config (Gst.Structure)

the required configuration

Returns (bool)

whether the configuration could be set.


start

gboolean
start (GstBufferPool * pool)

Start the bufferpool. The default implementation will preallocate min-buffers buffers and put them in the queue.

Parameters:

pool

the GstBufferPool

Returns

whether the pool could be started.


vfunc_start

function vfunc_start(pool: Gst.BufferPool): {
    // javascript implementation of the 'start' virtual method
}

Start the bufferpool. The default implementation will preallocate min-buffers buffers and put them in the queue.

Parameters:

Returns (Number)

whether the pool could be started.


do_start

def do_start (pool):
    #python implementation of the 'start' virtual method

Start the bufferpool. The default implementation will preallocate min-buffers buffers and put them in the queue.

Parameters:

Returns (bool)

whether the pool could be started.


stop

gboolean
stop (GstBufferPool * pool)

Stop the bufferpool. the default implementation will free the preallocated buffers. This function is called when all the buffers are returned to the pool.

Parameters:

pool

the GstBufferPool

Returns

whether the pool could be stopped.


vfunc_stop

function vfunc_stop(pool: Gst.BufferPool): {
    // javascript implementation of the 'stop' virtual method
}

Stop the bufferpool. the default implementation will free the preallocated buffers. This function is called when all the buffers are returned to the pool.

Parameters:

Returns (Number)

whether the pool could be stopped.


do_stop

def do_stop (pool):
    #python implementation of the 'stop' virtual method

Stop the bufferpool. the default implementation will free the preallocated buffers. This function is called when all the buffers are returned to the pool.

Parameters:

Returns (bool)

whether the pool could be stopped.


GstBufferPoolAcquireParams

Parameters passed to the gst_buffer_pool_acquire_buffer function to control the allocation of the buffer.

The default implementation ignores the start and stop members but other implementations can use this extra information to decide what buffer to return.

Members

format (GstFormat) –

the format of start and stop

start (gint64) –

the start position

stop (gint64) –

the stop position

additional flags


Gst.BufferPoolAcquireParams

Parameters passed to the Gst.BufferPool.prototype.acquire_buffer function to control the allocation of the buffer.

The default implementation ignores the start and stop members but other implementations can use this extra information to decide what buffer to return.

Members

format (Gst.Format) –

the format of start and stop

start (Number) –

the start position

stop (Number) –

the stop position

additional flags


Gst.BufferPoolAcquireParams

Parameters passed to the Gst.BufferPool.acquire_buffer function to control the allocation of the buffer.

The default implementation ignores the start and stop members but other implementations can use this extra information to decide what buffer to return.

Members

format (Gst.Format) –

the format of start and stop

start (int) –

the start position

stop (int) –

the stop position

additional flags


Function Macros

GST_BUFFER_POOL_CAST

#define GST_BUFFER_POOL_CAST(obj)            ((GstBufferPool *)(obj))

GST_BUFFER_POOL_IS_FLUSHING

#define GST_BUFFER_POOL_IS_FLUSHING(pool)  (g_atomic_int_get (&pool->flushing))

Check if the bufferpool is flushing. Subclasses might want to check the state of the pool in the acquire function.

Parameters:

pool

a GstBufferPool


Enumerations

GstBufferPoolAcquireFlags

Additional flags to control the allocation of a buffer

Members
GST_BUFFER_POOL_ACQUIRE_FLAG_NONE (0) –

no flags

GST_BUFFER_POOL_ACQUIRE_FLAG_KEY_UNIT (1) –

buffer is keyframe

GST_BUFFER_POOL_ACQUIRE_FLAG_DONTWAIT (2) –

when the bufferpool is empty, acquire_buffer will by default block until a buffer is released into the pool again. Setting this flag makes acquire_buffer return GST_FLOW_EOS instead of blocking.

GST_BUFFER_POOL_ACQUIRE_FLAG_DISCONT (4) –

buffer is discont

GST_BUFFER_POOL_ACQUIRE_FLAG_LAST (65536) –

last flag, subclasses can use private flags starting from this value.


Gst.BufferPoolAcquireFlags

Additional flags to control the allocation of a buffer

Members
Gst.BufferPoolAcquireFlags.NONE (0) –

no flags

Gst.BufferPoolAcquireFlags.KEY_UNIT (1) –

buffer is keyframe

Gst.BufferPoolAcquireFlags.DONTWAIT (2) –

when the bufferpool is empty, acquire_buffer will by default block until a buffer is released into the pool again. Setting this flag makes acquire_buffer return Gst.FlowReturn.EOS instead of blocking.

Gst.BufferPoolAcquireFlags.DISCONT (4) –

buffer is discont

Gst.BufferPoolAcquireFlags.LAST (65536) –

last flag, subclasses can use private flags starting from this value.


Gst.BufferPoolAcquireFlags

Additional flags to control the allocation of a buffer

Members
Gst.BufferPoolAcquireFlags.NONE (0) –

no flags

Gst.BufferPoolAcquireFlags.KEY_UNIT (1) –

buffer is keyframe

Gst.BufferPoolAcquireFlags.DONTWAIT (2) –

when the bufferpool is empty, acquire_buffer will by default block until a buffer is released into the pool again. Setting this flag makes acquire_buffer return Gst.FlowReturn.EOS instead of blocking.

Gst.BufferPoolAcquireFlags.DISCONT (4) –

buffer is discont

Gst.BufferPoolAcquireFlags.LAST (65536) –

last flag, subclasses can use private flags starting from this value.


The results of the search are