summaryrefslogtreecommitdiff
path: root/libavformat/rtsp.h
diff options
context:
space:
mode:
authorRonald S. Bultje <rsbultje@gmail.com>2009-04-15 13:04:34 +0000
committerRonald S. Bultje <rsbultje@gmail.com>2009-04-15 13:04:34 +0000
commit30e79845b464bd93172bfe1a3ce5f6815178f18e (patch)
treeb52c4c142f10fa26495591deba48e4d4a7a2ae3b /libavformat/rtsp.h
parent888505df22aebba26db7cd3b65e4201d8097e582 (diff)
Send dummy requests over the TCP connection (WMS wants GET_PARAMETER,
Real wants OPTIONS) while the connection is idle, otherwise it will be aborted after a short period (usually a minute). See the thread "[PATCH] rtsp.c: keep-alive" on the mailinglist. Originally committed as revision 18525 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavformat/rtsp.h')
-rw-r--r--libavformat/rtsp.h18
1 files changed, 18 insertions, 0 deletions
diff --git a/libavformat/rtsp.h b/libavformat/rtsp.h
index 4ad49ff716..99e56eeb92 100644
--- a/libavformat/rtsp.h
+++ b/libavformat/rtsp.h
@@ -132,6 +132,14 @@ typedef struct RTSPMessageHeader {
* (RealServer compatible)" or "RealServer Version v.e.r.sion (platform)",
* where platform is the output of $uname -msr | sed 's/ /-/g'. */
char server[64];
+
+ /** The "timeout" comes as part of the server response to the "SETUP"
+ * command, in the "Session: <xyz>[;timeout=<value>]" line. It is the
+ * time, in seconds, that the server will go without traffic over the
+ * RTSP/TCP connection before it closes the connection. To prevent
+ * this, sent dummy requests (e.g. OPTIONS) with intervals smaller
+ * than this value. */
+ int timeout;
} RTSPMessageHeader;
/**
@@ -192,6 +200,16 @@ typedef struct RTSPState {
* identifier that the client should re-transmit in each RTSP command */
char session_id[512];
+ /** copy of RTSPMessageHeader->timeout, i.e. the time (in seconds) that
+ * the server will go without traffic on the RTSP/TCP line before it
+ * closes the connection. */
+ int timeout;
+
+ /** timestamp of the last RTSP command that we sent to the RTSP server.
+ * This is used to calculate when to send dummy commands to keep the
+ * connection alive, in conjunction with \p timeout. */
+ int64_t last_cmd_time;
+
/** the negotiated data/packet transport protocol; e.g. RTP or RDT */
enum RTSPTransport transport;