summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGöran Jönsson <goranjn@axis.com>2014-05-27 12:36:52 +0200
committerWim Taymans <wtaymans@redhat.com>2014-06-05 10:36:11 +0200
commitaaf921cac423a7dee34d66def9271845b8c998eb (patch)
tree706c6a0c0b19a81eb00ed216cb384a77e377358c
parent35a6c8cbcc46c188afb1215916c2390da0bc5c4d (diff)
rtsp-session: Timeout in header.
Adding the possbilty to always have timout in header. This is configurabe with setting "timeout-always-visible". Fixes https://bugzilla.gnome.org/show_bug.cgi?id=728264
-rw-r--r--gst/rtsp-server/rtsp-session.c21
1 files changed, 19 insertions, 2 deletions
diff --git a/gst/rtsp-server/rtsp-session.c b/gst/rtsp-server/rtsp-session.c
index 59463ce..9beb8ab 100644
--- a/gst/rtsp-server/rtsp-session.c
+++ b/gst/rtsp-server/rtsp-session.c
@@ -56,6 +56,7 @@ struct _GstRTSPSessionPrivate
gchar *sessionid;
guint timeout;
+ gboolean timeout_always_visible;
GTimeVal create_time; /* immutable */
GTimeVal last_access;
gint expire_count;
@@ -65,13 +66,15 @@ struct _GstRTSPSessionPrivate
#undef DEBUG
-#define DEFAULT_TIMEOUT 60
+#define DEFAULT_TIMEOUT 60
+#define DEFAULT_ALWAYS_VISIBLE FALSE
enum
{
PROP_0,
PROP_SESSIONID,
PROP_TIMEOUT,
+ PROP_TIMEOUT_ALWAYS_VISIBLE,
PROP_LAST
};
@@ -109,6 +112,11 @@ gst_rtsp_session_class_init (GstRTSPSessionClass * klass)
"the timeout of the session (0 = never)", 0, G_MAXUINT,
DEFAULT_TIMEOUT, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
+ g_object_class_install_property (gobject_class, PROP_TIMEOUT_ALWAYS_VISIBLE,
+ g_param_spec_boolean ("timeout-always-visible", "Timeout Always Visible ",
+ "timeout always visible in header",
+ DEFAULT_ALWAYS_VISIBLE, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
+
GST_DEBUG_CATEGORY_INIT (rtsp_session_debug, "rtspsession", 0,
"GstRTSPSession");
}
@@ -161,6 +169,9 @@ gst_rtsp_session_get_property (GObject * object, guint propid,
case PROP_TIMEOUT:
g_value_set_uint (value, gst_rtsp_session_get_timeout (session));
break;
+ case PROP_TIMEOUT_ALWAYS_VISIBLE:
+ g_value_set_boolean (value, priv->timeout_always_visible);
+ break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, propid, pspec);
}
@@ -181,6 +192,11 @@ gst_rtsp_session_set_property (GObject * object, guint propid,
case PROP_TIMEOUT:
gst_rtsp_session_set_timeout (session, g_value_get_uint (value));
break;
+ case PROP_TIMEOUT_ALWAYS_VISIBLE:
+ g_mutex_lock (&priv->lock);
+ priv->timeout_always_visible = g_value_get_boolean (value);
+ g_mutex_unlock (&priv->lock);
+ break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, propid, pspec);
}
@@ -433,8 +449,9 @@ gst_rtsp_session_get_header (GstRTSPSession * session)
priv = session->priv;
+
g_mutex_lock (&priv->lock);
- if (priv->timeout != 60)
+ if (priv->timeout_always_visible || priv->timeout != 60)
result = g_strdup_printf ("%s; timeout=%d", priv->sessionid, priv->timeout);
else
result = g_strdup (priv->sessionid);