GstRTSPContext * ctx);
static GstRTSPResult default_params_get (GstRTSPClient * client,
GstRTSPContext * ctx);
-static gchar * default_make_path_from_uri (GstRTSPClient *client,
- const GstRTSPUrl *uri);
+static gchar *default_make_path_from_uri (GstRTSPClient * client,
+ const GstRTSPUrl * uri);
G_DEFINE_TYPE (GstRTSPClient, gst_rtsp_client, G_TYPE_OBJECT);
goto bad_request;
}
- absolute_uristr = g_strdup_printf ("rtsp://%s%s", priv->server_ip, uristr);
+ absolute_uristr =
+ g_strdup_printf ("rtsp://%s%s", priv->server_ip, uristr);
GST_DEBUG_OBJECT (client, "absolute url: %s", absolute_uristr);
if (gst_rtsp_url_parse (absolute_uristr, &uri) != GST_RTSP_OK) {
* will also be added with an additional ref to the result #GList of this
* function..
*
+ * When @func is %NULL, #GST_RTSP_FILTER_REF will be assumed for each session.
+ *
* Returns: (element-type GstRTSPSession) (transfer full): a #GList with all
* sessions for which @func returned #GST_RTSP_FILTER_REF. After usage, each
* element in the #GList should be unreffed before the list is freed.
GList *result, *walk, *next;
g_return_val_if_fail (GST_IS_RTSP_CLIENT (client), NULL);
- g_return_val_if_fail (func != NULL, NULL);
priv = client->priv;
g_mutex_lock (&priv->lock);
for (walk = priv->sessions; walk; walk = next) {
GstRTSPSession *sess = walk->data;
+ GstRTSPFilterResult res;
next = g_list_next (walk);
- switch (func (client, sess, user_data)) {
+ if (func)
+ res = func (client, sess, user_data);
+ else
+ res = GST_RTSP_FILTER_REF;
+
+ switch (res) {
case GST_RTSP_FILTER_REMOVE:
/* stop watching the session and pretent it went away */
client_cleanup_session (client, sess);
g_clear_error (&addr_error);
break;
}
- port = g_inet_socket_address_get_port (G_INET_SOCKET_ADDRESS (sockaddr));
+ port =
+ g_inet_socket_address_get_port (G_INET_SOCKET_ADDRESS (sockaddr));
if (port != 0) {
g_free (priv->service);
* will also be added with an additional ref to the result #GList of this
* function..
*
+ * When @func is %NULL, #GST_RTSP_FILTER_REF will be assumed for each client.
+ *
* Returns: (element-type GstRTSPClient) (transfer full): a #GList with all
* clients for which @func returned #GST_RTSP_FILTER_REF. After usage, each
* element in the #GList should be unreffed before the list is freed.
GList *result, *walk, *next;
g_return_val_if_fail (GST_IS_RTSP_SERVER (server), NULL);
- g_return_val_if_fail (func != NULL, NULL);
priv = server->priv;
GST_RTSP_SERVER_LOCK (server);
for (walk = priv->clients; walk; walk = next) {
ClientContext *cctx = walk->data;
+ GstRTSPFilterResult res;
next = g_list_next (walk);
- switch (func (server, cctx->client, user_data)) {
+ if (func)
+ res = func (server, cctx->client, user_data);
+ else
+ res = GST_RTSP_FILTER_REF;
+
+ switch (res) {
case GST_RTSP_FILTER_REMOVE:
/* remove client, FIXME */
break;
static gboolean
filter_func (gchar * sessionid, GstRTSPSession * sess, FilterData * data)
{
- switch (data->func (data->pool, sess, data->user_data)) {
+ GstRTSPFilterResult res;
+
+ if (data->func)
+ res = data->func (data->pool, sess, data->user_data);
+ else
+ res = GST_RTSP_FILTER_REF;
+
+ switch (res) {
case GST_RTSP_FILTER_REMOVE:
return TRUE;
case GST_RTSP_FILTER_REF:
* will also be added with an additional ref to the result GList of this
* function..
*
+ * When @func is %NULL, #GST_RTSP_FILTER_REF will be assumed for all sessions.
+ *
* Returns: (element-type GstRTSPSession) (transfer full): a GList with all
* sessions for which @func returned #GST_RTSP_FILTER_REF. After usage, each
* element in the GList should be unreffed before the list is freed.
FilterData data;
g_return_val_if_fail (GST_IS_RTSP_SESSION_POOL (pool), NULL);
- g_return_val_if_fail (func != NULL, NULL);
priv = pool->priv;
* will also be added with an additional ref to the result #GList of this
* function..
*
+ * When @func is %NULL, #GST_RTSP_FILTER_REF will be assumed for all media.
+ *
* Returns: (element-type GstRTSPSessionMedia) (transfer full): a GList with all
* media for which @func returned #GST_RTSP_FILTER_REF. After usage, each
* element in the #GList should be unreffed before the list is freed.
GList *result, *walk, *next;
g_return_val_if_fail (GST_IS_RTSP_SESSION (sess), NULL);
- g_return_val_if_fail (func != NULL, NULL);
priv = sess->priv;
g_mutex_lock (&priv->lock);
for (walk = priv->medias; walk; walk = next) {
GstRTSPSessionMedia *media = walk->data;
+ GstRTSPFilterResult res;
next = g_list_next (walk);
- switch (func (sess, media, user_data)) {
+ if (func)
+ res = func (sess, media, user_data);
+ else
+ res = GST_RTSP_FILTER_REF;
+
+ switch (res) {
case GST_RTSP_FILTER_REMOVE:
g_object_unref (media);
priv->medias = g_list_delete_link (priv->medias, walk);