From 530f214bd57cfd8fa9e001d957808211a28df06a Mon Sep 17 00:00:00 2001 From: Wim Taymans Date: Thu, 26 Apr 2007 10:08:27 +0000 Subject: gst/rtsp/gstrtspsrc.*: Protect state changes with a lock. Original commit message from CVS: * gst/rtsp/gstrtspsrc.c: (gst_rtspsrc_init), (gst_rtspsrc_finalize), (gst_rtspsrc_stream_configure_transport), (gst_rtspsrc_open), (gst_rtspsrc_close), (gst_rtspsrc_parse_rtpinfo), (gst_rtspsrc_play), (gst_rtspsrc_pause): * gst/rtsp/gstrtspsrc.h: Protect state changes with a lock. * gst/rtsp/rtspconnection.c: (rtsp_connection_create), (parse_line): * gst/rtsp/rtspconnection.h: Remove some unused stuff. --- gst/rtsp/gstrtspsrc.h | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'gst/rtsp/gstrtspsrc.h') diff --git a/gst/rtsp/gstrtspsrc.h b/gst/rtsp/gstrtspsrc.h index 82582cf3..7d595f69 100644 --- a/gst/rtsp/gstrtspsrc.h +++ b/gst/rtsp/gstrtspsrc.h @@ -67,6 +67,10 @@ G_BEGIN_DECLS typedef struct _GstRTSPSrc GstRTSPSrc; typedef struct _GstRTSPSrcClass GstRTSPSrcClass; +#define GST_RTSP_STATE_GET_LOCK(rtsp) (GST_RTSPSRC_CAST(rtsp)->state_lock) +#define GST_RTSP_STATE_LOCK(rtsp) (g_mutex_lock (GST_RTSP_STATE_GET_LOCK(rtsp))) +#define GST_RTSP_STATE_UNLOCK(rtsp) (g_mutex_unlock (GST_RTSP_STATE_GET_LOCK(rtsp))) + #define GST_RTSP_LOOP_GET_COND(rtsp) (GST_RTSPSRC_CAST(rtsp)->loop_cond) #define GST_RTSP_LOOP_WAIT(rtsp) (g_cond_wait(GST_RTSP_LOOP_GET_COND (rtsp), GST_OBJECT_GET_LOCK (rtsp))) #define GST_RTSP_LOOP_SIGNAL(rtsp) (g_cond_signal(GST_RTSP_LOOP_GET_COND (rtsp))) @@ -124,6 +128,7 @@ struct _GstRTSPSrc { /* cond to signal loop */ GCond *loop_cond; gint loop_cmd; + GMutex *state_lock; gint numstreams; GList *streams; @@ -141,6 +146,7 @@ struct _GstRTSPSrc { guint latency; /* state */ + RTSPState state; gchar *content_base; RTSPLowerTrans cur_protocols; gboolean tried_url_auth; -- cgit