Functions¶
Details¶
- Gst.buffer_get_max_memory()[source]¶
- Returns:
the maximum amount of memory blocks that a buffer can hold.
- Return type:
Gets the maximum amount of memory blocks that a buffer can hold. This is a compile time constant that can be queried with the function.
When more memory blocks are added, existing memory blocks will be merged together to make room for the new block.
New in version 1.2.
- Gst.caps_features_from_string(features)[source]¶
- Parameters:
features (
str
) – a string representation of aGst.CapsFeatures
.- Returns:
a new
Gst.CapsFeatures
orNone
when the string could not be parsed.- Return type:
Creates a
Gst.CapsFeatures
from a string representation.New in version 1.2.
- Gst.caps_from_string(string)[source]¶
- Parameters:
- Returns:
a newly allocated
Gst.Caps
- Return type:
Converts caps from a string representation.
The implementation of serialization up to 1.20 would lead to unexpected results when there were nested
Gst.Caps
/Gst.Structure
deeper than one level.
- Gst.debug_add_log_function(func, *user_data)[source]¶
- Parameters:
func (
Gst.LogFunction
) – the function to use
Adds the logging function to the list of logging functions. Be sure to use #G_GNUC_NO_INSTRUMENT on that function, it is needed.
- Gst.debug_add_ring_buffer_logger(max_size_per_thread, thread_timeout)[source]¶
- Parameters:
Adds a memory ringbuffer based debug logger that stores up to max_size_per_thread bytes of logs per thread and times out threads after thread_timeout seconds of inactivity.
Logs can be fetched with
Gst.debug_ring_buffer_logger_get_logs
() and the logger can be removed again withGst.debug_remove_ring_buffer_logger
(). Only one logger at a time is possible.New in version 1.14.
- Gst.debug_bin_to_dot_data(bin, details)[source]¶
- Parameters:
bin (
Gst.Bin
) – the top-level pipeline that should be analyzeddetails (
Gst.DebugGraphDetails
) – type ofGst.DebugGraphDetails
to use
- Returns:
a string containing the pipeline in graphviz dot format.
- Return type:
To aid debugging applications one can use this method to obtain the whole network of gstreamer elements that form the pipeline into a dot file. This data can be processed with graphviz to get an image.
- Gst.debug_bin_to_dot_file(bin, details, file_name)[source]¶
- Parameters:
bin (
Gst.Bin
) – the top-level pipeline that should be analyzeddetails (
Gst.DebugGraphDetails
) – type ofGst.DebugGraphDetails
to usefile_name (
str
) – output base filename (e.g. “myplayer”)
To aid debugging applications one can use this method to write out the whole network of gstreamer elements that form the pipeline into a dot file. This file can be processed with graphviz to get an image.
- `` shell
dot -Tpng -oimage.png graph_lowlevel.dot
- Gst.debug_bin_to_dot_file_with_ts(bin, details, file_name)[source]¶
- Parameters:
bin (
Gst.Bin
) – the top-level pipeline that should be analyzeddetails (
Gst.DebugGraphDetails
) – type ofGst.DebugGraphDetails
to usefile_name (
str
) – output base filename (e.g. “myplayer”)
This works like
Gst.debug_bin_to_dot_file
(), but adds the current timestamp to the filename, so that it can be used to take multiple snapshots.
- Gst.debug_construct_term_color(colorinfo)[source]¶
- Parameters:
colorinfo (
int
) – the color info- Returns:
a string containing the color definition
- Return type:
Constructs a string that can be used for getting the desired color in color terminals. You need to free the string after use.
- Gst.debug_construct_win_color(colorinfo)[source]¶
- Parameters:
colorinfo (
int
) – the color info- Returns:
an integer containing the color definition
- Return type:
Constructs an integer that can be used for getting the desired color in windows’ terminals (cmd.exe). As there is no mean to underline, we simply ignore this attribute.
This function returns 0 on non-windows machines.
- Gst.debug_get_all_categories()[source]¶
- Returns:
the list of debug categories
- Return type:
Returns a snapshot of a all categories that are currently in use . This list may change anytime. The caller has to free the list after use.
- Gst.debug_get_color_mode()[source]¶
- Returns:
see GstDebugColorMode for possible values.
- Return type:
Changes the coloring mode for debug output.
New in version 1.2.
- Gst.debug_get_default_threshold()[source]¶
- Returns:
the default threshold level
- Return type:
Returns the default threshold that is used for new categories.
- Gst.debug_get_stack_trace(flags)[source]¶
- Parameters:
flags (
Gst.StackTraceFlags
) – A set ofGst.StackTraceFlags
to determine how the stack trace should look like. PassGst.StackTraceFlags.NONE
to retrieve a minimal backtrace.- Returns:
a stack trace, if libunwind or glibc backtrace are present, else
None
.- Return type:
New in version 1.12.
- Gst.debug_level_get_name(level)[source]¶
- Parameters:
level (
Gst.DebugLevel
) – the level to get the name for- Returns:
the name
- Return type:
Get the string representation of a debugging level
- Gst.debug_log_default(category, level, file, function, line, object, message, user_data)[source]¶
- Parameters:
category (
Gst.DebugCategory
) – category to loglevel (
Gst.DebugLevel
) – level of the messagefile (
str
) – the file that emitted the message, usually the __FILE__ identifierfunction (
str
) – the function that emitted the messageline (
int
) – the line from that the message was emitted, usually __LINE__object (
GObject.Object
orNone
) – the object this message relates to, orNone
if nonemessage (
Gst.DebugMessage
) – the actual message
The default logging handler used by GStreamer. Logging functions get called whenever a macro like GST_DEBUG or similar is used. By default this function is setup to output the message and additional info to stderr (or the log file specified via the GST_DEBUG_FILE environment variable) as received via user_data.
You can add other handlers by using
Gst.debug_add_log_function
(). And you can remove this handler by callingGst.debug_remove_log_function
(Gst.debug_log_default
);
- Gst.debug_log_get_line(category, level, file, function, line, object, message)[source]¶
- Parameters:
category (
Gst.DebugCategory
) – category to loglevel (
Gst.DebugLevel
) – level of the messagefile (
str
) – the file that emitted the message, usually the __FILE__ identifierfunction (
str
) – the function that emitted the messageline (
int
) – the line from that the message was emitted, usually __LINE__object (
GObject.Object
orNone
) – the object this message relates to, orNone
if nonemessage (
Gst.DebugMessage
) – the actual message
- Return type:
Returns the string representation for the specified debug log message formatted in the same way as
Gst.debug_log_default
() (the default handler), without color. The purpose is to make it easy for custom log output handlers to get a log output that is identical to what the default handler would write out.New in version 1.18.
- Gst.debug_log_id_literal(category, level, file, function, line, id, message_string)[source]¶
- Parameters:
category (
Gst.DebugCategory
) – category to loglevel (
Gst.DebugLevel
) – level of the message is infile (
str
) – the file that emitted the message, usually the __FILE__ identifierfunction (
str
) – the function that emitted the messageline (
int
) – the line from that the message was emitted, usually __LINE__id (
str
orNone
) – the identifier of the object this message relates to orNone
if nonemessage_string (
str
) – a message string
Logs the given message using the currently registered debugging handlers.
New in version 1.22.
- Gst.debug_log_literal(category, level, file, function, line, object, message_string)[source]¶
- Parameters:
category (
Gst.DebugCategory
) – category to loglevel (
Gst.DebugLevel
) – level of the message is infile (
str
) – the file that emitted the message, usually the __FILE__ identifierfunction (
str
) – the function that emitted the messageline (
int
) – the line from that the message was emitted, usually __LINE__object (
GObject.Object
orNone
) – the object this message relates to, orNone
if nonemessage_string (
str
) – a message string
Logs the given message using the currently registered debugging handlers.
New in version 1.20.
- Gst.debug_print_stack_trace()[source]¶
If libunwind, glibc backtrace or DbgHelp are present a stack trace is printed.
- Gst.debug_remove_log_function(func)[source]¶
- Parameters:
func (
Gst.LogFunction
orNone
) – the log function to remove, orNone
to remove the default log function- Returns:
How many instances of the function were removed
- Return type:
Removes all registered instances of the given logging functions.
- Gst.debug_remove_log_function_by_data(data)[source]¶
- Parameters:
data (
object
orNone
) – user data of the log function to remove- Returns:
How many instances of the function were removed
- Return type:
Removes all registered instances of log functions with the given user data.
- Gst.debug_remove_ring_buffer_logger()[source]¶
Removes any previously added ring buffer logger with
Gst.debug_add_ring_buffer_logger
().New in version 1.14.
- Gst.debug_ring_buffer_logger_get_logs()[source]¶
-
Fetches the current logs per thread from the ring buffer logger. See
Gst.debug_add_ring_buffer_logger
() for details.New in version 1.14.
- Gst.debug_set_active(active)[source]¶
- Parameters:
active (
bool
) – Whether to use debugging output or not
If activated, debugging messages are sent to the debugging handlers. It makes sense to deactivate it for speed issues.
This function is not threadsafe. It makes sense to only call it during initialization.
- Gst.debug_set_color_mode(mode)[source]¶
- Parameters:
mode (
Gst.DebugColorMode
) – The coloring mode for debug output. See GstDebugColorMode.
Changes the coloring mode for debug output.
This function may be called before
Gst.init
().New in version 1.2.
- Gst.debug_set_color_mode_from_string(mode)[source]¶
- Parameters:
mode (
str
) – The coloring mode for debug output. One of the following: “on”, “auto”, “off”, “disable”, “unix”.
Changes the coloring mode for debug output.
This function may be called before
Gst.init
().New in version 1.2.
- Gst.debug_set_colored(colored)[source]¶
- Parameters:
colored (
bool
) – Whether to use colored output or not
Sets or unsets the use of coloured debugging output. Same as
Gst.debug_set_color_mode
() with the argument being beingGst.DebugColorMode.ON
orGst.DebugColorMode.OFF
.This function may be called before
Gst.init
().
- Gst.debug_set_default_threshold(level)[source]¶
- Parameters:
level (
Gst.DebugLevel
) – level to set
Sets the default threshold to the given level and updates all categories to use this threshold.
This function may be called before
Gst.init
().
- Gst.debug_set_threshold_for_name(name, level)[source]¶
- Parameters:
name (
str
) – name of the categories to setlevel (
Gst.DebugLevel
) – level to set them to
Sets all categories which match the given glob style pattern to the given level.
- Gst.debug_set_threshold_from_string(list, reset)[source]¶
- Parameters:
Sets the debug logging wanted in the same form as with the GST_DEBUG environment variable. You can use wildcards such as
*
, but note that the order matters when you use wild cards, e.g.foosrc:6,*src:3,*:2
sets everything to log level 2.New in version 1.2.
- Gst.debug_unset_threshold_for_name(name)[source]¶
- Parameters:
name (
str
) – name of the categories to set
Resets all categories with the given name back to the default level.
- Gst.deinit()[source]¶
Clean up any resources created by GStreamer in
Gst.init
().It is normally not needed to call this function in a normal application as the resources will automatically be freed when the program terminates. This function is therefore mostly used by testsuites and other memory profiling tools.
After this call GStreamer (including this method) should not be used anymore.
- Gst.dynamic_type_register(plugin, type)[source]¶
- Parameters:
plugin (
Gst.Plugin
) – TheGst.Plugin
to register dyn_type fortype (
GObject.GType
) – TheGObject.GType
to register dynamically
- Return type:
Registers a new
Gst.DynamicTypeFactory
in the registryNew in version 1.12.
- Gst.error_get_message(domain, code)[source]¶
- Parameters:
- Returns:
a newly allocated string describing the error message (in UTF-8 encoding)
- Return type:
Get a string describing the error message in the current locale.
- Gst.event_type_get_flags(type)[source]¶
- Parameters:
type (
Gst.EventType
) – aGst.EventType
- Returns:
- Return type:
Gets the
Gst.EventTypeFlags
associated with type.
- Gst.event_type_get_name(type)[source]¶
- Parameters:
type (
Gst.EventType
) – the event type- Returns:
a reference to the static name of the event.
- Return type:
Get a printable name for the given event type. Do not modify or free.
- Gst.event_type_to_quark(type)[source]¶
- Parameters:
type (
Gst.EventType
) – the event type- Returns:
the quark associated with the event type
- Return type:
Get the unique quark for the given event type.
- Gst.event_type_to_sticky_ordering(type)[source]¶
- Parameters:
type (
Gst.EventType
) – aGst.EventType
- Returns:
an unsigned integer
- Return type:
Converts the
Gst.EventType
to an unsigned integer that represents the ordering of sticky events when re-sending them. A lower value represents a higher-priority event.New in version 1.22.
- Gst.filename_to_uri(filename)[source]¶
- Parameters:
filename (
str
) – absolute or relative file name path- Raises:
- Returns:
newly-allocated URI string, or
None
on error. The caller must free the URI string withGLib.free
() when no longer needed.- Return type:
Similar to
GLib.filename_to_uri
(), but attempts to handle relative file paths as well. Before converting filename into an URI, it will be prefixed by the current working directory if it is a relative path, and then the path will be canonicalised so that it doesn’t contain any ‘./’ or ‘../’ segments.On Windows filename should be in UTF-8 encoding.
- Gst.flow_get_name(ret)[source]¶
- Parameters:
ret (
Gst.FlowReturn
) – aGst.FlowReturn
to get the name of.- Returns:
a static string with the name of the flow return.
- Return type:
Gets a string representing the given flow return.
- Gst.flow_to_quark(ret)[source]¶
- Parameters:
ret (
Gst.FlowReturn
) – aGst.FlowReturn
to get the quark of.- Returns:
the quark associated with the flow return or 0 if an invalid return was specified.
- Return type:
Get the unique quark for the given
Gst.FlowReturn
.
- Gst.format_get_by_nick(nick)[source]¶
- Parameters:
nick (
str
) – The nick of the format- Returns:
The format with nick or
Gst.Format.UNDEFINED
if the format was not registered.- Return type:
Return the format registered with the given nick.
- Gst.format_get_details(format)[source]¶
- Parameters:
format (
Gst.Format
) – The format to get details of- Returns:
The
Gst.FormatDefinition
for format orNone
on failure.MT safe.
- Return type:
Get details about the given format.
- Gst.format_get_name(format)[source]¶
- Parameters:
format (
Gst.Format
) – aGst.Format
- Returns:
a reference to the static name of the format or
None
if the format is unknown.- Return type:
Get a printable name for the given format. Do not modify or free.
- Gst.format_iterate_definitions()[source]¶
- Returns:
- Return type:
Iterate all the registered formats. The format definition is read only.
- Gst.format_register(nick, description)[source]¶
- Parameters:
- Returns:
A new
Gst.Format
or an already registered format with the same nick.MT safe.
- Return type:
Create a new
Gst.Format
based on the nick or return an already registered format with that nick.
- Gst.format_to_quark(format)[source]¶
- Parameters:
format (
Gst.Format
) – aGst.Format
- Returns:
the quark associated with the format or 0 if the format is unknown.
- Return type:
Get the unique quark for the given format.
- Gst.formats_contains(formats, format)[source]¶
- Parameters:
formats ([
Gst.Format
]) – The format array to searchformat (
Gst.Format
) – the format to find
- Returns:
True
if the format is found inside the array- Return type:
See if the given format is inside the format array.
- Gst.get_main_executable_path()[source]¶
- Returns:
The path of the executable that initialized GStreamer, or
None
if it could not be determined.- Return type:
This helper is mostly helpful for plugins that need to inspect the folder of the main executable to determine their set of features.
When a plugin is initialized from the gst-plugin-scanner external process, the returned path will be the same as from the parent process.
New in version 1.14.
- Gst.init(argv)[source]¶
- Parameters:
- Returns:
pointer to application’s argv
- Return type:
argv: [
str
]
Initializes the GStreamer library, setting up internal path lists, registering built-in elements, and loading standard plugins.
Unless the plugin registry is disabled at compile time, the registry will be loaded. By default this will also check if the registry cache needs to be updated and rescan all plugins if needed. See
Gst.update_registry
() for details and section‘Running GStreamer Applications [gst-running]’ for how to disable automatic registry updates.
WARNING: This function will terminate your program if it was unable to initialize GStreamer for some reason. If you want your program to fall back, use
Gst.init_check
() instead.
- Gst.init_check(argv)[source]¶
- Parameters:
- Raises:
- Returns:
True
if GStreamer could be initialized.- argv:
pointer to application’s argv
- Return type:
Initializes the GStreamer library, setting up internal path lists, registering built-in elements, and loading standard plugins.
This function will return
False
if GStreamer could not be initialized for some reason. If you want your program to fail fatally, useGst.init
() instead.
- Gst.is_caps_features(obj)[source]¶
- Parameters:
- Returns:
True
if obj is aGst.CapsFeatures
False
otherwise- Return type:
Checks if obj is a
Gst.CapsFeatures
- Gst.is_initialized()[source]¶
-
Use this function to check if GStreamer has been initialized with
Gst.init
() orGst.init_check
().
- Gst.message_type_get_name(type)[source]¶
- Parameters:
type (
Gst.MessageType
) – the message type- Returns:
a reference to the static name of the message.
- Return type:
Get a printable name for the given message type. Do not modify or free.
- Gst.message_type_to_quark(type)[source]¶
- Parameters:
type (
Gst.MessageType
) – the message type- Returns:
the quark associated with the message type
- Return type:
Get the unique quark for the given message type.
- Gst.meta_api_type_get_tags(api)[source]¶
- Parameters:
api (
GObject.GType
) – an API- Returns:
an array of tags as strings.
- Return type:
[
str
]
New in version 1.2.
- Gst.meta_api_type_has_tag(api, tag)[source]¶
- Parameters:
api (
GObject.GType
) – an APItag (
int
) – the tag to check
- Returns:
True
if api was registered with tag.- Return type:
Check if api was registered with tag.
- Gst.meta_api_type_register(api, tags)[source]¶
- Parameters:
- Returns:
a unique
GObject.GType
for api.- Return type:
Register and return a
GObject.GType
for the api and associate it with tags.
- Gst.meta_deserialize(buffer, data, size)[source]¶
- Parameters:
buffer (
Gst.Buffer
) – aGst.Buffer
data (
int
) – serialization data obtained fromGst.Meta.serialize
()size (
int
) – size of data
- Returns:
the metadata owned by buffer, or
None
.- consumed:
total size used by this meta, could be less than size
- Return type:
Recreate a
Gst.Meta
from serialized data returned byGst.Meta.serialize
() and add it to buffer.Note that the meta must have been previously registered by calling one of
gst_*_meta_get_info ()
functions.consumed is set to the number of bytes that can be skipped from data to find the next meta serialization, if any. In case of parsing error that does not allow to determine that size, consumed is set to 0.
New in version 1.24.
- Gst.meta_get_info(impl)[source]¶
- Parameters:
impl (
str
) – the name- Returns:
a
Gst.MetaInfo
with impl, orNone
when no such metainfo exists.- Return type:
Gst.MetaInfo
orNone
Lookup a previously registered meta info structure by its implementation name impl.
- Gst.meta_register_custom(name, tags, transform_func, *user_data)[source]¶
- Parameters:
tags ([
str
]) – tags for apitransform_func (
Gst.CustomMetaTransformFunction
orNone
) – aGst.MetaTransformFunction
user_data (
object
orNone
) – user data passed to transform_func
- Returns:
a
Gst.MetaInfo
that can be used to access metadata.- Return type:
Register a new custom
Gst.Meta
implementation, backed by an opaque structure holding aGst.Structure
.The registered info can be retrieved later with
Gst.Meta.get_info
() by using name as the key.The backing
Gst.Structure
can be retrieved withGst.CustomMeta.get_structure
(), its mutability is conditioned by the writability of the buffer the meta is attached to.When transform_func is
None
, the meta and its backingGst.Structure
will always be copied when the transform operation is copy, other operations are discarded, copy regions are ignored.New in version 1.20.
- Gst.meta_register_custom_simple(name)[source]¶
- Parameters:
- Returns:
a
Gst.MetaInfo
that can be used to access metadata.- Return type:
Simplified version of
Gst.Meta.register_custom
(), with no tags and no transform function.New in version 1.24.
- Gst.mini_object_replace(olddata, newdata)[source]¶
- Parameters:
olddata (
Gst.MiniObject
orNone
) – pointer to a pointer to a mini-object to be replacednewdata (
Gst.MiniObject
orNone
) – pointer to new mini-object
- Returns:
True
if newdata was different from olddata- olddata:
pointer to a pointer to a mini-object to be replaced
- Return type:
(
bool
, olddata:Gst.MiniObject
orNone
)
Atomically modifies a pointer to point to a new mini-object. The reference count of olddata is decreased and the reference count of newdata is increased.
Either newdata and the value pointed to by olddata may be
None
.
- Gst.mini_object_take(olddata, newdata)[source]¶
- Parameters:
olddata (
Gst.MiniObject
) – pointer to a pointer to a mini-object to be replacednewdata (
Gst.MiniObject
) – pointer to new mini-object
- Returns:
True
if newdata was different from olddata- olddata:
pointer to a pointer to a mini-object to be replaced
- Return type:
(
bool
, olddata:Gst.MiniObject
)
Modifies a pointer to point to a new mini-object. The modification is done atomically. This version is similar to
Gst.MiniObject.replace
() except that it does not increase the refcount of newdata and thus takes ownership of newdata.Either newdata and the value pointed to by olddata may be
None
.
- Gst.pad_mode_get_name(mode)[source]¶
- Parameters:
mode (
Gst.PadMode
) – the pad mode- Returns:
short mnemonic for pad mode mode
- Return type:
Return the name of a pad mode, for use in debug messages mostly.
- Gst.param_spec_array(name, nick, blurb, element_spec, flags)[source]¶
- Parameters:
name (
str
) – canonical name of the property specifiednick (
str
) – nick name for the property specifiedblurb (
str
) – description of the property specifiedelement_spec (
GObject.ParamSpec
) –GObject.ParamSpec
of the arrayflags (
GObject.ParamFlags
) – flags for the property specified
- Returns:
a newly created parameter specification
- Return type:
This function creates a GstArray
GObject.ParamSpec
for use by objects/elements that want to expose properties of GstArray type. This function is typically * used in connection withGObject.ObjectClass.install_property
() in a GObjects’s instance_init function.New in version 1.14.
- Gst.param_spec_fraction(name, nick, blurb, min_num, min_denom, max_num, max_denom, default_num, default_denom, flags)[source]¶
- Parameters:
name (
str
) – canonical name of the property specifiednick (
str
) – nick name for the property specifiedblurb (
str
) – description of the property specifiedmin_num (
int
) – minimum value (fraction numerator)min_denom (
int
) – minimum value (fraction denominator)max_num (
int
) – maximum value (fraction numerator)max_denom (
int
) – maximum value (fraction denominator)default_num (
int
) – default value (fraction numerator)default_denom (
int
) – default value (fraction denominator)flags (
GObject.ParamFlags
) – flags for the property specified
- Returns:
a newly created parameter specification
- Return type:
This function creates a fraction
GObject.ParamSpec
for use by objects/elements that want to expose properties of fraction type. This function is typically used in connection withGObject.ObjectClass.install_property
() in a GObjects’s instance_init function.
- Gst.parent_buffer_meta_get_info()[source]¶
- Returns:
The
Gst.MetaInfo
- Return type:
Gets the global
Gst.MetaInfo
describing theGst.ParentBufferMeta
meta.New in version 1.6.
- Gst.parse_bin_from_description(bin_description, ghost_unlinked_pads)[source]¶
- Parameters:
- Raises:
- Returns:
a newly-created bin, or
None
if an error occurred.- Return type:
This is a convenience wrapper around
Gst.parse_launch
() to create aGst.Bin
from a gst-launch-style pipeline description. SeeGst.parse_launch
() and the gst-launch man page for details about the syntax. Ghost pads on the bin for unlinked source or sink pads within the bin can automatically be created (but only a maximum of one ghost pad for each direction will be created; if you expect multiple unlinked source pads or multiple unlinked sink pads and want them all ghosted, you will have to create the ghost pads yourself).
- Gst.parse_bin_from_description_full(bin_description, ghost_unlinked_pads, context, flags)[source]¶
- Parameters:
bin_description (
str
) – command line describing the binghost_unlinked_pads (
bool
) – whether to automatically create ghost pads for unlinked source or sink pads within the bincontext (
Gst.ParseContext
orNone
) – a parse context allocated withGst.ParseContext.new
(), orNone
flags (
Gst.ParseFlags
) – parsing options, orGst.ParseFlags.NONE
- Raises:
- Returns:
a newly-created element, which is guaranteed to be a bin unless
Gst.ParseFlags.NO_SINGLE_ELEMENT_BINS
was passed, orNone
if an error occurred.- Return type:
This is a convenience wrapper around
Gst.parse_launch
() to create aGst.Bin
from a gst-launch-style pipeline description. SeeGst.parse_launch
() and the gst-launch man page for details about the syntax. Ghost pads on the bin for unlinked source or sink pads within the bin can automatically be created (but only a maximum of one ghost pad for each direction will be created; if you expect multiple unlinked source pads or multiple unlinked sink pads and want them all ghosted, you will have to create the ghost pads yourself).
- Gst.parse_error_quark()[source]¶
- Returns:
the quark of the parse errors.
- Return type:
Get the error quark used by the parsing subsystem.
- Gst.parse_launch(pipeline_description)[source]¶
- Parameters:
pipeline_description (
str
) – the command line describing the pipeline- Raises:
- Returns:
a new element on success,
None
on failure. If more than one toplevel element is specified by the pipeline_description, all elements are put into aGst.Pipeline
, which than is returned.- Return type:
Create a new pipeline based on command line syntax. Please note that you might get a return value that is not
None
even though the error is set. In this case there was a recoverable parsing error and you can try to play the pipeline.To create a sub-pipeline (bin) for embedding into an existing pipeline use
Gst.parse_bin_from_description
().
- Gst.parse_launch_full(pipeline_description, context, flags)[source]¶
- Parameters:
pipeline_description (
str
) – the command line describing the pipelinecontext (
Gst.ParseContext
orNone
) – a parse context allocated withGst.ParseContext.new
(), orNone
flags (
Gst.ParseFlags
) – parsing options, orGst.ParseFlags.NONE
- Raises:
- Returns:
a new element on success,
None
on failure. If more than one toplevel element is specified by the pipeline_description, all elements are put into aGst.Pipeline
, which then is returned (unless theGst.ParseFlags.PLACE_IN_BIN
flag is set, in which case they are put in aGst.Bin
instead).- Return type:
Create a new pipeline based on command line syntax. Please note that you might get a return value that is not
None
even though the error is set. In this case there was a recoverable parsing error and you can try to play the pipeline.To create a sub-pipeline (bin) for embedding into an existing pipeline use
Gst.parse_bin_from_description_full
().
- Gst.parse_launchv(argv)[source]¶
- Parameters:
argv ([
str
]) – null-terminated array of arguments- Raises:
- Returns:
a new element on success and
None
on failure.- Return type:
Create a new element based on command line syntax. error will contain an error message if an erroneous pipeline is specified. An error does not mean that the pipeline could not be constructed.
- Gst.parse_launchv_full(argv, context, flags)[source]¶
- Parameters:
argv ([
str
]) – null-terminated array of argumentscontext (
Gst.ParseContext
orNone
) – a parse context allocated withGst.ParseContext.new
(), orNone
flags (
Gst.ParseFlags
) – parsing options, orGst.ParseFlags.NONE
- Raises:
- Returns:
a new element on success; on failure, either
None
or a partially-constructed bin or element will be returned and error will be set (unless you passedGst.ParseFlags.FATAL_ERRORS
in flags, thenNone
will always be returned on failure)- Return type:
Create a new element based on command line syntax. error will contain an error message if an erroneous pipeline is specified. An error does not mean that the pipeline could not be constructed.
- Gst.plugin_error_quark()[source]¶
- Returns:
The error quark used in
GLib.Error
messages- Return type:
Get the error quark.
- Gst.preset_get_app_dir()[source]¶
-
Gets the directory for application specific presets if set by the application.
- Gst.preset_set_app_dir(app_dir)[source]¶
- Parameters:
app_dir (
str
) – the application specific preset dir- Returns:
- Return type:
Sets an extra directory as an absolute path that should be considered when looking for presets. Any presets in the application dir will shadow the system presets.
- Gst.protection_filter_systems_by_available_decryptors(system_identifiers)[source]¶
- Parameters:
system_identifiers ([
str
]) – A null terminated array of strings that contains the UUID values of each protection system that is to be checked.- Returns:
A null terminated array containing all the system_identifiers supported by the set of available decryptors, or
None
if no matches were found.- Return type:
Iterates the supplied list of UUIDs and checks the
Gst.Registry
for all the decryptors supporting one of the supplied UUIDs.New in version 1.14.
- Gst.protection_select_system(system_identifiers)[source]¶
- Parameters:
system_identifiers ([
str
]) – A null terminated array of strings that contains the UUID values of each protection system that is to be checked.- Returns:
One of the strings from system_identifiers that indicates the highest ranked element that implements the protection system indicated by that system ID, or
None
if no element has been found.- Return type:
Iterates the supplied list of UUIDs and checks the
Gst.Registry
for an element that supports one of the supplied UUIDs. If more than one element matches, the system ID of the highest ranked element is selected.New in version 1.6.
- Gst.query_type_get_flags(type)[source]¶
- Parameters:
type (
Gst.QueryType
) – aGst.QueryType
- Returns:
- Return type:
Gets the
Gst.QueryTypeFlags
associated with type.
- Gst.query_type_get_name(type)[source]¶
- Parameters:
type (
Gst.QueryType
) – the query type- Returns:
a reference to the static name of the query.
- Return type:
Get a printable name for the given query type. Do not modify or free.
- Gst.query_type_to_quark(type)[source]¶
- Parameters:
type (
Gst.QueryType
) – the query type- Returns:
the quark associated with the query type
- Return type:
Get the unique quark for the given query type.
- Gst.reference_timestamp_meta_get_info()[source]¶
- Returns:
The
Gst.MetaInfo
- Return type:
Gets the global
Gst.MetaInfo
describing theGst.ReferenceTimestampMeta
meta.New in version 1.14.
- Gst.segtrap_is_enabled()[source]¶
-
Some functions in the GStreamer core might install a custom SIGSEGV handler to better catch and report errors to the application. Currently this feature is enabled by default when loading plugins.
Applications might want to disable this behaviour with the
Gst.segtrap_set_enabled
() function. This is typically done if the application wants to install its own handler without GStreamer interfering.
- Gst.segtrap_set_enabled(enabled)[source]¶
- Parameters:
enabled (
bool
) – whether a custom SIGSEGV handler should be installed.
Applications might want to disable/enable the SIGSEGV handling of the GStreamer core. See
Gst.segtrap_is_enabled
() for more information.
- Gst.state_change_get_name(transition)[source]¶
- Parameters:
transition (
Gst.StateChange
) – aGst.StateChange
to get the name of.- Returns:
a string with the name of the state result.
- Return type:
Gets a string representing the given state transition.
New in version 1.14.
- Gst.stream_type_get_name(stype)[source]¶
- Parameters:
stype (
Gst.StreamType
) – aGst.StreamType
- Returns:
A string describing the stream type
- Return type:
Get a descriptive string for a given
Gst.StreamType
New in version 1.10.
- Gst.structure_take(oldstr_ptr, newstr)[source]¶
- Parameters:
oldstr_ptr (
Gst.Structure
orNone
) – pointer to a place of aGst.Structure
to takenewstr (
Gst.Structure
orNone
) – a newGst.Structure
- Returns:
True
if newstr was different from oldstr_ptr- oldstr_ptr:
pointer to a place of a
Gst.Structure
to take
- Return type:
(
bool
, oldstr_ptr:Gst.Structure
orNone
)
Atomically modifies a pointer to point to a new structure. The
Gst.Structure
oldstr_ptr is pointing to is freed and newstr is taken ownership over.Either newstr and the value pointed to by oldstr_ptr may be
None
.It is a programming error if both newstr and the value pointed to by oldstr_ptr refer to the same, non-
None
structure.New in version 1.18.
- Gst.tag_exists(tag)[source]¶
- Parameters:
tag (
str
) – name of the tag- Returns:
True
if the type is already registered- Return type:
Checks if the given type is already registered.
- Gst.tag_get_description(tag)[source]¶
- Parameters:
tag (
str
) – the tag- Returns:
the human-readable description of this tag
- Return type:
Returns the human-readable description of this tag, You must not change or free this string.
- Gst.tag_get_flag(tag)[source]¶
- Parameters:
tag (
str
) – the tag- Returns:
the flag of this tag.
- Return type:
Gets the flag of tag.
- Gst.tag_get_nick(tag)[source]¶
-
Returns the human-readable name of this tag, You must not change or free this string.
- Gst.tag_get_type(tag)[source]¶
- Parameters:
tag (
str
) – the tag- Returns:
the
GObject.GType
of this tag- Return type:
Gets the
GObject.GType
used for this tag.
- Gst.tag_is_fixed(tag)[source]¶
-
Checks if the given tag is fixed. A fixed tag can only contain one value. Unfixed tags can contain lists of values.
- Gst.tag_list_copy_value(list, tag)[source]¶
- Parameters:
list (
Gst.TagList
) – list to get the tag fromtag (
str
) – tag to read out
- Returns:
True
, if a value was copied,False
if the tag didn’t exist in the given list.- dest:
uninitialized
GObject.Value
to copy into
- Return type:
(
bool
, dest:GObject.Value
)
Copies the contents for the given tag into the value, merging multiple values into one if multiple values are associated with the tag. You must
GObject.Value.unset
() the value after use.
- Gst.tag_merge_strings_with_comma(src)[source]¶
- Parameters:
src (
GObject.Value
) –GObject.Value
to copy from- Returns:
uninitialized
GObject.Value
to store result in- Return type:
dest:
GObject.Value
This is a convenience function for the func argument of gst_tag_register(). It concatenates all given strings using a comma. The tag must be registered as a
GObject.TYPE_STRING
or this function will fail.
- Gst.tag_merge_use_first(src)[source]¶
- Parameters:
src (
GObject.Value
) –GObject.Value
to copy from- Returns:
uninitialized
GObject.Value
to store result in- Return type:
dest:
GObject.Value
This is a convenience function for the func argument of gst_tag_register(). It creates a copy of the first value from the list.
- Gst.toc_entry_type_get_nick(type)[source]¶
- Parameters:
type (
Gst.TocEntryType
) – aGst.TocEntryType
.- Returns:
Returns a human-readable string for type. This string is only for debugging purpose and should not be displayed in a user interface.
- Return type:
Converts type to a string representation.
- Gst.tracing_get_active_tracers()[source]¶
- Returns:
A
GLib.List
ofGst.Tracer
objects- Return type:
Get a list of all active tracer objects owned by the tracing framework for the entirety of the run-time of the process or till
Gst.deinit
() is called.New in version 1.18.
- Gst.tracing_register_hook(tracer, detail, func)[source]¶
- Parameters:
tracer (
Gst.Tracer
) – the tracerdetail (
str
) – the detailed hookfunc (
GObject.Callback
) – the callback
Register func to be called when the trace hook detail is getting invoked. Use
None
for detail to register to all hooks.New in version 1.8.
- Gst.type_find_register(plugin, name, rank, func, extensions, possible_caps, *data)[source]¶
- Parameters:
plugin (
Gst.Plugin
orNone
) – AGst.Plugin
, orNone
for a static typefind functionname (
str
) – The name for registeringrank (
int
) – The rank (or importance) of this typefind functionfunc (
Gst.TypeFindFunction
) – TheGst.TypeFindFunction
to useextensions (
str
orNone
) – Optional comma-separated list of extensions that could belong to this typepossible_caps (
Gst.Caps
orNone
) – Optionally the caps that could be returned when typefinding succeedsdata (
object
orNone
) – Optional user data. This user data must be available until the plugin is unloaded.
- Returns:
- Return type:
Registers a new typefind function to be used for typefinding. After registering this function will be available for typefinding. This function is typically called during an element’s plugin initialization.
- Gst.type_is_plugin_api(type)[source]¶
- Parameters:
type (
GObject.GType
) – aGObject.GType
- Returns:
True
if type is plugin API orFalse
otherwise.- flags:
What
Gst.PluginAPIFlags
the plugin was marked with
- Return type:
(
bool
, flags:Gst.PluginAPIFlags
)
Checks if type is plugin API. See
Gst.type_mark_as_plugin_api
() for details.New in version 1.18.
- Gst.type_mark_as_plugin_api(type, flags)[source]¶
- Parameters:
type (
GObject.GType
) – aGObject.GType
flags (
Gst.PluginAPIFlags
) – a set ofGst.PluginAPIFlags
to further inform cache generation.
Marks type as plugin API. This should be called in
class_init
of elements that expose new types (i.e. enums, flags or internal GObjects) via properties, signals or pad templates.Types exposed by plugins are not automatically added to the documentation as they might originate from another library and should in that case be documented via that library instead.
By marking a type as plugin API it will be included in the documentation of the plugin that defines it.
New in version 1.18.
- Gst.update_registry()[source]¶
- Returns:
True
if the registry has been updated successfully (does not imply that there were changes), otherwiseFalse
.- Return type:
Forces GStreamer to re-scan its plugin paths and update the default plugin registry.
Applications will almost never need to call this function, it is only useful if the application knows new plugins have been installed (or old ones removed) since the start of the application (or, to be precise, the first call to
Gst.init
()) and the application wants to make use of any newly-installed plugins without restarting the application.Applications should assume that the registry update is neither atomic nor thread-safe and should therefore not have any dynamic pipelines running (including the playbin and decodebin elements) and should also not create any elements or access the GStreamer registry while the update is in progress.
Note that this function may block for a significant amount of time.
- Gst.uri_construct(protocol, location)[source]¶
- Parameters:
- Returns:
a new string for this URI.
- Return type:
Constructs a URI for a given valid protocol and location.
Free-function:
GLib.free
Deprecated since version ???: Use GstURI instead.
- Gst.uri_from_string(uri)[source]¶
- Parameters:
uri (
str
) – The URI string to parse.- Returns:
- Return type:
Parses a URI string into a new
Gst.Uri
object. Will returnNone
if the URI cannot be parsed.New in version 1.6.
- Gst.uri_from_string_escaped(uri)[source]¶
- Parameters:
uri (
str
) – The URI string to parse.- Returns:
- Return type:
Parses a URI string into a new
Gst.Uri
object. Will returnNone
if the URI cannot be parsed. This is identical toGst.Uri.from_string
() except that the userinfo and fragment components of the URI will not be unescaped while parsing.Use this when you need to extract a username and password from the userinfo such as https://user:password`example`.com since either may contain a URI-escaped ‘:’ character.
Gst.Uri.from_string
() will unescape the entire userinfo component, which will make it impossible to know which ‘:’ delineates the username and password.The same applies to the fragment component of the URI, such as https://example.com/path#fragment which may contain a URI-escaped ‘#’.
New in version 1.18.
- Gst.uri_get_location(uri)[source]¶
- Parameters:
uri (
str
) – A URI string- Returns:
the location for this URI. Returns
None
if the URI isn’t valid. If the URI does not contain a location, an empty string is returned.- Return type:
Extracts the location out of a given valid URI, ie. the protocol and “://” are stripped from the URI, which means that the location returned includes the hostname if one is specified. The returned string must be freed using
GLib.free
().Free-function:
GLib.free
- Gst.uri_get_protocol(uri)[source]¶
-
Extracts the protocol out of a given valid URI. The returned string must be freed using
GLib.free
().
- Gst.uri_has_protocol(uri, protocol)[source]¶
- Parameters:
- Returns:
True
if the protocol matches.- Return type:
Checks if the protocol of a given valid URI matches protocol.
- Gst.uri_is_valid(uri)[source]¶
-
Tests if the given string is a valid URI identifier. URIs start with a valid scheme followed by “:” and maybe a string identifying the location.
- Gst.uri_join_strings(base_uri, ref_uri)[source]¶
- Parameters:
- Returns:
A string representing the percent-encoded join of the two URIs.
- Return type:
This is a convenience function to join two URI strings and return the result. The returned string should be
GLib.free
()’d after use.New in version 1.6.
- Gst.uri_protocol_is_supported(type, protocol)[source]¶
- Parameters:
type (
Gst.URIType
) – Whether to check for a source or a sinkprotocol (
str
) – Protocol that should be checked for (e.g. “http” or “smb”)
- Returns:
- Return type:
Checks if an element exists that supports the given URI protocol. Note that a positive return value does not imply that a subsequent call to
Gst.Element.make_from_uri
() is guaranteed to work.
- Gst.uri_protocol_is_valid(protocol)[source]¶
- Parameters:
protocol (
str
) – A string- Returns:
True
if the string is a valid protocol identifier,False
otherwise.- Return type:
Tests if the given string is a valid protocol identifier. Protocols must consist of alphanumeric characters, ‘+’, ‘-’ and ‘.’ and must start with a alphabetic character. See RFC 3986 Section 3.1.
- Gst.util_array_binary_search(array, num_elements, element_size, search_func, mode, search_data, *user_data)[source]¶
- Parameters:
num_elements (
int
) – number of elements in the arrayelement_size (
int
) – size of every element in bytessearch_func (
GLib.CompareDataFunc
) – function to compare two elements, search_data will always be passed as second argumentmode (
Gst.SearchMode
) – search mode that should be used
- Returns:
The address of the found element or
None
if nothing was found- Return type:
Searches inside array for search_data by using the comparison function search_func. array must be sorted ascending.
As search_data is always passed as second argument to search_func it’s not required that search_data has the same type as the array elements.
The complexity of this search function is O(log (num_elements)).
- Gst.util_double_to_fraction(src)[source]¶
- Parameters:
- Returns:
- Return type:
Transforms a
float
to a fraction and simplifies the result.
- Gst.util_dump_buffer(buf)[source]¶
- Parameters:
buf (
Gst.Buffer
) – aGst.Buffer
whose memory to dump
Dumps the buffer memory into a hex representation. Useful for debugging.
New in version 1.14.
- Gst.util_dump_mem(mem)[source]¶
- Parameters:
mem (
bytes
) – a pointer to the memory to dump
Dumps the memory block into a hex representation. Useful for debugging.
- Gst.util_filename_compare(a, b)[source]¶
- Parameters:
- Return type:
Compares the given filenames using natural ordering.
New in version 1.24.
- Gst.util_fraction_add(a_n, a_d, b_n, b_d)[source]¶
- Parameters:
- Returns:
- Return type:
Adds the fractions a_n/a_d and b_n/b_d and stores the result in res_n and res_d.
- Gst.util_fraction_compare(a_n, a_d, b_n, b_d)[source]¶
- Parameters:
- Returns:
-1 if a < b; 0 if a = b; 1 if a > b.
- Return type:
Compares the fractions a_n/a_d and b_n/b_d and returns -1 if a < b, 0 if a = b and 1 if a > b.
- Gst.util_fraction_multiply(a_n, a_d, b_n, b_d)[source]¶
- Parameters:
- Returns:
- Return type:
Multiplies the fractions a_n/a_d and b_n/b_d and stores the result in res_n and res_d.
- Gst.util_fraction_to_double(src_n, src_d)[source]¶
-
Transforms a fraction to a
float
.
- Gst.util_get_object_array(object, name)[source]¶
- Parameters:
object (
GObject.Object
) – the object to set the array toname (
str
) – the name of the property to set
- Returns:
- array:
a return
GObject.ValueArray
- Return type:
(
bool
, array:GObject.ValueArray
)
Get a property of type %GST_TYPE_ARRAY and transform it into a
GObject.ValueArray
. This allow language bindings to get GST_TYPE_ARRAY properties which are otherwise not an accessible type.New in version 1.12.
- Gst.util_get_timestamp()[source]¶
- Returns:
the timestamp
- Return type:
Get a timestamp as GstClockTime to be used for interval measurements. The timestamp should not be interpreted in any other way.
- Gst.util_greatest_common_divisor(a, b)[source]¶
- Parameters:
- Returns:
Greatest common divisor of a and b
- Return type:
Calculates the greatest common divisor of a and b.
- Gst.util_greatest_common_divisor_int64(a, b)[source]¶
- Parameters:
- Returns:
Greatest common divisor of a and b
- Return type:
Calculates the greatest common divisor of a and b.
- Gst.util_group_id_next()[source]¶
- Returns:
A constantly incrementing unsigned integer, which might overflow back to 0 at some point.
- Return type:
Return a constantly incrementing group id.
This function is used to generate a new group-id for the stream-start event.
This function never returns
Gst.GROUP_ID_INVALID
(which is 0)
- Gst.util_seqnum_compare(s1, s2)[source]¶
- Parameters:
- Returns:
A negative number if s1 is before s2, 0 if they are equal, or a positive number if s1 is after s2.
- Return type:
Compare two sequence numbers, handling wraparound.
The current implementation just returns (gint32)(s1 - s2).
- Gst.util_seqnum_next()[source]¶
- Returns:
A constantly incrementing 32-bit unsigned integer, which might overflow at some point. Use
Gst.util_seqnum_compare
() to make sure you handle wraparound correctly.- Return type:
Return a constantly incrementing sequence number.
This function is used internally to GStreamer to be able to determine which events and messages are “the same”. For example, elements may set the seqnum on a segment-done message to be the same as that of the last seek event, to indicate that event and the message correspond to the same segment.
This function never returns
Gst.SEQNUM_INVALID
(which is 0).
- Gst.util_set_object_arg(object, name, value)[source]¶
- Parameters:
object (
GObject.Object
) – the object to set the argument ofname (
str
) – the name of the argument to setvalue (
str
) – the string value to set
Converts the string value to the type of the objects argument and sets the argument with it.
Note that this function silently returns if object has no property named name or when value cannot be converted to the type of the property.
- Gst.util_set_object_array(object, name, array)[source]¶
- Parameters:
object (
GObject.Object
) – the object to set the array toname (
str
) – the name of the property to setarray (
GObject.ValueArray
) – aGObject.ValueArray
containing the values
- Return type:
Transfer a
GObject.ValueArray
to %GST_TYPE_ARRAY and set this value on the specified property name. This allow language bindings to set GST_TYPE_ARRAY properties which are otherwise not an accessible type.New in version 1.12.
- Gst.util_set_value_from_string(value_str)[source]¶
- Parameters:
value_str (
str
) – the string to get the value from- Returns:
the value to set
- Return type:
value:
GObject.Value
Converts the string to the type of the value and sets the value with it.
Note that this function is dangerous as it does not return any indication if the conversion worked or not.
- Gst.util_simplify_fraction(numerator, denominator, n_terms, threshold)[source]¶
- Parameters:
Calculates the simpler representation of numerator and denominator and update both values with the resulting simplified fraction.
Simplify a fraction using a simple continued fraction decomposition. The idea here is to convert fractions such as 333333/10000000 to 1/30 using 32 bit arithmetic only. The algorithm is not perfect and relies upon two arbitrary parameters to remove non-significative terms from the simple continued fraction decomposition. Using 8 and 333 for n_terms and threshold respectively seems to give nice results.
New in version 1.24.
- Gst.util_uint64_scale(val, num, denom)[source]¶
- Parameters:
- Returns:
val * num / denom. In the case of an overflow, this function returns
GObject.G_MAXUINT64
. If the result is not exactly representable as an integer it is truncated. See alsoGst.util_uint64_scale_round
(),Gst.util_uint64_scale_ceil
(),Gst.util_uint64_scale_int
(),Gst.util_uint64_scale_int_round
(),Gst.util_uint64_scale_int_ceil
().- Return type:
Scale val by the rational number num / denom, avoiding overflows and underflows and without loss of precision.
This function can potentially be very slow if val and num are both greater than
GObject.G_MAXUINT32
.
- Gst.util_uint64_scale_ceil(val, num, denom)[source]¶
- Parameters:
- Returns:
val * num / denom. In the case of an overflow, this function returns
GObject.G_MAXUINT64
. If the result is not exactly representable as an integer, it is rounded up. See alsoGst.util_uint64_scale
(),Gst.util_uint64_scale_round
(),Gst.util_uint64_scale_int
(),Gst.util_uint64_scale_int_round
(),Gst.util_uint64_scale_int_ceil
().- Return type:
Scale val by the rational number num / denom, avoiding overflows and underflows and without loss of precision.
This function can potentially be very slow if val and num are both greater than
GObject.G_MAXUINT32
.
- Gst.util_uint64_scale_int(val, num, denom)[source]¶
- Parameters:
- Returns:
val * num / denom. In the case of an overflow, this function returns
GObject.G_MAXUINT64
. If the result is not exactly representable as an integer, it is truncated. See alsoGst.util_uint64_scale_int_round
(),Gst.util_uint64_scale_int_ceil
(),Gst.util_uint64_scale
(),Gst.util_uint64_scale_round
(),Gst.util_uint64_scale_ceil
().- Return type:
Scale val by the rational number num / denom, avoiding overflows and underflows and without loss of precision. num must be non-negative and denom must be positive.
- Gst.util_uint64_scale_int_ceil(val, num, denom)[source]¶
- Parameters:
- Returns:
val * num / denom. In the case of an overflow, this function returns
GObject.G_MAXUINT64
. If the result is not exactly representable as an integer, it is rounded up. See alsoGst.util_uint64_scale_int
(),Gst.util_uint64_scale_int_round
(),Gst.util_uint64_scale
(),Gst.util_uint64_scale_round
(),Gst.util_uint64_scale_ceil
().- Return type:
Scale val by the rational number num / denom, avoiding overflows and underflows and without loss of precision. num must be non-negative and denom must be positive.
- Gst.util_uint64_scale_int_round(val, num, denom)[source]¶
- Parameters:
- Returns:
val * num / denom. In the case of an overflow, this function returns
GObject.G_MAXUINT64
. If the result is not exactly representable as an integer, it is rounded to the nearest integer (half-way cases are rounded up). See alsoGst.util_uint64_scale_int
(),Gst.util_uint64_scale_int_ceil
(),Gst.util_uint64_scale
(),Gst.util_uint64_scale_round
(),Gst.util_uint64_scale_ceil
().- Return type:
Scale val by the rational number num / denom, avoiding overflows and underflows and without loss of precision. num must be non-negative and denom must be positive.
- Gst.util_uint64_scale_round(val, num, denom)[source]¶
- Parameters:
- Returns:
val * num / denom. In the case of an overflow, this function returns
GObject.G_MAXUINT64
. If the result is not exactly representable as an integer, it is rounded to the nearest integer (half-way cases are rounded up). See alsoGst.util_uint64_scale
(),Gst.util_uint64_scale_ceil
(),Gst.util_uint64_scale_int
(),Gst.util_uint64_scale_int_round
(),Gst.util_uint64_scale_int_ceil
().- Return type:
Scale val by the rational number num / denom, avoiding overflows and underflows and without loss of precision.
This function can potentially be very slow if val and num are both greater than
GObject.G_MAXUINT32
.
- Gst.value_can_compare(value1, value2)[source]¶
- Parameters:
value1 (
GObject.Value
) – a value to comparevalue2 (
GObject.Value
) – another value to compare
- Returns:
True
if the values can be compared- Return type:
Determines if value1 and value2 can be compared.
- Gst.value_can_intersect(value1, value2)[source]¶
- Parameters:
value1 (
GObject.Value
) – a value to intersectvalue2 (
GObject.Value
) – another value to intersect
- Returns:
True
if the values can intersect- Return type:
Determines if intersecting two values will produce a valid result. Two values will produce a valid intersection if they have the same type.
- Gst.value_can_subtract(minuend, subtrahend)[source]¶
- Parameters:
minuend (
GObject.Value
) – the value to subtract fromsubtrahend (
GObject.Value
) – the value to subtract
- Returns:
True
if a subtraction is possible- Return type:
Checks if it’s possible to subtract subtrahend from minuend.
- Gst.value_can_union(value1, value2)[source]¶
- Parameters:
value1 (
GObject.Value
) – a value to unionvalue2 (
GObject.Value
) – another value to union
- Returns:
True
if there is a function allowing the two values to be unioned.- Return type:
Determines if value1 and value2 can be non-trivially unioned. Any two values can be trivially unioned by adding both of them to a
Gst.ValueList
. However, certain types have the possibility to be unioned in a simpler way. For example, an integer range and an integer can be unioned if the integer is a subset of the integer range. If there is the possibility that two values can be unioned, this function returnsTrue
.
- Gst.value_compare(value1, value2)[source]¶
- Parameters:
value1 (
GObject.Value
) – a value to comparevalue2 (
GObject.Value
) – another value to compare
- Returns:
comparison result
- Return type:
Compares value1 and value2. If value1 and value2 cannot be compared, the function returns
Gst.VALUE_UNORDERED
. Otherwise, if value1 is greater than value2,Gst.VALUE_GREATER_THAN
is returned. If value1 is less than value2,Gst.VALUE_LESS_THAN
is returned. If the values are equal,Gst.VALUE_EQUAL
is returned.
- Gst.value_deserialize(src)[source]¶
- Parameters:
src (
str
) – string to deserialize- Returns:
True
on success- dest:
GObject.Value
to fill with contents of deserialization
- Return type:
(
bool
, dest:GObject.Value
)
Tries to deserialize a string into the type specified by the given
GObject.Value
. If the operation succeeds,True
is returned,False
otherwise.
- Gst.value_deserialize_with_pspec(src, pspec)[source]¶
- Parameters:
src (
str
) – string to deserializepspec (
GObject.ParamSpec
orNone
) – theGObject.ParamSpec
describing the expected value
- Returns:
True
on success- dest:
GObject.Value
to fill with contents of deserialization
- Return type:
(
bool
, dest:GObject.Value
)
Tries to deserialize a string into the type specified by the given
GObject.Value
. pspec may be used to guide the deserializing of nested members. If the operation succeeds,True
is returned,False
otherwise.New in version 1.20.
- Gst.value_fixate(dest, src)[source]¶
- Parameters:
dest (
GObject.Value
) – theGObject.Value
destinationsrc (
GObject.Value
) – theGObject.Value
to fixate
- Returns:
True
if dest contains a fixated version of src.- Return type:
Fixate src into a new value dest. For ranges, the first element is taken. For lists and arrays, the first item is fixated and returned. If src is already fixed, this function returns
False
.
- Gst.value_fraction_multiply(product, factor1, factor2)[source]¶
- Parameters:
product (
GObject.Value
) – aGObject.Value
initialized to #GST_TYPE_FRACTIONfactor1 (
GObject.Value
) – aGObject.Value
initialized to #GST_TYPE_FRACTIONfactor2 (
GObject.Value
) – aGObject.Value
initialized to #GST_TYPE_FRACTION
- Returns:
False
in case of an error (like integer overflow),True
otherwise.- Return type:
Multiplies the two
GObject.Value
items containing a #GST_TYPE_FRACTION and sets product to the product of the two fractions.
- Gst.value_fraction_subtract(dest, minuend, subtrahend)[source]¶
- Parameters:
dest (
GObject.Value
) – aGObject.Value
initialized to #GST_TYPE_FRACTIONminuend (
GObject.Value
) – aGObject.Value
initialized to #GST_TYPE_FRACTIONsubtrahend (
GObject.Value
) – aGObject.Value
initialized to #GST_TYPE_FRACTION
- Returns:
False
in case of an error (like integer overflow),True
otherwise.- Return type:
Subtracts the subtrahend from the minuend and sets dest to the result.
- Gst.value_get_bitmask(value)[source]¶
- Parameters:
value (
GObject.Value
) – aGObject.Value
initialized to #GST_TYPE_BITMASK- Returns:
the bitmask.
- Return type:
Gets the bitmask specified by value.
- Gst.value_get_caps(value)[source]¶
- Parameters:
value (
GObject.Value
) – aGObject.Value
initialized to GST_TYPE_CAPS- Returns:
the contents of value
- Return type:
Gets the contents of value. The reference count of the returned
Gst.Caps
will not be modified, therefore the caller must take one before getting rid of the value.
- Gst.value_get_caps_features(value)[source]¶
- Parameters:
value (
GObject.Value
) – aGObject.Value
initialized to GST_TYPE_CAPS_FEATURES- Returns:
the contents of value
- Return type:
Gets the contents of value.
- Gst.value_get_double_range_max(value)[source]¶
- Parameters:
value (
GObject.Value
) – aGObject.Value
initialized to GST_TYPE_DOUBLE_RANGE- Returns:
the maximum of the range
- Return type:
Gets the maximum of the range specified by value.
- Gst.value_get_double_range_min(value)[source]¶
- Parameters:
value (
GObject.Value
) – aGObject.Value
initialized to GST_TYPE_DOUBLE_RANGE- Returns:
the minimum of the range
- Return type:
Gets the minimum of the range specified by value.
- Gst.value_get_flagset_flags(value)[source]¶
- Parameters:
value (
GObject.Value
) – aGObject.Value
initialized to #GST_TYPE_FLAG_SET- Returns:
the flags field of the flagset instance.
- Return type:
Retrieve the flags field of a
Gst.FlagSet
value.New in version 1.6.
- Gst.value_get_flagset_mask(value)[source]¶
- Parameters:
value (
GObject.Value
) – aGObject.Value
initialized to #GST_TYPE_FLAG_SET- Returns:
the mask field of the flagset instance.
- Return type:
Retrieve the mask field of a
Gst.FlagSet
value.New in version 1.6.
- Gst.value_get_fraction_denominator(value)[source]¶
- Parameters:
value (
GObject.Value
) – aGObject.Value
initialized to #GST_TYPE_FRACTION- Returns:
the denominator of the fraction.
- Return type:
Gets the denominator of the fraction specified by value.
- Gst.value_get_fraction_numerator(value)[source]¶
- Parameters:
value (
GObject.Value
) – aGObject.Value
initialized to #GST_TYPE_FRACTION- Returns:
the numerator of the fraction.
- Return type:
Gets the numerator of the fraction specified by value.
- Gst.value_get_fraction_range_max(value)[source]¶
- Parameters:
value (
GObject.Value
) – aGObject.Value
initialized to GST_TYPE_FRACTION_RANGE- Returns:
the maximum of the range
- Return type:
Gets the maximum of the range specified by value.
- Gst.value_get_fraction_range_min(value)[source]¶
- Parameters:
value (
GObject.Value
) – aGObject.Value
initialized to GST_TYPE_FRACTION_RANGE- Returns:
the minimum of the range
- Return type:
Gets the minimum of the range specified by value.
- Gst.value_get_int64_range_max(value)[source]¶
- Parameters:
value (
GObject.Value
) – aGObject.Value
initialized to GST_TYPE_INT64_RANGE- Returns:
the maximum of the range
- Return type:
Gets the maximum of the range specified by value.
- Gst.value_get_int64_range_min(value)[source]¶
- Parameters:
value (
GObject.Value
) – aGObject.Value
initialized to GST_TYPE_INT64_RANGE- Returns:
the minimum of the range
- Return type:
Gets the minimum of the range specified by value.
- Gst.value_get_int64_range_step(value)[source]¶
- Parameters:
value (
GObject.Value
) – aGObject.Value
initialized to GST_TYPE_INT64_RANGE- Returns:
the step of the range
- Return type:
Gets the step of the range specified by value.
- Gst.value_get_int_range_max(value)[source]¶
- Parameters:
value (
GObject.Value
) – aGObject.Value
initialized to GST_TYPE_INT_RANGE- Returns:
the maximum of the range
- Return type:
Gets the maximum of the range specified by value.
- Gst.value_get_int_range_min(value)[source]¶
- Parameters:
value (
GObject.Value
) – aGObject.Value
initialized to GST_TYPE_INT_RANGE- Returns:
the minimum of the range
- Return type:
Gets the minimum of the range specified by value.
- Gst.value_get_int_range_step(value)[source]¶
- Parameters:
value (
GObject.Value
) – aGObject.Value
initialized to GST_TYPE_INT_RANGE- Returns:
the step of the range
- Return type:
Gets the step of the range specified by value.
- Gst.value_get_structure(value)[source]¶
- Parameters:
value (
GObject.Value
) – aGObject.Value
initialized to GST_TYPE_STRUCTURE- Returns:
the contents of value
- Return type:
Gets the contents of value.
- Gst.value_init_and_copy(src)[source]¶
- Parameters:
src (
GObject.Value
) – the source value- Returns:
the target value
- Return type:
dest:
GObject.Value
Initialises the target value to be of the same type as source and then copies the contents from source to target.
- Gst.value_intersect(value1, value2)[source]¶
- Parameters:
value1 (
GObject.Value
) – a value to intersectvalue2 (
GObject.Value
) – another value to intersect
- Returns:
True
if the intersection is non-empty- dest:
a uninitialized
GObject.Value
that will hold the calculated intersection value. May beNone
if the resulting set if not needed.
- Return type:
(
bool
, dest:GObject.Value
)
Calculates the intersection of two values. If the values have a non-empty intersection, the value representing the intersection is placed in dest, unless
None
. If the intersection is non-empty, dest is not modified.
- Gst.value_is_fixed(value)[source]¶
- Parameters:
value (
GObject.Value
) – theGObject.Value
to check- Returns:
true if the value is “fixed”.
- Return type:
Tests if the given
GObject.Value
, if available in aGst.Structure
(or any other container) contains a “fixed” (which means: one value) or an “unfixed” (which means: multiple possible values, such as data lists or data ranges) value.
- Gst.value_is_subset(value1, value2)[source]¶
- Parameters:
value1 (
GObject.Value
) – aGObject.Value
value2 (
GObject.Value
) – aGObject.Value
- Returns:
True
is value1 is a subset of value2- Return type:
Check that value1 is a subset of value2.
- Gst.value_register(table)[source]¶
- Parameters:
table (
Gst.ValueTable
) – structure containing functions to register
Registers functions to perform calculations on
GObject.Value
items of a given type. Each type can only be added once.
- Gst.value_serialize(value)[source]¶
- Parameters:
value (
GObject.Value
) – aGObject.Value
to serialize- Returns:
the serialization for value or
None
if none exists- Return type:
tries to transform the given value into a string representation that allows getting back this string later on using
Gst.value_deserialize
().Free-function:
GLib.free
- Gst.value_set_bitmask(value, bitmask)[source]¶
- Parameters:
value (
GObject.Value
) – aGObject.Value
initialized to #GST_TYPE_BITMASKbitmask (
int
) – the bitmask
Sets value to the bitmask specified by bitmask.
- Gst.value_set_caps(value, caps)[source]¶
- Parameters:
value (
GObject.Value
) – aGObject.Value
initialized to GST_TYPE_CAPScaps (
Gst.Caps
) – the caps to set the value to
Sets the contents of value to caps. A reference to the provided caps will be taken by the value.
- Gst.value_set_caps_features(value, features)[source]¶
- Parameters:
value (
GObject.Value
) – aGObject.Value
initialized to GST_TYPE_CAPS_FEATURESfeatures (
Gst.CapsFeatures
) – the features to set the value to
Sets the contents of value to features.
- Gst.value_set_double_range(value, start, end)[source]¶
- Parameters:
value (
GObject.Value
) – aGObject.Value
initialized to GST_TYPE_DOUBLE_RANGEstart (
float
) – the start of the rangeend (
float
) – the end of the range
Sets value to the range specified by start and end.
- Gst.value_set_flagset(value, flags, mask)[source]¶
- Parameters:
value (
GObject.Value
) – aGObject.Value
initialized to %GST_TYPE_FLAG_SETflags (
int
) – The value of the flags set or unsetmask (
int
) – The mask indicate which flags bits must match for comparisons
Sets value to the flags and mask values provided in flags and mask. The flags value indicates the values of flags, the mask represents which bits in the flag value have been set, and which are “don’t care”
New in version 1.6.
- Gst.value_set_fraction(value, numerator, denominator)[source]¶
- Parameters:
value (
GObject.Value
) – aGObject.Value
initialized to #GST_TYPE_FRACTIONnumerator (
int
) – the numerator of the fractiondenominator (
int
) – the denominator of the fraction
Sets value to the fraction specified by numerator over denominator. The fraction gets reduced to the smallest numerator and denominator, and if necessary the sign is moved to the numerator.
- Gst.value_set_fraction_range(value, start, end)[source]¶
- Parameters:
value (
GObject.Value
) – aGObject.Value
initialized to GST_TYPE_FRACTION_RANGEstart (
GObject.Value
) – the start of the range (a GST_TYPE_FRACTIONGObject.Value
)end (
GObject.Value
) – the end of the range (a GST_TYPE_FRACTIONGObject.Value
)
Sets value to the range specified by start and end.
- Gst.value_set_fraction_range_full(value, numerator_start, denominator_start, numerator_end, denominator_end)[source]¶
- Parameters:
value (
GObject.Value
) – aGObject.Value
initialized to GST_TYPE_FRACTION_RANGEnumerator_start (
int
) – the numerator start of the rangedenominator_start (
int
) – the denominator start of the rangenumerator_end (
int
) – the numerator end of the rangedenominator_end (
int
) – the denominator end of the range
Sets value to the range specified by numerator_start/denominator_start and numerator_end/denominator_end.
- Gst.value_set_int64_range(value, start, end)[source]¶
- Parameters:
value (
GObject.Value
) – aGObject.Value
initialized to GST_TYPE_INT64_RANGEstart (
int
) – the start of the rangeend (
int
) – the end of the range
Sets value to the range specified by start and end.
- Gst.value_set_int64_range_step(value, start, end, step)[source]¶
- Parameters:
value (
GObject.Value
) – aGObject.Value
initialized to GST_TYPE_INT64_RANGEstart (
int
) – the start of the rangeend (
int
) – the end of the rangestep (
int
) – the step of the range
Sets value to the range specified by start, end and step.
- Gst.value_set_int_range(value, start, end)[source]¶
- Parameters:
value (
GObject.Value
) – aGObject.Value
initialized to GST_TYPE_INT_RANGEstart (
int
) – the start of the rangeend (
int
) – the end of the range
Sets value to the range specified by start and end.
- Gst.value_set_int_range_step(value, start, end, step)[source]¶
- Parameters:
value (
GObject.Value
) – aGObject.Value
initialized to GST_TYPE_INT_RANGEstart (
int
) – the start of the rangeend (
int
) – the end of the rangestep (
int
) – the step of the range
Sets value to the range specified by start, end and step.
- Gst.value_set_structure(value, structure)[source]¶
- Parameters:
value (
GObject.Value
) – aGObject.Value
initialized to GST_TYPE_STRUCTUREstructure (
Gst.Structure
) – the structure to set the value to
Sets the contents of value to structure.
- Gst.value_subtract(minuend, subtrahend)[source]¶
- Parameters:
minuend (
GObject.Value
) – the value to subtract fromsubtrahend (
GObject.Value
) – the value to subtract
- Returns:
True
if the subtraction is not empty- dest:
the destination value for the result if the subtraction is not empty. May be
None
, in which case the resulting set will not be computed, which can give a fair speedup.
- Return type:
(
bool
, dest:GObject.Value
)
Subtracts subtrahend from minuend and stores the result in dest. Note that this means subtraction as in sets, not as in mathematics.
- Gst.value_union(value1, value2)[source]¶
- Parameters:
value1 (
GObject.Value
) – a value to unionvalue2 (
GObject.Value
) – another value to union
- Returns:
True
if the union succeeded.- dest:
the destination value
- Return type:
(
bool
, dest:GObject.Value
)
Creates a
GObject.Value
corresponding to the union of value1 and value2.