Package ch.bailu.gtk.gst
Klasse BufferPool
java.lang.Object
ch.bailu.gtk.type.Type
ch.bailu.gtk.type.Pointer
ch.bailu.gtk.gobject.Object
ch.bailu.gtk.type.PropertyHolder
ch.bailu.gtk.gst.BufferPool
- Alle implementierten Schnittstellen:
PointerInterface
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.
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.
https://gstreamer.freedesktop.org/documentation/gstreamer/gi-index.html
-
Verschachtelte Klassen - Übersicht
Von Klasse geerbte verschachtelte Klassen/Schnittstellen ch.bailu.gtk.gobject.Object
Object.OnBindingTransformFunc, Object.OnDestroyNotify, Object.OnDuplicateFunc, Object.OnNotify, Object.OnToggleNotify, Object.OnWeakNotify
-
Feldübersicht
Von Klasse geerbte Felder ch.bailu.gtk.gobject.Object
SIGNAL_ON_NOTIFY
-
Konstruktorübersicht
KonstruktorenKonstruktorBeschreibungCreates a new #GstBufferPool instance.BufferPool
(PointerContainer pointer) -
Methodenübersicht
Modifizierer und TypMethodeBeschreibungstatic void
configAddOption
(Structure config, Str option) Enables the option in @config.static Str
configGetOption
(Structure config, int index) Parses an available @config and gets the option at @index of the options API
array.static boolean
configHasOption
(Structure config, Str option) Checks if @config contains @option.static int
configNOptions
(Structure config) Retrieves the number of values currently stored in the options array of the
@config structure.static void
configSetAllocator
(Structure config, Allocator allocator, AllocationParams params) Sets the @allocator and @params on @config.static void
configSetParams
(Structure config, Caps caps, int size, int min_buffers, int max_buffers) Configures @config with the given parameters.static boolean
configValidateParams
(Structure config, Caps caps, int size, int min_buffers, int max_buffers) Validates that changes made to @config are still valid in the context of the
expected parameters.static ClassHandler
Gets a copy of the current configuration of the pool.static int
static long
static TypeSystem.TypeSize
static long
static TypeSystem.TypeSize
boolean
Checks if the bufferpool supports @option.boolean
Checks if the bufferpool supports @option.boolean
isActive()
Checks if @pool is active.void
releaseBuffer
(Buffer buffer) Releases @buffer to @pool.boolean
setActive
(boolean active) Controls the active state of @pool.boolean
Sets the configuration of the pool.void
setFlushing
(boolean flushing) Enables or disables the flushing state of a @pool without freeing or
allocating buffers.Von Klasse geerbte Methoden ch.bailu.gtk.type.PropertyHolder
getBooleanProperty, getIntProperty, getObjectProperty, getStringProperty, getStrProperty, setBooleanProperty, setIntProperty, setObjectProperty, setStringProperty, setStrProperty
Von Klasse geerbte Methoden ch.bailu.gtk.gobject.Object
addToggleRef, bindProperty, bindProperty, bindPropertyFull, bindPropertyFull, bindPropertyWithClosures, bindPropertyWithClosures, compatControl, connect, connect, disconnect, disconnect, dupData, dupData, dupQdata, forceFloating, freezeNotify, get, get, getData, getData, getProperty, getProperty, getQdata, interfaceFindProperty, interfaceInstallProperty, isFloating, notify, notify, notifyByPspec, onNotify, ref, refSink, removeToggleRef, replaceData, replaceData, replaceQdata, runDispose, set, set, setData, setData, setDataFull, setDataFull, setProperty, setProperty, setQdata, setQdataFull, stealData, stealData, stealQdata, takeRef, thawNotify, unref, watchClosure, weakRef, weakUnref
Von Klasse geerbte Methoden ch.bailu.gtk.type.Pointer
asCPointer, cast, connectSignal, disconnectSignals, disconnectSignals, equals, hashCode, throwIfNull, throwNullPointerException, toString, unregisterCallbacks, unregisterCallbacks
Von Klasse geerbte Methoden ch.bailu.gtk.type.Type
asCPointer, asCPointer, asCPointerNotNull, asJnaPointer, asJnaPointer, asPointer, asPointer, cast, cast, throwIfNull
Von Klasse geerbte Methoden java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Von Schnittstelle geerbte Methoden ch.bailu.gtk.type.PointerInterface
asCPointerNotNull, asJnaPointer, asPointer, isNotNull, isNull
-
Konstruktordetails
-
BufferPool
-
BufferPool
public BufferPool()Creates a new #GstBufferPool instance.
-
-
Methodendetails
-
getClassHandler
-
getConfig
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.- Gibt zurück:
- a copy of the current configuration of @pool.
-
hasOption
Checks if the bufferpool supports @option.- Parameter:
option
- an option- Gibt zurück:
- %TRUE if the buffer pool contains @option.
-
hasOption
Checks if the bufferpool supports @option.- Parameter:
option
- an option- Gibt zurück:
- %TRUE if the buffer pool contains @option.
-
isActive
public boolean isActive()Checks if @pool is active. A pool can be activated with the
gst_buffer_pool_set_active() call.- Gibt zurück:
- %TRUE when the pool is active.
-
releaseBuffer
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.- Parameter:
buffer
- a #GstBuffer
-
setActive
public boolean setActive(boolean 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.- Parameter:
active
- the new active state- Gibt zurück:
- %FALSE when the pool was not configured or when preallocation of the buffers failed.
-
setConfig
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.- Parameter:
config
- a #GstStructure- Gibt zurück:
- %TRUE when the configuration could be set.
-
setFlushing
public void setFlushing(boolean flushing) Enables or disables the flushing state of a @pool without freeing or
allocating buffers.- Parameter:
flushing
- whether to start or stop flushing
-
configAddOption
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().- Parameter:
config
- a #GstBufferPool configurationoption
- an option to add
-
configGetOption
Parses an available @config and gets the option at @index of the options API
array.- Parameter:
config
- a #GstBufferPool configurationindex
- position in the option array to read- Gibt zurück:
- the option at @index.
-
configHasOption
Checks if @config contains @option.- Parameter:
config
- a #GstBufferPool configurationoption
- an option- Gibt zurück:
- %TRUE if the options array contains @option.
-
configNOptions
Retrieves the number of values currently stored in the options array of the
@config structure.- Parameter:
config
- a #GstBufferPool configuration- Gibt zurück:
- the options array size as a #guint.
-
configSetAllocator
public static void configSetAllocator(@Nonnull Structure config, @Nullable Allocator allocator, @Nullable AllocationParams 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.- Parameter:
config
- a #GstBufferPool configurationallocator
- a #GstAllocatorparams
- #GstAllocationParams
-
configSetParams
public static void configSetParams(@Nonnull Structure config, @Nullable Caps caps, int size, int min_buffers, int max_buffers) Configures @config with the given parameters.- Parameter:
config
- a #GstBufferPool configurationcaps
- caps for the bufferssize
- the size of each buffer, not including prefix and paddingmin_buffers
- the minimum amount of buffers to allocate.max_buffers
- the maximum amount of buffers to allocate or 0 for unlimited.
-
configValidateParams
public static boolean configValidateParams(@Nonnull Structure config, @Nullable Caps caps, int size, int min_buffers, int 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.- Parameter:
config
- a #GstBufferPool configurationcaps
- the excepted caps of bufferssize
- the expected size of each buffer, not including prefix and paddingmin_buffers
- the expected minimum amount of buffers to allocate.max_buffers
- the expect maximum amount of buffers to allocate or 0 for unlimited.- Gibt zurück:
- %TRUE, if the parameters are valid in this context.
-
getTypeID
public static long getTypeID() -
getParentTypeID
public static long getParentTypeID() -
getTypeSize
-
getParentTypeSize
-
getInstanceSize
public static int getInstanceSize()
-