From d86a90550bf7e2cba312801a0861fa2ece99d7a3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tim-Philipp=20M=C3=BCller?= Date: Mon, 12 Mar 2018 23:03:26 +0000 Subject: [PATCH] net: GST_EXPORT -> GST_NET_API We need different export decorators for the different libs. For now no actual change though, just rename before the release, and add prelude headers to define the new decorator to GST_EXPORT. --- libs/gst/net/Makefile.am | 1 + libs/gst/net/gstnet.h | 2 ++ libs/gst/net/gstnetaddressmeta.h | 9 +++---- libs/gst/net/gstnetclientclock.h | 9 +++---- libs/gst/net/gstnetcontrolmessagemeta.h | 7 +++--- libs/gst/net/gstnettimepacket.h | 15 ++++++------ libs/gst/net/gstnettimeprovider.h | 5 ++-- libs/gst/net/gstptpclock.h | 17 +++++++------- libs/gst/net/meson.build | 1 + libs/gst/net/net-prelude.h | 31 +++++++++++++++++++++++++ libs/gst/net/net.h | 2 ++ 11 files changed, 71 insertions(+), 28 deletions(-) create mode 100644 libs/gst/net/net-prelude.h diff --git a/libs/gst/net/Makefile.am b/libs/gst/net/Makefile.am index 35ed9062d3..de254e9ed6 100644 --- a/libs/gst/net/Makefile.am +++ b/libs/gst/net/Makefile.am @@ -3,6 +3,7 @@ lib_LTLIBRARIES = libgstnet-@GST_API_VERSION@.la libgstnet_@GST_API_VERSION@_includedir = $(includedir)/gstreamer-@GST_API_VERSION@/gst/net libgstnet_@GST_API_VERSION@_include_HEADERS = \ net.h \ + net-prelude.h \ gstnet.h \ gstnetaddressmeta.h \ gstnetclientclock.h \ diff --git a/libs/gst/net/gstnet.h b/libs/gst/net/gstnet.h index 96cc8b8e94..28173809c2 100644 --- a/libs/gst/net/gstnet.h +++ b/libs/gst/net/gstnet.h @@ -21,6 +21,8 @@ #ifndef __GST_NET_H__ #define __GST_NET_H__ +#include + #include #include #include diff --git a/libs/gst/net/gstnetaddressmeta.h b/libs/gst/net/gstnetaddressmeta.h index e891413686..e949b3117e 100644 --- a/libs/gst/net/gstnetaddressmeta.h +++ b/libs/gst/net/gstnetaddressmeta.h @@ -22,6 +22,7 @@ #include #include +#include G_BEGIN_DECLS @@ -40,20 +41,20 @@ struct _GstNetAddressMeta { GSocketAddress *addr; }; -GST_EXPORT +GST_NET_API GType gst_net_address_meta_api_get_type (void); #define GST_NET_ADDRESS_META_API_TYPE (gst_net_address_meta_api_get_type()) /* implementation */ -GST_EXPORT +GST_NET_API const GstMetaInfo *gst_net_address_meta_get_info (void); #define GST_NET_ADDRESS_META_INFO (gst_net_address_meta_get_info()) -GST_EXPORT +GST_NET_API GstNetAddressMeta * gst_buffer_add_net_address_meta (GstBuffer *buffer, GSocketAddress *addr); -GST_EXPORT +GST_NET_API GstNetAddressMeta * gst_buffer_get_net_address_meta (GstBuffer *buffer); G_END_DECLS diff --git a/libs/gst/net/gstnetclientclock.h b/libs/gst/net/gstnetclientclock.h index 0a9a26cfcc..b741e6b7b0 100644 --- a/libs/gst/net/gstnetclientclock.h +++ b/libs/gst/net/gstnetclientclock.h @@ -29,6 +29,7 @@ #include #include +#include G_BEGIN_DECLS @@ -68,10 +69,10 @@ struct _GstNetClientClockClass { gpointer _gst_reserved[GST_PADDING]; }; -GST_EXPORT +GST_NET_API GType gst_net_client_clock_get_type (void); -GST_EXPORT +GST_NET_API GstClock* gst_net_client_clock_new (const gchar *name, const gchar *remote_address, gint remote_port, GstClockTime base_time); @@ -89,10 +90,10 @@ GstClock* gst_net_client_clock_new (const gchar *name, const gchar *remote_addre typedef struct _GstNetClientClock GstNtpClock; typedef struct _GstNetClientClockClass GstNtpClockClass; -GST_EXPORT +GST_NET_API GType gst_ntp_clock_get_type (void); -GST_EXPORT +GST_NET_API GstClock* gst_ntp_clock_new (const gchar *name, const gchar *remote_address, gint remote_port, GstClockTime base_time); diff --git a/libs/gst/net/gstnetcontrolmessagemeta.h b/libs/gst/net/gstnetcontrolmessagemeta.h index 39fe66d8a0..b51b87683c 100644 --- a/libs/gst/net/gstnetcontrolmessagemeta.h +++ b/libs/gst/net/gstnetcontrolmessagemeta.h @@ -22,6 +22,7 @@ #include #include +#include G_BEGIN_DECLS @@ -41,7 +42,7 @@ struct _GstNetControlMessageMeta { GSocketControlMessage *message; }; -GST_EXPORT +GST_NET_API GType gst_net_control_message_meta_api_get_type (void); #define GST_NET_CONTROL_MESSAGE_META_API_TYPE \ @@ -52,13 +53,13 @@ GType gst_net_control_message_meta_api_get_type (void); /* implementation */ -GST_EXPORT +GST_NET_API const GstMetaInfo *gst_net_control_message_meta_get_info (void); #define GST_NET_CONTROL_MESSAGE_META_INFO \ (gst_net_control_message_meta_get_info()) -GST_EXPORT +GST_NET_API GstNetControlMessageMeta * gst_buffer_add_net_control_message_meta (GstBuffer * buffer, GSocketControlMessage * message); diff --git a/libs/gst/net/gstnettimepacket.h b/libs/gst/net/gstnettimepacket.h index 36ceef83b7..a04ea030dd 100644 --- a/libs/gst/net/gstnettimepacket.h +++ b/libs/gst/net/gstnettimepacket.h @@ -23,6 +23,7 @@ #include #include +#include G_BEGIN_DECLS @@ -47,26 +48,26 @@ struct _GstNetTimePacket { GstClockTime remote_time; }; -GST_EXPORT +GST_NET_API GType gst_net_time_packet_get_type (void); -GST_EXPORT +GST_NET_API GstNetTimePacket* gst_net_time_packet_new (const guint8 *buffer); -GST_EXPORT +GST_NET_API GstNetTimePacket* gst_net_time_packet_copy (const GstNetTimePacket *packet); -GST_EXPORT +GST_NET_API void gst_net_time_packet_free (GstNetTimePacket *packet); -GST_EXPORT +GST_NET_API guint8* gst_net_time_packet_serialize (const GstNetTimePacket *packet); -GST_EXPORT +GST_NET_API GstNetTimePacket* gst_net_time_packet_receive (GSocket * socket, GSocketAddress ** src_address, GError ** error); -GST_EXPORT +GST_NET_API gboolean gst_net_time_packet_send (const GstNetTimePacket * packet, GSocket * socket, GSocketAddress * dest_address, diff --git a/libs/gst/net/gstnettimeprovider.h b/libs/gst/net/gstnettimeprovider.h index 9343306f83..d1f6de34f5 100644 --- a/libs/gst/net/gstnettimeprovider.h +++ b/libs/gst/net/gstnettimeprovider.h @@ -24,6 +24,7 @@ #define __GST_NET_TIME_PROVIDER_H__ #include +#include G_BEGIN_DECLS @@ -62,10 +63,10 @@ struct _GstNetTimeProviderClass { gpointer _gst_reserved[GST_PADDING]; }; -GST_EXPORT +GST_NET_API GType gst_net_time_provider_get_type (void); -GST_EXPORT +GST_NET_API GstNetTimeProvider* gst_net_time_provider_new (GstClock *clock, const gchar *address, gint port); diff --git a/libs/gst/net/gstptpclock.h b/libs/gst/net/gstptpclock.h index 6a1c839069..06ca5cf8b1 100644 --- a/libs/gst/net/gstptpclock.h +++ b/libs/gst/net/gstptpclock.h @@ -23,6 +23,7 @@ #include #include +#include G_BEGIN_DECLS @@ -75,19 +76,19 @@ struct _GstPtpClockClass { */ #define GST_PTP_CLOCK_ID_NONE ((guint64) -1) -GST_EXPORT +GST_NET_API GType gst_ptp_clock_get_type (void); -GST_EXPORT +GST_NET_API gboolean gst_ptp_is_supported (void); -GST_EXPORT +GST_NET_API gboolean gst_ptp_is_initialized (void); -GST_EXPORT +GST_NET_API gboolean gst_ptp_init (guint64 clock_id, gchar ** interfaces); -GST_EXPORT +GST_NET_API void gst_ptp_deinit (void); #define GST_PTP_STATISTICS_NEW_DOMAIN_FOUND "GstPtpStatisticsNewDomainFound" @@ -142,13 +143,13 @@ void gst_ptp_deinit (void); typedef gboolean (*GstPtpStatisticsCallback) (guint8 domain, const GstStructure * stats, gpointer user_data); -GST_EXPORT +GST_NET_API gulong gst_ptp_statistics_callback_add (GstPtpStatisticsCallback callback, gpointer user_data, GDestroyNotify destroy_data); -GST_EXPORT +GST_NET_API void gst_ptp_statistics_callback_remove (gulong id); -GST_EXPORT +GST_NET_API GstClock* gst_ptp_clock_new (const gchar *name, guint domain); diff --git a/libs/gst/net/meson.build b/libs/gst/net/meson.build index c32bef25ec..0a76fd2912 100644 --- a/libs/gst/net/meson.build +++ b/libs/gst/net/meson.build @@ -17,6 +17,7 @@ gst_net_headers = [ 'gstnettimepacket.h', 'gstnettimeprovider.h', 'gstptpclock.h', + 'net-prelude.h', 'net.h', ] install_headers(gst_net_headers, subdir : 'gstreamer-1.0/gst/net/') diff --git a/libs/gst/net/net-prelude.h b/libs/gst/net/net-prelude.h new file mode 100644 index 0000000000..8db756574f --- /dev/null +++ b/libs/gst/net/net-prelude.h @@ -0,0 +1,31 @@ +/* GStreamer Net Library + * Copyright (C) 2018 GStreamer developers + * + * net-prelude.h: prelude include header for gst-net library + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, + * Boston, MA 02110-1301, USA. + */ + +#ifndef __GST_NET_PRELUDE_H__ +#define __GST_NET_PRELUDE_H__ + +#include + +#ifndef GST_NET_API +#define GST_NET_API GST_EXPORT +#endif + +#endif /* __GST_NET_PRELUDE_H__ */ diff --git a/libs/gst/net/net.h b/libs/gst/net/net.h index 8af032e799..abecd32350 100644 --- a/libs/gst/net/net.h +++ b/libs/gst/net/net.h @@ -22,6 +22,8 @@ #ifndef __GST_NET__H__ #define __GST_NET__H__ +#include + #include #include #include