netaddressmeta: gst_buffer_get_net_address_meta() as function

Implement gst_buffer_get_net_address_meta() as a function instead
of a macro in order to get gobject-introspection to work.

https://bugzilla.gnome.org/show_bug.cgi?id=702921
This commit is contained in:
Stian Selnes 2015-10-26 12:50:12 +01:00 committed by Tim-Philipp Müller
parent 5af73b30ed
commit 85b93fa347
3 changed files with 18 additions and 3 deletions

View file

@ -119,3 +119,19 @@ gst_buffer_add_net_address_meta (GstBuffer * buffer, GSocketAddress * addr)
return meta;
}
/**
* gst_buffer_get_net_address_meta:
* @buffer: a #GstBuffer
*
* Find the #GstNetAddressMeta on @buffer.
*
* Returns: (transfer none): the #GstNetAddressMeta or %NULL when there
* is no such metadata on @buffer.
*/
GstNetAddressMeta *
gst_buffer_get_net_address_meta (GstBuffer * buffer)
{
return (GstNetAddressMeta *)
gst_buffer_get_meta (buffer, GST_NET_ADDRESS_META_API_TYPE);
}

View file

@ -43,15 +43,13 @@ struct _GstNetAddressMeta {
GType gst_net_address_meta_api_get_type (void);
#define GST_NET_ADDRESS_META_API_TYPE (gst_net_address_meta_api_get_type())
#define gst_buffer_get_net_address_meta(b) \
((GstNetAddressMeta*)gst_buffer_get_meta((b),GST_NET_ADDRESS_META_API_TYPE))
/* implementation */
const GstMetaInfo *gst_net_address_meta_get_info (void);
#define GST_NET_ADDRESS_META_INFO (gst_net_address_meta_get_info())
GstNetAddressMeta * gst_buffer_add_net_address_meta (GstBuffer *buffer,
GSocketAddress *addr);
GstNetAddressMeta * gst_buffer_get_net_address_meta (GstBuffer *buffer);
G_END_DECLS

View file

@ -1,6 +1,7 @@
EXPORTS
gst_buffer_add_net_address_meta
gst_buffer_add_net_control_message_meta
gst_buffer_get_net_address_meta
gst_net_address_meta_api_get_type
gst_net_address_meta_get_info
gst_net_client_clock_get_type