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 a 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.
Use gst_object_unref to release the reference to a bufferpool. If the refcount of the pool reaches 0, the pool will be freed.
GstBufferPool
GObject ╰──GInitiallyUnowned ╰──GstObject ╰──GstBufferPool
The structure of a GstBufferPool. Use the associated macros to access the public variables.
Class structure
GstBufferPoolClass
The GstBufferPool class.
Fields
object_class
(GstObjectClass)
–
Object parent class
Gst.BufferPoolClass
The GstBufferPool class.
Attributes
object_class
(Gst.ObjectClass)
–
Object parent class
Gst.BufferPoolClass
The GstBufferPool class.
Attributes
object_class
(Gst.ObjectClass)
–
Object parent class
GstBufferPool
GObject ╰──GInitiallyUnowned ╰──GstObject ╰──GstBufferPool
The structure of a GstBufferPool. Use the associated macros to access the public variables.
GstBufferPool
GObject ╰──GInitiallyUnowned ╰──GstObject ╰──GstBufferPool
The structure of a GstBufferPool. Use the associated macros to access the public variables.
Constructors
gst_buffer_pool_new
GstBufferPool * gst_buffer_pool_new ()
Creates a new GstBufferPool instance.
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.
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.
a new Gst.BufferPool instance
Methods
gst_buffer_pool_acquire_buffer
GstFlowReturn gst_buffer_pool_acquire_buffer (GstBufferPool * pool, GstBuffer ** buffer, GstBufferPoolAcquireParams * params)
Acquire a buffer from pool. buffer should point to a memory location that can hold a pointer to the new buffer.
params can be NULL or contain optional parameters to influence the allocation.
Parameters:
pool
–
buffer
(
[out]
)
–
a location for a GstBuffer
params
(
[transfer: none]
[allow-none]
)
–
parameters.
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'
}
Acquire a buffer from pool. buffer should point to a memory location that can hold a pointer to the new buffer.
params can be null or contain optional parameters to influence the allocation.
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'
Acquire a buffer from pool. buffer should point to a memory location that can hold a pointer to the new buffer.
params can be None or contain optional parameters to influence the allocation.
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)
Get a copy of the current configuration of the pool. This configuration can either be modified and used for the gst_buffer_pool_set_config call or it must be freed after usage.
Parameters:
pool
–
a copy of the current configuration of pool. use gst_structure_free after usage or gst_buffer_pool_set_config.
Gst.BufferPool.prototype.get_config
function Gst.BufferPool.prototype.get_config(): {
// javascript wrapper for 'gst_buffer_pool_get_config'
}
Get a copy of the current configuration of the pool. This configuration can either be modified and used for the Gst.BufferPool.prototype.set_config call or it must be freed after usage.
Parameters:
pool
(
Gst.BufferPool
)
–
a copy of the current configuration of pool. use Gst.Structure.prototype.free after usage or Gst.BufferPool.prototype.set_config.
Gst.BufferPool.get_config
def Gst.BufferPool.get_config (self):
#python wrapper for 'gst_buffer_pool_get_config'
Get a copy of the current configuration of the pool. This configuration can either be modified and used for the Gst.BufferPool.set_config call or it must be freed after usage.
Parameters:
pool
(
Gst.BufferPool
)
–
a copy of the current configuration of pool. use Gst.Structure.free after usage or Gst.BufferPool.set_config.
gst_buffer_pool_get_options
const gchar ** gst_buffer_pool_get_options (GstBufferPool * pool)
Get 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 NULL terminated array of strings.
Gst.BufferPool.prototype.get_options
function Gst.BufferPool.prototype.get_options(): {
// javascript wrapper for 'gst_buffer_pool_get_options'
}
Get 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:
pool
(
Gst.BufferPool
)
–
Gst.BufferPool.get_options
def Gst.BufferPool.get_options (self):
#python wrapper for 'gst_buffer_pool_get_options'
Get 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:
pool
(
Gst.BufferPool
)
–
gst_buffer_pool_has_option
gboolean gst_buffer_pool_has_option (GstBufferPool * pool, const gchar * option)
Check if the bufferpool supports option.
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'
}
Check if the bufferpool supports option.
Gst.BufferPool.has_option
def Gst.BufferPool.has_option (self, option):
#python wrapper for 'gst_buffer_pool_has_option'
Check if the bufferpool supports option.
gst_buffer_pool_is_active
gboolean gst_buffer_pool_is_active (GstBufferPool * pool)
Check if pool is active. A pool can be activated with the gst_buffer_pool_set_active call.
Parameters:
pool
–
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'
}
Check if pool is active. A pool can be activated with the Gst.BufferPool.prototype.set_active call.
Parameters:
pool
(
Gst.BufferPool
)
–
Gst.BufferPool.is_active
def Gst.BufferPool.is_active (self):
#python wrapper for 'gst_buffer_pool_is_active'
Check if pool is active. A pool can be activated with the Gst.BufferPool.set_active call.
Parameters:
pool
(
Gst.BufferPool
)
–
gst_buffer_pool_release_buffer
gst_buffer_pool_release_buffer (GstBufferPool * pool, GstBuffer * buffer)
Release 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.
Gst.BufferPool.prototype.release_buffer
function Gst.BufferPool.prototype.release_buffer(buffer: Gst.Buffer): {
// javascript wrapper for 'gst_buffer_pool_release_buffer'
}
Release 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.
Gst.BufferPool.release_buffer
def Gst.BufferPool.release_buffer (self, buffer):
#python wrapper for 'gst_buffer_pool_release_buffer'
Release 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.
gst_buffer_pool_set_active
gboolean gst_buffer_pool_set_active (GstBufferPool * pool, gboolean active)
Control 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.
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'
}
Control 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.
Gst.BufferPool.set_active
def Gst.BufferPool.set_active (self, active):
#python wrapper for 'gst_buffer_pool_set_active'
Control 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.
gst_buffer_pool_set_config
gboolean gst_buffer_pool_set_config (GstBufferPool * pool, GstStructure * config)
Set the configuration of the pool. If the pool is already configured, and the configuration haven't change, this function will return TRUE. If the pool is active, this method will return FALSE and active configuration will remain. Buffers allocated form 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.
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'
}
Set the configuration of the pool. If the pool is already configured, and the configuration haven't change, this function will return true. If the pool is active, this method will return false and active configuration will remain. Buffers allocated form 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.
Gst.BufferPool.set_config
def Gst.BufferPool.set_config (self, config):
#python wrapper for 'gst_buffer_pool_set_config'
Set the configuration of the pool. If the pool is already configured, and the configuration haven't change, this function will return True. If the pool is active, this method will return False and active configuration will remain. Buffers allocated form 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.
gst_buffer_pool_set_flushing
gst_buffer_pool_set_flushing (GstBufferPool * pool, gboolean flushing)
Enable or disable the flushing state of a pool without freeing or allocating buffers.
Since : 1.4
Gst.BufferPool.prototype.set_flushing
function Gst.BufferPool.prototype.set_flushing(flushing: Number): {
// javascript wrapper for 'gst_buffer_pool_set_flushing'
}
Enable or disable the flushing state of a pool without freeing or allocating buffers.
Since : 1.4
Gst.BufferPool.set_flushing
def Gst.BufferPool.set_flushing (self, flushing):
#python wrapper for 'gst_buffer_pool_set_flushing'
Enable or disable the flushing state of a pool without freeing or allocating buffers.
Since : 1.4
Functions
gst_buffer_pool_config_add_option
gst_buffer_pool_config_add_option (GstStructure * config, const gchar * option)
Enabled the option in config. This will instruct the bufferpool to enable the specified option on the buffers that it allocates.
The supported options by pool can be retrieved with gst_buffer_pool_get_options.
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'
}
Enabled the option in config. This will instruct the bufferpool to enable the specified option on the buffers that it allocates.
The supported options 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'
Enabled the option in config. This will instruct the bufferpool to enable the specified option on the buffers that it allocates.
The supported options 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)
Get 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]
)
–
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'
}
Get the allocator and params from config.
Parameters:
config
(
Gst.Structure
)
–
a Gst.BufferPool configuration
Returns a tuple made of:
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'
Get the allocator and params from config.
Parameters:
config
(
Gst.Structure
)
–
a Gst.BufferPool configuration
Returns a tuple made of:
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)
Parse an available config and get the option at index of the options API array.
a gchar of 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'
}
Parse an available config and get 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
Gst.BufferPool.config_get_option
def Gst.BufferPool.config_get_option (config, index):
#python wrapper for 'gst_buffer_pool_config_get_option'
Parse an available config and get 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
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)
Get 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.
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'
}
Get the configuration values from config.
Parameters:
config
(
Gst.Structure
)
–
a Gst.BufferPool configuration
Returns a tuple made of:
Gst.BufferPool.config_get_params
def Gst.BufferPool.config_get_params (config):
#python wrapper for 'gst_buffer_pool_config_get_params'
Get the configuration values from config.
Parameters:
config
(
Gst.Structure
)
–
a Gst.BufferPool configuration
Returns a tuple made of:
gst_buffer_pool_config_has_option
gboolean gst_buffer_pool_config_has_option (GstStructure * config, const gchar * option)
Check if config contains option.
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'
}
Check if config contains option.
Gst.BufferPool.config_has_option
def Gst.BufferPool.config_has_option (config, option):
#python wrapper for 'gst_buffer_pool_config_has_option'
Check if config contains option.
gst_buffer_pool_config_n_options
guint gst_buffer_pool_config_n_options (GstStructure * config)
Retrieve the number of values currently stored in the options array of the config structure.
Parameters:
config
–
a GstBufferPool configuration
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'
}
Retrieve the number of values currently stored in the options array of the config structure.
Parameters:
config
(
Gst.Structure
)
–
a Gst.BufferPool configuration
Gst.BufferPool.config_n_options
def Gst.BufferPool.config_n_options (config):
#python wrapper for 'gst_buffer_pool_config_n_options'
Retrieve the number of values currently stored in the options array of the config structure.
Parameters:
config
(
Gst.Structure
)
–
a Gst.BufferPool configuration
gst_buffer_pool_config_set_allocator
gst_buffer_pool_config_set_allocator (GstStructure * config, GstAllocator * allocator, const GstAllocationParams * params)
Set 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]
)
–
params
(
[nullable]
)
–
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'
}
Set 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
)
–
params
(
Gst.AllocationParams
)
–
Gst.BufferPool.config_set_allocator
def Gst.BufferPool.config_set_allocator (config, allocator, params):
#python wrapper for 'gst_buffer_pool_config_set_allocator'
Set 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
)
–
params
(
Gst.AllocationParams
)
–
gst_buffer_pool_config_set_params
gst_buffer_pool_config_set_params (GstStructure * config, GstCaps * caps, guint size, guint min_buffers, guint max_buffers)
Configure 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'
}
Configure 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'
Configure 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)
Validate 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.
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'
}
Validate 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.
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'
Validate 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.
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
–
buffer
–
params
–
acquire_buffer
function 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:
pool
(
Gst.BufferPool
)
–
params
(
Gst.BufferPoolAcquireParams
)
–
Returns a tuple made of:
buffer
(
Gst.Buffer
)
–
acquire_buffer
def 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:
pool
(
Gst.BufferPool
)
–
params
(
Gst.BufferPoolAcquireParams
)
–
Returns a tuple made of:
buffer
(
Gst.Buffer
)
–
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
–
buffer
–
params
–
alloc_buffer
function alloc_buffer(pool: Gst.BufferPool, buffer: Gst.Buffer, 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_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
(
Gst.BufferPool
)
–
buffer
(
Gst.Buffer
)
–
params
(
Gst.BufferPoolAcquireParams
)
–
alloc_buffer
def alloc_buffer (pool, buffer, 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_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
(
Gst.BufferPool
)
–
buffer
(
Gst.Buffer
)
–
params
(
Gst.BufferPoolAcquireParams
)
–
flush_start
flush_start (GstBufferPool * pool)
enter the flushing state. (Since: 1.4)
Parameters:
pool
–
flush_start
function flush_start(pool: Gst.BufferPool): {
// javascript implementation of the 'flush_start' virtual method
}
enter the flushing state. (Since: 1.4)
Parameters:
pool
(
Gst.BufferPool
)
–
flush_start
def flush_start (pool):
#python implementation of the 'flush_start' virtual method
enter the flushing state. (Since: 1.4)
Parameters:
pool
(
Gst.BufferPool
)
–
flush_stop
flush_stop (GstBufferPool * pool)
leave the flushign state. (Since: 1.4)
Parameters:
pool
–
flush_stop
function flush_stop(pool: Gst.BufferPool): {
// javascript implementation of the 'flush_stop' virtual method
}
leave the flushign state. (Since: 1.4)
Parameters:
pool
(
Gst.BufferPool
)
–
flush_stop
def flush_stop (pool):
#python implementation of the 'flush_stop' virtual method
leave the flushign state. (Since: 1.4)
Parameters:
pool
(
Gst.BufferPool
)
–
free_buffer
free_buffer (GstBufferPool * pool, GstBuffer * buffer)
free a buffer. The default implementation unrefs the buffer.
Parameters:
pool
–
buffer
–
free_buffer
function 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:
pool
(
Gst.BufferPool
)
–
buffer
(
Gst.Buffer
)
–
free_buffer
def free_buffer (pool, buffer):
#python implementation of the 'free_buffer' virtual method
free a buffer. The default implementation unrefs the buffer.
Parameters:
pool
(
Gst.BufferPool
)
–
buffer
(
Gst.Buffer
)
–
get_options
const gchar ** get_options (GstBufferPool * pool)
get a list of options supported by this pool
Parameters:
pool
–
get_options
function get_options(pool: Gst.BufferPool): {
// javascript implementation of the 'get_options' virtual method
}
get a list of options supported by this pool
Parameters:
pool
(
Gst.BufferPool
)
–
get_options
def get_options (pool):
#python implementation of the 'get_options' virtual method
get a list of options supported by this pool
Parameters:
pool
(
Gst.BufferPool
)
–
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
–
buffer
–
release_buffer
function 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 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
(
Gst.BufferPool
)
–
buffer
(
Gst.Buffer
)
–
release_buffer
def 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 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
(
Gst.BufferPool
)
–
buffer
(
Gst.Buffer
)
–
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
–
buffer
–
reset_buffer
function 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_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
(
Gst.BufferPool
)
–
buffer
(
Gst.Buffer
)
–
reset_buffer
def 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_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
(
Gst.BufferPool
)
–
buffer
(
Gst.Buffer
)
–
set_config
gboolean set_config (GstBufferPool * pool, GstStructure * config)
apply the bufferpool configuration. The default configuration will parse the default config parameters
Parameters:
pool
–
config
–
set_config
function 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:
pool
(
Gst.BufferPool
)
–
config
(
Gst.Structure
)
–
set_config
def 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:
pool
(
Gst.BufferPool
)
–
config
(
Gst.Structure
)
–
start
gboolean start (GstBufferPool * pool)
start the bufferpool. The default implementation will preallocate min-buffers buffers and put them in the queue
Parameters:
pool
–
start
function 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:
pool
(
Gst.BufferPool
)
–
start
def 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:
pool
(
Gst.BufferPool
)
–
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
–
stop
function 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:
pool
(
Gst.BufferPool
)
–
stop
def 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:
pool
(
Gst.BufferPool
)
–
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
flags
(GstBufferPoolAcquireFlags)
–
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
flags
(Gst.BufferPoolAcquireFlags)
–
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
flags
(Gst.BufferPoolAcquireFlags)
–
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