[farsight2/master] Make the RTP session mutex puiblic
Olivier Crête
olivier.crete at collabora.co.uk
Tue Dec 23 15:20:06 PST 2008
---
gst/fsrtpconference/fs-rtp-session.c | 9 ++-------
gst/fsrtpconference/fs-rtp-session.h | 7 +++++++
2 files changed, 9 insertions(+), 7 deletions(-)
diff --git a/gst/fsrtpconference/fs-rtp-session.c b/gst/fsrtpconference/fs-rtp-session.c
index 50455d4..a0961d7 100644
--- a/gst/fsrtpconference/fs-rtp-session.c
+++ b/gst/fsrtpconference/fs-rtp-session.c
@@ -126,17 +126,12 @@ struct _FsRtpSessionPrivate
GError *construction_error;
- GMutex *mutex;
-
gboolean disposed;
};
#define FS_RTP_SESSION_GET_PRIVATE(o) \
(G_TYPE_INSTANCE_GET_PRIVATE ((o), FS_TYPE_RTP_SESSION, FsRtpSessionPrivate))
-#define FS_RTP_SESSION_LOCK(session) g_mutex_lock ((session)->priv->mutex)
-#define FS_RTP_SESSION_UNLOCK(session) g_mutex_unlock ((session)->priv->mutex)
-
static void fs_rtp_session_class_init (FsRtpSessionClass *klass);
static void fs_rtp_session_init (FsRtpSession *self);
static void fs_rtp_session_dispose (GObject *object);
@@ -280,7 +275,7 @@ fs_rtp_session_init (FsRtpSession *self)
self->priv->transmitters = g_hash_table_new_full (g_str_hash, g_str_equal,
g_free, g_object_unref);
- self->priv->mutex = g_mutex_new ();
+ self->mutex = g_mutex_new ();
self->priv->media_type = FS_MEDIA_TYPE_LAST + 1;
}
@@ -477,7 +472,7 @@ fs_rtp_session_finalize (GObject *object)
{
FsRtpSession *self = FS_RTP_SESSION (object);
- g_mutex_free (self->priv->mutex);
+ g_mutex_free (self->mutex);
if (self->priv->local_codecs_configuration)
fs_codec_list_destroy (self->priv->local_codecs_configuration);
diff --git a/gst/fsrtpconference/fs-rtp-session.h b/gst/fsrtpconference/fs-rtp-session.h
index daa8f43..2f81c60 100644
--- a/gst/fsrtpconference/fs-rtp-session.h
+++ b/gst/fsrtpconference/fs-rtp-session.h
@@ -69,9 +69,16 @@ struct _FsRtpSession
/*< private >*/
+ GMutex *mutex; /* Should only be accessed using the macros */
+
FsRtpSessionPrivate *priv;
};
+#define FS_RTP_SESSION_LOCK(session) \
+ g_mutex_lock (FS_RTP_SESSION(session)->mutex)
+#define FS_RTP_SESSION_UNLOCK(session) \
+ g_mutex_unlock (FS_RTP_SESSION(session)->mutex)
+
GType fs_rtp_session_get_type (void);
--
1.5.6.5
More information about the farsight-commits
mailing list