mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-04-12 19:14:16 +00:00
client: remove reference to server
We don't need to keep a ref to the server
This commit is contained in:
parent
4fa7502fd9
commit
8da4171055
4 changed files with 6 additions and 61 deletions
|
@ -268,8 +268,6 @@ GstRTSPClientState
|
|||
GstRTSPClient
|
||||
GstRTSPClientClass
|
||||
gst_rtsp_client_new
|
||||
gst_rtsp_client_set_server
|
||||
gst_rtsp_client_get_server
|
||||
gst_rtsp_client_set_session_pool
|
||||
gst_rtsp_client_get_session_pool
|
||||
gst_rtsp_client_set_mount_points
|
||||
|
|
|
@ -1749,55 +1749,6 @@ gst_rtsp_client_get_session_pool (GstRTSPClient * client)
|
|||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* gst_rtsp_client_set_server:
|
||||
* @client: a #GstRTSPClient
|
||||
* @server: a #GstRTSPServer
|
||||
*
|
||||
* Set @server as the server that created @client.
|
||||
*/
|
||||
void
|
||||
gst_rtsp_client_set_server (GstRTSPClient * client, GstRTSPServer * server)
|
||||
{
|
||||
GstRTSPServer *old;
|
||||
|
||||
g_return_if_fail (GST_IS_RTSP_CLIENT (client));
|
||||
|
||||
if (server)
|
||||
g_object_ref (server);
|
||||
|
||||
g_mutex_lock (&client->lock);
|
||||
old = client->server;
|
||||
client->server = server;
|
||||
g_mutex_unlock (&client->lock);
|
||||
|
||||
if (old)
|
||||
g_object_unref (old);
|
||||
}
|
||||
|
||||
/**
|
||||
* gst_rtsp_client_get_server:
|
||||
* @client: a #GstRTSPClient
|
||||
*
|
||||
* Get the #GstRTSPServer object that @client was created from.
|
||||
*
|
||||
* Returns: (transfer full): a #GstRTSPServer, unref after usage.
|
||||
*/
|
||||
GstRTSPServer *
|
||||
gst_rtsp_client_get_server (GstRTSPClient * client)
|
||||
{
|
||||
GstRTSPServer *result;
|
||||
|
||||
g_return_val_if_fail (GST_IS_RTSP_CLIENT (client), NULL);
|
||||
|
||||
g_mutex_lock (&client->lock);
|
||||
if ((result = client->server))
|
||||
g_object_ref (result);
|
||||
g_mutex_unlock (&client->lock);
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* gst_rtsp_client_set_mount_points:
|
||||
* @client: a #GstRTSPClient
|
||||
|
|
|
@ -74,13 +74,16 @@ struct _GstRTSPClientState {
|
|||
|
||||
/**
|
||||
* GstRTSPClient:
|
||||
*
|
||||
* @lock: lock protecting the client object
|
||||
* @connection: the connection object handling the client request.
|
||||
* @watch: watch for the connection
|
||||
* @ip: ip address used by the client to connect to us
|
||||
* @close_response_seq: sequence number of message with close header
|
||||
* @server_ip: ip address of the server
|
||||
* @is_ipv6: if we are IPv6
|
||||
* @use_client_settings: whether to allow client transport settings for multicast
|
||||
* @session_pool: handle to the session pool used by the client.
|
||||
* @mount_points: handle to the mount points used by the client.
|
||||
* @auth: authorization object
|
||||
* @uri: cached uri
|
||||
* @media: cached media
|
||||
* @transports: a list of #GstRTSPStreamTransport using @connection.
|
||||
|
@ -94,11 +97,11 @@ struct _GstRTSPClient {
|
|||
GMutex lock;
|
||||
GstRTSPConnection *connection;
|
||||
GstRTSPWatch *watch;
|
||||
guint close_response_seq;
|
||||
gchar *server_ip;
|
||||
gboolean is_ipv6;
|
||||
gboolean use_client_settings;
|
||||
|
||||
GstRTSPServer *server;
|
||||
GstRTSPSessionPool *session_pool;
|
||||
GstRTSPMountPoints *mount_points;
|
||||
GstRTSPAuth *auth;
|
||||
|
@ -108,8 +111,6 @@ struct _GstRTSPClient {
|
|||
|
||||
GList *transports;
|
||||
GList *sessions;
|
||||
|
||||
guint close_response_seq;
|
||||
};
|
||||
|
||||
struct _GstRTSPClientClass {
|
||||
|
@ -134,9 +135,6 @@ GType gst_rtsp_client_get_type (void);
|
|||
|
||||
GstRTSPClient * gst_rtsp_client_new (void);
|
||||
|
||||
void gst_rtsp_client_set_server (GstRTSPClient * client, GstRTSPServer * server);
|
||||
GstRTSPServer * gst_rtsp_client_get_server (GstRTSPClient * client);
|
||||
|
||||
void gst_rtsp_client_set_session_pool (GstRTSPClient *client,
|
||||
GstRTSPSessionPool *pool);
|
||||
GstRTSPSessionPool * gst_rtsp_client_get_session_pool (GstRTSPClient *client);
|
||||
|
|
|
@ -858,7 +858,6 @@ unmanage_client (GstRTSPClient * client, ClientContext * ctx)
|
|||
GST_DEBUG_OBJECT (server, "unmanage client %p", client);
|
||||
|
||||
g_object_ref (server);
|
||||
gst_rtsp_client_set_server (client, NULL);
|
||||
|
||||
GST_RTSP_SERVER_LOCK (server);
|
||||
server->clients = g_list_remove (server->clients, ctx);
|
||||
|
@ -880,7 +879,6 @@ manage_client (GstRTSPServer * server, GstRTSPClient * client)
|
|||
ClientContext *ctx;
|
||||
|
||||
GST_DEBUG_OBJECT (server, "manage client %p", client);
|
||||
gst_rtsp_client_set_server (client, server);
|
||||
|
||||
ctx = g_slice_new0 (ClientContext);
|
||||
ctx->server = server;
|
||||
|
|
Loading…
Reference in a new issue