struct _GstRTSPAddressPoolPrivate
{
- GMutex lock;
+ GMutex lock; /* protects everything in this struct */
GList *addresses;
GList *allocated;
};
struct _GstRTSPAuthPrivate
{
GMutex lock;
- gchar *basic;
+ gchar *basic; /* protected by lock */
GstRTSPMethod methods;
};
#define GST_RTSP_CLIENT_GET_PRIVATE(obj) \
(G_TYPE_INSTANCE_GET_PRIVATE ((obj), GST_TYPE_RTSP_CLIENT, GstRTSPClientPrivate))
+/* locking order:
+ * send_lock, lock, tunnels_lock
+ */
+
struct _GstRTSPClientPrivate
{
- GMutex lock;
+ GMutex lock; /* protects everything else */
GMutex send_lock;
GstRTSPConnection *connection;
GstRTSPWatch *watch;
gboolean is_ipv6;
gboolean use_client_settings;
- GstRTSPClientSendFunc send_func;
- gpointer send_data;
- GDestroyNotify send_notify;
+ GstRTSPClientSendFunc send_func; /* protected by send_lock */
+ gpointer send_data; /* protected by send_lock */
+ GDestroyNotify send_notify; /* protected by send_lock */
GstRTSPSessionPool *session_pool;
GstRTSPMountPoints *mount_points;
};
static GMutex tunnels_lock;
-static GHashTable *tunnels;
+static GHashTable *tunnels; /* protected by tunnels_lock */
#define DEFAULT_SESSION_POOL NULL
#define DEFAULT_MOUNT_POINTS NULL
struct _GstRTSPMediaFactoryURIPrivate
{
GMutex lock;
- gchar *uri;
+ gchar *uri; /* protected by lock */
gboolean use_gstpay;
GstCaps *raw_vcaps;
struct _GstRTSPMediaFactoryPrivate
{
- GMutex lock;
+ GMutex lock; /* protects everything but medias */
gchar *launch;
gboolean shared;
gboolean eos_shutdown;
GstRTSPAddressPool *pool;
GMutex medias_lock;
- GHashTable *medias;
+ GHashTable *medias; /* protected by medias_lock */
};
#define DEFAULT_LAUNCH NULL
}
parse_error:
{
- GST_RTSP_MEDIA_FACTORY_UNLOCK (factory);
g_critical ("could not parse launch syntax (%s): %s", priv->launch,
(error ? error->message : "unknown reason"));
+ GST_RTSP_MEDIA_FACTORY_UNLOCK (factory);
if (error)
g_error_free (error);
return NULL;
GMutex lock;
GCond cond;
+ /* protected by lock */
gboolean shared;
gboolean reusable;
GstRTSPLowerTrans protocols;
GstRTSPAddressPool *pool;
GstElement *element;
- GRecMutex state_lock;
- GPtrArray *streams;
- GList *dynamic;
- GstRTSPMediaStatus status;
+ GRecMutex state_lock; /* locking order: state lock, lock */
+ GPtrArray *streams; /* protected by lock */
+ GList *dynamic; /* protected by lock */
+ GstRTSPMediaStatus status; /* protected by lock */
gint prepare_count;
gint n_active;
gboolean adding;
/* the pipeline for the media */
GstElement *pipeline;
- GstElement *fakesink;
+ GstElement *fakesink; /* protected by lock */
GSource *source;
guint id;
GstElement *rtpbin;
/* the range of media */
- GstRTSPTimeRange range;
+ GstRTSPTimeRange range; /* protected by lock */
GstClockTime range_start;
GstClockTime range_stop;
};
struct _GstRTSPMountPointsPrivate
{
GMutex lock;
- GHashTable *mounts;
+ GHashTable *mounts; /* protected by lock */
};
G_DEFINE_TYPE (GstRTSPMountPoints, gst_rtsp_mount_points, G_TYPE_OBJECT);
struct _GstRTSPServerPrivate
{
- GMutex lock;
+ GMutex lock; /* protects everything in this struct */
/* server information */
gchar *address;
struct _GstRTSPSessionMediaPrivate
{
GMutex lock;
- GstRTSPUrl *url;
- GstRTSPMedia *media;
- GstRTSPState state;
- guint counter;
+ GstRTSPUrl *url; /* unmutable */
+ GstRTSPMedia *media; /* unmutable */
+ GstRTSPState state; /* protected by lock */
+ guint counter; /* protected by lock */
- GPtrArray *transports;
+ GPtrArray *transports; /* protected by lock */
};
enum
struct _GstRTSPSessionPoolPrivate
{
+ GMutex lock; /* protects everything in this struct */
guint max_sessions;
-
- GMutex lock;
GHashTable *sessions;
};
struct _GstRTSPSessionPrivate
{
- GMutex lock;
+ GMutex lock; /* protects everything but sessionid and create_time */
gchar *sessionid;
guint timeout;
- GTimeVal create_time;
+ GTimeVal create_time; /* immutable */
GTimeVal last_access;
gint expire_count;