}
}
+static GPrivate state_key;
+
+/**
+ * gst_rtsp_client_state_get_current:
+ *
+ * Get the current #GstRTSPClientState. This object is retrieved from the
+ * current thread that is handling the request for a client.
+ *
+ * Returns: a #GstRTSPClientState
+ */
+GstRTSPClientState *
+gst_rtsp_client_state_get_current (void)
+{
+ return g_private_get (&state_key);
+}
+
static void
handle_request (GstRTSPClient * client, GstRTSPMessage * request)
{
GstRTSPMessage response = { 0 };
gchar *sessid;
+ state.client = client;
state.request = request;
state.response = &response;
+ state.auth = priv->auth;
+ g_private_set (&state_key, &state);
if (gst_debug_category_get_threshold (rtsp_client_debug) >= GST_LEVEL_LOG) {
gst_rtsp_message_dump (request);
}
done:
+ g_private_set (&state_key, NULL);
if (session)
g_object_unref (session);
if (uri)
/**
* GstRTSPClientState:
+ * @client: the client
* @request: the complete request
* @uri: the complete url parsed from @request
* @method: the parsed method of @uri
* Information passed around containing the client state of a request.
*/
struct _GstRTSPClientState {
+ GstRTSPClient *client;
GstRTSPMessage *request;
GstRTSPUrl *uri;
GstRTSPMethod method;
GstRTSPMessage *response;
};
+GstRTSPClientState * gst_rtsp_client_state_get_current (void);
+
/**
* GstRTSPClientSendFunc:
* @client: a #GstRTSPClient