From 2eb4d1b8106b692a6ad0c909de6071c3285cb44c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tim-Philipp=20M=C3=BCller?= Date: Sun, 24 Jun 2018 12:44:26 +0200 Subject: [PATCH] Update for g_type_class_add_private() deprecation in recent GLib --- gst/rtsp-server/rtsp-address-pool.c | 7 +++---- gst/rtsp-server/rtsp-auth.c | 9 ++------- gst/rtsp-server/rtsp-client.c | 9 ++------- gst/rtsp-server/rtsp-media-factory-uri.c | 9 ++------- gst/rtsp-server/rtsp-media-factory.c | 10 +++------- gst/rtsp-server/rtsp-media.c | 9 ++------- gst/rtsp-server/rtsp-mount-points.c | 12 ++++-------- gst/rtsp-server/rtsp-server.c | 9 ++------- gst/rtsp-server/rtsp-session-media.c | 12 ++++-------- gst/rtsp-server/rtsp-session-pool.c | 12 ++++-------- gst/rtsp-server/rtsp-session.c | 11 +++-------- gst/rtsp-server/rtsp-stream-transport.c | 12 ++---------- gst/rtsp-server/rtsp-stream.c | 17 ++++++----------- gst/rtsp-server/rtsp-thread-pool.c | 10 +++------- 14 files changed, 42 insertions(+), 106 deletions(-) diff --git a/gst/rtsp-server/rtsp-address-pool.c b/gst/rtsp-server/rtsp-address-pool.c index 1343839f3a..5b032bf0c4 100644 --- a/gst/rtsp-server/rtsp-address-pool.c +++ b/gst/rtsp-server/rtsp-address-pool.c @@ -129,7 +129,8 @@ typedef struct #define RANGE_IS_SINGLE(r) (memcmp ((r)->min.bytes, (r)->max.bytes, (r)->min.size) == 0) #define gst_rtsp_address_pool_parent_class parent_class -G_DEFINE_TYPE (GstRTSPAddressPool, gst_rtsp_address_pool, G_TYPE_OBJECT); +G_DEFINE_TYPE_WITH_PRIVATE (GstRTSPAddressPool, gst_rtsp_address_pool, + G_TYPE_OBJECT); static void gst_rtsp_address_pool_finalize (GObject * obj); @@ -142,8 +143,6 @@ gst_rtsp_address_pool_class_init (GstRTSPAddressPoolClass * klass) gobject_class->finalize = gst_rtsp_address_pool_finalize; - g_type_class_add_private (klass, sizeof (GstRTSPAddressPoolPrivate)); - GST_DEBUG_CATEGORY_INIT (rtsp_address_pool_debug, "rtspaddresspool", 0, "GstRTSPAddressPool"); } @@ -151,7 +150,7 @@ gst_rtsp_address_pool_class_init (GstRTSPAddressPoolClass * klass) static void gst_rtsp_address_pool_init (GstRTSPAddressPool * pool) { - pool->priv = GST_RTSP_ADDRESS_POOL_GET_PRIVATE (pool); + pool->priv = gst_rtsp_address_pool_get_instance_private (pool); g_mutex_init (&pool->priv->lock); } diff --git a/gst/rtsp-server/rtsp-auth.c b/gst/rtsp-server/rtsp-auth.c index c1223b574e..c0bcdb12fb 100644 --- a/gst/rtsp-server/rtsp-auth.c +++ b/gst/rtsp-server/rtsp-auth.c @@ -50,9 +50,6 @@ #include "rtsp-auth.h" -#define GST_RTSP_AUTH_GET_PRIVATE(obj) \ - (G_TYPE_INSTANCE_GET_PRIVATE ((obj), GST_TYPE_RTSP_AUTH, GstRTSPAuthPrivate)) - struct _GstRTSPAuthPrivate { GMutex lock; @@ -132,15 +129,13 @@ static void default_generate_authenticate_header (GstRTSPAuth * auth, GstRTSPContext * ctx); -G_DEFINE_TYPE (GstRTSPAuth, gst_rtsp_auth, G_TYPE_OBJECT); +G_DEFINE_TYPE_WITH_PRIVATE (GstRTSPAuth, gst_rtsp_auth, G_TYPE_OBJECT); static void gst_rtsp_auth_class_init (GstRTSPAuthClass * klass) { GObjectClass *gobject_class; - g_type_class_add_private (klass, sizeof (GstRTSPAuthPrivate)); - gobject_class = G_OBJECT_CLASS (klass); gobject_class->get_property = gst_rtsp_auth_get_property; @@ -184,7 +179,7 @@ gst_rtsp_auth_init (GstRTSPAuth * auth) { GstRTSPAuthPrivate *priv; - auth->priv = priv = GST_RTSP_AUTH_GET_PRIVATE (auth); + auth->priv = priv = gst_rtsp_auth_get_instance_private (auth); g_mutex_init (&priv->lock); diff --git a/gst/rtsp-server/rtsp-client.c b/gst/rtsp-server/rtsp-client.c index fb6998c2ce..d76374eb2e 100644 --- a/gst/rtsp-server/rtsp-client.c +++ b/gst/rtsp-server/rtsp-client.c @@ -51,9 +51,6 @@ #include "rtsp-sdp.h" #include "rtsp-params.h" -#define GST_RTSP_CLIENT_GET_PRIVATE(obj) \ - (G_TYPE_INSTANCE_GET_PRIVATE ((obj), GST_TYPE_RTSP_CLIENT, GstRTSPClientPrivate)) - typedef enum { TUNNEL_STATE_UNKNOWN, @@ -192,15 +189,13 @@ static GstRTSPStatusCode default_pre_signal_handler (GstRTSPClient * client, static gboolean pre_signal_accumulator (GSignalInvocationHint * ihint, GValue * return_accu, const GValue * handler_return, gpointer data); -G_DEFINE_TYPE (GstRTSPClient, gst_rtsp_client, G_TYPE_OBJECT); +G_DEFINE_TYPE_WITH_PRIVATE (GstRTSPClient, gst_rtsp_client, G_TYPE_OBJECT); static void gst_rtsp_client_class_init (GstRTSPClientClass * klass) { GObjectClass *gobject_class; - g_type_class_add_private (klass, sizeof (GstRTSPClientPrivate)); - gobject_class = G_OBJECT_CLASS (klass); gobject_class->get_property = gst_rtsp_client_get_property; @@ -584,7 +579,7 @@ gst_rtsp_client_class_init (GstRTSPClientClass * klass) static void gst_rtsp_client_init (GstRTSPClient * client) { - GstRTSPClientPrivate *priv = GST_RTSP_CLIENT_GET_PRIVATE (client); + GstRTSPClientPrivate *priv = gst_rtsp_client_get_instance_private (client); client->priv = priv; diff --git a/gst/rtsp-server/rtsp-media-factory-uri.c b/gst/rtsp-server/rtsp-media-factory-uri.c index 3598dde25a..7100b1647d 100644 --- a/gst/rtsp-server/rtsp-media-factory-uri.c +++ b/gst/rtsp-server/rtsp-media-factory-uri.c @@ -34,9 +34,6 @@ #include "rtsp-media-factory-uri.h" -#define GST_RTSP_MEDIA_FACTORY_URI_GET_PRIVATE(obj) \ - (G_TYPE_INSTANCE_GET_PRIVATE ((obj), GST_TYPE_RTSP_MEDIA_FACTORY_URI, GstRTSPMediaFactoryURIPrivate)) - struct _GstRTSPMediaFactoryURIPrivate { GMutex lock; @@ -98,7 +95,7 @@ static void gst_rtsp_media_factory_uri_finalize (GObject * obj); static GstElement *rtsp_media_factory_uri_create_element (GstRTSPMediaFactory * factory, const GstRTSPUrl * url); -G_DEFINE_TYPE (GstRTSPMediaFactoryURI, gst_rtsp_media_factory_uri, +G_DEFINE_TYPE_WITH_PRIVATE (GstRTSPMediaFactoryURI, gst_rtsp_media_factory_uri, GST_TYPE_RTSP_MEDIA_FACTORY); static void @@ -107,8 +104,6 @@ gst_rtsp_media_factory_uri_class_init (GstRTSPMediaFactoryURIClass * klass) GObjectClass *gobject_class; GstRTSPMediaFactoryClass *mediafactory_class; - g_type_class_add_private (klass, sizeof (GstRTSPMediaFactoryURIPrivate)); - gobject_class = G_OBJECT_CLASS (klass); mediafactory_class = GST_RTSP_MEDIA_FACTORY_CLASS (klass); @@ -188,7 +183,7 @@ static void gst_rtsp_media_factory_uri_init (GstRTSPMediaFactoryURI * factory) { GstRTSPMediaFactoryURIPrivate *priv = - GST_RTSP_MEDIA_FACTORY_URI_GET_PRIVATE (factory); + gst_rtsp_media_factory_uri_get_instance_private (factory); FilterData data = { NULL, NULL, NULL }; GST_DEBUG_OBJECT (factory, "new"); diff --git a/gst/rtsp-server/rtsp-media-factory.c b/gst/rtsp-server/rtsp-media-factory.c index 46c0becfa0..bbb6a91196 100644 --- a/gst/rtsp-server/rtsp-media-factory.c +++ b/gst/rtsp-server/rtsp-media-factory.c @@ -40,9 +40,6 @@ #include "rtsp-media-factory.h" -#define GST_RTSP_MEDIA_FACTORY_GET_PRIVATE(obj) \ - (G_TYPE_INSTANCE_GET_PRIVATE ((obj), GST_TYPE_RTSP_MEDIA_FACTORY, GstRTSPMediaFactoryPrivate)) - #define GST_RTSP_MEDIA_FACTORY_GET_LOCK(f) (&(GST_RTSP_MEDIA_FACTORY_CAST(f)->priv->lock)) #define GST_RTSP_MEDIA_FACTORY_LOCK(f) (g_mutex_lock(GST_RTSP_MEDIA_FACTORY_GET_LOCK(f))) #define GST_RTSP_MEDIA_FACTORY_UNLOCK(f) (g_mutex_unlock(GST_RTSP_MEDIA_FACTORY_GET_LOCK(f))) @@ -136,15 +133,14 @@ static void default_configure (GstRTSPMediaFactory * factory, static GstElement *default_create_pipeline (GstRTSPMediaFactory * factory, GstRTSPMedia * media); -G_DEFINE_TYPE (GstRTSPMediaFactory, gst_rtsp_media_factory, G_TYPE_OBJECT); +G_DEFINE_TYPE_WITH_PRIVATE (GstRTSPMediaFactory, gst_rtsp_media_factory, + G_TYPE_OBJECT); static void gst_rtsp_media_factory_class_init (GstRTSPMediaFactoryClass * klass) { GObjectClass *gobject_class; - g_type_class_add_private (klass, sizeof (GstRTSPMediaFactoryPrivate)); - gobject_class = G_OBJECT_CLASS (klass); gobject_class->get_property = gst_rtsp_media_factory_get_property; @@ -252,7 +248,7 @@ static void gst_rtsp_media_factory_init (GstRTSPMediaFactory * factory) { GstRTSPMediaFactoryPrivate *priv = - GST_RTSP_MEDIA_FACTORY_GET_PRIVATE (factory); + gst_rtsp_media_factory_get_instance_private (factory); factory->priv = priv; priv->launch = g_strdup (DEFAULT_LAUNCH); diff --git a/gst/rtsp-server/rtsp-media.c b/gst/rtsp-server/rtsp-media.c index 48117c139e..74d52803be 100644 --- a/gst/rtsp-server/rtsp-media.c +++ b/gst/rtsp-server/rtsp-media.c @@ -81,9 +81,6 @@ #include "rtsp-media.h" -#define GST_RTSP_MEDIA_GET_PRIVATE(obj) \ - (G_TYPE_INSTANCE_GET_PRIVATE ((obj), GST_TYPE_RTSP_MEDIA, GstRTSPMediaPrivate)) - struct _GstRTSPMediaPrivate { GMutex lock; @@ -297,15 +294,13 @@ gst_rtsp_publish_clock_mode_get_type (void) return (GType) id; } -G_DEFINE_TYPE (GstRTSPMedia, gst_rtsp_media, G_TYPE_OBJECT); +G_DEFINE_TYPE_WITH_PRIVATE (GstRTSPMedia, gst_rtsp_media, G_TYPE_OBJECT); static void gst_rtsp_media_class_init (GstRTSPMediaClass * klass) { GObjectClass *gobject_class; - g_type_class_add_private (klass, sizeof (GstRTSPMediaPrivate)); - gobject_class = G_OBJECT_CLASS (klass); gobject_class->get_property = gst_rtsp_media_get_property; @@ -429,7 +424,7 @@ gst_rtsp_media_class_init (GstRTSPMediaClass * klass) static void gst_rtsp_media_init (GstRTSPMedia * media) { - GstRTSPMediaPrivate *priv = GST_RTSP_MEDIA_GET_PRIVATE (media); + GstRTSPMediaPrivate *priv = gst_rtsp_media_get_instance_private (media); media->priv = priv; diff --git a/gst/rtsp-server/rtsp-mount-points.c b/gst/rtsp-server/rtsp-mount-points.c index 53b4ffd85e..15685ba8ab 100644 --- a/gst/rtsp-server/rtsp-mount-points.c +++ b/gst/rtsp-server/rtsp-mount-points.c @@ -38,9 +38,6 @@ #include "rtsp-mount-points.h" -#define GST_RTSP_MOUNT_POINTS_GET_PRIVATE(obj) \ - (G_TYPE_INSTANCE_GET_PRIVATE ((obj), GST_TYPE_RTSP_MOUNT_POINTS, GstRTSPMountPointsPrivate)) - typedef struct { gchar *path; @@ -97,7 +94,8 @@ struct _GstRTSPMountPointsPrivate gboolean dirty; }; -G_DEFINE_TYPE (GstRTSPMountPoints, gst_rtsp_mount_points, G_TYPE_OBJECT); +G_DEFINE_TYPE_WITH_PRIVATE (GstRTSPMountPoints, gst_rtsp_mount_points, + G_TYPE_OBJECT); GST_DEBUG_CATEGORY_STATIC (rtsp_media_debug); #define GST_CAT_DEFAULT rtsp_media_debug @@ -111,8 +109,6 @@ gst_rtsp_mount_points_class_init (GstRTSPMountPointsClass * klass) { GObjectClass *gobject_class; - g_type_class_add_private (klass, sizeof (GstRTSPMountPointsPrivate)); - gobject_class = G_OBJECT_CLASS (klass); gobject_class->finalize = gst_rtsp_mount_points_finalize; @@ -126,11 +122,11 @@ gst_rtsp_mount_points_class_init (GstRTSPMountPointsClass * klass) static void gst_rtsp_mount_points_init (GstRTSPMountPoints * mounts) { - GstRTSPMountPointsPrivate *priv = GST_RTSP_MOUNT_POINTS_GET_PRIVATE (mounts); + GstRTSPMountPointsPrivate *priv; GST_DEBUG_OBJECT (mounts, "created"); - mounts->priv = priv; + mounts->priv = priv = gst_rtsp_mount_points_get_instance_private (mounts); g_mutex_init (&priv->lock); priv->mounts = g_sequence_new (data_item_free); diff --git a/gst/rtsp-server/rtsp-server.c b/gst/rtsp-server/rtsp-server.c index 91f4dfb05d..0a0b912fb8 100644 --- a/gst/rtsp-server/rtsp-server.c +++ b/gst/rtsp-server/rtsp-server.c @@ -58,9 +58,6 @@ #include "rtsp-server.h" #include "rtsp-client.h" -#define GST_RTSP_SERVER_GET_PRIVATE(obj) \ - (G_TYPE_INSTANCE_GET_PRIVATE ((obj), GST_TYPE_RTSP_SERVER, GstRTSPServerPrivate)) - #define GST_RTSP_SERVER_GET_LOCK(server) (&(GST_RTSP_SERVER_CAST(server)->priv->lock)) #define GST_RTSP_SERVER_LOCK(server) (g_mutex_lock(GST_RTSP_SERVER_GET_LOCK(server))) #define GST_RTSP_SERVER_UNLOCK(server) (g_mutex_unlock(GST_RTSP_SERVER_GET_LOCK(server))) @@ -123,7 +120,7 @@ enum SIGNAL_LAST }; -G_DEFINE_TYPE (GstRTSPServer, gst_rtsp_server, G_TYPE_OBJECT); +G_DEFINE_TYPE_WITH_PRIVATE (GstRTSPServer, gst_rtsp_server, G_TYPE_OBJECT); GST_DEBUG_CATEGORY_STATIC (rtsp_server_debug); #define GST_CAT_DEFAULT rtsp_server_debug @@ -145,8 +142,6 @@ gst_rtsp_server_class_init (GstRTSPServerClass * klass) { GObjectClass *gobject_class; - g_type_class_add_private (klass, sizeof (GstRTSPServerPrivate)); - gobject_class = G_OBJECT_CLASS (klass); gobject_class->get_property = gst_rtsp_server_get_property; @@ -237,7 +232,7 @@ gst_rtsp_server_class_init (GstRTSPServerClass * klass) static void gst_rtsp_server_init (GstRTSPServer * server) { - GstRTSPServerPrivate *priv = GST_RTSP_SERVER_GET_PRIVATE (server); + GstRTSPServerPrivate *priv = gst_rtsp_server_get_instance_private (server); server->priv = priv; diff --git a/gst/rtsp-server/rtsp-session-media.c b/gst/rtsp-server/rtsp-session-media.c index a1eb98ea06..c3bac97ccb 100644 --- a/gst/rtsp-server/rtsp-session-media.c +++ b/gst/rtsp-server/rtsp-session-media.c @@ -39,9 +39,6 @@ #include "rtsp-session.h" -#define GST_RTSP_SESSION_MEDIA_GET_PRIVATE(obj) \ - (G_TYPE_INSTANCE_GET_PRIVATE ((obj), GST_TYPE_RTSP_SESSION_MEDIA, GstRTSPSessionMediaPrivate)) - struct _GstRTSPSessionMediaPrivate { GMutex lock; @@ -65,15 +62,14 @@ GST_DEBUG_CATEGORY_STATIC (rtsp_session_media_debug); static void gst_rtsp_session_media_finalize (GObject * obj); -G_DEFINE_TYPE (GstRTSPSessionMedia, gst_rtsp_session_media, G_TYPE_OBJECT); +G_DEFINE_TYPE_WITH_PRIVATE (GstRTSPSessionMedia, gst_rtsp_session_media, + G_TYPE_OBJECT); static void gst_rtsp_session_media_class_init (GstRTSPSessionMediaClass * klass) { GObjectClass *gobject_class; - g_type_class_add_private (klass, sizeof (GstRTSPSessionMediaPrivate)); - gobject_class = G_OBJECT_CLASS (klass); gobject_class->finalize = gst_rtsp_session_media_finalize; @@ -85,9 +81,9 @@ gst_rtsp_session_media_class_init (GstRTSPSessionMediaClass * klass) static void gst_rtsp_session_media_init (GstRTSPSessionMedia * media) { - GstRTSPSessionMediaPrivate *priv = GST_RTSP_SESSION_MEDIA_GET_PRIVATE (media); + GstRTSPSessionMediaPrivate *priv; - media->priv = priv; + media->priv = priv = gst_rtsp_session_media_get_instance_private (media); g_mutex_init (&priv->lock); priv->state = GST_RTSP_STATE_INIT; diff --git a/gst/rtsp-server/rtsp-session-pool.c b/gst/rtsp-server/rtsp-session-pool.c index 3915b8cbb1..8f45e28279 100644 --- a/gst/rtsp-server/rtsp-session-pool.c +++ b/gst/rtsp-server/rtsp-session-pool.c @@ -42,9 +42,6 @@ #include "rtsp-session-pool.h" -#define GST_RTSP_SESSION_POOL_GET_PRIVATE(obj) \ - (G_TYPE_INSTANCE_GET_PRIVATE ((obj), GST_TYPE_RTSP_SESSION_POOL, GstRTSPSessionPoolPrivate)) - struct _GstRTSPSessionPoolPrivate { GMutex lock; /* protects everything in this struct */ @@ -91,15 +88,14 @@ static gchar *create_session_id (GstRTSPSessionPool * pool); static GstRTSPSession *create_session (GstRTSPSessionPool * pool, const gchar * id); -G_DEFINE_TYPE (GstRTSPSessionPool, gst_rtsp_session_pool, G_TYPE_OBJECT); +G_DEFINE_TYPE_WITH_PRIVATE (GstRTSPSessionPool, gst_rtsp_session_pool, + G_TYPE_OBJECT); static void gst_rtsp_session_pool_class_init (GstRTSPSessionPoolClass * klass) { GObjectClass *gobject_class; - g_type_class_add_private (klass, sizeof (GstRTSPSessionPoolPrivate)); - gobject_class = G_OBJECT_CLASS (klass); gobject_class->get_property = gst_rtsp_session_pool_get_property; @@ -128,9 +124,9 @@ gst_rtsp_session_pool_class_init (GstRTSPSessionPoolClass * klass) static void gst_rtsp_session_pool_init (GstRTSPSessionPool * pool) { - GstRTSPSessionPoolPrivate *priv = GST_RTSP_SESSION_POOL_GET_PRIVATE (pool); + GstRTSPSessionPoolPrivate *priv; - pool->priv = priv; + pool->priv = priv = gst_rtsp_session_pool_get_instance_private (pool); g_mutex_init (&priv->lock); priv->sessions = g_hash_table_new_full (g_str_hash, g_str_equal, diff --git a/gst/rtsp-server/rtsp-session.c b/gst/rtsp-server/rtsp-session.c index 83a998527e..37945f853d 100644 --- a/gst/rtsp-server/rtsp-session.c +++ b/gst/rtsp-server/rtsp-session.c @@ -47,9 +47,6 @@ #include "rtsp-session.h" -#define GST_RTSP_SESSION_GET_PRIVATE(obj) \ - (G_TYPE_INSTANCE_GET_PRIVATE ((obj), GST_TYPE_RTSP_SESSION, GstRTSPSessionPrivate)) - struct _GstRTSPSessionPrivate { GMutex lock; /* protects everything but sessionid and create_time */ @@ -90,15 +87,13 @@ static void gst_rtsp_session_set_property (GObject * object, guint propid, const GValue * value, GParamSpec * pspec); static void gst_rtsp_session_finalize (GObject * obj); -G_DEFINE_TYPE (GstRTSPSession, gst_rtsp_session, G_TYPE_OBJECT); +G_DEFINE_TYPE_WITH_PRIVATE (GstRTSPSession, gst_rtsp_session, G_TYPE_OBJECT); static void gst_rtsp_session_class_init (GstRTSPSessionClass * klass) { GObjectClass *gobject_class; - g_type_class_add_private (klass, sizeof (GstRTSPSessionPrivate)); - gobject_class = G_OBJECT_CLASS (klass); gobject_class->get_property = gst_rtsp_session_get_property; @@ -127,9 +122,9 @@ gst_rtsp_session_class_init (GstRTSPSessionClass * klass) static void gst_rtsp_session_init (GstRTSPSession * session) { - GstRTSPSessionPrivate *priv = GST_RTSP_SESSION_GET_PRIVATE (session); + GstRTSPSessionPrivate *priv; - session->priv = priv; + session->priv = priv = gst_rtsp_session_get_instance_private (session); GST_INFO ("init session %p", session); diff --git a/gst/rtsp-server/rtsp-stream-transport.c b/gst/rtsp-server/rtsp-stream-transport.c index 9da62d87e8..7a6ba12c3c 100644 --- a/gst/rtsp-server/rtsp-stream-transport.c +++ b/gst/rtsp-server/rtsp-stream-transport.c @@ -43,9 +43,6 @@ #include "rtsp-stream-transport.h" -#define GST_RTSP_STREAM_TRANSPORT_GET_PRIVATE(obj) \ - (G_TYPE_INSTANCE_GET_PRIVATE ((obj), GST_TYPE_RTSP_STREAM_TRANSPORT, GstRTSPStreamTransportPrivate)) - struct _GstRTSPStreamTransportPrivate { GstRTSPStream *stream; @@ -78,7 +75,7 @@ GST_DEBUG_CATEGORY_STATIC (rtsp_stream_transport_debug); static void gst_rtsp_stream_transport_finalize (GObject * obj); -G_DEFINE_TYPE (GstRTSPStreamTransport, gst_rtsp_stream_transport, +G_DEFINE_TYPE_WITH_PRIVATE (GstRTSPStreamTransport, gst_rtsp_stream_transport, G_TYPE_OBJECT); static void @@ -86,8 +83,6 @@ gst_rtsp_stream_transport_class_init (GstRTSPStreamTransportClass * klass) { GObjectClass *gobject_class; - g_type_class_add_private (klass, sizeof (GstRTSPStreamTransportPrivate)); - gobject_class = G_OBJECT_CLASS (klass); gobject_class->finalize = gst_rtsp_stream_transport_finalize; @@ -99,10 +94,7 @@ gst_rtsp_stream_transport_class_init (GstRTSPStreamTransportClass * klass) static void gst_rtsp_stream_transport_init (GstRTSPStreamTransport * trans) { - GstRTSPStreamTransportPrivate *priv = - GST_RTSP_STREAM_TRANSPORT_GET_PRIVATE (trans); - - trans->priv = priv; + trans->priv = gst_rtsp_stream_transport_get_instance_private (trans); } static void diff --git a/gst/rtsp-server/rtsp-stream.c b/gst/rtsp-server/rtsp-stream.c index a94c5bd418..0e230a4bb0 100644 --- a/gst/rtsp-server/rtsp-stream.c +++ b/gst/rtsp-server/rtsp-stream.c @@ -59,9 +59,6 @@ #include "rtsp-stream.h" -#define GST_RTSP_STREAM_GET_PRIVATE(obj) \ - (G_TYPE_INSTANCE_GET_PRIVATE ((obj), GST_TYPE_RTSP_STREAM, GstRTSPStreamPrivate)) - struct _GstRTSPStreamPrivate { GMutex lock; @@ -211,15 +208,13 @@ static void gst_rtsp_stream_finalize (GObject * obj); static guint gst_rtsp_stream_signals[SIGNAL_LAST] = { 0 }; -G_DEFINE_TYPE (GstRTSPStream, gst_rtsp_stream, G_TYPE_OBJECT); +G_DEFINE_TYPE_WITH_PRIVATE (GstRTSPStream, gst_rtsp_stream, G_TYPE_OBJECT); static void gst_rtsp_stream_class_init (GstRTSPStreamClass * klass) { GObjectClass *gobject_class; - g_type_class_add_private (klass, sizeof (GstRTSPStreamPrivate)); - gobject_class = G_OBJECT_CLASS (klass); gobject_class->get_property = gst_rtsp_stream_get_property; @@ -259,7 +254,7 @@ gst_rtsp_stream_class_init (GstRTSPStreamClass * klass) static void gst_rtsp_stream_init (GstRTSPStream * stream) { - GstRTSPStreamPrivate *priv = GST_RTSP_STREAM_GET_PRIVATE (stream); + GstRTSPStreamPrivate *priv = gst_rtsp_stream_get_instance_private (stream); GST_DEBUG ("new stream %p", stream); @@ -4016,7 +4011,7 @@ gst_rtsp_stream_update_crypto (GstRTSPStream * stream, GSocket * gst_rtsp_stream_get_rtp_socket (GstRTSPStream * stream, GSocketFamily family) { - GstRTSPStreamPrivate *priv = GST_RTSP_STREAM_GET_PRIVATE (stream); + GstRTSPStreamPrivate *priv = stream->priv; GSocket *socket; const gchar *name; @@ -4050,7 +4045,7 @@ gst_rtsp_stream_get_rtp_socket (GstRTSPStream * stream, GSocketFamily family) GSocket * gst_rtsp_stream_get_rtcp_socket (GstRTSPStream * stream, GSocketFamily family) { - GstRTSPStreamPrivate *priv = GST_RTSP_STREAM_GET_PRIVATE (stream); + GstRTSPStreamPrivate *priv = gst_rtsp_stream_get_instance_private (stream); GSocket *socket; const gchar *name; @@ -4083,7 +4078,7 @@ GSocket * gst_rtsp_stream_get_rtp_multicast_socket (GstRTSPStream * stream, GSocketFamily family) { - GstRTSPStreamPrivate *priv = GST_RTSP_STREAM_GET_PRIVATE (stream); + GstRTSPStreamPrivate *priv = gst_rtsp_stream_get_instance_private (stream); GSocket *socket; const gchar *name; @@ -4116,7 +4111,7 @@ GSocket * gst_rtsp_stream_get_rtcp_multicast_socket (GstRTSPStream * stream, GSocketFamily family) { - GstRTSPStreamPrivate *priv = GST_RTSP_STREAM_GET_PRIVATE (stream); + GstRTSPStreamPrivate *priv = gst_rtsp_stream_get_instance_private (stream); GSocket *socket; const gchar *name; diff --git a/gst/rtsp-server/rtsp-thread-pool.c b/gst/rtsp-server/rtsp-thread-pool.c index a3cb850c12..4e14447778 100644 --- a/gst/rtsp-server/rtsp-thread-pool.c +++ b/gst/rtsp-server/rtsp-thread-pool.c @@ -184,9 +184,6 @@ gst_rtsp_thread_stop (GstRTSPThread * thread) gst_rtsp_thread_unref (thread); } -#define GST_RTSP_THREAD_POOL_GET_PRIVATE(obj) \ - (G_TYPE_INSTANCE_GET_PRIVATE ((obj), GST_TYPE_RTSP_THREAD_POOL, GstRTSPThreadPoolPrivate)) - struct _GstRTSPThreadPoolPrivate { GMutex lock; @@ -220,15 +217,14 @@ static gpointer do_loop (GstRTSPThread * thread); static GstRTSPThread *default_get_thread (GstRTSPThreadPool * pool, GstRTSPThreadType type, GstRTSPContext * ctx); -G_DEFINE_TYPE (GstRTSPThreadPool, gst_rtsp_thread_pool, G_TYPE_OBJECT); +G_DEFINE_TYPE_WITH_PRIVATE (GstRTSPThreadPool, gst_rtsp_thread_pool, + G_TYPE_OBJECT); static void gst_rtsp_thread_pool_class_init (GstRTSPThreadPoolClass * klass) { GObjectClass *gobject_class; - g_type_class_add_private (klass, sizeof (GstRTSPThreadPoolPrivate)); - gobject_class = G_OBJECT_CLASS (klass); gobject_class->get_property = gst_rtsp_thread_pool_get_property; @@ -261,7 +257,7 @@ gst_rtsp_thread_pool_init (GstRTSPThreadPool * pool) { GstRTSPThreadPoolPrivate *priv; - pool->priv = priv = GST_RTSP_THREAD_POOL_GET_PRIVATE (pool); + pool->priv = priv = gst_rtsp_thread_pool_get_instance_private (pool); g_mutex_init (&priv->lock); priv->max_threads = DEFAULT_MAX_THREADS;