[farsight2/master] Make it clear that the lock is held accross the new_remote_codecs callback
Olivier Crête
olivier.crete at collabora.co.uk
Fri Dec 12 16:25:55 PST 2008
---
gst/fsrtpconference/fs-rtp-session.c | 8 ++++----
gst/fsrtpconference/fs-rtp-stream.c | 15 ++++++++-------
gst/fsrtpconference/fs-rtp-stream.h | 4 ++--
3 files changed, 14 insertions(+), 13 deletions(-)
diff --git a/gst/fsrtpconference/fs-rtp-session.c b/gst/fsrtpconference/fs-rtp-session.c
index 7ea0d7c..41abbe5 100644
--- a/gst/fsrtpconference/fs-rtp-session.c
+++ b/gst/fsrtpconference/fs-rtp-session.c
@@ -237,8 +237,8 @@ static void _substream_no_rtcp_timedout_cb (FsRtpSubStream *substream,
static void _substream_blocked (FsRtpSubStream *substream, FsRtpStream *stream,
FsRtpSession *session);
-static gboolean _stream_new_remote_codecs (FsRtpStream *stream, GList *codecs,
- GError **error, gpointer user_data);
+static gboolean _stream_new_remote_codecs_locked (FsRtpStream *stream,
+ GList *codecs, GError **error, gpointer user_data);
static FsStreamTransmitter *fs_rtp_session_get_new_stream_transmitter (
@@ -1461,7 +1461,7 @@ fs_rtp_session_new_stream (FsSession *session,
return NULL;
new_stream = FS_STREAM_CAST (fs_rtp_stream_new (self, rtpparticipant,
- direction, st, _stream_new_remote_codecs,
+ direction, st, _stream_new_remote_codecs_locked,
_stream_known_source_packet_received, self, error));
FS_RTP_SESSION_LOCK (self);
@@ -2186,7 +2186,7 @@ fs_rtp_session_update_codecs (FsRtpSession *session,
}
static gboolean
-_stream_new_remote_codecs (FsRtpStream *stream,
+_stream_new_remote_codecs_locked (FsRtpStream *stream,
GList *codecs, GError **error, gpointer user_data)
{
FsRtpSession *session = FS_RTP_SESSION_CAST (user_data);
diff --git a/gst/fsrtpconference/fs-rtp-stream.c b/gst/fsrtpconference/fs-rtp-stream.c
index 743d7f5..eda023b 100644
--- a/gst/fsrtpconference/fs-rtp-stream.c
+++ b/gst/fsrtpconference/fs-rtp-stream.c
@@ -77,7 +77,7 @@ struct _FsRtpStreamPrivate
GError *construction_error;
- stream_new_remote_codecs_cb new_remote_codecs_cb;
+ stream_new_remote_codecs_locked_cb new_remote_codecs_locked_cb;
stream_known_source_packet_receive_cb known_source_packet_received_cb;
gpointer user_data_for_cb;
@@ -537,7 +537,7 @@ fs_rtp_stream_set_remote_codecs (FsStream *stream,
}
}
- if (self->priv->new_remote_codecs_cb (self, remote_codecs, error,
+ if (self->priv->new_remote_codecs_locked_cb (self, remote_codecs, error,
self->priv->user_data_for_cb))
{
if (self->remote_codecs)
@@ -562,8 +562,9 @@ fs_rtp_stream_set_remote_codecs (FsStream *stream,
* @direction: the initial #FsDirection for this stream
* @stream_transmitter: the #FsStreamTransmitter for this stream, one
* reference to it will be eaten
- * @new_remote_codecs: Callback called when the remote codecs change
- * (ie when fs_rtp_stream_set_remote_codecs() is called).
+ * @new_remote_codecs_locked_cb: Callback called when the remote codecs change
+ * (ie when fs_rtp_stream_set_remote_codecs() is called). One must hold
+ * the session lock across calls.
* @known_source_packet_received: Callback called when a packet from a
* known source is receive.
* @user_data: User data for the callbacks.
@@ -577,7 +578,7 @@ fs_rtp_stream_new (FsRtpSession *session,
FsRtpParticipant *participant,
FsStreamDirection direction,
FsStreamTransmitter *stream_transmitter,
- stream_new_remote_codecs_cb new_remote_codecs_cb,
+ stream_new_remote_codecs_locked_cb new_remote_codecs_locked_cb,
stream_known_source_packet_receive_cb known_source_packet_received_cb,
gpointer user_data_for_cb,
GError **error)
@@ -587,7 +588,7 @@ fs_rtp_stream_new (FsRtpSession *session,
g_return_val_if_fail (session, NULL);
g_return_val_if_fail (participant, NULL);
g_return_val_if_fail (stream_transmitter, NULL);
- g_return_val_if_fail (new_remote_codecs_cb, NULL);
+ g_return_val_if_fail (new_remote_codecs_locked_cb, NULL);
g_return_val_if_fail (known_source_packet_received_cb, NULL);
self = g_object_new (FS_TYPE_RTP_STREAM,
@@ -597,7 +598,7 @@ fs_rtp_stream_new (FsRtpSession *session,
"stream-transmitter", stream_transmitter,
NULL);
- self->priv->new_remote_codecs_cb = new_remote_codecs_cb;
+ self->priv->new_remote_codecs_locked_cb = new_remote_codecs_locked_cb;
self->priv->known_source_packet_received_cb = known_source_packet_received_cb;
self->priv->user_data_for_cb = user_data_for_cb;
diff --git a/gst/fsrtpconference/fs-rtp-stream.h b/gst/fsrtpconference/fs-rtp-stream.h
index 846ebd2..6688362 100644
--- a/gst/fsrtpconference/fs-rtp-stream.h
+++ b/gst/fsrtpconference/fs-rtp-stream.h
@@ -84,7 +84,7 @@ struct _FsRtpStream
GType fs_rtp_stream_get_type (void);
-typedef gboolean (*stream_new_remote_codecs_cb) (FsRtpStream *stream,
+typedef gboolean (*stream_new_remote_codecs_locked_cb) (FsRtpStream *stream,
GList *codecs, GError **error, gpointer user_data);
typedef void (*stream_known_source_packet_receive_cb) (FsRtpStream *stream,
guint component, GstBuffer *buffer, gpointer user_data);
@@ -93,7 +93,7 @@ FsRtpStream *fs_rtp_stream_new (FsRtpSession *session,
FsRtpParticipant *participant,
FsStreamDirection direction,
FsStreamTransmitter *stream_transmitter,
- stream_new_remote_codecs_cb new_remote_codecs_cb,
+ stream_new_remote_codecs_locked_cb new_remote_codecs_locked_cb,
stream_known_source_packet_receive_cb known_source_packet_received_cb,
gpointer user_data_for_cb,
GError **error);
--
1.5.6.5
More information about the farsight-commits
mailing list