|
| 1 | +from typing import Any, Optional, Callable |
| 2 | + |
| 3 | +from gi.repository import Gst, GObject, Gio |
| 4 | + |
| 5 | + |
| 6 | +# https://gstreamer.freedesktop.org/documentation/net/gstnetaddressmeta.html?gi-language=python |
| 7 | + |
| 8 | +class NetAddressMeta(Gst.Meta): |
| 9 | + meta: Gst.Meta |
| 10 | + addr: Gio.SocketAddress |
| 11 | + |
| 12 | +def net_address_meta_get_info() -> Gst.MetaInfo: ... |
| 13 | +def buffer_add_net_address_meta(buffer: Gst.Buffer, addr: Gio.SocketAddress) -> NetAddressMeta: ... |
| 14 | +def buffer_get_net_address_meta(buffer: Gst.Buffer) -> NetAddressMeta: ... |
| 15 | +def net_address_meta_api_get_type() -> GObject.GType: ... |
| 16 | + |
| 17 | +# https://gstreamer.freedesktop.org/documentation/net/gstnetclientclock.html?gi-language=python |
| 18 | + |
| 19 | +class NetClientClock(Gst.SystemClock): |
| 20 | + class Props(Gst.SystemClock.Props): |
| 21 | + address: str |
| 22 | + base_time: int |
| 23 | + bus: Gst.Bus |
| 24 | + internal_clock: Gst.Clock |
| 25 | + minimum_update_interval: int |
| 26 | + port: int |
| 27 | + qos_dscp: int |
| 28 | + round_trip_limit: int |
| 29 | + |
| 30 | + props: Props = ... |
| 31 | + |
| 32 | + clock: Gst.SystemClock = ... |
| 33 | + |
| 34 | + @staticmethod |
| 35 | + def new(name: str, remote_address: str, remote_port: int, base_time: int) -> 'NetClientClock': ... |
| 36 | + |
| 37 | +# https://gstreamer.freedesktop.org/documentation/net/gstnetcontrolmessagemeta.html?gi-language=python |
| 38 | + |
| 39 | +class NetControlMessageMeta(Gst.Meta): |
| 40 | + meta: Gst.Meta |
| 41 | + message: Gio.SocketControlMessage |
| 42 | + |
| 43 | +def net_control_message_meta_get_info() -> Gst.MetaInfo: ... |
| 44 | +def buffer_add_net_control_message_meta(buffer: Gst.Buffer, message: Gio.SocketControlMessage) -> NetControlMessageMeta: ... |
| 45 | +def net_control_message_meta_api_get_type() -> GObject.GType: ... |
| 46 | + |
| 47 | +# https://gstreamer.freedesktop.org/documentation/net/gstnettimepacket.html?gi-language=python |
| 48 | + |
| 49 | +NET_TIME_PACKET_SIZE = 16 |
| 50 | + |
| 51 | +class NetTimePacket: |
| 52 | + local_time: int = ... |
| 53 | + remote_time: int = ... |
| 54 | + |
| 55 | + @staticmethod |
| 56 | + def new(buffer: list[int]) -> NetTimePacket: ... |
| 57 | + |
| 58 | + def copy(self) -> NetTimePacket: ... |
| 59 | + def free(self) -> None: ... |
| 60 | + def send(self, socket: Gio.Socket, dest_address: Gio.SocketAddress) -> bool: ... |
| 61 | + def serialize(self) -> list[int]: ... |
| 62 | + |
| 63 | +def net_time_packet_receive(socket: Gio.Socket) -> tuple[NetTimePacket, Gio.SocketAddress]: ... |
| 64 | + |
| 65 | +# https://gstreamer.freedesktop.org/documentation/net/gstnettimeprovider.html?gi-language=python |
| 66 | + |
| 67 | +class NetTimeProvider(Gst.Object): |
| 68 | + class Props(Gst.Object.Props): |
| 69 | + active: bool |
| 70 | + address: str |
| 71 | + clock: Gst.Clock |
| 72 | + port: int |
| 73 | + qos_dscp: int |
| 74 | + |
| 75 | + props: Props = ... |
| 76 | + |
| 77 | + @staticmethod |
| 78 | + def new(clock: Gst.Clock, address: str, port: int) -> 'NetTimeProvider': ... |
| 79 | + |
| 80 | +# https://gstreamer.freedesktop.org/documentation/net/gstnetclientclock.html?gi-language=python#GstNtpClock |
| 81 | + |
| 82 | +class NtpClock(NetClientClock): |
| 83 | + @staticmethod |
| 84 | + def new(name: str, remote_address: str, remote_port: int, base_time: int) -> 'NtpClock': ... |
| 85 | + |
| 86 | +# https://gstreamer.freedesktop.org/documentation/net/gstptpclock.html?gi-language=python |
| 87 | + |
| 88 | +PTP_CLOCK_ID_NONE: int = ... |
| 89 | +PTP_STATISTICS_BEST_MASTER_CLOCK_SELECTED: str = "GstPtpStatisticsBestMasterClockSelected" |
| 90 | +PTP_STATISTICS_NEW_DOMAIN_FOUND: str = "GstPtpStatisticsNewDomainFound" |
| 91 | +PTP_STATISTICS_PATH_DELAY_MEASURED: str = "GstPtpStatisticsPathDelayMeasured" |
| 92 | +PTP_STATISTICS_TIME_UPDATED: str = "GstPtpStatisticsTimeUpdated" |
| 93 | + |
| 94 | +class PtpClock(Gst.SystemClock): |
| 95 | + class Props(Gst.SystemClock.Props): |
| 96 | + domain: int |
| 97 | + grandmaster_clock_id: int |
| 98 | + internal_clock: Gst.Clock |
| 99 | + master_clock_id: int |
| 100 | + |
| 101 | + props: Props = ... |
| 102 | + |
| 103 | + @staticmethod |
| 104 | + def new(name: str, domain: int) -> 'PtpClock': ... |
| 105 | + |
| 106 | +def ptp_deinit() -> None: ... |
| 107 | +def ptp_init(clock_id: int, interfaces: list[str]) -> bool: ... |
| 108 | +def ptp_init_full(config: Gst.Structure) -> bool: ... |
| 109 | +def ptp_is_initialized() -> bool: ... |
| 110 | +def ptp_is_supported() -> bool: ... |
| 111 | + |
| 112 | +PtpStatisticsCallback = Callable[[int, Gst.Structure, Any], bool] |
| 113 | +def ptp_statistics_callback_add(callback: Optional[PtpStatisticsCallback] = None, *user_data: Any) -> int: ... |
| 114 | +def ptp_statistics_callback_remove(id: int) -> None: ... |
| 115 | + |
| 116 | +# https://gstreamer.freedesktop.org/documentation/net/gstnetutils.html?gi-language=python |
| 117 | + |
| 118 | +def net_utils_set_socket_tos(socket: Gio.Socket, qos_dscp: int) -> bool: ... |
0 commit comments