![]() |
![]() |
![]() |
GStreamer Base Plugins 0.10 Library Reference Manual | ![]() |
---|---|---|---|---|
#include <gst/netbuffer/gstnetbuffer.h> GstNetBuffer; enum GstNetType; GstNetAddress; GstNetBuffer* gst_netbuffer_new (void); gboolean gst_netaddress_get_ip4_address (GstNetAddress *naddr, guint32 *address, guint16 *port); gboolean gst_netaddress_get_ip6_address (GstNetAddress *naddr, guint8 address[16], guint16 *port); GstNetType gst_netaddress_get_net_type (GstNetAddress *naddr); void gst_netaddress_set_ip4_address (GstNetAddress *naddr, guint32 address, guint16 port); void gst_netaddress_set_ip6_address (GstNetAddress *naddr, guint8 address[16], guint16 port); gboolean gst_netaddress_equal (const GstNetAddress *naddr1, const GstNetAddress *naddr2);
GstNetBuffer is a subclass of a normal GstBuffer that contains two additional metadata fields of type GstNetAddress named 'to' and 'from'. The buffer can be used to store additional information about the origin of the buffer data and is used in various network elements to track the to and from addresses.
Last reviewed on 2006-08-21 (0.10.10)
typedef struct { GstBuffer buffer; GstNetAddress from; GstNetAddress to; } GstNetBuffer;
buffer for use in network sources and sinks. It contains the source or destination address of the buffer.
GstBuffer |
the parent GstBuffer |
GstNetAddress |
the address where this buffer came from. |
GstNetAddress |
the address where this buffer should go to. |
typedef enum { GST_NET_TYPE_UNKNOWN, GST_NET_TYPE_IP4, GST_NET_TYPE_IP6, } GstNetType;
The Address type used in GstNetAddress.
GstNetBuffer* gst_netbuffer_new (void);
Create a new network buffer.
Returns : |
a new GstNetBuffer. |
gboolean gst_netaddress_get_ip4_address (GstNetAddress *naddr, guint32 *address, guint16 *port);
Get the IPv4 address stored in naddr
into address
.
|
a network address |
|
a location to store the address. |
|
a location to store the port. |
Returns : |
TRUE if the address could be retrieved. |
gboolean gst_netaddress_get_ip6_address (GstNetAddress *naddr, guint8 address[16], guint16 *port);
Get the IPv6 address stored in naddr
into address
.
|
a network address |
|
a location to store the result. |
|
a location to store the port. |
Returns : |
TRUE if the address could be retrieved. |
GstNetType gst_netaddress_get_net_type (GstNetAddress *naddr);
Get the type of address stored in naddr
.
|
a network address |
Returns : |
the network type stored in naddr .
|
void gst_netaddress_set_ip4_address (GstNetAddress *naddr, guint32 address, guint16 port);
Set naddr
with the IPv4 address
and port
pair.
|
a network address |
|
an IPv4 network address. |
|
a port number to set. |
void gst_netaddress_set_ip6_address (GstNetAddress *naddr, guint8 address[16], guint16 port);
Set naddr
with the IPv6 address
and port
pair.
|
a network address |
|
an IPv6 network address. |
|
a port number to set. |
gboolean gst_netaddress_equal (const GstNetAddress *naddr1, const GstNetAddress *naddr2);
Compare two GstNetAddress structures
|
The first GstNetAddress |
|
The second GstNetAddress |
Returns : |
TRUE if they are identical, FALSE otherwise |
Since 0.10.18