Class: Gst::BufferPool
- Defined in:
- (unknown)
Overview
The Gst::BufferPool class.
Class Method Summary collapse
-
.config_add_option(config, option) ⇒ nil
Enables the option in config.
-
.config_get_allocator(config, allocator, params) ⇒ Boolean
Gets the allocator and params from config.
-
.config_get_option(config, index) ⇒ String
Parses an available config and gets the option at index of the options API array.
-
.config_get_params(config, caps, size, min_buffers, max_buffers) ⇒ Boolean
Gets the configuration values from config.
-
.config_has_option(config, option) ⇒ Boolean
Checks if config contains option.
-
.config_n_options(config) ⇒ Integer
Retrieves the number of values currently stored in the options array of the config structure.
-
.config_set_allocator(config, allocator, params) ⇒ nil
Sets the allocator and params on config.
-
.config_set_params(config, caps, size, min_buffers, max_buffers) ⇒ nil
Configures config with the given parameters.
-
.config_validate_params(config, caps, size, min_buffers, max_buffers) ⇒ Boolean
Validates that changes made to config are still valid in the context of the expected parameters.
Instance Method Summary collapse
-
#acquire_buffer(buffer, params) ⇒ Gst::FlowReturn
Acquires a buffer from pool.
-
#active=(active) ⇒ Boolean
Controls the active state of pool.
-
#config ⇒ Gst::Structure
Gets a copy of the current configuration of the pool.
-
#config=(config) ⇒ Boolean
Sets the configuration of the pool.
-
#flushing=(flushing) ⇒ nil
Enables or disables the flushing state of a pool without freeing or allocating buffers.
-
#has_option(option) ⇒ Boolean
Checks if the bufferpool supports option.
-
#initialize ⇒ Gst::BufferPool
constructor
Creates a new Gst::BufferPool instance.
-
#is_active ⇒ Boolean
Checks if pool is active.
-
#options ⇒ Array<String>
Gets a nil terminated array of string with supported bufferpool options for pool.
-
#release_buffer(buffer) ⇒ nil
Releases buffer to pool.
Methods inherited from Object
#add_control_binding, check_uniqueness, #control_bindings_disabled=, #control_rate, #control_rate=, default_deep_notify, #default_error, #get_control_binding, #get_g_value_array, #get_value, #get_value_array, #has_active_control_bindings, #has_ancestor, #has_as_ancestor, #has_as_parent, #name, #name=, #parent, #parent=, #path_string, #ref, ref_sink, #remove_control_binding, replace, #set_control_binding_disabled, #suggest_next_sync, #sync_values, #unparent, #unref
Constructor Details
#initialize ⇒ Gst::BufferPool
Creates a new Gst::BufferPool instance.
Class Method Details
.config_add_option(config, option) ⇒ nil
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().
.config_get_allocator(config, allocator, params) ⇒ Boolean
Gets the allocator and params from config.
.config_get_option(config, index) ⇒ String
Parses an available config and gets the option at index of the options API array.
.config_get_params(config, caps, size, min_buffers, max_buffers) ⇒ Boolean
Gets the configuration values from config.
.config_has_option(config, option) ⇒ Boolean
Checks if config contains option.
.config_n_options(config) ⇒ Integer
Retrieves the number of values currently stored in the options array of the config structure.
.config_set_allocator(config, allocator, params) ⇒ nil
Sets the allocator and params on config.
One of allocator and params can be nil, but not both. When allocator is nil, the default allocator of the pool will use the values in param to perform its allocation. When param is nil, the pool will use the provided allocator with its default Gst::AllocationParams.
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.
.config_set_params(config, caps, size, min_buffers, max_buffers) ⇒ nil
Configures config with the given parameters.
.config_validate_params(config, caps, size, min_buffers, max_buffers) ⇒ Boolean
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.
Instance Method Details
#acquire_buffer(buffer, params) ⇒ Gst::FlowReturn
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. inactive.
#active=(active) ⇒ Boolean
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. buffers failed.
#config ⇒ Gst::Structure
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.
#config=(config) ⇒ Boolean
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_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.
#flushing=(flushing) ⇒ nil
Enables or disables the flushing state of a pool without freeing or allocating buffers.
#has_option(option) ⇒ Boolean
Checks if the bufferpool supports option.
#is_active ⇒ Boolean
Checks if pool is active. A pool can be activated with the gst_buffer_pool_set_active() call.
#options ⇒ Array<String>
Gets a nil terminated array of string with supported bufferpool options for pool. An option would typically be enabled with gst_buffer_pool_config_add_option().
#release_buffer(buffer) ⇒ nil
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.