![]() |
![]() |
![]() |
GStreamer RTSP Server Reference Manual | ![]() |
---|---|---|---|---|
Top | Description |
#define GST_RTSP_ADDRESS_POOL_ANY_IPV4 #define GST_RTSP_ADDRESS_POOL_ANY_IPV6 struct GstRTSPAddress; enum GstRTSPAddressFlags; GstRTSPAddress * gst_rtsp_address_copy (GstRTSPAddress *addr
); void gst_rtsp_address_free (GstRTSPAddress *addr
); struct GstRTSPAddressPool; struct GstRTSPAddressPoolClass; enum GstRTSPAddressPoolResult; GstRTSPAddressPool * gst_rtsp_address_pool_new (void
); void gst_rtsp_address_pool_clear (GstRTSPAddressPool *pool
); void gst_rtsp_address_pool_dump (GstRTSPAddressPool *pool
); 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
); gboolean gst_rtsp_address_pool_has_unicast_addresses (GstRTSPAddressPool *pool
); GstRTSPAddress * gst_rtsp_address_pool_acquire_address (GstRTSPAddressPool *pool
,GstRTSPAddressFlags flags
,gint n_ports
); GstRTSPAddressPoolResult gst_rtsp_address_pool_reserve_address (GstRTSPAddressPool *pool
,const gchar *ip_address
,guint port
,guint n_ports
,guint ttl
,GstRTSPAddress **address
);
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)
#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 |
the address | |
the port number | |
number of ports | |
TTL or 0 for unicast addresses |
typedef enum { GST_RTSP_ADDRESS_FLAG_NONE = 0, GST_RTSP_ADDRESS_FLAG_IPV4 = (1 << 0), GST_RTSP_ADDRESS_FLAG_IPV6 = (1 << 1), GST_RTSP_ADDRESS_FLAG_EVEN_PORT = (1 << 2), GST_RTSP_ADDRESS_FLAG_MULTICAST = (1 << 3), GST_RTSP_ADDRESS_FLAG_UNICAST = (1 << 4), } GstRTSPAddressFlags;
Flags used to control allocation of addresses
GstRTSPAddress * gst_rtsp_address_copy (GstRTSPAddress *addr
);
Make a copy of addr
.
|
a GstRTSPAddress |
Returns : |
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.
|
a GstRTSPAddress |
struct GstRTSPAddressPool { GObject parent; };
An address pool, all member are private
struct GstRTSPAddressPoolClass { GObjectClass parent_class; };
Opaque Address pool class.
typedef enum { GST_RTSP_ADDRESS_POOL_OK = 0, /* errors */ GST_RTSP_ADDRESS_POOL_EINVAL = -1, GST_RTSP_ADDRESS_POOL_ERESERVED = -2, GST_RTSP_ADDRESS_POOL_ERANGE = -3, GST_RTSP_ADDRESS_POOL_ELAST = -4, } GstRTSPAddressPoolResult;
Result codes from RTSP address pool functions.
GstRTSPAddressPool * gst_rtsp_address_pool_new (void
);
Make a new GstRTSPAddressPool.
Returns : |
a new GstRTSPAddressPool. [transfer full] |
void gst_rtsp_address_pool_clear (GstRTSPAddressPool *pool
);
Clear all addresses in pool
. There should be no outstanding
allocations.
|
a GstRTSPAddressPool |
void gst_rtsp_address_pool_dump (GstRTSPAddressPool *pool
);
Dump the free and allocated addresses to stdout.
|
a GstRTSPAddressPool |
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.
|
a GstRTSPAddressPool |
|
a minimum address to add |
|
a maximum address to add |
|
the minimum port |
|
the maximum port |
|
a TTL or 0 for unicast addresses |
Returns : |
TRUE if the addresses could be added. |
gboolean gst_rtsp_address_pool_has_unicast_addresses
(GstRTSPAddressPool *pool
);
Used to know if the pool includes any unicast addresses.
|
a GstRTSPAddressPool |
Returns : |
TRUE if the pool includes any unicast addresses, FALSE otherwise |
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 GstRTSPAddressPool |
|
flags |
|
the amount of ports |
Returns : |
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.
|
a GstRTSPAddressPool |
|
The IP address to reserve |
|
The first port to reserve |
|
The number of ports |
|
The requested ttl |
|
storage for a GstRTSPAddress. [out] |
Returns : |
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. |