]> git.sesse.net Git - ffmpeg/blobdiff - libavformat/rtsp.h
mm: set channel layout
[ffmpeg] / libavformat / rtsp.h
index 45b003279772fecd3a28cc8de5e0cda07467c163..043b67aa6f192eab784388f1ddae65850eb7a464 100644 (file)
@@ -52,6 +52,7 @@ enum RTSPLowerTransport {
 enum RTSPTransport {
     RTSP_TRANSPORT_RTP, /**< Standards-compliant RTP */
     RTSP_TRANSPORT_RDT, /**< Realmedia Data Transport */
+    RTSP_TRANSPORT_RAW, /**< Raw data (over UDP) */
     RTSP_TRANSPORT_NB
 };
 
@@ -102,6 +103,9 @@ typedef struct RTSPTransportField {
      * packets will be allowed to make before being discarded. */
     int ttl;
 
+    /** transport set to record data */
+    int mode_record;
+
     struct sockaddr_storage destination; /**< destination IP address */
     char source[INET6_ADDRSTRLEN + 1]; /**< source IP address */
 
@@ -171,6 +175,11 @@ typedef struct RTSPMessageHeader {
      * returned
      */
     char reason[256];
+
+    /**
+     * Content type header
+     */
+    char content_type[64];
 } RTSPMessageHeader;
 
 /**
@@ -186,7 +195,7 @@ enum RTSPClientState {
 };
 
 /**
- * Identifies particular servers that require special handling, such as
+ * Identify particular servers that require special handling, such as
  * standards-incompliant "Transport:" lines in the SETUP request.
  */
 enum RTSPServerType {
@@ -302,6 +311,13 @@ typedef struct RTSPState {
      * other cases, this is a copy of AVFormatContext->filename. */
     char control_uri[1024];
 
+    /** The following are used for parsing raw mpegts in udp */
+    //@{
+    struct MpegTSContext *ts;
+    int recvbuf_pos;
+    int recvbuf_len;
+    //@}
+
     /** Additional output handle, used when input and output are done
      * separately, eg for HTTP tunneling. */
     URLContext *rtsp_hd_out;
@@ -359,14 +375,30 @@ typedef struct RTSPState {
      * Mask of all requested media types
      */
     int media_type_mask;
+
+    /**
+     * Minimum and maximum local UDP ports.
+     */
+    int rtp_port_min, rtp_port_max;
+
+    /**
+     * Timeout to wait for incoming connections.
+     */
+    int initial_timeout;
+
+    /**
+     * Size of RTP packet reordering queue.
+     */
+    int reordering_queue_size;
 } RTSPState;
 
 #define RTSP_FLAG_FILTER_SRC  0x1    /**< Filter incoming UDP packets -
                                           receive packets only from the right
                                           source address and port. */
+#define RTSP_FLAG_LISTEN      0x2    /**< Wait for incoming connections. */
 
 /**
- * Describes a single stream, as identified by a single m= line block in the
+ * Describe a single stream, as identified by a single m= line block in the
  * SDP content. In the case of RDT, one RTSPStream can represent multiple
  * AVStreams. In this case, each AVStream in this set has similar content
  * (but different codec/bitrate).
@@ -392,7 +424,7 @@ typedef struct RTSPStream {
     int sdp_payload_type;     /**< payload type */
     //@}
 
-    /** The following are used for dynamic protocols (rtp_*.c/rdt.c) */
+    /** The following are used for dynamic protocols (rtpdec_*.c/rdt.c) */
     //@{
     /** handler structure */
     RTPDynamicProtocolHandler *dynamic_handler;
@@ -405,9 +437,6 @@ typedef struct RTSPStream {
 void ff_rtsp_parse_line(RTSPMessageHeader *reply, const char *buf,
                         RTSPState *rt, const char *method);
 
-extern int rtsp_rtp_port_min;
-extern int rtsp_rtp_port_max;
-
 /**
  * Send a command to the RTSP server without waiting for the reply.
  *
@@ -518,6 +547,12 @@ int ff_rtsp_setup_input_streams(AVFormatContext *s, RTSPMessageHeader *reply);
  */
 int ff_rtsp_setup_output_streams(AVFormatContext *s, const char *addr);
 
+/**
+ * Parse RTSP commands (OPTIONS, PAUSE and TEARDOWN) during streaming in
+ * listen mode.
+ */
+int ff_rtsp_parse_streaming_commands(AVFormatContext *s);
+
 /**
  * Parse an SDP description of streams by populating an RTSPState struct
  * within the AVFormatContext; also allocate the RTP streams and the
@@ -551,6 +586,11 @@ int ff_rtsp_make_setup_request(AVFormatContext *s, const char *host, int port,
  */
 void ff_rtsp_undo_setup(AVFormatContext *s);
 
+/**
+ * Open RTSP transport context.
+ */
+int ff_rtsp_open_transport_ctx(AVFormatContext *s, RTSPStream *rtsp_st);
+
 extern const AVOption ff_rtsp_options[];
 
 #endif /* AVFORMAT_RTSP_H */