diff options
author | Tim-Philipp Müller <tim@centricular.com> | 2018-06-24 00:17:26 +0200 |
---|---|---|
committer | Tim-Philipp Müller <tim@centricular.com> | 2018-06-24 01:06:24 +0200 |
commit | 3c6f642fa625f8690c6471cd5416a8558dda69c1 (patch) | |
tree | f95fc99f5e359ad1cf20db0b9f1144326d728b5a /ext | |
parent | 6f46792f0f339abd33b9e0417f5d663d76e9610c (diff) |
dtls: Update for g_type_class_add_private() deprecation in recent GLib
Diffstat (limited to 'ext')
-rw-r--r-- | ext/dtls/gstdtlsagent.c | 10 | ||||
-rw-r--r-- | ext/dtls/gstdtlscertificate.c | 18 | ||||
-rw-r--r-- | ext/dtls/gstdtlsconnection.c | 17 |
3 files changed, 19 insertions, 26 deletions
diff --git a/ext/dtls/gstdtlsagent.c b/ext/dtls/gstdtlsagent.c index 55500f95b..212c5a073 100644 --- a/ext/dtls/gstdtlsagent.c +++ b/ext/dtls/gstdtlsagent.c @@ -42,10 +42,6 @@ GST_DEBUG_CATEGORY_STATIC (gst_dtls_agent_debug); #define GST_CAT_DEFAULT gst_dtls_agent_debug -G_DEFINE_TYPE (GstDtlsAgent, gst_dtls_agent, G_TYPE_OBJECT); - -#define GST_DTLS_AGENT_GET_PRIVATE(obj) (G_TYPE_INSTANCE_GET_PRIVATE((obj), GST_TYPE_DTLS_AGENT, GstDtlsAgentPrivate)) - enum { PROP_0, @@ -62,6 +58,8 @@ struct _GstDtlsAgentPrivate GstDtlsCertificate *certificate; }; +G_DEFINE_TYPE_WITH_PRIVATE (GstDtlsAgent, gst_dtls_agent, G_TYPE_OBJECT); + static void gst_dtls_agent_finalize (GObject * gobject); static void gst_dtls_agent_set_property (GObject *, guint prop_id, const GValue *, GParamSpec *); @@ -151,8 +149,6 @@ gst_dtls_agent_class_init (GstDtlsAgentClass * klass) { GObjectClass *gobject_class = G_OBJECT_CLASS (klass); - g_type_class_add_private (klass, sizeof (GstDtlsAgentPrivate)); - gobject_class->set_property = gst_dtls_agent_set_property; gobject_class->finalize = gst_dtls_agent_finalize; @@ -171,7 +167,7 @@ gst_dtls_agent_class_init (GstDtlsAgentClass * klass) static void gst_dtls_agent_init (GstDtlsAgent * self) { - GstDtlsAgentPrivate *priv = GST_DTLS_AGENT_GET_PRIVATE (self); + GstDtlsAgentPrivate *priv = gst_dtls_agent_get_instance_private (self); self->priv = priv; ERR_clear_error (); diff --git a/ext/dtls/gstdtlscertificate.c b/ext/dtls/gstdtlscertificate.c index c2d9bb217..5054993bf 100644 --- a/ext/dtls/gstdtlscertificate.c +++ b/ext/dtls/gstdtlscertificate.c @@ -50,12 +50,6 @@ GST_DEBUG_CATEGORY_STATIC (gst_dtls_certificate_debug); #define GST_CAT_DEFAULT gst_dtls_certificate_debug -G_DEFINE_TYPE_WITH_CODE (GstDtlsCertificate, gst_dtls_certificate, - G_TYPE_OBJECT, GST_DEBUG_CATEGORY_INIT (gst_dtls_certificate_debug, - "dtlscertificate", 0, "DTLS Certificate")); - -#define GST_DTLS_CERTIFICATE_GET_PRIVATE(obj) (G_TYPE_INSTANCE_GET_PRIVATE((obj), GST_TYPE_DTLS_CERTIFICATE, GstDtlsCertificatePrivate)) - enum { PROP_0, @@ -75,6 +69,11 @@ struct _GstDtlsCertificatePrivate gchar *pem; }; +G_DEFINE_TYPE_WITH_CODE (GstDtlsCertificate, gst_dtls_certificate, + G_TYPE_OBJECT, G_ADD_PRIVATE (GstDtlsCertificate) + GST_DEBUG_CATEGORY_INIT (gst_dtls_certificate_debug, + "dtlscertificate", 0, "DTLS Certificate")); + static void gst_dtls_certificate_finalize (GObject * gobject); static void gst_dtls_certificate_set_property (GObject *, guint prop_id, const GValue *, GParamSpec *); @@ -89,8 +88,6 @@ gst_dtls_certificate_class_init (GstDtlsCertificateClass * klass) { GObjectClass *gobject_class = G_OBJECT_CLASS (klass); - g_type_class_add_private (klass, sizeof (GstDtlsCertificatePrivate)); - gobject_class->set_property = gst_dtls_certificate_set_property; gobject_class->get_property = gst_dtls_certificate_get_property; @@ -111,8 +108,9 @@ gst_dtls_certificate_class_init (GstDtlsCertificateClass * klass) static void gst_dtls_certificate_init (GstDtlsCertificate * self) { - GstDtlsCertificatePrivate *priv = GST_DTLS_CERTIFICATE_GET_PRIVATE (self); - self->priv = priv; + GstDtlsCertificatePrivate *priv; + + self->priv = priv = gst_dtls_certificate_get_instance_private (self); priv->x509 = NULL; priv->private_key = NULL; diff --git a/ext/dtls/gstdtlsconnection.c b/ext/dtls/gstdtlsconnection.c index 77ed95e5c..372b9b9ee 100644 --- a/ext/dtls/gstdtlsconnection.c +++ b/ext/dtls/gstdtlsconnection.c @@ -46,11 +46,6 @@ GST_DEBUG_CATEGORY_STATIC (gst_dtls_connection_debug); #define GST_CAT_DEFAULT gst_dtls_connection_debug -G_DEFINE_TYPE_WITH_CODE (GstDtlsConnection, gst_dtls_connection, G_TYPE_OBJECT, - GST_DEBUG_CATEGORY_INIT (gst_dtls_connection_debug, "dtlsconnection", 0, - "DTLS Connection")); - -#define GST_DTLS_CONNECTION_GET_PRIVATE(obj) (G_TYPE_INSTANCE_GET_PRIVATE((obj), GST_TYPE_DTLS_CONNECTION, GstDtlsConnectionPrivate)) #define SRTP_KEY_LEN 16 #define SRTP_SALT_LEN 14 @@ -99,6 +94,11 @@ struct _GstDtlsConnectionPrivate GThreadPool *thread_pool; }; +G_DEFINE_TYPE_WITH_CODE (GstDtlsConnection, gst_dtls_connection, G_TYPE_OBJECT, + G_ADD_PRIVATE (GstDtlsConnection) + GST_DEBUG_CATEGORY_INIT (gst_dtls_connection_debug, "dtlsconnection", 0, + "DTLS Connection")); + static void gst_dtls_connection_finalize (GObject * gobject); static void gst_dtls_connection_set_property (GObject *, guint prop_id, const GValue *, GParamSpec *); @@ -121,8 +121,6 @@ gst_dtls_connection_class_init (GstDtlsConnectionClass * klass) { GObjectClass *gobject_class = G_OBJECT_CLASS (klass); - g_type_class_add_private (klass, sizeof (GstDtlsConnectionPrivate)); - gobject_class->set_property = gst_dtls_connection_set_property; connection_ex_index = @@ -163,8 +161,9 @@ gst_dtls_connection_class_init (GstDtlsConnectionClass * klass) static void gst_dtls_connection_init (GstDtlsConnection * self) { - GstDtlsConnectionPrivate *priv = GST_DTLS_CONNECTION_GET_PRIVATE (self); - self->priv = priv; + GstDtlsConnectionPrivate *priv; + + self->priv = priv = gst_dtls_connection_get_instance_private (self); priv->ssl = NULL; priv->bio = NULL; |