]> git.sesse.net Git - ffmpeg/blobdiff - libavformat/rtsp.h
Fix indentation after r21257.
[ffmpeg] / libavformat / rtsp.h
index 4ad49ff716bf5ff150081c98fc963736c7f2f1ee..8f79c759ff0997ab26ac0f90b21875e50730f497 100644 (file)
@@ -18,8 +18,8 @@
  * License along with FFmpeg; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
  */
-#ifndef FFMPEG_RTSP_H
-#define FFMPEG_RTSP_H
+#ifndef AVFORMAT_RTSP_H
+#define AVFORMAT_RTSP_H
 
 #include <stdint.h>
 #include "avformat.h"
@@ -121,6 +121,10 @@ typedef struct RTSPMessageHeader {
      * should be re-transmitted by the client in every RTSP command. */
     char session_id[512];
 
+    /** the "Location:" field. This value is used to handle redirection.
+     */
+    char location[4096];
+
     /** the "RealChallenge1:" field from the server */
     char real_challenge[64];
 
@@ -132,6 +136,19 @@ 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;
+
+    /** The "Notice" or "X-Notice" field value. See
+     * http://tools.ietf.org/html/draft-stiemerling-rtsp-announce-00
+     * for a complete list of supported values. */
+    int notice;
 } RTSPMessageHeader;
 
 /**
@@ -143,6 +160,7 @@ enum RTSPClientState {
     RTSP_STATE_IDLE,    /**< not initialized */
     RTSP_STATE_PLAYING, /**< initialized and receiving data */
     RTSP_STATE_PAUSED,  /**< initialized, but not receiving data */
+    RTSP_STATE_SEEKING, /**< initialized, requesting a seek */
 };
 
 /**
@@ -192,6 +210,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 timeout. */
+    int64_t last_cmd_time;
+
     /** the negotiated data/packet transport protocol; e.g. RTP or RDT */
     enum RTSPTransport transport;
 
@@ -204,6 +232,9 @@ typedef struct RTSPState {
      * of RTSPMessageHeader->real_challenge */
     enum RTSPServerType server_type;
 
+    /** base64-encoded authorization lines (username:password) */
+    char *auth_b64;
+
     /** The last reply of the server to a RTSP command */
     char last_reply[2048]; /* XXX: allocate ? */
 
@@ -230,6 +261,10 @@ typedef struct RTSPState {
     //@{
     /** ASF demuxer context for the embedded ASF stream from WMS servers */
     AVFormatContext *asf_ctx;
+
+    /** cache for position of the asf demuxer, since we load a new
+     * data packet in the bytecontext for each incoming RTSP packet. */
+    uint64_t asf_pb_pos;
     //@}
 } RTSPState;
 
@@ -287,4 +322,4 @@ extern int rtsp_rtp_port_max;
 int rtsp_pause(AVFormatContext *s);
 int rtsp_resume(AVFormatContext *s);
 
-#endif /* FFMPEG_RTSP_H */
+#endif /* AVFORMAT_RTSP_H */