Functions ========= .. currentmodule:: gi.repository.Gst .. function:: buffer_get_max_memory() -> int .. function:: caps_features_from_string(features: str) -> ~gi.repository.Gst.CapsFeatures | None :param features: .. function:: caps_from_string(string: str) -> ~gi.repository.Gst.Caps | None :param string: .. function:: core_error_quark() -> int .. function:: debug_add_log_function(func: ~typing.Callable[[...], None], *user_data: ~typing.Any) -> None Adds the logging function to the list of logging functions. Be sure to use ``G_GNUC_NO_INSTRUMENT`` on that function, it is needed. :param func: the function to use :param user_data: user data .. function:: debug_add_ring_buffer_logger(max_size_per_thread: int, thread_timeout: int) -> None 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 :func:`~gi.repository.Gst.debug_ring_buffer_logger_get_logs` and the logger can be removed again with :func:`~gi.repository.Gst.debug_remove_ring_buffer_logger`. Only one logger at a time is possible. .. versionadded:: 1.14 :param max_size_per_thread: Maximum size of log per thread in bytes :param thread_timeout: Timeout for threads in seconds .. function:: debug_bin_to_dot_data(bin: ~gi.repository.Gst.Bin, details: ~gi.repository.Gst.DebugGraphDetails) -> str 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. :param bin: the top-level pipeline that should be analyzed :param details: type of :obj:`~gi.repository.Gst.DebugGraphDetails` to use :return: a string containing the pipeline in graphviz dot format. .. function:: debug_bin_to_dot_file(bin: ~gi.repository.Gst.Bin, details: ~gi.repository.Gst.DebugGraphDetails, file_name: str) -> None 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. .. code-block:: shell :dedent: dot -Tpng -oimage.png graph_lowlevel.dot :param bin: the top-level pipeline that should be analyzed :param details: type of :obj:`~gi.repository.Gst.DebugGraphDetails` to use :param file_name: output base filename (e.g. "myplayer") .. function:: debug_bin_to_dot_file_with_ts(bin: ~gi.repository.Gst.Bin, details: ~gi.repository.Gst.DebugGraphDetails, file_name: str) -> None This works like :func:`~gi.repository.Gst.debug_bin_to_dot_file`, but adds the current timestamp to the filename, so that it can be used to take multiple snapshots. :param bin: the top-level pipeline that should be analyzed :param details: type of :obj:`~gi.repository.Gst.DebugGraphDetails` to use :param file_name: output base filename (e.g. "myplayer") .. function:: debug_construct_term_color(colorinfo: int) -> str Constructs a string that can be used for getting the desired color in color terminals. You need to free the string after use. :param colorinfo: the color info :return: a string containing the color definition .. function:: debug_construct_win_color(colorinfo: int) -> int 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. :param colorinfo: the color info :return: an integer containing the color definition .. function:: debug_get_all_categories() -> list[~gi.repository.Gst.DebugCategory] 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. :return: the list of debug categories .. function:: debug_get_color_mode() -> ~gi.repository.Gst.DebugColorMode Changes the coloring mode for debug output. .. versionadded:: 1.2 :return: see ``GstDebugColorMode`` for possible values. .. function:: debug_get_default_threshold() -> ~gi.repository.Gst.DebugLevel Returns the default threshold that is used for new categories. :return: the default threshold level .. function:: debug_get_stack_trace(flags: ~gi.repository.Gst.StackTraceFlags) -> str | None .. versionadded:: 1.12 :param flags: A set of :obj:`~gi.repository.Gst.StackTraceFlags` to determine how the stack trace should look like. Pass ``GST_STACK_TRACE_SHOW_NONE`` to retrieve a minimal backtrace. :return: a stack trace, if libunwind or glibc backtrace are present, else :const:`None`. .. function:: debug_is_active() -> bool Checks if debugging output is activated. :return: :const:`True`, if debugging is activated .. function:: debug_is_colored() -> bool Checks if the debugging output should be colored. :return: :const:`True`, if the debug output should be colored. .. function:: debug_level_get_name(level: ~gi.repository.Gst.DebugLevel) -> str :param level: .. function:: debug_log_default(category: ~gi.repository.Gst.DebugCategory, level: ~gi.repository.Gst.DebugLevel, file: str, function: str, line: int, object: ~gi.repository.GObject.Object | None, message: ~gi.repository.Gst.DebugMessage, user_data: None) -> None 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 :func:`~gi.repository.Gst.debug_add_log_function`. And you can remove this handler by calling gst_debug_remove_log_function(gst_debug_log_default); :param category: category to log :param level: level of the message :param file: the file that emitted the message, usually the ``__FILE__`` identifier :param function: the function that emitted the message :param line: the line from that the message was emitted, usually ``__LINE__`` :param object: the object this message relates to, or :const:`None` if none :param message: the actual message :param user_data: the FILE* to log to .. function:: debug_log_get_line(category: ~gi.repository.Gst.DebugCategory, level: ~gi.repository.Gst.DebugLevel, file: str, function: str, line: int, object: ~gi.repository.GObject.Object | None, message: ~gi.repository.Gst.DebugMessage) -> str Returns the string representation for the specified debug log message formatted in the same way as :func:`~gi.repository.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. .. versionadded:: 1.18 :param category: category to log :param level: level of the message :param file: the file that emitted the message, usually the ``__FILE__`` identifier :param function: the function that emitted the message :param line: the line from that the message was emitted, usually ``__LINE__`` :param object: the object this message relates to, or :const:`None` if none :param message: the actual message .. function:: debug_log_id_literal(category: ~gi.repository.Gst.DebugCategory, level: ~gi.repository.Gst.DebugLevel, file: str, function: str, line: int, id: str | None, message_string: str) -> None Logs the given message using the currently registered debugging handlers. .. versionadded:: 1.22 :param category: category to log :param level: level of the message is in :param file: the file that emitted the message, usually the ``__FILE__`` identifier :param function: the function that emitted the message :param line: the line from that the message was emitted, usually ``__LINE__`` :param id: the identifier of the object this message relates to or :const:`None` if none :param message_string: a message string .. function:: debug_log_literal(category: ~gi.repository.Gst.DebugCategory, level: ~gi.repository.Gst.DebugLevel, file: str, function: str, line: int, object: ~gi.repository.GObject.Object | None, message_string: str) -> None Logs the given message using the currently registered debugging handlers. .. versionadded:: 1.20 :param category: category to log :param level: level of the message is in :param file: the file that emitted the message, usually the ``__FILE__`` identifier :param function: the function that emitted the message :param line: the line from that the message was emitted, usually ``__LINE__`` :param object: the object this message relates to, or :const:`None` if none :param message_string: a message string .. function:: debug_print_stack_trace() -> None If libunwind, glibc backtrace or DbgHelp are present a stack trace is printed. .. function:: debug_remove_log_function(func: ~typing.Callable[[...], None] | None = None) -> int Removes all registered instances of the given logging functions. :param func: the log function to remove, or :const:`None` to remove the default log function :return: How many instances of the function were removed .. function:: debug_remove_log_function_by_data(data: None) -> int Removes all registered instances of log functions with the given user data. :param data: user data of the log function to remove :return: How many instances of the function were removed .. function:: debug_remove_ring_buffer_logger() -> None Removes any previously added ring buffer logger with :func:`~gi.repository.Gst.debug_add_ring_buffer_logger`. .. versionadded:: 1.14 .. function:: debug_ring_buffer_logger_get_logs() -> list[str] Fetches the current logs per thread from the ring buffer logger. See :func:`~gi.repository.Gst.debug_add_ring_buffer_logger` for details. .. versionadded:: 1.14 :return: NULL-terminated array of strings with the debug output per thread .. function:: debug_set_active(active: bool) -> None 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. :param active: Whether to use debugging output or not .. function:: debug_set_color_mode(mode: ~gi.repository.Gst.DebugColorMode) -> None Changes the coloring mode for debug output. This function may be called before :func:`~gi.repository.Gst.init`. .. versionadded:: 1.2 :param mode: The coloring mode for debug output. See ``GstDebugColorMode``. .. function:: debug_set_color_mode_from_string(mode: str) -> None Changes the coloring mode for debug output. This function may be called before :func:`~gi.repository.Gst.init`. .. versionadded:: 1.2 :param mode: The coloring mode for debug output. One of the following: "on", "auto", "off", "disable", "unix". .. function:: debug_set_colored(colored: bool) -> None Sets or unsets the use of coloured debugging output. Same as gst_debug_set_color_mode () with the argument being being GST_DEBUG_COLOR_MODE_ON or GST_DEBUG_COLOR_MODE_OFF. This function may be called before :func:`~gi.repository.Gst.init`. :param colored: Whether to use colored output or not .. function:: debug_set_default_threshold(level: ~gi.repository.Gst.DebugLevel) -> None Sets the default threshold to the given level and updates all categories to use this threshold. This function may be called before :func:`~gi.repository.Gst.init`. :param level: level to set .. function:: debug_set_threshold_for_name(name: str, level: ~gi.repository.Gst.DebugLevel) -> None Sets all categories which match the given glob style pattern to the given level. :param name: name of the categories to set :param level: level to set them to .. function:: debug_set_threshold_from_string(list: str, reset: bool) -> None 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. .. versionadded:: 1.2 :param list: comma-separated list of "category:level" pairs to be used as debug logging levels :param reset: :const:`True` to clear all previously-set debug levels before setting new thresholds :const:`False` if adding the threshold described by ``list`` to the one already set. .. function:: debug_unset_threshold_for_name(name: str) -> None Resets all categories with the given name back to the default level. :param name: name of the categories to set .. function:: deinit() -> None Clean up any resources created by GStreamer in :func:`~gi.repository.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. .. function:: dynamic_type_register(plugin: ~gi.repository.Gst.Plugin, type: type) -> bool Registers a new ``GstDynamicTypeFactory`` in the registry .. versionadded:: 1.12 :param plugin: The :obj:`~gi.repository.Gst.Plugin` to register ``dyn_type`` for :param type: The :obj:`~gi.repository.GObject.Type` to register dynamically .. function:: error_get_message(domain: int, code: int) -> str Get a string describing the error message in the current locale. :param domain: the GStreamer error domain this error belongs to. :param code: the error code belonging to the domain. :return: a newly allocated string describing the error message (in UTF-8 encoding) .. function:: event_type_get_flags(type: ~gi.repository.Gst.EventType) -> ~gi.repository.Gst.EventTypeFlags :param type: .. function:: event_type_get_name(type: ~gi.repository.Gst.EventType) -> str :param type: .. function:: event_type_to_quark(type: ~gi.repository.Gst.EventType) -> int :param type: .. function:: event_type_to_sticky_ordering(type: ~gi.repository.Gst.EventType) -> int :param type: .. function:: filename_to_uri(filename: str) -> str | None Similar to :func:`~gi.repository.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. :param filename: absolute or relative file name path :return: newly-allocated URI string, or NULL on error. The caller must free the URI string with :func:`~gi.repository.GLib.free` when no longer needed. .. function:: flow_get_name(ret: ~gi.repository.Gst.FlowReturn) -> str Gets a string representing the given flow return. :param ret: a :obj:`~gi.repository.Gst.FlowReturn` to get the name of. :return: a static string with the name of the flow return. .. function:: flow_to_quark(ret: ~gi.repository.Gst.FlowReturn) -> int Get the unique quark for the given GstFlowReturn. :param ret: a :obj:`~gi.repository.Gst.FlowReturn` to get the quark of. :return: the quark associated with the flow return or 0 if an invalid return was specified. .. function:: format_get_by_nick(nick: str) -> ~gi.repository.Gst.Format :param nick: .. function:: format_get_details(format: ~gi.repository.Gst.Format) -> ~gi.repository.Gst.FormatDefinition | None :param format: .. function:: format_get_name(format: ~gi.repository.Gst.Format) -> str | None :param format: .. function:: format_iterate_definitions() -> ~gi.repository.Gst.Iterator .. function:: format_register(nick: str, description: str) -> ~gi.repository.Gst.Format :param nick: :param description: .. function:: format_to_quark(format: ~gi.repository.Gst.Format) -> int :param format: .. function:: formats_contains(formats: ~typing.Sequence[~gi.repository.Gst.Format], format: ~gi.repository.Gst.Format) -> bool See if the given format is inside the format array. :param formats: The format array to search :param format: the format to find :return: :const:`True` if the format is found inside the array .. function:: get_main_executable_path() -> str | None 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. .. versionadded:: 1.14 :return: The path of the executable that initialized GStreamer, or :const:`None` if it could not be determined. .. function:: init() -> list[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 :func:`~gi.repository.Gst.update_registry` for details and section Running GStreamer Applications 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 :func:`~gi.repository.Gst.init_check` instead. .. function:: init_check() -> tuple[bool, list[str]] Initializes the GStreamer library, setting up internal path lists, registering built-in elements, and loading standard plugins. This function will return :const:`False` if GStreamer could not be initialized for some reason. If you want your program to fail fatally, use :func:`~gi.repository.Gst.init` instead. :return: :const:`True` if GStreamer could be initialized. .. function:: is_caps_features(obj: None) -> bool Checks if ``obj`` is a :obj:`~gi.repository.Gst.CapsFeatures` :param obj: :return: :const:`True` if ``obj`` is a :obj:`~gi.repository.Gst.CapsFeatures` :const:`False` otherwise .. function:: is_initialized() -> bool Use this function to check if GStreamer has been initialized with :func:`~gi.repository.Gst.init` or :func:`~gi.repository.Gst.init_check`. :return: :const:`True` if initialization has been done, :const:`False` otherwise. .. function:: library_error_quark() -> int .. function:: message_type_get_name(type: ~gi.repository.Gst.MessageType) -> str :param type: .. function:: message_type_to_quark(type: ~gi.repository.Gst.MessageType) -> int :param type: .. function:: meta_api_type_get_tags(api: type) -> list[str] :param api: .. function:: meta_api_type_has_tag(api: type, tag: int) -> bool :param api: :param tag: .. function:: meta_api_type_register(api: str, tags: ~typing.Sequence[str]) -> type :param api: :param tags: .. function:: meta_deserialize(buffer: ~gi.repository.Gst.Buffer, data: int, size: int) -> tuple[~gi.repository.Gst.Meta | None, int] :param buffer: :param data: :param size: .. function:: meta_get_info(impl: str) -> ~gi.repository.Gst.MetaInfo | None :param impl: .. function:: meta_register_custom(name: str, tags: ~typing.Sequence[str], transform_func: ~typing.Callable[[...], bool] | None = None, *user_data: ~typing.Any) -> ~gi.repository.Gst.MetaInfo :param name: :param tags: :param transform_func: :param user_data: .. function:: meta_register_custom_simple(name: str) -> ~gi.repository.Gst.MetaInfo :param name: .. function:: mini_object_replace(newdata: ~gi.repository.Gst.MiniObject | None = None) -> tuple[bool, ~gi.repository.Gst.MiniObject] :param newdata: .. function:: mini_object_take(newdata: ~gi.repository.Gst.MiniObject) -> tuple[bool, ~gi.repository.Gst.MiniObject] :param newdata: .. function:: pad_mode_get_name(mode: ~gi.repository.Gst.PadMode) -> str :param mode: .. function:: param_spec_array(name: str, nick: str, blurb: str, element_spec: ~gi.repository.GObject.ParamSpec, flags: ~gi.repository.GObject.ParamFlags) -> ~gi.repository.GObject.ParamSpec This function creates a GstArray GParamSpec for use by objects/elements that want to expose properties of GstArray type. This function is typically * used in connection with :func:`~gi.repository.GObject.ObjectClass.install_property` in a GObjects's instance_init function. .. versionadded:: 1.14 :param name: canonical name of the property specified :param nick: nick name for the property specified :param blurb: description of the property specified :param element_spec: GParamSpec of the array :param flags: flags for the property specified :return: a newly created parameter specification .. function:: param_spec_fraction(name: str, nick: str, blurb: str, min_num: int, min_denom: int, max_num: int, max_denom: int, default_num: int, default_denom: int, flags: ~gi.repository.GObject.ParamFlags) -> ~gi.repository.GObject.ParamSpec | None This function creates a fraction GParamSpec for use by objects/elements that want to expose properties of fraction type. This function is typically used in connection with :func:`~gi.repository.GObject.ObjectClass.install_property` in a GObjects's instance_init function. :param name: canonical name of the property specified :param nick: nick name for the property specified :param blurb: description of the property specified :param min_num: minimum value (fraction numerator) :param min_denom: minimum value (fraction denominator) :param max_num: maximum value (fraction numerator) :param max_denom: maximum value (fraction denominator) :param default_num: default value (fraction numerator) :param default_denom: default value (fraction denominator) :param flags: flags for the property specified :return: a newly created parameter specification .. function:: parent_buffer_meta_api_get_type() -> type .. function:: parent_buffer_meta_get_info() -> ~gi.repository.Gst.MetaInfo .. function:: parse_bin_from_description(bin_description: str, ghost_unlinked_pads: bool) -> ~gi.repository.Gst.Bin This is a convenience wrapper around :func:`~gi.repository.Gst.parse_launch` to create a :obj:`~gi.repository.Gst.Bin` from a gst-launch-style pipeline description. See :func:`~gi.repository.Gst.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). :param bin_description: command line describing the bin :param ghost_unlinked_pads: whether to automatically create ghost pads for unlinked source or sink pads within the bin :return: a newly-created bin, or :const:`None` if an error occurred. .. function:: parse_bin_from_description_full(bin_description: str, ghost_unlinked_pads: bool, context: ~gi.repository.Gst.ParseContext | None, flags: ~gi.repository.Gst.ParseFlags) -> ~gi.repository.Gst.Element This is a convenience wrapper around :func:`~gi.repository.Gst.parse_launch` to create a :obj:`~gi.repository.Gst.Bin` from a gst-launch-style pipeline description. See :func:`~gi.repository.Gst.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). :param bin_description: command line describing the bin :param ghost_unlinked_pads: whether to automatically create ghost pads for unlinked source or sink pads within the bin :param context: a parse context allocated with :func:`~gi.repository.Gst.ParseContext.new`, or :const:`None` :param flags: parsing options, or ``GST_PARSE_FLAG_NONE`` :return: a newly-created element, which is guaranteed to be a bin unless ``GST_PARSE_FLAG_NO_SINGLE_ELEMENT_BINS`` was passed, or :const:`None` if an error occurred. .. function:: parse_error_quark() -> int .. function:: parse_launch(pipeline_description: str) -> ~gi.repository.Gst.Element Create a new pipeline based on command line syntax. Please note that you might get a return value that is not :const:`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 :func:`~gi.repository.Gst.parse_bin_from_description`. :param pipeline_description: the command line describing the pipeline :return: a new element on success, :const:`None` on failure. If more than one toplevel element is specified by the ``pipeline_description``, all elements are put into a :obj:`~gi.repository.Gst.Pipeline`, which than is returned. .. function:: parse_launch_full(pipeline_description: str, context: ~gi.repository.Gst.ParseContext | None, flags: ~gi.repository.Gst.ParseFlags) -> ~gi.repository.Gst.Element Create a new pipeline based on command line syntax. Please note that you might get a return value that is not :const:`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 :func:`~gi.repository.Gst.parse_bin_from_description_full`. :param pipeline_description: the command line describing the pipeline :param context: a parse context allocated with :func:`~gi.repository.Gst.ParseContext.new`, or :const:`None` :param flags: parsing options, or ``GST_PARSE_FLAG_NONE`` :return: a new element on success, :const:`None` on failure. If more than one toplevel element is specified by the ``pipeline_description``, all elements are put into a :obj:`~gi.repository.Gst.Pipeline`, which then is returned (unless the GST_PARSE_FLAG_PLACE_IN_BIN flag is set, in which case they are put in a :obj:`~gi.repository.Gst.Bin` instead). .. function:: parse_launchv(argv: ~typing.Sequence[str]) -> ~gi.repository.Gst.Element 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. :param argv: null-terminated array of arguments :return: a new element on success and :const:`None` on failure. .. function:: parse_launchv_full(argv: ~typing.Sequence[str], context: ~gi.repository.Gst.ParseContext | None, flags: ~gi.repository.Gst.ParseFlags) -> ~gi.repository.Gst.Element 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. :param argv: null-terminated array of arguments :param context: a parse context allocated with :func:`~gi.repository.Gst.ParseContext.new`, or :const:`None` :param flags: parsing options, or ``GST_PARSE_FLAG_NONE`` :return: a new element on success; on failure, either :const:`None` or a partially-constructed bin or element will be returned and ``error`` will be set (unless you passed ``GST_PARSE_FLAG_FATAL_ERRORS`` in ``flags``, then :const:`None` will always be returned on failure) .. function:: plugin_error_quark() -> int .. function:: preset_get_app_dir() -> str | None .. function:: preset_set_app_dir(app_dir: str) -> bool :param app_dir: .. function:: protection_filter_systems_by_available_decryptors(system_identifiers: ~typing.Sequence[str]) -> list[str] | None Iterates the supplied list of UUIDs and checks the GstRegistry for all the decryptors supporting one of the supplied UUIDs. .. versionadded:: 1.14 :param system_identifiers: A null terminated array of strings that contains the UUID values of each protection system that is to be checked. :return: A null terminated array containing all the ``system_identifiers`` supported by the set of available decryptors, or :const:`None` if no matches were found. .. function:: protection_meta_api_get_type() -> type .. function:: protection_meta_get_info() -> ~gi.repository.Gst.MetaInfo .. function:: protection_select_system(system_identifiers: ~typing.Sequence[str]) -> str | None Iterates the supplied list of UUIDs and checks the GstRegistry 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. .. versionadded:: 1.6 :param system_identifiers: A null terminated array of strings that contains the UUID values of each protection system that is to be checked. :return: One of the strings from ``system_identifiers`` that indicates the highest ranked element that implements the protection system indicated by that system ID, or :const:`None` if no element has been found. .. function:: query_type_get_flags(type: ~gi.repository.Gst.QueryType) -> ~gi.repository.Gst.QueryTypeFlags :param type: .. function:: query_type_get_name(type: ~gi.repository.Gst.QueryType) -> str :param type: .. function:: query_type_to_quark(type: ~gi.repository.Gst.QueryType) -> int :param type: .. function:: reference_timestamp_meta_api_get_type() -> type .. function:: reference_timestamp_meta_get_info() -> ~gi.repository.Gst.MetaInfo .. function:: resource_error_quark() -> int .. function:: segtrap_is_enabled() -> bool 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 :func:`~gi.repository.Gst.segtrap_set_enabled` function. This is typically done if the application wants to install its own handler without GStreamer interfering. :return: :const:`True` if GStreamer is allowed to install a custom SIGSEGV handler. .. function:: segtrap_set_enabled(enabled: bool) -> None Applications might want to disable/enable the SIGSEGV handling of the GStreamer core. See :func:`~gi.repository.Gst.segtrap_is_enabled` for more information. :param enabled: whether a custom SIGSEGV handler should be installed. .. function:: state_change_get_name(transition: ~gi.repository.Gst.StateChange) -> str :param transition: .. function:: static_caps_get_type() -> type .. function:: static_pad_template_get_type() -> type .. function:: stream_error_quark() -> int .. function:: stream_type_get_name(stype: ~gi.repository.Gst.StreamType) -> str :param stype: .. function:: structure_take(newstr: ~gi.repository.Gst.Structure | None = None) -> tuple[bool, ~gi.repository.Gst.Structure] :param newstr: .. function:: tag_exists(tag: str) -> bool Checks if the given type is already registered. :param tag: name of the tag :return: :const:`True` if the type is already registered .. function:: tag_get_description(tag: str) -> str Returns the human-readable description of this tag, You must not change or free this string. :param tag: the tag :return: the human-readable description of this tag .. function:: tag_get_flag(tag: str) -> ~gi.repository.Gst.TagFlag Gets the flag of ``tag``. :param tag: the tag :return: the flag of this tag. .. function:: tag_get_nick(tag: str) -> str Returns the human-readable name of this tag, You must not change or free this string. :param tag: the tag :return: the human-readable name of this tag .. function:: tag_get_type(tag: str) -> type Gets the :obj:`~gi.repository.GObject.Type` used for this tag. :param tag: the tag :return: the :obj:`~gi.repository.GObject.Type` of this tag .. function:: tag_is_fixed(tag: str) -> bool Checks if the given tag is fixed. A fixed tag can only contain one value. Unfixed tags can contain lists of values. :param tag: tag to check :return: :const:`True`, if the given tag is fixed. .. function:: tag_merge_strings_with_comma(src: ~typing.Any) -> ~typing.Any This is a convenience function for the func argument of :func:`~gi.repository.Gst.tag_register`. It concatenates all given strings using a comma. The tag must be registered as a G_TYPE_STRING or this function will fail. :param src: GValue to copy from .. function:: tag_merge_use_first(src: ~typing.Any) -> ~typing.Any This is a convenience function for the func argument of :func:`~gi.repository.Gst.tag_register`. It creates a copy of the first value from the list. :param src: GValue to copy from .. function:: toc_entry_type_get_nick(type: ~gi.repository.Gst.TocEntryType) -> str :param type: .. function:: tracing_get_active_tracers() -> list[~gi.repository.Gst.Tracer] 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 :func:`~gi.repository.Gst.deinit` is called. .. versionadded:: 1.18 :return: A ``GList`` of :obj:`~gi.repository.Gst.Tracer` objects .. function:: tracing_register_hook(tracer: ~gi.repository.Gst.Tracer, detail: str, func: ~typing.Callable[[], None]) -> None Register ``func`` to be called when the trace hook ``detail`` is getting invoked. Use :const:`None` for ``detail`` to register to all hooks. .. versionadded:: 1.8 :param tracer: the tracer :param detail: the detailed hook :param func: the callback .. function:: type_find_get_type() -> type .. function:: type_find_register(plugin: ~gi.repository.Gst.Plugin | None, name: str, rank: int, func: ~typing.Callable[[...], None], extensions: str | None = None, possible_caps: ~gi.repository.Gst.Caps | None = None, *data: ~typing.Any) -> bool :param plugin: :param name: :param rank: :param func: :param extensions: :param possible_caps: :param data: .. function:: type_is_plugin_api(type: type) -> tuple[bool, ~gi.repository.Gst.PluginAPIFlags] Checks if ``type`` is plugin API. See :func:`~gi.repository.Gst.type_mark_as_plugin_api` for details. .. versionadded:: 1.18 :param type: a GType :return: :const:`True` if ``type`` is plugin API or :const:`False` otherwise. .. function:: type_mark_as_plugin_api(type: type, flags: ~gi.repository.Gst.PluginAPIFlags) -> None 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. .. versionadded:: 1.18 :param type: a GType :param flags: a set of :obj:`~gi.repository.Gst.PluginAPIFlags` to further inform cache generation. .. function:: update_registry() -> bool 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 :func:`~gi.repository.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. :return: :const:`True` if the registry has been updated successfully (does not imply that there were changes), otherwise :const:`False`. .. function:: uri_construct(protocol: str, location: str) -> str :param protocol: :param location: .. function:: uri_error_quark() -> int .. function:: uri_from_string(uri: str) -> ~gi.repository.Gst.Uri | None :param uri: .. function:: uri_from_string_escaped(uri: str) -> ~gi.repository.Gst.Uri | None :param uri: .. function:: uri_get_location(uri: str) -> str | None :param uri: .. function:: uri_get_protocol(uri: str) -> str | None :param uri: .. function:: uri_has_protocol(uri: str, protocol: str) -> bool :param uri: :param protocol: .. function:: uri_is_valid(uri: str) -> bool :param uri: .. function:: uri_join_strings(base_uri: str, ref_uri: str) -> str | None :param base_uri: :param ref_uri: .. function:: uri_protocol_is_supported(type: ~gi.repository.Gst.URIType, protocol: str) -> bool :param type: :param protocol: .. function:: uri_protocol_is_valid(protocol: str) -> bool :param protocol: .. function:: util_array_binary_search(array: None, num_elements: int, element_size: int, search_func: ~typing.Callable[[...], int], mode: ~gi.repository.Gst.SearchMode, search_data: None, *user_data: ~typing.Any) -> None 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)). :param array: the sorted input array :param num_elements: number of elements in the array :param element_size: size of every element in bytes :param search_func: function to compare two elements, ``search_data`` will always be passed as second argument :param mode: search mode that should be used :param search_data: element that should be found :param user_data: data to pass to ``search_func`` :return: The address of the found element or :const:`None` if nothing was found .. function:: util_ceil_log2(v: int) -> int Return a max num of log2. .. versionadded:: 1.24 :param v: a :obj:`~gi.repository.guint32` value. :return: a computed :obj:`~gi.repository.guint` val. .. function:: util_double_to_fraction(src: float) -> tuple[int, int] Transforms a :obj:`float` to a fraction and simplifies the result. :param src: :obj:`float` to transform .. function:: util_dump_buffer(buf: ~gi.repository.Gst.Buffer) -> None Dumps the buffer memory into a hex representation. Useful for debugging. .. versionadded:: 1.14 :param buf: a :obj:`~gi.repository.Gst.Buffer` whose memory to dump .. function:: util_dump_mem(mem: ~typing.Sequence[int]) -> None Dumps the memory block into a hex representation. Useful for debugging. :param mem: a pointer to the memory to dump .. function:: util_filename_compare(a: str, b: str) -> int Compares the given filenames using natural ordering. .. versionadded:: 1.24 :param a: a filename to compare with ``b`` :param b: a filename to compare with ``a`` .. function:: util_fraction_add(a_n: int, a_d: int, b_n: int, b_d: int) -> tuple[bool, int, int] Adds the fractions ``a_n``/``a_d`` and ``b_n``/``b_d`` and stores the result in ``res_n`` and ``res_d``. :param a_n: Numerator of first value :param a_d: Denominator of first value :param b_n: Numerator of second value :param b_d: Denominator of second value :return: :const:`False` on overflow, :const:`True` otherwise. .. function:: util_fraction_compare(a_n: int, a_d: int, b_n: int, b_d: int) -> int 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. :param a_n: Numerator of first value :param a_d: Denominator of first value :param b_n: Numerator of second value :param b_d: Denominator of second value :return: -1 if a < b; 0 if a = b; 1 if a > b. .. function:: util_fraction_multiply(a_n: int, a_d: int, b_n: int, b_d: int) -> tuple[bool, int, int] Multiplies the fractions ``a_n``/``a_d`` and ``b_n``/``b_d`` and stores the result in ``res_n`` and ``res_d``. :param a_n: Numerator of first value :param a_d: Denominator of first value :param b_n: Numerator of second value :param b_d: Denominator of second value :return: :const:`False` on overflow, :const:`True` otherwise. .. function:: util_fraction_to_double(src_n: int, src_d: int) -> float Transforms a fraction to a :obj:`float`. :param src_n: Fraction numerator as :obj:`int` :param src_d: Fraction denominator :obj:`int` .. function:: util_gdouble_to_guint64(value: float) -> int :param value: The :obj:`float` value to convert guint64 double :return: ``value`` casted to :obj:`~gi.repository.guint64` .. function:: util_get_object_array(object: ~gi.repository.GObject.Object, name: str) -> tuple[bool, ~gi.repository.GObject.ValueArray] Get a property of type ``%GST_TYPE_ARRAY`` and transform it into a :obj:`~gi.repository.GObject.ValueArray`. This allow language bindings to get GST_TYPE_ARRAY properties which are otherwise not an accessible type. .. versionadded:: 1.12 :param object: the object to set the array to :param name: the name of the property to set .. function:: util_get_timestamp() -> int Get a timestamp as GstClockTime to be used for interval measurements. The timestamp should not be interpreted in any other way. :return: the timestamp .. function:: util_greatest_common_divisor(a: int, b: int) -> int Calculates the greatest common divisor of ``a`` and ``b``. :param a: First value as :obj:`int` :param b: Second value as :obj:`int` :return: Greatest common divisor of ``a`` and ``b`` .. function:: util_greatest_common_divisor_int64(a: int, b: int) -> int Calculates the greatest common divisor of ``a`` and ``b``. :param a: First value as :obj:`int` :param b: Second value as :obj:`int` :return: Greatest common divisor of ``a`` and ``b`` .. function:: util_group_id_next() -> int 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 :const:`~gi.repository.Gst.GROUP_ID_INVALID` (which is 0) :return: A constantly incrementing unsigned integer, which might overflow back to 0 at some point. .. function:: util_guint64_to_gdouble(value: int) -> float :param value: The :obj:`~gi.repository.guint64` value to convert to double :return: ``value`` casted to :obj:`float` .. function:: util_seqnum_compare(s1: int, s2: int) -> int Compare two sequence numbers, handling wraparound. The current implementation just returns (gint32)(``s1`` - ``s2``). :param s1: A sequence number. :param s2: Another sequence number. :return: A negative number if ``s1`` is before ``s2``, 0 if they are equal, or a positive number if ``s1`` is after ``s2``. .. function:: util_seqnum_next() -> int 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 :const:`~gi.repository.Gst.SEQNUM_INVALID` (which is 0). :return: A constantly incrementing 32-bit unsigned integer, which might overflow at some point. Use :func:`~gi.repository.Gst.util_seqnum_compare` to make sure you handle wraparound correctly. .. function:: util_set_object_arg(object: ~gi.repository.GObject.Object, name: str, value: str) -> None 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. :param object: the object to set the argument of :param name: the name of the argument to set :param value: the string value to set .. function:: util_set_object_array(object: ~gi.repository.GObject.Object, name: str, array: ~gi.repository.GObject.ValueArray) -> bool Transfer a :obj:`~gi.repository.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. .. versionadded:: 1.12 :param object: the object to set the array to :param name: the name of the property to set :param array: a :obj:`~gi.repository.GObject.ValueArray` containing the values .. function:: util_set_value_from_string(value_str: str) -> ~typing.Any 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. :param value_str: the string to get the value from .. function:: util_simplify_fraction(numerator: int, denominator: int, n_terms: int, threshold: int) -> None 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. .. versionadded:: 1.24 :param numerator: First value as :obj:`int` :param denominator: Second value as :obj:`int` :param n_terms: non-significative terms (typical value: 8) :param threshold: threshold (typical value: 333) .. function:: util_uint64_scale(val: int, num: int, denom: int) -> int 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 G_MAXUINT32. :param val: the number to scale :param num: the numerator of the scale ratio :param denom: the denominator of the scale ratio :return: ``val`` * ``num`` / ``denom``. In the case of an overflow, this function returns G_MAXUINT64. If the result is not exactly representable as an integer it is truncated. See also :func:`~gi.repository.Gst.util_uint64_scale_round`, :func:`~gi.repository.Gst.util_uint64_scale_ceil`, :func:`~gi.repository.Gst.util_uint64_scale_int`, :func:`~gi.repository.Gst.util_uint64_scale_int_round`, :func:`~gi.repository.Gst.util_uint64_scale_int_ceil`. .. function:: util_uint64_scale_ceil(val: int, num: int, denom: int) -> int 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 G_MAXUINT32. :param val: the number to scale :param num: the numerator of the scale ratio :param denom: the denominator of the scale ratio :return: ``val`` * ``num`` / ``denom``. In the case of an overflow, this function returns G_MAXUINT64. If the result is not exactly representable as an integer, it is rounded up. See also :func:`~gi.repository.Gst.util_uint64_scale`, :func:`~gi.repository.Gst.util_uint64_scale_round`, :func:`~gi.repository.Gst.util_uint64_scale_int`, :func:`~gi.repository.Gst.util_uint64_scale_int_round`, :func:`~gi.repository.Gst.util_uint64_scale_int_ceil`. .. function:: util_uint64_scale_int(val: int, num: int, denom: int) -> int 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. :param val: guint64 (such as a :obj:`~gi.repository.Gst.ClockTime`) to scale. :param num: numerator of the scale factor. :param denom: denominator of the scale factor. :return: ``val`` * ``num`` / ``denom``. In the case of an overflow, this function returns G_MAXUINT64. If the result is not exactly representable as an integer, it is truncated. See also :func:`~gi.repository.Gst.util_uint64_scale_int_round`, :func:`~gi.repository.Gst.util_uint64_scale_int_ceil`, :func:`~gi.repository.Gst.util_uint64_scale`, :func:`~gi.repository.Gst.util_uint64_scale_round`, :func:`~gi.repository.Gst.util_uint64_scale_ceil`. .. function:: util_uint64_scale_int_ceil(val: int, num: int, denom: int) -> int 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. :param val: guint64 (such as a :obj:`~gi.repository.Gst.ClockTime`) to scale. :param num: numerator of the scale factor. :param denom: denominator of the scale factor. :return: ``val`` * ``num`` / ``denom``. In the case of an overflow, this function returns G_MAXUINT64. If the result is not exactly representable as an integer, it is rounded up. See also :func:`~gi.repository.Gst.util_uint64_scale_int`, :func:`~gi.repository.Gst.util_uint64_scale_int_round`, :func:`~gi.repository.Gst.util_uint64_scale`, :func:`~gi.repository.Gst.util_uint64_scale_round`, :func:`~gi.repository.Gst.util_uint64_scale_ceil`. .. function:: util_uint64_scale_int_round(val: int, num: int, denom: int) -> int 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. :param val: guint64 (such as a :obj:`~gi.repository.Gst.ClockTime`) to scale. :param num: numerator of the scale factor. :param denom: denominator of the scale factor. :return: ``val`` * ``num`` / ``denom``. In the case of an overflow, this function returns 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 also :func:`~gi.repository.Gst.util_uint64_scale_int`, :func:`~gi.repository.Gst.util_uint64_scale_int_ceil`, :func:`~gi.repository.Gst.util_uint64_scale`, :func:`~gi.repository.Gst.util_uint64_scale_round`, :func:`~gi.repository.Gst.util_uint64_scale_ceil`. .. function:: util_uint64_scale_round(val: int, num: int, denom: int) -> int 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 G_MAXUINT32. :param val: the number to scale :param num: the numerator of the scale ratio :param denom: the denominator of the scale ratio :return: ``val`` * ``num`` / ``denom``. In the case of an overflow, this function returns 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 also :func:`~gi.repository.Gst.util_uint64_scale`, :func:`~gi.repository.Gst.util_uint64_scale_ceil`, :func:`~gi.repository.Gst.util_uint64_scale_int`, :func:`~gi.repository.Gst.util_uint64_scale_int_round`, :func:`~gi.repository.Gst.util_uint64_scale_int_ceil`. .. function:: value_can_compare(value1: ~typing.Any, value2: ~typing.Any) -> bool Determines if ``value1`` and ``value2`` can be compared. :param value1: a value to compare :param value2: another value to compare :return: :const:`True` if the values can be compared .. function:: value_can_intersect(value1: ~typing.Any, value2: ~typing.Any) -> bool Determines if intersecting two values will produce a valid result. Two values will produce a valid intersection if they have the same type. :param value1: a value to intersect :param value2: another value to intersect :return: :const:`True` if the values can intersect .. function:: value_can_subtract(minuend: ~typing.Any, subtrahend: ~typing.Any) -> bool Checks if it's possible to subtract ``subtrahend`` from ``minuend``. :param minuend: the value to subtract from :param subtrahend: the value to subtract :return: :const:`True` if a subtraction is possible .. function:: value_can_union(value1: ~typing.Any, value2: ~typing.Any) -> bool Determines if ``value1`` and ``value2`` can be non-trivially unioned. Any two values can be trivially unioned by adding both of them to a GstValueList. 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 returns :const:`True`. :param value1: a value to union :param value2: another value to union :return: :const:`True` if there is a function allowing the two values to be unioned. .. function:: value_compare(value1: ~typing.Any, value2: ~typing.Any) -> int 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. :param value1: a value to compare :param value2: another value to compare :return: comparison result .. function:: value_deserialize(src: str) -> tuple[bool, ~typing.Any] Tries to deserialize a string into the type specified by the given GValue. If the operation succeeds, :const:`True` is returned, :const:`False` otherwise. :param src: string to deserialize :return: :const:`True` on success .. function:: value_deserialize_with_pspec(src: str, pspec: ~gi.repository.GObject.ParamSpec | None = None) -> tuple[bool, ~typing.Any] Tries to deserialize a string into the type specified by the given GValue. ``pspec`` may be used to guide the deserializing of nested members. If the operation succeeds, :const:`True` is returned, :const:`False` otherwise. .. versionadded:: 1.20 :param src: string to deserialize :param pspec: the :obj:`~gi.repository.GObject.ParamSpec` describing the expected value :return: :const:`True` on success .. function:: value_fixate(dest: ~typing.Any, src: ~typing.Any) -> bool 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 :const:`False`. :param dest: the :obj:`~gi.repository.GObject.Value` destination :param src: the :obj:`~gi.repository.GObject.Value` to fixate :return: :const:`True` if ``dest`` contains a fixated version of ``src``. .. function:: value_fraction_multiply(product: ~typing.Any, factor1: ~typing.Any, factor2: ~typing.Any) -> bool Multiplies the two :obj:`~gi.repository.GObject.Value` items containing a ``GST_TYPE_FRACTION`` and sets ``product`` to the product of the two fractions. :param product: a GValue initialized to ``GST_TYPE_FRACTION`` :param factor1: a GValue initialized to ``GST_TYPE_FRACTION`` :param factor2: a GValue initialized to ``GST_TYPE_FRACTION`` :return: :const:`False` in case of an error (like integer overflow), :const:`True` otherwise. .. function:: value_fraction_subtract(dest: ~typing.Any, minuend: ~typing.Any, subtrahend: ~typing.Any) -> bool Subtracts the ``subtrahend`` from the ``minuend`` and sets ``dest`` to the result. :param dest: a GValue initialized to ``GST_TYPE_FRACTION`` :param minuend: a GValue initialized to ``GST_TYPE_FRACTION`` :param subtrahend: a GValue initialized to ``GST_TYPE_FRACTION`` :return: :const:`False` in case of an error (like integer overflow), :const:`True` otherwise. .. function:: value_get_bitmask(value: ~typing.Any) -> int Gets the bitmask specified by ``value``. :param value: a GValue initialized to ``GST_TYPE_BITMASK`` :return: the bitmask. .. function:: value_get_caps(value: ~typing.Any) -> ~gi.repository.Gst.Caps Gets the contents of ``value``. The reference count of the returned :obj:`~gi.repository.Gst.Caps` will not be modified, therefore the caller must take one before getting rid of the ``value``. :param value: a GValue initialized to GST_TYPE_CAPS :return: the contents of ``value`` .. function:: value_get_caps_features(value: ~typing.Any) -> ~gi.repository.Gst.CapsFeatures Gets the contents of ``value``. :param value: a GValue initialized to GST_TYPE_CAPS_FEATURES :return: the contents of ``value`` .. function:: value_get_double_range_max(value: ~typing.Any) -> float Gets the maximum of the range specified by ``value``. :param value: a GValue initialized to GST_TYPE_DOUBLE_RANGE :return: the maximum of the range .. function:: value_get_double_range_min(value: ~typing.Any) -> float Gets the minimum of the range specified by ``value``. :param value: a GValue initialized to GST_TYPE_DOUBLE_RANGE :return: the minimum of the range .. function:: value_get_flagset_flags(value: ~typing.Any) -> int Retrieve the flags field of a GstFlagSet ``value``. .. versionadded:: 1.6 :param value: a GValue initialized to ``GST_TYPE_FLAG_SET`` :return: the flags field of the flagset instance. .. function:: value_get_flagset_mask(value: ~typing.Any) -> int Retrieve the mask field of a GstFlagSet ``value``. .. versionadded:: 1.6 :param value: a GValue initialized to ``GST_TYPE_FLAG_SET`` :return: the mask field of the flagset instance. .. function:: value_get_fraction_denominator(value: ~typing.Any) -> int Gets the denominator of the fraction specified by ``value``. :param value: a GValue initialized to ``GST_TYPE_FRACTION`` :return: the denominator of the fraction. .. function:: value_get_fraction_numerator(value: ~typing.Any) -> int Gets the numerator of the fraction specified by ``value``. :param value: a GValue initialized to ``GST_TYPE_FRACTION`` :return: the numerator of the fraction. .. function:: value_get_fraction_range_max(value: ~typing.Any) -> ~typing.Any | None Gets the maximum of the range specified by ``value``. :param value: a GValue initialized to GST_TYPE_FRACTION_RANGE :return: the maximum of the range .. function:: value_get_fraction_range_min(value: ~typing.Any) -> ~typing.Any | None Gets the minimum of the range specified by ``value``. :param value: a GValue initialized to GST_TYPE_FRACTION_RANGE :return: the minimum of the range .. function:: value_get_int64_range_max(value: ~typing.Any) -> int Gets the maximum of the range specified by ``value``. :param value: a GValue initialized to GST_TYPE_INT64_RANGE :return: the maximum of the range .. function:: value_get_int64_range_min(value: ~typing.Any) -> int Gets the minimum of the range specified by ``value``. :param value: a GValue initialized to GST_TYPE_INT64_RANGE :return: the minimum of the range .. function:: value_get_int64_range_step(value: ~typing.Any) -> int Gets the step of the range specified by ``value``. :param value: a GValue initialized to GST_TYPE_INT64_RANGE :return: the step of the range .. function:: value_get_int_range_max(value: ~typing.Any) -> int Gets the maximum of the range specified by ``value``. :param value: a GValue initialized to GST_TYPE_INT_RANGE :return: the maximum of the range .. function:: value_get_int_range_min(value: ~typing.Any) -> int Gets the minimum of the range specified by ``value``. :param value: a GValue initialized to GST_TYPE_INT_RANGE :return: the minimum of the range .. function:: value_get_int_range_step(value: ~typing.Any) -> int Gets the step of the range specified by ``value``. :param value: a GValue initialized to GST_TYPE_INT_RANGE :return: the step of the range .. function:: value_get_structure(value: ~typing.Any) -> ~gi.repository.Gst.Structure Gets the contents of ``value``. :param value: a GValue initialized to GST_TYPE_STRUCTURE :return: the contents of ``value`` .. function:: value_intersect(value1: ~typing.Any, value2: ~typing.Any) -> tuple[bool, ~typing.Any] Calculates the intersection of two values. If the values have a non-empty intersection, the value representing the intersection is placed in ``dest``, unless :const:`None`. If the intersection is non-empty, ``dest`` is not modified. :param value1: a value to intersect :param value2: another value to intersect :return: :const:`True` if the intersection is non-empty .. function:: value_is_fixed(value: ~typing.Any) -> bool Tests if the given GValue, if available in a GstStructure (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. :param value: the :obj:`~gi.repository.GObject.Value` to check :return: true if the value is "fixed". .. function:: value_is_subset(value1: ~typing.Any, value2: ~typing.Any) -> bool Check that ``value1`` is a subset of ``value2``. :param value1: a :obj:`~gi.repository.GObject.Value` :param value2: a :obj:`~gi.repository.GObject.Value` :return: :const:`True` is ``value1`` is a subset of ``value2`` .. function:: value_register(table: ~gi.repository.Gst.ValueTable) -> None Registers functions to perform calculations on :obj:`~gi.repository.GObject.Value` items of a given type. Each type can only be added once. :param table: structure containing functions to register .. function:: value_serialize(value: ~typing.Any) -> str | None tries to transform the given ``value`` into a string representation that allows getting back this string later on using :func:`~gi.repository.Gst.value_deserialize`. Free-function: g_free :param value: a :obj:`~gi.repository.GObject.Value` to serialize :return: the serialization for ``value`` or :const:`None` if none exists .. function:: value_set_bitmask(value: ~typing.Any, bitmask: int) -> None Sets ``value`` to the bitmask specified by ``bitmask``. :param value: a GValue initialized to ``GST_TYPE_BITMASK`` :param bitmask: the bitmask .. function:: value_set_caps(value: ~typing.Any, caps: ~gi.repository.Gst.Caps) -> None Sets the contents of ``value`` to ``caps``. A reference to the provided ``caps`` will be taken by the ``value``. :param value: a GValue initialized to GST_TYPE_CAPS :param caps: the caps to set the value to .. function:: value_set_caps_features(value: ~typing.Any, features: ~gi.repository.Gst.CapsFeatures) -> None Sets the contents of ``value`` to ``features``. :param value: a GValue initialized to GST_TYPE_CAPS_FEATURES :param features: the features to set the value to .. function:: value_set_double_range(value: ~typing.Any, start: float, end: float) -> None Sets ``value`` to the range specified by ``start`` and ``end``. :param value: a GValue initialized to GST_TYPE_DOUBLE_RANGE :param start: the start of the range :param end: the end of the range .. function:: value_set_flagset(value: ~typing.Any, flags: int, mask: int) -> None 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" .. versionadded:: 1.6 :param value: a GValue initialized to ``%GST_TYPE_FLAG_SET`` :param flags: The value of the flags set or unset :param mask: The mask indicate which flags bits must match for comparisons .. function:: value_set_fraction(value: ~typing.Any, numerator: int, denominator: int) -> None 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. :param value: a GValue initialized to ``GST_TYPE_FRACTION`` :param numerator: the numerator of the fraction :param denominator: the denominator of the fraction .. function:: value_set_fraction_range(value: ~typing.Any, start: ~typing.Any, end: ~typing.Any) -> None Sets ``value`` to the range specified by ``start`` and ``end``. :param value: a GValue initialized to GST_TYPE_FRACTION_RANGE :param start: the start of the range (a GST_TYPE_FRACTION GValue) :param end: the end of the range (a GST_TYPE_FRACTION GValue) .. function:: value_set_fraction_range_full(value: ~typing.Any, numerator_start: int, denominator_start: int, numerator_end: int, denominator_end: int) -> None Sets ``value`` to the range specified by ``numerator_start``/``denominator_start`` and ``numerator_end``/``denominator_end``. :param value: a GValue initialized to GST_TYPE_FRACTION_RANGE :param numerator_start: the numerator start of the range :param denominator_start: the denominator start of the range :param numerator_end: the numerator end of the range :param denominator_end: the denominator end of the range .. function:: value_set_int64_range(value: ~typing.Any, start: int, end: int) -> None Sets ``value`` to the range specified by ``start`` and ``end``. :param value: a GValue initialized to GST_TYPE_INT64_RANGE :param start: the start of the range :param end: the end of the range .. function:: value_set_int64_range_step(value: ~typing.Any, start: int, end: int, step: int) -> None Sets ``value`` to the range specified by ``start``, ``end`` and ``step``. :param value: a GValue initialized to GST_TYPE_INT64_RANGE :param start: the start of the range :param end: the end of the range :param step: the step of the range .. function:: value_set_int_range(value: ~typing.Any, start: int, end: int) -> None Sets ``value`` to the range specified by ``start`` and ``end``. :param value: a GValue initialized to GST_TYPE_INT_RANGE :param start: the start of the range :param end: the end of the range .. function:: value_set_int_range_step(value: ~typing.Any, start: int, end: int, step: int) -> None Sets ``value`` to the range specified by ``start``, ``end`` and ``step``. :param value: a GValue initialized to GST_TYPE_INT_RANGE :param start: the start of the range :param end: the end of the range :param step: the step of the range .. function:: value_set_structure(value: ~typing.Any, structure: ~gi.repository.Gst.Structure) -> None Sets the contents of ``value`` to ``structure``. :param value: a GValue initialized to GST_TYPE_STRUCTURE :param structure: the structure to set the value to .. function:: value_subtract(minuend: ~typing.Any, subtrahend: ~typing.Any) -> tuple[bool, ~typing.Any] Subtracts ``subtrahend`` from ``minuend`` and stores the result in ``dest``. Note that this means subtraction as in sets, not as in mathematics. :param minuend: the value to subtract from :param subtrahend: the value to subtract :return: :const:`True` if the subtraction is not empty .. function:: value_union(value1: ~typing.Any, value2: ~typing.Any) -> tuple[bool, ~typing.Any] Creates a GValue corresponding to the union of ``value1`` and ``value2``. :param value1: a value to union :param value2: another value to union :return: :const:`True` if the union succeeded. .. function:: version() -> tuple[int, int, int, int] Gets the version number of the GStreamer library. .. function:: version_string() -> str This function returns a string that is useful for describing this version of GStreamer to the outside world: user agent strings, logging, ... :return: a newly allocated string describing this version of GStreamer.