Update for g_type_class_add_private() deprecation in recent GLib

This commit is contained in:
Tim-Philipp Müller 2018-06-24 12:44:26 +02:00
parent e82ba1e52f
commit 2eb4d1b810
14 changed files with 42 additions and 106 deletions

View file

@ -129,7 +129,8 @@ typedef struct
#define RANGE_IS_SINGLE(r) (memcmp ((r)->min.bytes, (r)->max.bytes, (r)->min.size) == 0) #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 #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); 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; 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, GST_DEBUG_CATEGORY_INIT (rtsp_address_pool_debug, "rtspaddresspool", 0,
"GstRTSPAddressPool"); "GstRTSPAddressPool");
} }
@ -151,7 +150,7 @@ gst_rtsp_address_pool_class_init (GstRTSPAddressPoolClass * klass)
static void static void
gst_rtsp_address_pool_init (GstRTSPAddressPool * pool) 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); g_mutex_init (&pool->priv->lock);
} }

View file

@ -50,9 +50,6 @@
#include "rtsp-auth.h" #include "rtsp-auth.h"
#define GST_RTSP_AUTH_GET_PRIVATE(obj) \
(G_TYPE_INSTANCE_GET_PRIVATE ((obj), GST_TYPE_RTSP_AUTH, GstRTSPAuthPrivate))
struct _GstRTSPAuthPrivate struct _GstRTSPAuthPrivate
{ {
GMutex lock; GMutex lock;
@ -132,15 +129,13 @@ static void default_generate_authenticate_header (GstRTSPAuth * auth,
GstRTSPContext * ctx); 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 static void
gst_rtsp_auth_class_init (GstRTSPAuthClass * klass) gst_rtsp_auth_class_init (GstRTSPAuthClass * klass)
{ {
GObjectClass *gobject_class; GObjectClass *gobject_class;
g_type_class_add_private (klass, sizeof (GstRTSPAuthPrivate));
gobject_class = G_OBJECT_CLASS (klass); gobject_class = G_OBJECT_CLASS (klass);
gobject_class->get_property = gst_rtsp_auth_get_property; gobject_class->get_property = gst_rtsp_auth_get_property;
@ -184,7 +179,7 @@ gst_rtsp_auth_init (GstRTSPAuth * auth)
{ {
GstRTSPAuthPrivate *priv; 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); g_mutex_init (&priv->lock);

View file

@ -51,9 +51,6 @@
#include "rtsp-sdp.h" #include "rtsp-sdp.h"
#include "rtsp-params.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 typedef enum
{ {
TUNNEL_STATE_UNKNOWN, TUNNEL_STATE_UNKNOWN,
@ -192,15 +189,13 @@ static GstRTSPStatusCode default_pre_signal_handler (GstRTSPClient * client,
static gboolean pre_signal_accumulator (GSignalInvocationHint * ihint, static gboolean pre_signal_accumulator (GSignalInvocationHint * ihint,
GValue * return_accu, const GValue * handler_return, gpointer data); 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 static void
gst_rtsp_client_class_init (GstRTSPClientClass * klass) gst_rtsp_client_class_init (GstRTSPClientClass * klass)
{ {
GObjectClass *gobject_class; GObjectClass *gobject_class;
g_type_class_add_private (klass, sizeof (GstRTSPClientPrivate));
gobject_class = G_OBJECT_CLASS (klass); gobject_class = G_OBJECT_CLASS (klass);
gobject_class->get_property = gst_rtsp_client_get_property; gobject_class->get_property = gst_rtsp_client_get_property;
@ -584,7 +579,7 @@ gst_rtsp_client_class_init (GstRTSPClientClass * klass)
static void static void
gst_rtsp_client_init (GstRTSPClient * client) 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; client->priv = priv;

View file

@ -34,9 +34,6 @@
#include "rtsp-media-factory-uri.h" #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 struct _GstRTSPMediaFactoryURIPrivate
{ {
GMutex lock; 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 * static GstElement *rtsp_media_factory_uri_create_element (GstRTSPMediaFactory *
factory, const GstRTSPUrl * url); 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); GST_TYPE_RTSP_MEDIA_FACTORY);
static void static void
@ -107,8 +104,6 @@ gst_rtsp_media_factory_uri_class_init (GstRTSPMediaFactoryURIClass * klass)
GObjectClass *gobject_class; GObjectClass *gobject_class;
GstRTSPMediaFactoryClass *mediafactory_class; GstRTSPMediaFactoryClass *mediafactory_class;
g_type_class_add_private (klass, sizeof (GstRTSPMediaFactoryURIPrivate));
gobject_class = G_OBJECT_CLASS (klass); gobject_class = G_OBJECT_CLASS (klass);
mediafactory_class = GST_RTSP_MEDIA_FACTORY_CLASS (klass); mediafactory_class = GST_RTSP_MEDIA_FACTORY_CLASS (klass);
@ -188,7 +183,7 @@ static void
gst_rtsp_media_factory_uri_init (GstRTSPMediaFactoryURI * factory) gst_rtsp_media_factory_uri_init (GstRTSPMediaFactoryURI * factory)
{ {
GstRTSPMediaFactoryURIPrivate *priv = GstRTSPMediaFactoryURIPrivate *priv =
GST_RTSP_MEDIA_FACTORY_URI_GET_PRIVATE (factory); gst_rtsp_media_factory_uri_get_instance_private (factory);
FilterData data = { NULL, NULL, NULL }; FilterData data = { NULL, NULL, NULL };
GST_DEBUG_OBJECT (factory, "new"); GST_DEBUG_OBJECT (factory, "new");

View file

@ -40,9 +40,6 @@
#include "rtsp-media-factory.h" #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_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_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))) #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, static GstElement *default_create_pipeline (GstRTSPMediaFactory * factory,
GstRTSPMedia * media); 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 static void
gst_rtsp_media_factory_class_init (GstRTSPMediaFactoryClass * klass) gst_rtsp_media_factory_class_init (GstRTSPMediaFactoryClass * klass)
{ {
GObjectClass *gobject_class; GObjectClass *gobject_class;
g_type_class_add_private (klass, sizeof (GstRTSPMediaFactoryPrivate));
gobject_class = G_OBJECT_CLASS (klass); gobject_class = G_OBJECT_CLASS (klass);
gobject_class->get_property = gst_rtsp_media_factory_get_property; gobject_class->get_property = gst_rtsp_media_factory_get_property;
@ -252,7 +248,7 @@ static void
gst_rtsp_media_factory_init (GstRTSPMediaFactory * factory) gst_rtsp_media_factory_init (GstRTSPMediaFactory * factory)
{ {
GstRTSPMediaFactoryPrivate *priv = GstRTSPMediaFactoryPrivate *priv =
GST_RTSP_MEDIA_FACTORY_GET_PRIVATE (factory); gst_rtsp_media_factory_get_instance_private (factory);
factory->priv = priv; factory->priv = priv;
priv->launch = g_strdup (DEFAULT_LAUNCH); priv->launch = g_strdup (DEFAULT_LAUNCH);

View file

@ -81,9 +81,6 @@
#include "rtsp-media.h" #include "rtsp-media.h"
#define GST_RTSP_MEDIA_GET_PRIVATE(obj) \
(G_TYPE_INSTANCE_GET_PRIVATE ((obj), GST_TYPE_RTSP_MEDIA, GstRTSPMediaPrivate))
struct _GstRTSPMediaPrivate struct _GstRTSPMediaPrivate
{ {
GMutex lock; GMutex lock;
@ -297,15 +294,13 @@ gst_rtsp_publish_clock_mode_get_type (void)
return (GType) id; 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 static void
gst_rtsp_media_class_init (GstRTSPMediaClass * klass) gst_rtsp_media_class_init (GstRTSPMediaClass * klass)
{ {
GObjectClass *gobject_class; GObjectClass *gobject_class;
g_type_class_add_private (klass, sizeof (GstRTSPMediaPrivate));
gobject_class = G_OBJECT_CLASS (klass); gobject_class = G_OBJECT_CLASS (klass);
gobject_class->get_property = gst_rtsp_media_get_property; gobject_class->get_property = gst_rtsp_media_get_property;
@ -429,7 +424,7 @@ gst_rtsp_media_class_init (GstRTSPMediaClass * klass)
static void static void
gst_rtsp_media_init (GstRTSPMedia * media) 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; media->priv = priv;

View file

@ -38,9 +38,6 @@
#include "rtsp-mount-points.h" #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 typedef struct
{ {
gchar *path; gchar *path;
@ -97,7 +94,8 @@ struct _GstRTSPMountPointsPrivate
gboolean dirty; 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); GST_DEBUG_CATEGORY_STATIC (rtsp_media_debug);
#define GST_CAT_DEFAULT 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; GObjectClass *gobject_class;
g_type_class_add_private (klass, sizeof (GstRTSPMountPointsPrivate));
gobject_class = G_OBJECT_CLASS (klass); gobject_class = G_OBJECT_CLASS (klass);
gobject_class->finalize = gst_rtsp_mount_points_finalize; gobject_class->finalize = gst_rtsp_mount_points_finalize;
@ -126,11 +122,11 @@ gst_rtsp_mount_points_class_init (GstRTSPMountPointsClass * klass)
static void static void
gst_rtsp_mount_points_init (GstRTSPMountPoints * mounts) gst_rtsp_mount_points_init (GstRTSPMountPoints * mounts)
{ {
GstRTSPMountPointsPrivate *priv = GST_RTSP_MOUNT_POINTS_GET_PRIVATE (mounts); GstRTSPMountPointsPrivate *priv;
GST_DEBUG_OBJECT (mounts, "created"); GST_DEBUG_OBJECT (mounts, "created");
mounts->priv = priv; mounts->priv = priv = gst_rtsp_mount_points_get_instance_private (mounts);
g_mutex_init (&priv->lock); g_mutex_init (&priv->lock);
priv->mounts = g_sequence_new (data_item_free); priv->mounts = g_sequence_new (data_item_free);

View file

@ -58,9 +58,6 @@
#include "rtsp-server.h" #include "rtsp-server.h"
#include "rtsp-client.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_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_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))) #define GST_RTSP_SERVER_UNLOCK(server) (g_mutex_unlock(GST_RTSP_SERVER_GET_LOCK(server)))
@ -123,7 +120,7 @@ enum
SIGNAL_LAST 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); GST_DEBUG_CATEGORY_STATIC (rtsp_server_debug);
#define GST_CAT_DEFAULT rtsp_server_debug #define GST_CAT_DEFAULT rtsp_server_debug
@ -145,8 +142,6 @@ gst_rtsp_server_class_init (GstRTSPServerClass * klass)
{ {
GObjectClass *gobject_class; GObjectClass *gobject_class;
g_type_class_add_private (klass, sizeof (GstRTSPServerPrivate));
gobject_class = G_OBJECT_CLASS (klass); gobject_class = G_OBJECT_CLASS (klass);
gobject_class->get_property = gst_rtsp_server_get_property; gobject_class->get_property = gst_rtsp_server_get_property;
@ -237,7 +232,7 @@ gst_rtsp_server_class_init (GstRTSPServerClass * klass)
static void static void
gst_rtsp_server_init (GstRTSPServer * server) 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; server->priv = priv;

View file

@ -39,9 +39,6 @@
#include "rtsp-session.h" #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 struct _GstRTSPSessionMediaPrivate
{ {
GMutex lock; GMutex lock;
@ -65,15 +62,14 @@ GST_DEBUG_CATEGORY_STATIC (rtsp_session_media_debug);
static void gst_rtsp_session_media_finalize (GObject * obj); 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 static void
gst_rtsp_session_media_class_init (GstRTSPSessionMediaClass * klass) gst_rtsp_session_media_class_init (GstRTSPSessionMediaClass * klass)
{ {
GObjectClass *gobject_class; GObjectClass *gobject_class;
g_type_class_add_private (klass, sizeof (GstRTSPSessionMediaPrivate));
gobject_class = G_OBJECT_CLASS (klass); gobject_class = G_OBJECT_CLASS (klass);
gobject_class->finalize = gst_rtsp_session_media_finalize; gobject_class->finalize = gst_rtsp_session_media_finalize;
@ -85,9 +81,9 @@ gst_rtsp_session_media_class_init (GstRTSPSessionMediaClass * klass)
static void static void
gst_rtsp_session_media_init (GstRTSPSessionMedia * media) 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); g_mutex_init (&priv->lock);
priv->state = GST_RTSP_STATE_INIT; priv->state = GST_RTSP_STATE_INIT;

View file

@ -42,9 +42,6 @@
#include "rtsp-session-pool.h" #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 struct _GstRTSPSessionPoolPrivate
{ {
GMutex lock; /* protects everything in this struct */ GMutex lock; /* protects everything in this struct */
@ -91,15 +88,14 @@ static gchar *create_session_id (GstRTSPSessionPool * pool);
static GstRTSPSession *create_session (GstRTSPSessionPool * pool, static GstRTSPSession *create_session (GstRTSPSessionPool * pool,
const gchar * id); 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 static void
gst_rtsp_session_pool_class_init (GstRTSPSessionPoolClass * klass) gst_rtsp_session_pool_class_init (GstRTSPSessionPoolClass * klass)
{ {
GObjectClass *gobject_class; GObjectClass *gobject_class;
g_type_class_add_private (klass, sizeof (GstRTSPSessionPoolPrivate));
gobject_class = G_OBJECT_CLASS (klass); gobject_class = G_OBJECT_CLASS (klass);
gobject_class->get_property = gst_rtsp_session_pool_get_property; gobject_class->get_property = gst_rtsp_session_pool_get_property;
@ -128,9 +124,9 @@ gst_rtsp_session_pool_class_init (GstRTSPSessionPoolClass * klass)
static void static void
gst_rtsp_session_pool_init (GstRTSPSessionPool * pool) 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); g_mutex_init (&priv->lock);
priv->sessions = g_hash_table_new_full (g_str_hash, g_str_equal, priv->sessions = g_hash_table_new_full (g_str_hash, g_str_equal,

View file

@ -47,9 +47,6 @@
#include "rtsp-session.h" #include "rtsp-session.h"
#define GST_RTSP_SESSION_GET_PRIVATE(obj) \
(G_TYPE_INSTANCE_GET_PRIVATE ((obj), GST_TYPE_RTSP_SESSION, GstRTSPSessionPrivate))
struct _GstRTSPSessionPrivate struct _GstRTSPSessionPrivate
{ {
GMutex lock; /* protects everything but sessionid and create_time */ 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); const GValue * value, GParamSpec * pspec);
static void gst_rtsp_session_finalize (GObject * obj); 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 static void
gst_rtsp_session_class_init (GstRTSPSessionClass * klass) gst_rtsp_session_class_init (GstRTSPSessionClass * klass)
{ {
GObjectClass *gobject_class; GObjectClass *gobject_class;
g_type_class_add_private (klass, sizeof (GstRTSPSessionPrivate));
gobject_class = G_OBJECT_CLASS (klass); gobject_class = G_OBJECT_CLASS (klass);
gobject_class->get_property = gst_rtsp_session_get_property; gobject_class->get_property = gst_rtsp_session_get_property;
@ -127,9 +122,9 @@ gst_rtsp_session_class_init (GstRTSPSessionClass * klass)
static void static void
gst_rtsp_session_init (GstRTSPSession * session) 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); GST_INFO ("init session %p", session);

View file

@ -43,9 +43,6 @@
#include "rtsp-stream-transport.h" #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 struct _GstRTSPStreamTransportPrivate
{ {
GstRTSPStream *stream; GstRTSPStream *stream;
@ -78,7 +75,7 @@ GST_DEBUG_CATEGORY_STATIC (rtsp_stream_transport_debug);
static void gst_rtsp_stream_transport_finalize (GObject * obj); 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); G_TYPE_OBJECT);
static void static void
@ -86,8 +83,6 @@ gst_rtsp_stream_transport_class_init (GstRTSPStreamTransportClass * klass)
{ {
GObjectClass *gobject_class; GObjectClass *gobject_class;
g_type_class_add_private (klass, sizeof (GstRTSPStreamTransportPrivate));
gobject_class = G_OBJECT_CLASS (klass); gobject_class = G_OBJECT_CLASS (klass);
gobject_class->finalize = gst_rtsp_stream_transport_finalize; gobject_class->finalize = gst_rtsp_stream_transport_finalize;
@ -99,10 +94,7 @@ gst_rtsp_stream_transport_class_init (GstRTSPStreamTransportClass * klass)
static void static void
gst_rtsp_stream_transport_init (GstRTSPStreamTransport * trans) gst_rtsp_stream_transport_init (GstRTSPStreamTransport * trans)
{ {
GstRTSPStreamTransportPrivate *priv = trans->priv = gst_rtsp_stream_transport_get_instance_private (trans);
GST_RTSP_STREAM_TRANSPORT_GET_PRIVATE (trans);
trans->priv = priv;
} }
static void static void

View file

@ -59,9 +59,6 @@
#include "rtsp-stream.h" #include "rtsp-stream.h"
#define GST_RTSP_STREAM_GET_PRIVATE(obj) \
(G_TYPE_INSTANCE_GET_PRIVATE ((obj), GST_TYPE_RTSP_STREAM, GstRTSPStreamPrivate))
struct _GstRTSPStreamPrivate struct _GstRTSPStreamPrivate
{ {
GMutex lock; GMutex lock;
@ -211,15 +208,13 @@ static void gst_rtsp_stream_finalize (GObject * obj);
static guint gst_rtsp_stream_signals[SIGNAL_LAST] = { 0 }; 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 static void
gst_rtsp_stream_class_init (GstRTSPStreamClass * klass) gst_rtsp_stream_class_init (GstRTSPStreamClass * klass)
{ {
GObjectClass *gobject_class; GObjectClass *gobject_class;
g_type_class_add_private (klass, sizeof (GstRTSPStreamPrivate));
gobject_class = G_OBJECT_CLASS (klass); gobject_class = G_OBJECT_CLASS (klass);
gobject_class->get_property = gst_rtsp_stream_get_property; gobject_class->get_property = gst_rtsp_stream_get_property;
@ -259,7 +254,7 @@ gst_rtsp_stream_class_init (GstRTSPStreamClass * klass)
static void static void
gst_rtsp_stream_init (GstRTSPStream * stream) 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); GST_DEBUG ("new stream %p", stream);
@ -4016,7 +4011,7 @@ gst_rtsp_stream_update_crypto (GstRTSPStream * stream,
GSocket * GSocket *
gst_rtsp_stream_get_rtp_socket (GstRTSPStream * stream, GSocketFamily family) gst_rtsp_stream_get_rtp_socket (GstRTSPStream * stream, GSocketFamily family)
{ {
GstRTSPStreamPrivate *priv = GST_RTSP_STREAM_GET_PRIVATE (stream); GstRTSPStreamPrivate *priv = stream->priv;
GSocket *socket; GSocket *socket;
const gchar *name; const gchar *name;
@ -4050,7 +4045,7 @@ gst_rtsp_stream_get_rtp_socket (GstRTSPStream * stream, GSocketFamily family)
GSocket * GSocket *
gst_rtsp_stream_get_rtcp_socket (GstRTSPStream * stream, GSocketFamily family) 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; GSocket *socket;
const gchar *name; const gchar *name;
@ -4083,7 +4078,7 @@ GSocket *
gst_rtsp_stream_get_rtp_multicast_socket (GstRTSPStream * stream, gst_rtsp_stream_get_rtp_multicast_socket (GstRTSPStream * stream,
GSocketFamily family) GSocketFamily family)
{ {
GstRTSPStreamPrivate *priv = GST_RTSP_STREAM_GET_PRIVATE (stream); GstRTSPStreamPrivate *priv = gst_rtsp_stream_get_instance_private (stream);
GSocket *socket; GSocket *socket;
const gchar *name; const gchar *name;
@ -4116,7 +4111,7 @@ GSocket *
gst_rtsp_stream_get_rtcp_multicast_socket (GstRTSPStream * stream, gst_rtsp_stream_get_rtcp_multicast_socket (GstRTSPStream * stream,
GSocketFamily family) GSocketFamily family)
{ {
GstRTSPStreamPrivate *priv = GST_RTSP_STREAM_GET_PRIVATE (stream); GstRTSPStreamPrivate *priv = gst_rtsp_stream_get_instance_private (stream);
GSocket *socket; GSocket *socket;
const gchar *name; const gchar *name;

View file

@ -184,9 +184,6 @@ gst_rtsp_thread_stop (GstRTSPThread * thread)
gst_rtsp_thread_unref (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 struct _GstRTSPThreadPoolPrivate
{ {
GMutex lock; GMutex lock;
@ -220,15 +217,14 @@ static gpointer do_loop (GstRTSPThread * thread);
static GstRTSPThread *default_get_thread (GstRTSPThreadPool * pool, static GstRTSPThread *default_get_thread (GstRTSPThreadPool * pool,
GstRTSPThreadType type, GstRTSPContext * ctx); 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 static void
gst_rtsp_thread_pool_class_init (GstRTSPThreadPoolClass * klass) gst_rtsp_thread_pool_class_init (GstRTSPThreadPoolClass * klass)
{ {
GObjectClass *gobject_class; GObjectClass *gobject_class;
g_type_class_add_private (klass, sizeof (GstRTSPThreadPoolPrivate));
gobject_class = G_OBJECT_CLASS (klass); gobject_class = G_OBJECT_CLASS (klass);
gobject_class->get_property = gst_rtsp_thread_pool_get_property; gobject_class->get_property = gst_rtsp_thread_pool_get_property;
@ -261,7 +257,7 @@ gst_rtsp_thread_pool_init (GstRTSPThreadPool * pool)
{ {
GstRTSPThreadPoolPrivate *priv; 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); g_mutex_init (&priv->lock);
priv->max_threads = DEFAULT_MAX_THREADS; priv->max_threads = DEFAULT_MAX_THREADS;