# GstNetTimePacket

Various functions for receiving, sending an serializing GstNetTimePacket structures.

## GstNetTimePacket

Content of a GstNetTimePacket.

### Members

`local_time` (GstClockTime) –

the local time when this packet was sent

`remote_time` (GstClockTime) –

the remote time observation

## GstNet.NetTimePacket

Content of a GstNet.NetTimePacket.

### Members

`local_time` (Number) –

the local time when this packet was sent

`remote_time` (Number) –

the remote time observation

## GstNet.NetTimePacket

Content of a GstNet.NetTimePacket.

### Members

`local_time` (int) –

the local time when this packet was sent

`remote_time` (int) –

the remote time observation

### Constructors

#### gst_net_time_packet_new

    GstNetTimePacket *
    gst_net_time_packet_new (const guint8* buffer)

Creates a new GstNetTimePacket 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 NULL, 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).

Parameters:

`buffer` ( [arrayzero-terminated=0][nullable]) –

a buffer from which to construct the packet, or NULL

Returns ( [transfer: full]) –

The new GstNetTimePacket.

#### GstNet.NetTimePacket.prototype.new

    function GstNet.NetTimePacket.prototype.new(buffer: [ Number ]): {
        // javascript wrapper for 'gst_net_time_packet_new'
    }

Creates a new GstNet.NetTimePacket from a buffer received over the network. The caller is responsible for ensuring that buffer is at least GstNet.NET_TIME_PACKET_SIZE bytes long.

If buffer is NULL, 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).

Parameters:

`buffer` ([ Number ]) –

a buffer from which to construct the packet, or NULL

Returns (GstNet.NetTimePacket) –

The new GstNet.NetTimePacket.

#### GstNet.NetTimePacket.new

    def GstNet.NetTimePacket.new (buffer):
        #python wrapper for 'gst_net_time_packet_new'

Creates a new GstNet.NetTimePacket from a buffer received over the network. The caller is responsible for ensuring that buffer is at least GstNet.NET_TIME_PACKET_SIZE bytes long.

If buffer is NULL, 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).

Parameters:

`buffer` ([ int ]) –

a buffer from which to construct the packet, or NULL

Returns (GstNet.NetTimePacket) –

The new GstNet.NetTimePacket.

### Methods

#### gst_net_time_packet_copy

    GstNetTimePacket *
    gst_net_time_packet_copy (const GstNetTimePacket * packet)

Make a copy of packet.

Parameters:

`packet` –

the GstNetTimePacket

Returns ( [transfer: full]) –

a copy of packet, free with gst_net_time_packet_free.

#### GstNet.NetTimePacket.prototype.copy

    function GstNet.NetTimePacket.prototype.copy(): {
        // javascript wrapper for 'gst_net_time_packet_copy'
    }

Make a copy of packet.

Parameters:

`packet` (GstNet.NetTimePacket) –

the GstNet.NetTimePacket

Returns (GstNet.NetTimePacket) –

a copy of packet, free with GstNet.NetTimePacket.prototype.free.

#### GstNet.NetTimePacket.copy

    def GstNet.NetTimePacket.copy (self):
        #python wrapper for 'gst_net_time_packet_copy'

Make a copy of packet.

Parameters:

`packet` (GstNet.NetTimePacket) –

the GstNet.NetTimePacket

Returns (GstNet.NetTimePacket) –

a copy of packet, free with GstNet.NetTimePacket.free.

#### gst_net_time_packet_free

    gst_net_time_packet_free (GstNetTimePacket * packet)

Free packet.

Parameters:

`packet` –

the GstNetTimePacket

#### GstNet.NetTimePacket.prototype.free

    function GstNet.NetTimePacket.prototype.free(): {
        // javascript wrapper for 'gst_net_time_packet_free'
    }

Free packet.

Parameters:

`packet` (GstNet.NetTimePacket) –

the GstNet.NetTimePacket

#### GstNet.NetTimePacket.free

    def GstNet.NetTimePacket.free (self):
        #python wrapper for 'gst_net_time_packet_free'

Free packet.

Parameters:

`packet` (GstNet.NetTimePacket) –

the GstNet.NetTimePacket

#### gst_net_time_packet_send

    gboolean
    gst_net_time_packet_send (const GstNetTimePacket * packet,
                              GSocket * socket,
                              GSocketAddress * dest_address,
                              GError ** error)

Sends a GstNetTimePacket over a socket.

MT safe.

Parameters:

`packet` –

the GstNetTimePacket to send

`socket` –

socket to send the time packet on

`dest_address` –

address to send the time packet to

`error` –

return address for a GError, or NULL

Returns –

TRUE if successful, FALSE in case an error occurred.

#### GstNet.NetTimePacket.prototype.send

    function GstNet.NetTimePacket.prototype.send(socket: Gio.Socket, dest_address: Gio.SocketAddress): {
        // javascript wrapper for 'gst_net_time_packet_send'
    }

