]> git.sesse.net Git - vlc/blobdiff - modules/access/mms/mmstu.h
Made the mmsh protocol adhere to content-length header if it receives Connection...
[vlc] / modules / access / mms / mmstu.h
index e66f557fa07ed596b274f336945988e438adc28d..f924209d507ac89a04d4bf84570c00edb7d4f1ca 100644 (file)
@@ -1,8 +1,8 @@
 /*****************************************************************************
  * mms.h: MMS access plug-in
  *****************************************************************************
- * Copyright (C) 2001, 2002 VideoLAN
- * $Id: mmstu.h,v 1.1 2003/04/20 19:29:43 fenrir Exp $
+ * Copyright (C) 2001, 2002 the VideoLAN team
+ * $Id$
  *
  * Authors: Laurent Aimar <fenrir@via.ecp.fr>
  *
  *
  * You should have received a copy of the GNU General Public License
  * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111, USA.
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
  *****************************************************************************/
 
-#if 0
-/* url: [/]host[:port][/path] */
-typedef struct url_s
-{
-    char    *psz_server_addr;
-    int     i_server_port;
-
-    char    *psz_bind_addr;
-    int     i_bind_port;
-
-    char    *psz_path;
-
-    /* private */
-    char *psz_private;
-} url_t;
-#endif
+#ifndef _MMSTU_H_
+#define _MMSTU_H_ 1
 
 #define MMS_PACKET_ANY          0
 #define MMS_PACKET_CMD          1
@@ -44,45 +30,30 @@ typedef struct url_s
 #define MMS_PACKET_MEDIA        3
 #define MMS_PACKET_UDP_TIMING   4
 
-
 #define MMS_CMD_HEADERSIZE  48
 
-#if 0
-#define MMS_STREAM_VIDEO    0x0001
-#define MMS_STREAM_AUDIO    0x0002
-#define MMS_STREAM_UNKNOWN  0xffff
-typedef struct mms_stream_s
-{
-    int i_id;       /* 1 -> 127 */
-    int i_cat;      /* MMS_STREAM_VIDEO, MMS_STREAM_AUDIO */
-    int i_bitrate;  /* -1 if unknown */
-    int i_selected;
-
-} mms_stream_t;
-#endif
-
 #define MMS_BUFFER_SIZE 100000
+
 struct access_sys_t
 {
-    int                 i_proto;        /* MMS_PROTO_TCP, MMS_PROTO_UDP */
-    input_socket_t      socket_tcp;     /* TCP socket for communication with server */
-    input_socket_t      socket_udp;     /* Optional UDP socket for data(media/header packet) */
-                                        /* send by server */
-    char                *psz_bind_addr; /* used by udp */
+    int         i_proto;        /* MMS_PROTO_TCP, MMS_PROTO_UDP */
+    int         i_handle_tcp;   /* TCP socket for communication with server */
+    int         i_handle_udp;   /* Optional UDP socket for data(media/header packet) */
+                                /* send by server */
+    char        sz_bind_addr[NI_MAXNUMERICHOST]; /* used by udp */
 
-    url_t               *p_url;         /* connect to this server */
+    vlc_url_t   url;
 
-    //asf_stream_t        stream[128];    /* in asf never more than 1->127 streams */
-    asf_header_t        asfh;
+    asf_header_t    asfh;
 
-    off_t               i_pos;          /* position of next byte to be read */
+    unsigned    i_timeout;
 
     /* */
-    uint8_t             buffer_tcp[MMS_BUFFER_SIZE];
-    int                 i_buffer_tcp;
+    uint8_t     buffer_tcp[MMS_BUFFER_SIZE];
+    int         i_buffer_tcp;
 
-    uint8_t             buffer_udp[MMS_BUFFER_SIZE];
-    int                 i_buffer_udp;
+    uint8_t     buffer_udp[MMS_BUFFER_SIZE];
+    int         i_buffer_udp;
 
     /* data necessary to send data to server */
     guid_t      guid;
@@ -94,18 +65,17 @@ struct access_sys_t
     int         i_packet_seq_num;
 
     uint8_t     *p_cmd;     /* latest command read */
-    int         i_cmd;      /* allocated at the begining */
+    size_t      i_cmd;      /* allocated at the begining */
 
     uint8_t     *p_header;  /* allocated by mms_ReadPacket */
-    int         i_header;
+    size_t      i_header;
 
     uint8_t     *p_media;   /* allocated by mms_ReadPacket */
     size_t      i_media;
     size_t      i_media_used;
 
-    /* extracted informations */
+    /* extracted information */
     int         i_command;
-    int         i_eos;
 
     /* from 0x01 answer (not yet set) */
     char        *psz_server_version;
@@ -119,7 +89,14 @@ struct access_sys_t
     size_t      i_packet_length;
     uint32_t    i_packet_count;
     int         i_max_bit_rate;
-    int         i_header_size;
+    size_t      i_header_size;
+
+    /* misc */
+    bool  b_seekable;
 
+    vlc_mutex_t  lock_netwrite;
+    bool         b_keep_alive;
+    vlc_thread_t keep_alive;
 };
 
+#endif