:right-sidebar: True NetTimePacket =================================================================== .. currentmodule:: gi.repository.GstNet .. class:: NetTimePacket(*args, **kwargs) :no-contents-entry: Various functions for receiving, sending an serializing :obj:`~gi.repository.GstNet.NetTimePacket` structures. Constructors ------------ .. rst-class:: interim-class .. class:: NetTimePacket :no-index: .. classmethod:: new(buffer: list[int] | None = None) -> ~gi.repository.GstNet.NetTimePacket Creates a new :obj:`~gi.repository.GstNet.NetTimePacket` from a buffer received over the network. The caller is responsible for ensuring that ``buffer`` is at least ``GST_NET_TIME_PACKET_SIZE`` bytes long. If ``buffer`` is :const:`None`, the local and remote times will be set to ``GST_CLOCK_TIME_NONE``. MT safe. Caller owns return value (gst_net_time_packet_free to free). :param buffer: a buffer from which to construct the packet, or NULL Methods ------- .. rst-class:: interim-class .. class:: NetTimePacket :no-index: .. method:: free() -> None Free ``packet``\. .. classmethod:: receive() -> ~typing.Tuple[~gi.repository.GstNet.NetTimePacket, ~gi.repository.Gio.SocketAddress] Receives a :obj:`~gi.repository.GstNet.NetTimePacket` over a socket. Handles interrupted system calls, but otherwise returns NULL on error. .. method:: send(socket: ~gi.repository.Gio.Socket, dest_address: ~gi.repository.Gio.SocketAddress) -> bool Sends a :obj:`~gi.repository.GstNet.NetTimePacket` over a socket. MT safe. :param socket: socket to send the time packet on :param dest_address: address to send the time packet to .. method:: serialize() -> list[int] Serialized a :obj:`~gi.repository.GstNet.NetTimePacket` into a newly-allocated sequence of ``GST_NET_TIME_PACKET_SIZE`` bytes, in network byte order. The value returned is suitable for passing to write(2) or sendto(2) for communication over the network. MT safe. Caller owns return value (g_free to free). Fields ------ .. rst-class:: interim-class .. class:: NetTimePacket :no-index: .. attribute:: local_time The local time when this packet was sent .. attribute:: remote_time The remote time observation