mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-02-07 06:52:41 +00:00
client: add method to configure thread pool
This commit is contained in:
parent
27917f4ef3
commit
00997d956f
2 changed files with 63 additions and 1 deletions
|
@ -49,6 +49,7 @@ struct _GstRTSPClientPrivate
|
||||||
GstRTSPSessionPool *session_pool;
|
GstRTSPSessionPool *session_pool;
|
||||||
GstRTSPMountPoints *mount_points;
|
GstRTSPMountPoints *mount_points;
|
||||||
GstRTSPAuth *auth;
|
GstRTSPAuth *auth;
|
||||||
|
GstRTSPThreadPool *thread_pool;
|
||||||
|
|
||||||
/* used to cache the media in the last requested DESCRIBE so that
|
/* used to cache the media in the last requested DESCRIBE so that
|
||||||
* we can pick it up in the next SETUP immediately */
|
* we can pick it up in the next SETUP immediately */
|
||||||
|
@ -590,7 +591,7 @@ no_prepare:
|
||||||
GST_ERROR ("client %p: can't prepare media", client);
|
GST_ERROR ("client %p: can't prepare media", client);
|
||||||
send_generic_response (client, GST_RTSP_STS_SERVICE_UNAVAILABLE, state);
|
send_generic_response (client, GST_RTSP_STS_SERVICE_UNAVAILABLE, state);
|
||||||
g_object_unref (media);
|
g_object_unref (media);
|
||||||
state->media = media;
|
state->media = NULL;
|
||||||
g_object_unref (factory);
|
g_object_unref (factory);
|
||||||
state->factory = NULL;
|
state->factory = NULL;
|
||||||
return NULL;
|
return NULL;
|
||||||
|
@ -2223,6 +2224,63 @@ gst_rtsp_client_get_auth (GstRTSPClient * client)
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* gst_rtsp_client_set_thread_pool:
|
||||||
|
* @client: a #GstRTSPClient
|
||||||
|
* @pool: a #GstRTSPThreadPool
|
||||||
|
*
|
||||||
|
* configure @pool to be used as the thread pool of @client.
|
||||||
|
*/
|
||||||
|
void
|
||||||
|
gst_rtsp_client_set_thread_pool (GstRTSPClient * client,
|
||||||
|
GstRTSPThreadPool * pool)
|
||||||
|
{
|
||||||
|
GstRTSPClientPrivate *priv;
|
||||||
|
GstRTSPThreadPool *old;
|
||||||
|
|
||||||
|
g_return_if_fail (GST_IS_RTSP_CLIENT (client));
|
||||||
|
|
||||||
|
priv = client->priv;
|
||||||
|
|
||||||
|
if (pool)
|
||||||
|
g_object_ref (pool);
|
||||||
|
|
||||||
|
g_mutex_lock (&priv->lock);
|
||||||
|
old = priv->thread_pool;
|
||||||
|
priv->thread_pool = pool;
|
||||||
|
g_mutex_unlock (&priv->lock);
|
||||||
|
|
||||||
|
if (old)
|
||||||
|
g_object_unref (old);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* gst_rtsp_client_get_thread_pool:
|
||||||
|
* @client: a #GstRTSPClient
|
||||||
|
*
|
||||||
|
* Get the #GstRTSPThreadPool used as the thread pool of @client.
|
||||||
|
*
|
||||||
|
* Returns: (transfer full): the #GstRTSPThreadPool of @client. g_object_unref() after
|
||||||
|
* usage.
|
||||||
|
*/
|
||||||
|
GstRTSPThreadPool *
|
||||||
|
gst_rtsp_client_get_thread_pool (GstRTSPClient * client)
|
||||||
|
{
|
||||||
|
GstRTSPClientPrivate *priv;
|
||||||
|
GstRTSPThreadPool *result;
|
||||||
|
|
||||||
|
g_return_val_if_fail (GST_IS_RTSP_CLIENT (client), NULL);
|
||||||
|
|
||||||
|
priv = client->priv;
|
||||||
|
|
||||||
|
g_mutex_lock (&priv->lock);
|
||||||
|
if ((result = priv->thread_pool))
|
||||||
|
g_object_ref (result);
|
||||||
|
g_mutex_unlock (&priv->lock);
|
||||||
|
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* gst_rtsp_client_set_connection:
|
* gst_rtsp_client_set_connection:
|
||||||
* @client: a #GstRTSPClient
|
* @client: a #GstRTSPClient
|
||||||
|
|
|
@ -36,6 +36,7 @@ typedef struct _GstRTSPClientPrivate GstRTSPClientPrivate;
|
||||||
#include "rtsp-session-pool.h"
|
#include "rtsp-session-pool.h"
|
||||||
#include "rtsp-session-media.h"
|
#include "rtsp-session-media.h"
|
||||||
#include "rtsp-auth.h"
|
#include "rtsp-auth.h"
|
||||||
|
#include "rtsp-thread-pool.h"
|
||||||
#include "rtsp-token.h"
|
#include "rtsp-token.h"
|
||||||
#include "rtsp-sdp.h"
|
#include "rtsp-sdp.h"
|
||||||
|
|
||||||
|
@ -163,6 +164,9 @@ gboolean gst_rtsp_client_get_use_client_settings (GstRTSPClient * c
|
||||||
void gst_rtsp_client_set_auth (GstRTSPClient *client, GstRTSPAuth *auth);
|
void gst_rtsp_client_set_auth (GstRTSPClient *client, GstRTSPAuth *auth);
|
||||||
GstRTSPAuth * gst_rtsp_client_get_auth (GstRTSPClient *client);
|
GstRTSPAuth * gst_rtsp_client_get_auth (GstRTSPClient *client);
|
||||||
|
|
||||||
|
void gst_rtsp_client_set_thread_pool (GstRTSPClient *client, GstRTSPThreadPool *pool);
|
||||||
|
GstRTSPThreadPool * gst_rtsp_client_get_thread_pool (GstRTSPClient *client);
|
||||||
|
|
||||||
gboolean gst_rtsp_client_set_connection (GstRTSPClient *client, GstRTSPConnection *conn);
|
gboolean gst_rtsp_client_set_connection (GstRTSPClient *client, GstRTSPConnection *conn);
|
||||||
GstRTSPConnection * gst_rtsp_client_get_connection (GstRTSPClient *client);
|
GstRTSPConnection * gst_rtsp_client_get_connection (GstRTSPClient *client);
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue