Top | ![]() |
![]() |
![]() |
![]() |
#define | GST_RTSP_ADDRESS_POOL_ANY_IPV4 |
#define | GST_RTSP_ADDRESS_POOL_ANY_IPV6 |
struct | GstRTSPAddress |
enum | GstRTSPAddressFlags |
struct | GstRTSPAddressPool |
struct | GstRTSPAddressPoolClass |
enum | GstRTSPAddressPoolResult |
The GstRTSPAddressPool is an object that maintains a collection of network addresses. It is used to allocate server ports and server multicast addresses but also to reserve client provided destination addresses.
A range of addresses can be added with gst_rtsp_address_pool_add_range()
.
Both multicast and unicast addresses can be added.
With gst_rtsp_address_pool_acquire_address()
an unused address and port range
can be acquired from the pool. With gst_rtsp_address_pool_reserve_address()
a
specific address can be retrieved. Both methods return a boxed
GstRTSPAddress that should be freed with gst_rtsp_address_free()
after
usage, which brings the address back into the pool.
Last reviewed on 2013-07-16 (1.0.0)
GstRTSPAddress *
gst_rtsp_address_copy (GstRTSPAddress *addr
);
Make a copy of addr
.
void
gst_rtsp_address_free (GstRTSPAddress *addr
);
Free addr
and releasing it back into the pool when owned by a
pool.
GstRTSPAddressPool *
gst_rtsp_address_pool_new (void
);
Make a new GstRTSPAddressPool.
void
gst_rtsp_address_pool_clear (GstRTSPAddressPool *pool
);
Clear all addresses in pool
. There should be no outstanding
allocations.
void
gst_rtsp_address_pool_dump (GstRTSPAddressPool *pool
);
Dump the free and allocated addresses to stdout.
gboolean gst_rtsp_address_pool_add_range (GstRTSPAddressPool *pool
,const gchar *min_address
,const gchar *max_address
,guint16 min_port
,guint16 max_port
,guint8 ttl
);
Adds the addresses from min_addess
to max_address
(inclusive)
to pool
. 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
GST_RTSP_ADDRESS_POOL_ANY_IPV4 or GST_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.
gboolean
gst_rtsp_address_pool_has_unicast_addresses
(GstRTSPAddressPool *pool
);
Used to know if the pool includes any unicast addresses.
GstRTSPAddress * gst_rtsp_address_pool_acquire_address (GstRTSPAddressPool *pool
,GstRTSPAddressFlags flags
,gint n_ports
);
Take an address and ports from pool
. 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
.
a GstRTSPAddress that should be freed with
gst_rtsp_address_free after use or NULL
when no address could be
acquired.
[nullable]
GstRTSPAddressPoolResult gst_rtsp_address_pool_reserve_address (GstRTSPAddressPool *pool
,const gchar *ip_address
,guint port
,guint n_ports
,guint ttl
,GstRTSPAddress **address
);
Take a specific address and ports from pool
. 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.
pool |
||
ip_address |
The IP address to reserve |
|
port |
The first port to reserve |
|
n_ports |
The number of ports |
|
ttl |
The requested ttl |
|
address |
storage for a GstRTSPAddress. |
[out] |
GST_RTSP_ADDRESS_POOL_OK if an address was reserved. The address
is returned in address
and should be freed with gst_rtsp_address_free
after use.
#define GST_RTSP_ADDRESS_POOL_ANY_IPV4 "0.0.0.0"
Used with gst_rtsp_address_pool_add_range()
to bind to all
IPv4 addresses
#define GST_RTSP_ADDRESS_POOL_ANY_IPV6 "::"
Used with gst_rtsp_address_pool_add_range()
to bind to all
IPv6 addresses
struct GstRTSPAddress { GstRTSPAddressPool *pool; gchar *address; guint16 port; gint n_ports; guint8 ttl; };
An address
GstRTSPAddressPool * |
the GstRTSPAddressPool owner of this address |
|
gchar * |
the address |
|
guint16 |
the port number |
|
gint |
number of ports |
|
guint8 |
TTL or 0 for unicast addresses |
struct GstRTSPAddressPoolClass { GObjectClass parent_class; };
Opaque Address pool class.