From f212805058f1b75be37a586a52da61c84586b938 Mon Sep 17 00:00:00 2001 From: Wim Taymans Date: Mon, 21 Aug 2006 10:32:51 +0000 Subject: [PATCH] docs/libs/: Don't try to GObject scan the netbuffer as it's not a GObject. Original commit message from CVS: * docs/libs/Makefile.am: * docs/libs/gst-plugins-base-libs-sections.txt: * docs/libs/gst-plugins-base-libs.types: Don't try to GObject scan the netbuffer as it's not a GObject. Fixes #351308. * gst-libs/gst/netbuffer/gstnetbuffer.c: * gst-libs/gst/netbuffer/gstnetbuffer.h: Document GstNetBuffer. --- ChangeLog | 12 ++++ docs/libs/Makefile.am | 1 - docs/libs/gst-plugins-base-libs-sections.txt | 1 + docs/libs/gst-plugins-base-libs.types | 4 -- gst-libs/gst/netbuffer/gstnetbuffer.c | 60 +++++++++++++++++++- gst-libs/gst/netbuffer/gstnetbuffer.h | 39 +++++++++---- 6 files changed, 101 insertions(+), 16 deletions(-) diff --git a/ChangeLog b/ChangeLog index 0b1dc4c618..7b03b374e0 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,15 @@ +2006-08-21 Wim Taymans + + * docs/libs/Makefile.am: + * docs/libs/gst-plugins-base-libs-sections.txt: + * docs/libs/gst-plugins-base-libs.types: + Don't try to GObject scan the netbuffer as it's not a GObject. + Fixes #351308. + + * gst-libs/gst/netbuffer/gstnetbuffer.c: + * gst-libs/gst/netbuffer/gstnetbuffer.h: + Document GstNetBuffer. + 2006-08-21 Stefan Kost * tests/check/elements/audioconvert.c: (GST_START_TEST), diff --git a/docs/libs/Makefile.am b/docs/libs/Makefile.am index ca58aac0ed..f9318c7136 100644 --- a/docs/libs/Makefile.am +++ b/docs/libs/Makefile.am @@ -69,7 +69,6 @@ SCANOBJ_DEPS = \ $(top_builddir)/gst-libs/gst/interfaces/libgstinterfaces-@GST_MAJORMINOR@.la \ $(top_builddir)/gst-libs/gst/audio/libgstaudio-@GST_MAJORMINOR@.la \ $(top_builddir)/gst-libs/gst/cdda/libgstcdda-@GST_MAJORMINOR@.la \ - $(top_builddir)/gst-libs/gst/netbuffer/libgstnetbuffer-@GST_MAJORMINOR@.la \ $(top_builddir)/gst-libs/gst/rtp/libgstrtp-@GST_MAJORMINOR@.la \ $(top_builddir)/gst-libs/gst/tag/libgsttag-@GST_MAJORMINOR@.la \ $(top_builddir)/gst-libs/gst/video/libgstvideo-@GST_MAJORMINOR@.la diff --git a/docs/libs/gst-plugins-base-libs-sections.txt b/docs/libs/gst-plugins-base-libs-sections.txt index f222e42f6d..ab128393c0 100644 --- a/docs/libs/gst-plugins-base-libs-sections.txt +++ b/docs/libs/gst-plugins-base-libs-sections.txt @@ -489,6 +489,7 @@ gst_x_overlay_get_type gst/netbuffer/gstnetbuffer.h GstNetBuffer GstNetType +GstNetAddress gst_netbuffer_new gst_netaddress_get_ip4_address diff --git a/docs/libs/gst-plugins-base-libs.types b/docs/libs/gst-plugins-base-libs.types index e397d1ed28..b25ab23027 100644 --- a/docs/libs/gst-plugins-base-libs.types +++ b/docs/libs/gst-plugins-base-libs.types @@ -40,10 +40,6 @@ gst_tuner_norm_get_type gst_x_overlay_get_type -#include -gst_netbuffer_get_type - - #include gst_base_rtp_depayload_get_type #include diff --git a/gst-libs/gst/netbuffer/gstnetbuffer.c b/gst-libs/gst/netbuffer/gstnetbuffer.c index 1ef018419b..b41bee943a 100644 --- a/gst-libs/gst/netbuffer/gstnetbuffer.c +++ b/gst-libs/gst/netbuffer/gstnetbuffer.c @@ -20,6 +20,14 @@ /** * SECTION:gstnetbuffer * @short_description: Buffer for use in network sources and sinks + * + * #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) */ #include @@ -95,6 +103,13 @@ gst_netbuffer_copy (GstNetBuffer * nbuf) return copy; } +/** + * gst_netbuffer_new: + * + * Create a new network buffer. + * + * Returns: a new #GstNetBuffer. + */ GstNetBuffer * gst_netbuffer_new (void) { @@ -105,6 +120,14 @@ gst_netbuffer_new (void) return buf; } +/** + * gst_netaddress_set_ip4_address: + * @naddr: a network address + * @address: an IPv4 network address. + * @port: a port number to set. + * + * Set @naddr with the IPv4 @address and @port pair. + */ void gst_netaddress_set_ip4_address (GstNetAddress * naddr, guint32 address, guint16 port) @@ -116,6 +139,14 @@ gst_netaddress_set_ip4_address (GstNetAddress * naddr, guint32 address, naddr->port = port; } +/** + * gst_netaddress_set_ip6_address: + * @naddr: a network address + * @address: an IPv6 network address. + * @port: a port number to set. + * + * Set @naddr with the IPv6 @address and @port pair. + */ void gst_netaddress_set_ip6_address (GstNetAddress * naddr, guint8 address[16], guint16 port) @@ -127,7 +158,14 @@ gst_netaddress_set_ip6_address (GstNetAddress * naddr, guint8 address[16], naddr->port = port; } - +/** + * gst_netaddress_get_net_type: + * @naddr: a network address + * + * Get the type of address stored in @naddr. + * + * Returns: the network type stored in @naddr. + */ GstNetType gst_netaddress_get_net_type (GstNetAddress * naddr) { @@ -136,6 +174,16 @@ gst_netaddress_get_net_type (GstNetAddress * naddr) return naddr->type; } +/** + * gst_netaddress_get_ip4_address: + * @naddr: a network address + * @address: a location to store the address. + * @port: a location to store the port. + * + * Get the IPv4 address stored in @naddr into @address. + * + * Returns: TRUE if the address could be retrieved. + */ gboolean gst_netaddress_get_ip4_address (GstNetAddress * naddr, guint32 * address, guint16 * port) @@ -153,6 +201,16 @@ gst_netaddress_get_ip4_address (GstNetAddress * naddr, guint32 * address, return TRUE; } +/** + * gst_netaddress_get_ip6_address: + * @naddr: a network address + * @address: a location to store the result. + * @port: a location to store the port. + * + * Get the IPv6 address stored in @naddr into @address. + * + * Returns: TRUE if the address could be retrieved. + */ gboolean gst_netaddress_get_ip6_address (GstNetAddress * naddr, guint8 address[16], guint16 * port) diff --git a/gst-libs/gst/netbuffer/gstnetbuffer.h b/gst-libs/gst/netbuffer/gstnetbuffer.h index 9bf73e0e57..2fd772149c 100644 --- a/gst-libs/gst/netbuffer/gstnetbuffer.h +++ b/gst-libs/gst/netbuffer/gstnetbuffer.h @@ -26,6 +26,7 @@ G_BEGIN_DECLS typedef struct _GstNetBuffer GstNetBuffer; typedef struct _GstNetBufferClass GstNetBufferClass; +typedef struct _GstNetAddress GstNetAddress; #define GST_TYPE_NETBUFFER (gst_netbuffer_get_type()) #define GST_IS_NETBUFFER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GST_TYPE_NETBUFFER)) @@ -34,9 +35,13 @@ typedef struct _GstNetBufferClass GstNetBufferClass; #define GST_NETBUFFER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GST_TYPE_NETBUFFER, GstNetBuffer)) #define GST_NETBUFFER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GST_TYPE_NETBUFFER, GstNetBufferClass)) -/* buffer for use in network sources and sinks. +/** + * GstNetType: + * @GST_NET_TYPE_UNKNOWN: unknown address type + * @GST_NET_TYPE_IP4: an IPv4 address type + * @GST_NET_TYPE_IP6: and IPv6 address type * - * It contains the source or destination address of the buffer. + * The Address type used in #GstNetAddress. */ typedef enum { GST_NET_TYPE_UNKNOWN, @@ -44,8 +49,13 @@ typedef enum { GST_NET_TYPE_IP6, } GstNetType; -typedef struct -{ +/** + * GstNetAddress: + * + * An opaque network address as used in #GstNetBuffer. + */ +struct _GstNetAddress { + /*< private >*/ GstNetType type; union { guint8 ip6[16]; @@ -54,8 +64,17 @@ typedef struct guint16 port; /*< private >*/ gpointer _gst_reserved[GST_PADDING]; -} GstNetAddress; +}; +/** + * GstNetBuffer: + * @buffer: the parent #GstBuffer + * @from: the address where this buffer came from. + * @to: the address where this buffer should go to. + * + * buffer for use in network sources and sinks. + * It contains the source or destination address of the buffer. + */ struct _GstNetBuffer { GstBuffer buffer; @@ -79,12 +98,12 @@ GType gst_netbuffer_get_type (void); GstNetBuffer* gst_netbuffer_new (void); /* address operations */ -void gst_netaddress_set_ip4_address (GstNetAddress *nadd, guint32 address, guint16 port); -void gst_netaddress_set_ip6_address (GstNetAddress *nadd, guint8 address[16], guint16 port); +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); -GstNetType gst_netaddress_get_net_type (GstNetAddress *nadd); -gboolean gst_netaddress_get_ip4_address (GstNetAddress *nadd, guint32 *address, guint16 *port); -gboolean gst_netaddress_get_ip6_address (GstNetAddress *nadd, guint8 address[16], guint16 *port); +GstNetType gst_netaddress_get_net_type (GstNetAddress *naddr); +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); G_END_DECLS