gst.buffer_pool
Module for [BufferPool] class
Types 3
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.BufferPool.new_].
Once a pool is created, it needs to be configured. A call to [gst.buffer_pool.BufferPool.getConfig] returns the current configuration structure from the pool. With [gst.buffer_pool.BufferPool.configSetParams] and [gst.buffer_pool.BufferPool.configSetAllocator] 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.BufferPool.configAddOption]. The available options can be retrieved with [gst.buffer_pool.BufferPool.getOptions]. Some options allow for additional configuration properties to be set.
After the configuration structure has been configured, [gst.buffer_pool.BufferPool.setConfig] 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.BufferPool.setActive]. This will preallocate the configured resources in the pool.
When the pool is active, [gst.buffer_pool.BufferPool.acquireBuffer] 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.BufferPool.releaseBuffer] when their refcount drops to 0.
The bufferpool can be deactivated again with [gst.buffer_pool.BufferPool.setActive]. All further [gst.buffer_pool.BufferPool.acquireBuffer] calls will return an error. When all buffers are returned to the pool they will be freed.
BufferPool self()Returns `this`, for use in `with` statements.BufferPoolGidBuilder builder()Get builder for [gst.buffer_pool.BufferPool] Returns: New builder objectvoid configAddOption(gst.structure.Structure config, string option)Enables the option in config. This will instruct the bufferpool to enable the specified option on the buffers that it allocates.bool configGetAllocator(gst.structure.Structure config, out gst.allocator.Allocator allocator, out gst.allocation_params.AllocationParams params)Gets the allocator and params from config.string configGetOption(gst.structure.Structure config, uint index)Parses an available config and gets the option at index of the options API array.bool configGetParams(gst.structure.Structure config, out gst.caps.Caps caps, out uint size, out uint minBuffers, out uint maxBuffers)Gets the configuration values from config.bool configHasOption(gst.structure.Structure config, string option)Checks if config contains option.uint configNOptions(gst.structure.Structure config)Retrieves the number of values currently stored in the options array of the config structure.void configSetAllocator(gst.structure.Structure config, gst.allocator.Allocator allocator, gst.allocation_params.AllocationParams params)Sets the allocator and params on config.void configSetParams(gst.structure.Structure config, gst.caps.Caps caps, uint size, uint minBuffers, uint maxBuffers)Configures config with the given parameters.bool configValidateParams(gst.structure.Structure config, gst.caps.Caps caps, uint size, uint minBuffers, uint maxBuffers)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....gst.types.FlowReturn acquireBuffer(out gst.buffer.Buffer buffer, gst.types.BufferPoolAcquireParams 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 releas...gst.structure.Structure getConfig()Gets a copy of the current configuration of the pool. This configuration can be modified and used for the [gst.buffer_pool.BufferPool.setConfig] call. Returns: a copy of the current configuration o...string[] getOptions()Gets a null terminated array of string with supported bufferpool options for pool. An option would typically be enabled with [gst.buffer_pool.BufferPool.configAddOption]. Returns: a null terminated...bool hasOption(string option)Checks if the bufferpool supports option.bool isActive()Checks if pool is active. A pool can be activated with the [gst.buffer_pool.BufferPool.setActive] call. Returns: true when the pool is active.void releaseBuffer(gst.buffer.Buffer buffer)Releases buffer to pool. buffer should have previously been allocated from pool with [gst.buffer_pool.BufferPool.acquireBuffer].bool setActive(bool active)Controls the active state of pool. When the pool is inactive, new calls to [gst.buffer_pool.BufferPool.acquireBuffer] will return with [gst.types.FlowReturn.Flushing].bool setConfig(gst.structure.Structure 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...void setFlushing(bool flushing)Enables or disables the flushing state of a pool without freeing or allocating buffers.Fluent builder for [gst.buffer_pool.BufferPool]