static void
gst_rtsp_session_media_init (GstRTSPSessionMedia * media)
{
+ g_mutex_init (&media->lock);
media->state = GST_RTSP_STATE_INIT;
}
gst_rtsp_url_free (media->url);
g_object_unref (media->media);
+ g_mutex_clear (&media->lock);
G_OBJECT_CLASS (gst_rtsp_session_media_parent_class)->finalize (obj);
}
g_return_val_if_fail (GST_IS_RTSP_STREAM (stream), NULL);
g_return_val_if_fail (stream->idx < media->transports->len, NULL);
+ g_mutex_lock (&media->lock);
result = g_ptr_array_index (media->transports, stream->idx);
if (result == NULL) {
result = gst_rtsp_stream_transport_new (stream, tr);
g_ptr_array_index (media->transports, stream->idx) = result;
+ g_mutex_unlock (&media->lock);
} else {
gst_rtsp_stream_transport_set_transport (result, tr);
+ g_mutex_unlock (&media->lock);
}
+
return result;
}
g_return_val_if_fail (GST_IS_RTSP_SESSION_MEDIA (media), NULL);
g_return_val_if_fail (idx < media->transports->len, NULL);
+ g_mutex_lock (&media->lock);
result = g_ptr_array_index (media->transports, idx);
+ g_mutex_unlock (&media->lock);
return result;
}
{
g_return_val_if_fail (GST_IS_RTSP_SESSION_MEDIA (media), FALSE);
+ g_mutex_lock (&media->lock);
range->min = media->counter++;
range->max = media->counter++;
+ g_mutex_unlock (&media->lock);
return TRUE;
}
g_return_val_if_fail (GST_IS_RTSP_SESSION_MEDIA (media), FALSE);
+ g_mutex_lock (&media->lock);
ret = gst_rtsp_media_set_state (media->media, state, media->transports);
+ g_mutex_unlock (&media->lock);
return ret;
}