Callbacks¶
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Details¶
- Gst.BufferForeachMetaFunc(buffer, *user_data)¶
- Parameters:
buffer (
Gst.Buffer
) – aGst.Buffer
user_data (
object
orNone
) – user data passed toGst.Buffer.foreach_meta
()
- Returns:
False
whenGst.Buffer.foreach_meta
() should stop- meta:
a pointer to a
Gst.Meta
- Return type:
A function that will be called from
Gst.Buffer.foreach_meta
(). The meta field will point to a the reference of the meta.buffer should not be modified from this callback.
When this function returns
True
, the next meta will be returned. WhenFalse
is returned,Gst.Buffer.foreach_meta
() will return.When meta is set to
None
, the item will be removed from the buffer.
- Gst.BufferListFunc(idx, *user_data)¶
- Parameters:
idx (
int
) – the index of bufferuser_data (
object
orNone
) – user data passed toGst.BufferList.foreach
()
- Returns:
False
whenGst.BufferList.foreach
() should stop- buffer:
pointer to the buffer
- Return type:
(
bool
, buffer:Gst.Buffer
orNone
)
A function that will be called from
Gst.BufferList.foreach
(). The buffer field will point to a the reference of the buffer at idx.When this function returns
True
, the next buffer will be returned. WhenFalse
is returned,Gst.BufferList.foreach
() will return.When buffer is set to
None
, the item will be removed from the bufferlist. When buffer has been made writable, the new buffer reference can be assigned to buffer. This function is responsible for unreffing the old buffer when removing or modifying.
- Gst.BusFunc(bus, message, *user_data)¶
- Parameters:
message (
Gst.Message
) – theGst.Message
user_data (
object
orNone
) – user data that has been given, when registering the handler
- Returns:
False
if the event source should be removed.- Return type:
Specifies the type of function passed to
Gst.Bus.add_watch
() orGst.Bus.add_watch
(), which is called from the mainloop when a message is available on the bus.The message passed to the function will be unreffed after execution of this function so it should not be freed in the function.
Note that this function is used as a
GLib.SourceFunc
which means that returningFalse
will remove theGLib.Source
from the mainloop.
- Gst.BusSyncHandler(bus, message, *user_data)¶
- Parameters:
message (
Gst.Message
) – theGst.Message
user_data (
object
orNone
) – user data that has been given, when registering the handler
- Returns:
Gst.BusSyncReply
stating what to do with the message- Return type:
Handler will be invoked synchronously, when a new message has been injected into the bus. This function is mostly used internally. Only one sync handler can be attached to a given bus.
If the handler returns
Gst.BusSyncReply.DROP
, it should unref the message, else the message should not be unreffed by the sync handler.
- Gst.CapsFilterMapFunc(features, structure, *user_data)¶
- Parameters:
features (
Gst.CapsFeatures
) – theGst.CapsFeatures
structure (
Gst.Structure
) – theGst.Structure
- Returns:
True
if the features and structure should be preserved,False
if it should be removed.- Return type:
A function that will be called in
Gst.Caps.filter_and_map_in_place
(). The function may modify features and structure, and both will be removed from the caps ifFalse
is returned.
- Gst.CapsForeachFunc(features, structure, *user_data)¶
- Parameters:
features (
Gst.CapsFeatures
) – theGst.CapsFeatures
structure (
Gst.Structure
) – theGst.Structure
- Returns:
True
if the foreach operation should continue,False
if the foreach operation should stop withFalse
.- Return type:
A function that will be called in
Gst.Caps.foreach
(). The function may not modify features or structure.New in version 1.6.
- Gst.CapsMapFunc(features, structure, *user_data)¶
- Parameters:
features (
Gst.CapsFeatures
) – theGst.CapsFeatures
structure (
Gst.Structure
) – theGst.Structure
- Returns:
True
if the map operation should continue,False
if the map operation should stop withFalse
.- Return type:
A function that will be called in
Gst.Caps.map_in_place
(). The function may modify features and structure.
- Gst.ClockCallback(clock, time, id, *user_data)¶
- Parameters:
- Returns:
- Return type:
The function prototype of the callback.
- Gst.ControlBindingConvert(binding, src_value, dest_value)¶
- Parameters:
binding (
Gst.ControlBinding
) –src_value (
float
) –dest_value (
GObject.Value
) –
FIXME(2.0): remove, this is unused
- Gst.ControlSourceGetValue(self, timestamp, value)¶
- Parameters:
self (
Gst.ControlSource
) – theGst.ControlSource
instancetimestamp (
int
) – timestamp for which a value should be calculatedvalue (
float
) – a value which will be set to the result.
- Returns:
True
if the value was successfully calculated.- Return type:
Function for returning a value for a given timestamp.
- Gst.ControlSourceGetValueArray(self, timestamp, interval, n_values, values)¶
- Parameters:
self (
Gst.ControlSource
) – theGst.ControlSource
instancetimestamp (
int
) – timestamp for which a value should be calculatedinterval (
int
) – the time spacing between subsequent valuesn_values (
int
) – the number of valuesvalues (
float
) – array to put control-values in
- Returns:
True
if the values were successfully calculated.- Return type:
Function for returning an array of values starting at a given timestamp.
- Gst.CustomMetaTransformFunction(transbuf, meta, buffer, type, data, *user_data)¶
- Parameters:
transbuf (
Gst.Buffer
) – aGst.Buffer
meta (
Gst.CustomMeta
) – aGst.CustomMeta
buffer (
Gst.Buffer
) – aGst.Buffer
type (
int
) – the transform typeuser_data (
object
orNone
) – user data passed when registering the meta
- Returns:
True
if the transform could be performed- Return type:
Function called for each meta in buffer as a result of performing a transformation that yields transbuf. Additional type specific transform data is passed to the function as data.
Implementations should check the type of the transform and parse additional type specific fields in data that should be used to update the metadata on transbuf.
New in version 1.20.
- Gst.DebugFuncPtr()¶
we define this to avoid a compiler warning regarding a cast from a function pointer to a void pointer (see https://bugzilla.gnome.org/show_bug.cgi?id=309253)
- Gst.ElementCallAsyncFunc(element, *user_data)¶
- Parameters:
element (
Gst.Element
) – TheGst.Element
this function has been called againstuser_data (
object
orNone
) – Data passed in the function where that callback has been passed
Callback prototype used in
Gst.Element.call_async
- Gst.ElementForeachPadFunc(element, pad, *user_data)¶
- Parameters:
element (
Gst.Element
) – theGst.Element
user_data (
object
orNone
) – user data passed to the foreach function
- Returns:
- Return type:
Function called for each pad when using
Gst.Element.foreach_sink_pad
(),Gst.Element.foreach_src_pad
(), orGst.Element.foreach_pad
().New in version 1.14.
- Gst.IteratorCopyFunction(it, copy)¶
- Parameters:
it (
Gst.Iterator
) – The original iteratorcopy (
Gst.Iterator
) – The copied iterator
This function will be called when creating a copy of it and should create a copy of all custom iterator fields or increase their reference counts.
- Gst.IteratorFoldFunction(item, ret, *user_data)¶
- Parameters:
item (
GObject.Value
) – the item to foldret (
GObject.Value
) – aGObject.Value
collecting the resultuser_data (
object
orNone
) – data passed toGst.Iterator.fold
()
- Returns:
- Return type:
A function to be passed to
Gst.Iterator.fold
().
- Gst.IteratorForeachFunction(item, *user_data)¶
- Parameters:
item (
GObject.Value
) – The item
A function that is called by
Gst.Iterator.foreach
() for every element.
- Gst.IteratorFreeFunction(it)¶
- Parameters:
it (
Gst.Iterator
) – the iterator
This function will be called when the iterator is freed.
Implementors of a
Gst.Iterator
should implement this function and pass it to the constructor of the custom iterator. The function will be called with the iterator lock held.
- Gst.IteratorItemFunction(it, item)¶
- Parameters:
it (
Gst.Iterator
) – the iteratoritem (
GObject.Value
) – the item being retrieved.
- Returns:
the result of the operation.
- Return type:
The function that will be called after the next item of the iterator has been retrieved. This function can be used to skip items or stop the iterator.
The function will be called with the iterator lock held.
- Gst.IteratorNextFunction(it, result)¶
- Parameters:
it (
Gst.Iterator
) – the iteratorresult (
GObject.Value
) – a pointer to hold the next item
- Returns:
the result of the operation.
- Return type:
The function that will be called when the next element of the iterator should be retrieved.
Implementors of a
Gst.Iterator
should implement this function and pass it to the constructor of the custom iterator. The function will be called with the iterator lock held.
- Gst.IteratorResyncFunction(it)¶
- Parameters:
it (
Gst.Iterator
) – the iterator
This function will be called whenever a concurrent update happened to the iterated datastructure. The implementor of the iterator should restart the iterator from the beginning and clean up any state it might have.
Implementors of a
Gst.Iterator
should implement this function and pass it to the constructor of the custom iterator. The function will be called with the iterator lock held.
- Gst.LogFunction(category, level, file, function, line, object, message, *user_data)¶
- Parameters:
category (
Gst.DebugCategory
) – aGst.DebugCategory
level (
Gst.DebugLevel
) – aGst.DebugLevel
file (
str
) – file namefunction (
str
) – function nameline (
int
) – line numberobject (
GObject.Object
) – aGObject.Object
message (
Gst.DebugMessage
) – the message
Function prototype for a logging function that can be registered with
Gst.debug_add_log_function
(). Use G_GNUC_NO_INSTRUMENT on that function.
- Gst.MemoryCopyFunction(mem, offset, size)¶
- Parameters:
mem (
Gst.Memory
) – aGst.Memory
offset (
int
) – an offsetsize (
int
) – a size or -1
- Returns:
a new
Gst.Memory
object wrapping a copy of the requested region in mem.- Return type:
Copy size bytes from mem starting at offset and return them wrapped in a new
Gst.Memory
object. If size is set to -1, all bytes starting at offset are copied.
- Gst.MemoryIsSpanFunction(mem1, mem2, offset)¶
- Parameters:
mem1 (
Gst.Memory
) – aGst.Memory
mem2 (
Gst.Memory
) – aGst.Memory
offset (
int
) – a result offset
- Returns:
True
if mem1 and mem2 are in contiguous memory.- Return type:
Check if mem1 and mem2 occupy contiguous memory and return the offset of mem1 in the parent buffer in offset.
- Gst.MemoryMapFullFunction(mem, info, maxsize)¶
- Parameters:
mem (
Gst.Memory
) – aGst.Memory
info (
Gst.MapInfo
) – theGst.MapInfo
to map withmaxsize (
int
) – size to map
- Returns:
a pointer to memory of which at least maxsize bytes can be accessed according to the access pattern in info's flags.
- Return type:
Get the memory of mem that can be accessed according to the mode specified in info's flags. The function should return a pointer that contains at least maxsize bytes.
- Gst.MemoryMapFunction(mem, maxsize, flags)¶
- Parameters:
mem (
Gst.Memory
) – aGst.Memory
maxsize (
int
) – size to mapflags (
Gst.MapFlags
) – access mode for the memory
- Returns:
a pointer to memory of which at least maxsize bytes can be accessed according to the access pattern in flags.
- Return type:
Get the memory of mem that can be accessed according to the mode specified in flags. The function should return a pointer that contains at least maxsize bytes.
- Parameters:
mem (
Gst.Memory
) – aGst.Memory
offset (
int
) – an offsetsize (
int
) – a size or -1
- Returns:
a new
Gst.Memory
object sharing the requested region in mem.- Return type:
Share size bytes from mem starting at offset and return them wrapped in a new
Gst.Memory
object. If size is set to -1, all bytes starting at offset are shared. This function does not make a copy of the bytes in mem.
- Gst.MemoryUnmapFullFunction(mem, info)¶
- Parameters:
mem (
Gst.Memory
) – aGst.Memory
info (
Gst.MapInfo
) – aGst.MapInfo
Release the pointer previously retrieved with
Gst.Memory.map
() with info.
- Gst.MemoryUnmapFunction(mem)¶
- Parameters:
mem (
Gst.Memory
) – aGst.Memory
Release the pointer previously retrieved with
Gst.Memory.map
().
- Gst.MetaClearFunction(buffer, meta)¶
- Parameters:
buffer (
Gst.Buffer
) – aGst.Buffer
Clears the content of the meta. This will be called by the
Gst.BufferPool
when a pooled buffer is returned.New in version 1.24.
- Gst.MetaDeserializeFunction(info, buffer, data, size, version)¶
- Parameters:
info (
Gst.MetaInfo
) –Gst.MetaInfo
of the metabuffer (
Gst.Buffer
) – aGst.Buffer
data (
int
) – data obtained fromGst.MetaSerializeFunction
size (
int
) – size of data to avoid buffer overflowversion (
int
) –
- Returns:
the metadata owned by buffer, or
None
.- Return type:
Recreate a
Gst.Meta
from serialized data returned byGst.MetaSerializeFunction
and add it to buffer.New in version 1.24.
- Gst.MetaFreeFunction(meta, buffer)¶
- Parameters:
buffer (
Gst.Buffer
) – aGst.Buffer
Function called when meta is freed in buffer.
- Gst.MetaInitFunction(meta, params, buffer)¶
- Parameters:
params (
object
orNone
) – parameters passed to the init functionbuffer (
Gst.Buffer
) – aGst.Buffer
- Return type:
Function called when meta is initialized in buffer.
- Gst.MetaSerializeFunction(meta, data)¶
- Parameters:
data (
Gst.ByteArrayInterface
) –Gst.ByteArrayInterface
to append serialization data
- Returns:
True
on success,False
otherwise.- version:
version of the serialization format
- Return type:
Serialize meta into a format that can be stored or transmitted and later deserialized by
Gst.MetaDeserializeFunction
.By default version is set to 0, it should be bumped if incompatible changes are made to the format so
Gst.MetaDeserializeFunction
can deserialize each version.New in version 1.24.
- Gst.MetaTransformFunction(transbuf, meta, buffer, type, data)¶
- Parameters:
transbuf (
Gst.Buffer
) – aGst.Buffer
buffer (
Gst.Buffer
) – aGst.Buffer
type (
int
) – the transform type
- Returns:
True
if the transform could be performed- Return type:
Function called for each meta in buffer as a result of performing a transformation on transbuf. Additional type specific transform data is passed to the function as data.
Implementations should check the type of the transform and parse additional type specific fields in data that should be used to update the metadata on transbuf.
- Gst.MiniObjectCopyFunction(obj)¶
- Parameters:
obj (
Gst.MiniObject
) – MiniObject to copy- Returns:
reference to cloned instance.
- Return type:
Function prototype for methods to create copies of instances.
- Gst.MiniObjectDisposeFunction(obj)¶
- Parameters:
obj (
Gst.MiniObject
) – MiniObject to dispose- Returns:
True
if the object should be cleaned up.- Return type:
Function prototype for when a miniobject has lost its last refcount. Implementation of the mini object are allowed to revive the passed object by doing a gst_mini_object_ref(). If the object is not revived after the dispose function, the function should return
True
and the memory associated with the object is freed.
- Gst.MiniObjectFreeFunction(obj)¶
- Parameters:
obj (
Gst.MiniObject
) – MiniObject to free
Virtual function prototype for methods to free resources used by mini-objects.
- Gst.MiniObjectNotify(user_data, obj)¶
- Parameters:
user_data (
object
orNone
) – data that was provided when the notify was addedobj (
Gst.MiniObject
) – the mini object
A
Gst.MiniObjectNotify
function can be added to a mini object as a callback that gets triggered when gst_mini_object_unref() drops the last ref and obj is about to be freed.
- Gst.PadActivateFunction(pad, parent)¶
- Parameters:
parent (
Gst.Object
) – the parent of pad
- Returns:
True
if the pad could be activated.- Return type:
This function is called when the pad is activated during the element READY to PAUSED state change. By default this function will call the activate function that puts the pad in push mode but elements can override this function to activate the pad in pull mode if they wish.
- Gst.PadActivateModeFunction(pad, parent, mode, active)¶
- Parameters:
parent (
Gst.Object
) – the parent of padmode (
Gst.PadMode
) – the requested activation mode of padactive (
bool
) – activate or deactivate the pad.
- Returns:
True
if the pad could be activated or deactivated.- Return type:
The prototype of the push and pull activate functions.
- Gst.PadChainFunction(pad, parent, buffer)¶
- Parameters:
parent (
Gst.Object
orNone
) – the parent of pad. If theGst.PadFlags.NEED_PARENT
flag is set, parent is guaranteed to be not-None
and remain valid during the execution of this function.buffer (
Gst.Buffer
) – theGst.Buffer
that is chained, notNone
.
- Returns:
Gst.FlowReturn.OK
for success- Return type:
A function that will be called on sinkpads when chaining buffers. The function typically processes the data contained in the buffer and either consumes the data or passes it on to the internally linked pad(s).
The implementer of this function receives a refcount to buffer and should gst_buffer_unref() when the buffer is no longer needed.
When a chain function detects an error in the data stream, it must post an error on the bus and return an appropriate
Gst.FlowReturn
value.
- Gst.PadChainListFunction(pad, parent, list)¶
- Parameters:
parent (
Gst.Object
orNone
) – the parent of pad. If theGst.PadFlags.NEED_PARENT
flag is set, parent is guaranteed to be not-None
and remain valid during the execution of this function.list (
Gst.BufferList
) – theGst.BufferList
that is chained, notNone
.
- Returns:
Gst.FlowReturn.OK
for success- Return type:
A function that will be called on sinkpads when chaining buffer lists. The function typically processes the data contained in the buffer list and either consumes the data or passes it on to the internally linked pad(s).
The implementer of this function receives a refcount to list and should gst_buffer_list_unref() when the list is no longer needed.
When a chainlist function detects an error in the data stream, it must post an error on the bus and return an appropriate
Gst.FlowReturn
value.
- Gst.PadEventFullFunction(pad, parent, event)¶
- Parameters:
parent (
Gst.Object
orNone
) – the parent of pad. If theGst.PadFlags.NEED_PARENT
flag is set, parent is guaranteed to be not-None
and remain valid during the execution of this function.
- Returns:
Gst.FlowReturn.OK
if the event was handled properly, or any otherGst.FlowReturn
dependent on downstream state.- Return type:
Function signature to handle an event for the pad.
This variant is for specific elements that will take into account the last downstream flow return (from a pad push), in which case they can return it.
New in version 1.8.
- Gst.PadEventFunction(pad, parent, event)¶
- Parameters:
parent (
Gst.Object
orNone
) – the parent of pad. If theGst.PadFlags.NEED_PARENT
flag is set, parent is guaranteed to be not-None
and remain valid during the execution of this function.
- Returns:
True
if the pad could handle the event.- Return type:
Function signature to handle an event for the pad.
- Gst.PadForwardFunction(pad, *user_data)¶
- Parameters:
- Returns:
True
if the dispatching procedure has to be stopped.- Return type:
A forward function is called for all internally linked pads, see
Gst.Pad.forward
().
- Gst.PadGetRangeFunction(pad, parent, offset, length, buffer)¶
- Parameters:
parent (
Gst.Object
orNone
) – the parent of pad. If theGst.PadFlags.NEED_PARENT
flag is set, parent is guaranteed to be not-None
and remain valid during the execution of this function.offset (
int
) – the offset of the rangelength (
int
) – the length of the rangebuffer (
Gst.Buffer
) – a memory location to hold the result buffer, cannot beNone
.
- Returns:
Gst.FlowReturn.OK
for success and a valid buffer in buffer. Any other return value leaves buffer undefined.- Return type:
This function will be called on source pads when a peer element request a buffer at the specified offset and length. If this function returns
Gst.FlowReturn.OK
, the result buffer will be stored in buffer. The contents of buffer is invalid for any other return value.This function is installed on a source pad with gst_pad_set_getrange_function() and can only be called on source pads after they are successfully activated with
Gst.Pad.activate_mode
() with theGst.PadMode.PULL
.offset and length are always given in byte units. offset must normally be a value between 0 and the length in bytes of the data available on pad. The length (duration in bytes) can be retrieved with a
Gst.QueryType.DURATION
or with aGst.QueryType.SEEKING
.Any offset larger or equal than the length will make the function return
Gst.FlowReturn.EOS
, which corresponds to EOS. In this case buffer does not contain a valid buffer.The buffer size of buffer will only be smaller than length when offset is near the end of the stream. In all other cases, the size of buffer must be exactly the requested size.
It is allowed to call this function with a 0 length and valid offset, in which case buffer will contain a 0-sized buffer and the function returns
Gst.FlowReturn.OK
.When this function is called with a -1 offset, the sequentially next buffer of length length in the stream is returned.
When this function is called with a -1 length, a buffer with a default optimal length is returned in buffer. The length might depend on the value of offset.
- Gst.PadIterIntLinkFunction(pad, parent)¶
- Parameters:
parent (
Gst.Object
orNone
) – the parent of pad. If theGst.PadFlags.NEED_PARENT
flag is set, parent is guaranteed to be not-None
and remain valid during the execution of this function.
- Returns:
a new
Gst.Iterator
that will iterate over all pads that are linked to the given pad on the inside of the parent element.the caller must call
Gst.Iterator.free
() after usage.- Return type:
The signature of the internal pad link iterator function.
- Gst.PadLinkFunction(pad, parent, peer)¶
- Parameters:
parent (
Gst.Object
orNone
) – the parent of pad. If theGst.PadFlags.NEED_PARENT
flag is set, parent is guaranteed to be not-None
and remain valid during the execution of this function.
- Returns:
the result of the link with the specified peer.
- Return type:
Function signature to handle a new link on the pad.
- Gst.PadProbeCallback(pad, info, *user_data)¶
- Parameters:
info (
Gst.PadProbeInfo
) –Gst.PadProbeInfo
user_data (
object
orNone
) – theobject
to optional user data.
- Returns:
- Return type:
Callback used by
Gst.Pad.add_probe
(). Gets called to notify about the current blocking type.The callback is allowed to modify the data pointer in info.
- Gst.PadQueryFunction(pad, parent, query)¶
- Parameters:
parent (
Gst.Object
orNone
) – the parent of pad. If theGst.PadFlags.NEED_PARENT
flag is set, parent is guaranteed to be not-None
and remain valid during the execution of this function.
- Returns:
True
if the query could be performed.- Return type:
The signature of the query function.
- Gst.PadStickyEventsForeachFunction(pad, event, *user_data)¶
- Parameters:
- Returns:
True
if the iteration should continue- Return type:
Callback used by
Gst.Pad.sticky_events_foreach
().When this function returns
True
, the next event will be returned. WhenFalse
is returned,Gst.Pad.sticky_events_foreach
() will return.When event is set to
None
, the item will be removed from the list of sticky events. event can be replaced by assigning a new reference to it. This function is responsible for unreffing the old event when removing or modifying.
- Gst.PadUnlinkFunction(pad, parent)¶
- Parameters:
parent (
Gst.Object
orNone
) – the parent of pad. If theGst.PadFlags.NEED_PARENT
flag is set, parent is guaranteed to be not-None
and remain valid during the execution of this function.
Function signature to handle a unlinking the pad prom its peer.
The pad’s lock is already held when the unlink function is called, so most pad functions cannot be called from within the callback.
- Gst.PluginFeatureFilter(feature, *user_data)¶
- Parameters:
feature (
Gst.PluginFeature
) – the pluginfeature to checkuser_data (
object
orNone
) – the user_data that has been passed on e.g.Gst.Registry.feature_filter
()
- Returns:
- Return type:
A function that can be used with e.g.
Gst.Registry.feature_filter
() to get a list of pluginfeature that match certain criteria.
- Gst.PluginFilter(plugin, *user_data)¶
- Parameters:
plugin (
Gst.Plugin
) – the plugin to checkuser_data (
object
orNone
) – the user_data that has been passed on e.g.Gst.Registry.plugin_filter
()
- Returns:
- Return type:
A function that can be used with e.g.
Gst.Registry.plugin_filter
() to get a list of plugins that match certain criteria.
- Gst.PluginInitFullFunc(plugin, *user_data)¶
- Parameters:
plugin (
Gst.Plugin
) – The plugin object
- Returns:
True
if plugin initialised successfully- Return type:
A plugin should provide a pointer to a function of either
Gst.PluginInitFunc
or this type in the plugin_desc struct. The function will be called by the loader at startup. One would then register eachGst.PluginFeature
. This version allows user data to be passed to init function (useful for bindings).
- Gst.PluginInitFunc(plugin)¶
- Parameters:
plugin (
Gst.Plugin
) – The plugin object- Returns:
True
if plugin initialised successfully- Return type:
A plugin should provide a pointer to a function of this type in the plugin_desc struct. This function will be called by the loader at startup. One would then register each
Gst.PluginFeature
.
- Gst.PromiseChangeFunc(promise, *user_data)¶
- Parameters:
promise (
Gst.Promise
) – aGst.Promise
New in version 1.14.
- Gst.StructureFilterMapFunc(field_id, value, *user_data)¶
- Parameters:
field_id (
int
) – the #GQuark of the field namevalue (
GObject.Value
) – theGObject.Value
of the field
- Returns:
True
if the field should be preserved,False
if it should be removed.- Return type:
A function that will be called in
Gst.Structure.filter_and_map_in_place
(). The function may modify value, and the value will be removed from the structure ifFalse
is returned.
- Gst.StructureForeachFunc(field_id, value, *user_data)¶
- Parameters:
field_id (
int
) – the #GQuark of the field namevalue (
GObject.Value
) – theGObject.Value
of the field
- Returns:
True
if the foreach operation should continue,False
if the foreach operation should stop withFalse
.- Return type:
A function that will be called in
Gst.Structure.foreach
(). The function may not modify value.
- Gst.StructureMapFunc(field_id, value, *user_data)¶
- Parameters:
field_id (
int
) – the #GQuark of the field namevalue (
GObject.Value
) – theGObject.Value
of the field
- Returns:
True
if the map operation should continue,False
if the map operation should stop withFalse
.- Return type:
A function that will be called in
Gst.Structure.map_in_place
(). The function may modify value.
- Gst.TagForeachFunc(list, tag, *user_data)¶
- Parameters:
list (
Gst.TagList
) – theGst.TagList
tag (
str
) – a name of a tag in list
A function that will be called in
Gst.TagList.foreach
(). The function may not modify the tag list.
- Gst.TagMergeFunc(dest, src)¶
- Parameters:
dest (
GObject.Value
) – the destinationGObject.Value
src (
GObject.Value
) – the sourceGObject.Value
A function for merging multiple values of a tag used when registering tags.
- Gst.TaskFunction(*user_data)¶
-
A function that will repeatedly be called in the thread created by a
Gst.Task
.
- Gst.TaskPoolFunction(*user_data)¶
-
Task function, see
Gst.TaskPool.push
().
- Gst.TaskThreadFunc(task, thread, *user_data)¶
- Parameters:
thread (
GLib.Thread
) – TheGLib.Thread
Custom
Gst.Task
thread callback functions that can be installed.
- Gst.TypeFindFunction(find, *user_data)¶
- Parameters:
find (
Gst.TypeFind
) – AGst.TypeFind
structureuser_data (
object
orNone
) – optional data to pass to the function
A function that will be called by typefinding.
- Gst.ValueCompareFunc(value1, value2)¶
- Parameters:
value1 (
GObject.Value
) – first value for comparisonvalue2 (
GObject.Value
) – second value for comparison
- Returns:
one of
Gst.VALUE_LESS_THAN
,Gst.VALUE_EQUAL
,Gst.VALUE_GREATER_THAN
orGst.VALUE_UNORDERED
- Return type:
Used together with
Gst.value_compare
() to compareGObject.Value
items.
- Gst.ValueDeserializeFunc(dest, s)¶
- Parameters:
dest (
GObject.Value
) – aGObject.Value
s (
str
) – a string
- Returns:
True
for success- Return type:
Used by
Gst.value_deserialize
() to parse a non-binary form into theGObject.Value
.
- Gst.ValueDeserializeWithPSpecFunc(dest, s, pspec)¶
- Parameters:
dest (
GObject.Value
) – aGObject.Value
s (
str
) – a stringpspec (
GObject.ParamSpec
) – aGObject.ParamSpec
describing the expected value
- Returns:
True
for success- Return type:
Used by
Gst.value_deserialize_with_pspec
() to parse a non-binary form into theGObject.Value
.New in version 1.20.
- Gst.ValueSerializeFunc(value1)¶
- Parameters:
value1 (
GObject.Value
) – aGObject.Value
- Returns:
the string representation of the value
- Return type:
Used by
Gst.value_serialize
() to obtain a non-binary form of theGObject.Value
.Free-function:
GLib.free