GstRtspServer.RTSPAddressPool

g GObject.Object GObject.Object GstRtspServer.RTSPAddressPool GstRtspServer.RTSPAddressPool GObject.Object->GstRtspServer.RTSPAddressPool

Subclasses:

None

Methods

Inherited:

GObject.Object (37)

Structs:

GObject.ObjectClass (5)

class

new ()

acquire_address (flags, n_ports)

add_range (min_address, max_address, min_port, max_port, ttl)

clear ()

dump ()

has_unicast_addresses ()

reserve_address (ip_address, port, n_ports, ttl)

Virtual Methods

Inherited:

GObject.Object (7)

Properties

None

Signals

Inherited:

GObject.Object (1)

Fields

Inherited:

GObject.Object (1)

Name

Type

Access

Description

parent

GObject.Object

r

the parent GObject.Object

Class Details

class GstRtspServer.RTSPAddressPool(**kwargs)
Bases:

GObject.Object

Abstract:

No

Structure:

GstRtspServer.RTSPAddressPoolClass

An address pool, all member are private

classmethod new()[source]
Returns:

a new GstRtspServer.RTSPAddressPool

Return type:

GstRtspServer.RTSPAddressPool

Make a new GstRtspServer.RTSPAddressPool.

acquire_address(flags, n_ports)[source]
Parameters:
Returns:

a GstRtspServer.RTSPAddress that should be freed with GstRtspServer.RTSPAddress.free after use or None when no address could be acquired.

Return type:

GstRtspServer.RTSPAddress or None

Take an address and ports from self. flags can be used to control the allocation. n_ports consecutive ports will be allocated of which the first one can be found in port.

add_range(min_address, max_address, min_port, max_port, ttl)[source]
Parameters:
  • min_address (str) – a minimum address to add

  • max_address (str) – a maximum address to add

  • min_port (int) – the minimum port

  • max_port (int) – the maximum port

  • ttl (int) – a TTL or 0 for unicast addresses

Returns:

True if the addresses could be added.

Return type:

bool

Adds the addresses from min_addess to max_address (inclusive) to self. The valid port range for the addresses will be from min_port to max_port inclusive.

When ttl is 0, min_address and max_address should be unicast addresses. min_address and max_address can be set to GstRtspServer.RTSP_ADDRESS_POOL_ANY_IPV4 or GstRtspServer.RTSP_ADDRESS_POOL_ANY_IPV6 to bind to all available IPv4 or IPv6 addresses.

When ttl > 0, min_address and max_address should be multicast addresses.

clear()[source]

Clear all addresses in self. There should be no outstanding allocations.

dump()[source]

Dump the free and allocated addresses to stdout.

has_unicast_addresses()[source]
Returns:

True if the pool includes any unicast addresses, False otherwise

Return type:

bool

Used to know if the pool includes any unicast addresses.

reserve_address(ip_address, port, n_ports, ttl)[source]
Parameters:
  • ip_address (str) – The IP address to reserve

  • port (int) – The first port to reserve

  • n_ports (int) – The number of ports

  • ttl (int) – The requested ttl

Returns:

GstRtspServer.RTSPAddressPoolResult.OK if an address was reserved. The address is returned in address and should be freed with GstRtspServer.RTSPAddress.free after use.

address:

storage for a GstRtspServer.RTSPAddress

Return type:

(GstRtspServer.RTSPAddressPoolResult, address: GstRtspServer.RTSPAddress)

Take a specific address and ports from self. n_ports consecutive ports will be allocated of which the first one can be found in port.

If ttl is 0, address should be a unicast address. If ttl > 0, address should be a valid multicast address.