From 1783e69e76c1b22a53398af9083b4b9aefcd0a98 Mon Sep 17 00:00:00 2001 From: Xavier Claessens Date: Fri, 13 Mar 2026 06:34:25 -0700 Subject: [PATCH] imprv: GStreamer added Generic to its Iterator API --- src/gi-stubs/repository/Gst.pyi | 43 ++++++++------------------ src/gi-stubs/repository/GstPbutils.pyi | 2 +- 2 files changed, 14 insertions(+), 31 deletions(-) diff --git a/src/gi-stubs/repository/Gst.pyi b/src/gi-stubs/repository/Gst.pyi index 9b444b21..db3ef3e2 100644 --- a/src/gi-stubs/repository/Gst.pyi +++ b/src/gi-stubs/repository/Gst.pyi @@ -187,7 +187,7 @@ VALUE_GREATER_THAN: int = 1 VALUE_LESS_THAN: int = -1 VALUE_UNORDERED: int = 2 VERSION_MAJOR: int = 1 -VERSION_MICRO: int = 10 +VERSION_MICRO: int = 11 VERSION_MINOR: int = 26 VERSION_NANO: int = 1 @@ -781,9 +781,6 @@ class Bin(Element, ChildProxy): name: typing.Optional[str] = ..., parent: Object = ..., ) -> None: ... - def __init__( - self, name: typing.Optional[str] = None - ): ... # FIXME: Override is missing typing annotation def add(self, *args: Element) -> None: ... def do_add_element(self, element: Element) -> bool: ... def do_deep_element_added(self, sub_bin: Bin, child: Element) -> None: ... @@ -802,15 +799,13 @@ class Bin(Element, ChildProxy): def get_suppressed_flags(self) -> ElementFlags: ... def iterate_all_by_element_factory_name( self, factory_name: str - ) -> typing.Optional[Iterator]: ... - def iterate_all_by_interface( - self, iface: typing.Type[typing.Any] - ) -> typing.Optional[Iterator]: ... - def iterate_elements(self) -> typing.Optional[Iterator]: ... - def iterate_recurse(self) -> typing.Optional[Iterator]: ... - def iterate_sinks(self) -> typing.Optional[Iterator]: ... - def iterate_sorted(self) -> typing.Optional[Iterator]: ... - def iterate_sources(self) -> typing.Optional[Iterator]: ... + ) -> Iterator[Element]: ... + def iterate_all_by_interface(self, iface: typing.Type[typing.Any]) -> Iterator: ... + def iterate_elements(self) -> Iterator[Element]: ... + def iterate_recurse(self) -> Iterator[Element]: ... + def iterate_sinks(self) -> Iterator[Element]: ... + def iterate_sorted(self) -> Iterator[Element]: ... + def iterate_sources(self) -> Iterator[Element]: ... def make_and_add( self, factoryname: str, name: typing.Optional[str] = None ) -> Element: @@ -2374,9 +2369,9 @@ class Element(Object): ) -> typing.Tuple[StateChangeReturn, State, State]: ... def get_static_pad(self, name: str) -> typing.Optional[Pad]: ... def is_locked_state(self) -> bool: ... - def iterate_pads(self) -> Iterator: ... - def iterate_sink_pads(self) -> Iterator: ... - def iterate_src_pads(self) -> Iterator: ... + def iterate_pads(self) -> Iterator[Gst.Pad]: ... + def iterate_sink_pads(self) -> Iterator[Gst.Pad]: ... + def iterate_src_pads(self) -> Iterator[Gst.Pad]: ... def link(self, dest: Element) -> bool: ... def link_filtered( self, dest: Element, filter: typing.Optional[Caps] = None @@ -2901,12 +2896,6 @@ class GhostPad(ProxyPad): name: typing.Optional[str] = ..., parent: Object = ..., ) -> None: ... - def __init__( - self, - name: str, - target: typing.Optional[Pad] = None, - direction: typing.Optional[PadDirection] = None, - ): ... # FIXME: Override is missing typing annotation @staticmethod def activate_mode_default( pad: Pad, parent: typing.Optional[Object], mode: PadMode, active: bool @@ -2999,7 +2988,7 @@ class IntRange: """ def __init__(self, r: range): ... # FIXME: Override is missing typing annotation -class Iterator(GObject.GBoxed): +class Iterator(GObject.GBoxed, typing.Generic[T]): """ :Constructors: @@ -3016,7 +3005,7 @@ class Iterator(GObject.GBoxed): cookie: int = ... master_cookie: int = ... size: int = ... - def __iter__(self) -> typing.Iterator[typing.Any]: ... + def __iter__(self) -> typing.Iterator[T]: ... def copy(self) -> Iterator: ... def filter( self, func: typing.Callable[[None, None], int], user_data: typing.Any @@ -3782,9 +3771,6 @@ class Pad(Object): name: typing.Optional[str] = ..., parent: Object = ..., ) -> None: ... - def __init__( - self, *args, **kwargs - ): ... # FIXME: Override is missing typing annotation def activate_mode(self, mode: PadMode, active: bool) -> bool: ... def add_probe( self, @@ -4229,9 +4215,6 @@ class Pipeline(Bin, ChildProxy): name: typing.Optional[str] = ..., parent: Object = ..., ) -> None: ... - def __init__( - self, name: typing.Optional[str] = None - ): ... # FIXME: Override is missing typing annotation def auto_clock(self) -> None: ... def get_auto_flush_bus(self) -> bool: ... def get_bus(self) -> Bus: ... diff --git a/src/gi-stubs/repository/GstPbutils.pyi b/src/gi-stubs/repository/GstPbutils.pyi index ea157919..e2186eb9 100644 --- a/src/gi-stubs/repository/GstPbutils.pyi +++ b/src/gi-stubs/repository/GstPbutils.pyi @@ -15,7 +15,7 @@ ENCODING_CATEGORY_FILE_EXTENSION: str = "file-extension" ENCODING_CATEGORY_ONLINE_SERVICE: str = "online-service" ENCODING_CATEGORY_STORAGE_EDITING: str = "storage-editing" PLUGINS_BASE_VERSION_MAJOR: int = 1 -PLUGINS_BASE_VERSION_MICRO: int = 10 +PLUGINS_BASE_VERSION_MICRO: int = 11 PLUGINS_BASE_VERSION_MINOR: int = 26 PLUGINS_BASE_VERSION_NANO: int = 1