Sends a GstNet.NetTimePacket over a socket.

MT safe.

Parameters:

`packet` (GstNet.NetTimePacket) –

the GstNet.NetTimePacket to send

`socket` (Gio.Socket) –

socket to send the time packet on

`dest_address` (Gio.SocketAddress) –

address to send the time packet to

Returns (Number) –

TRUE if successful, FALSE in case an error occurred.

#### GstNet.NetTimePacket.send

    @raises(GLib.GError)
    def GstNet.NetTimePacket.send (self, socket, dest_address):
        #python wrapper for 'gst_net_time_packet_send'

Sends a GstNet.NetTimePacket over a socket.

MT safe.

Parameters:

`packet` (GstNet.NetTimePacket) –

the GstNet.NetTimePacket to send

`socket` (Gio.Socket) –

socket to send the time packet on

`dest_address` (Gio.SocketAddress) –

address to send the time packet to

Returns (bool) –

TRUE if successful, FALSE in case an error occurred.

#### gst_net_time_packet_serialize

    guint8*
    gst_net_time_packet_serialize (const GstNetTimePacket * packet)

Serialized a GstNetTimePacket 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).

Parameters:

`packet` –

the GstNetTimePacket

Returns ( [transfer: full][arrayzero-terminated=0]) –

A newly allocated sequence of GST_NET_TIME_PACKET_SIZE bytes.

#### GstNet.NetTimePacket.prototype.serialize

    function GstNet.NetTimePacket.prototype.serialize(): {
        // javascript wrapper for 'gst_net_time_packet_serialize'
    }

Serialized a GstNet.NetTimePacket into a newly-allocated sequence of GstNet.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).

Parameters:

`packet` (GstNet.NetTimePacket) –

the GstNet.NetTimePacket

Returns ([ Number ]) –

A newly allocated sequence of GstNet.NET_TIME_PACKET_SIZE bytes.

#### GstNet.NetTimePacket.serialize

    def GstNet.NetTimePacket.serialize (self):
        #python wrapper for 'gst_net_time_packet_serialize'

Serialized a GstNet.NetTimePacket into a newly-allocated sequence of GstNet.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).

Parameters:

`packet` (GstNet.NetTimePacket) –

the GstNet.NetTimePacket

Returns ([ int ]) –

A newly allocated sequence of GstNet.NET_TIME_PACKET_SIZE bytes.

### Functions

#### gst_net_time_packet_receive

    GstNetTimePacket *
    gst_net_time_packet_receive (GSocket * socket,
                                 GSocketAddress ** src_address,
                                 GError ** error)

Receives a GstNetTimePacket over a socket. Handles interrupted system calls, but otherwise returns NULL on error.

Parameters:

`socket` –

socket to receive the time packet on

`src_address` ( [out][optional][transfer: full]) –

address of variable to return sender address

`error` –

return address for a GError, or NULL

Returns ( [transfer: full]) –

a new GstNetTimePacket, or NULL on error. Free with gst_net_time_packet_free when done.

#### GstNet.prototype.net_time_packet_receive

    function GstNet.prototype.net_time_packet_receive(socket: Gio.Socket): {
        // javascript wrapper for 'gst_net_time_packet_receive'
    }

Receives a GstNet.NetTimePacket over a socket. Handles interrupted system calls, but otherwise returns NULL on error.

Parameters:

`socket` (Gio.Socket) –

socket to receive the time packet on

Returns a tuple made of:

(GstNet.NetTimePacket ) –

a new GstNet.NetTimePacket, or NULL on error. Free with GstNet.NetTimePacket.prototype.free when done.

`src_address` (Gio.SocketAddress ) –

a new GstNet.NetTimePacket, or NULL on error. Free with GstNet.NetTimePacket.prototype.free when done.

#### GstNet.net_time_packet_receive

    @raises(GLib.GError)
    def GstNet.net_time_packet_receive (socket):
        #python wrapper for 'gst_net_time_packet_receive'

Receives a GstNet.NetTimePacket over a socket. Handles interrupted system calls, but otherwise returns NULL on error.

Parameters:

`socket` (Gio.Socket) –

socket to receive the time packet on

Returns a tuple made of:

(GstNet.NetTimePacket ) –

a new GstNet.NetTimePacket, or NULL on error. Free with GstNet.NetTimePacket.free when done.

`src_address` (Gio.SocketAddress ) –

a new GstNet.NetTimePacket, or NULL on error. Free with GstNet.NetTimePacket.free when done.

## Constants

### GST_NET_TIME_PACKET_SIZE

    #define GST_NET_TIME_PACKET_SIZE 16

The size of the packets sent between network clocks.

### GstNet.NET_TIME_PACKET_SIZE

The size of the packets sent between network clocks.

### GstNet.NET_TIME_PACKET_SIZE

The size of the packets sent between network clocks.

The results of the search are