]> git.sesse.net Git - vlc/blob - modules/access/mms/mmstu.h
PDA Interface:
[vlc] / modules / access / mms / mmstu.h
1 /*****************************************************************************
2  * mms.h: MMS access plug-in
3  *****************************************************************************
4  * Copyright (C) 2001, 2002 VideoLAN
5  * $Id: mmstu.h,v 1.1 2003/04/20 19:29:43 fenrir Exp $
6  *
7  * Authors: Laurent Aimar <fenrir@via.ecp.fr>
8  *
9  * This program is free software; you can redistribute it and/or modify
10  * it under the terms of the GNU General Public License as published by
11  * the Free Software Foundation; either version 2 of the License, or
12  * (at your option) any later version.
13  *
14  * This program is distributed in the hope that it will be useful,
15  * but WITHOUT ANY WARRANTY; without even the implied warranty of
16  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
17  * GNU General Public License for more details.
18  *
19  * You should have received a copy of the GNU General Public License
20  * along with this program; if not, write to the Free Software
21  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111, USA.
22  *****************************************************************************/
23
24 #if 0
25 /* url: [/]host[:port][/path] */
26 typedef struct url_s
27 {
28     char    *psz_server_addr;
29     int     i_server_port;
30
31     char    *psz_bind_addr;
32     int     i_bind_port;
33
34     char    *psz_path;
35
36     /* private */
37     char *psz_private;
38 } url_t;
39 #endif
40
41 #define MMS_PACKET_ANY          0
42 #define MMS_PACKET_CMD          1
43 #define MMS_PACKET_HEADER       2
44 #define MMS_PACKET_MEDIA        3
45 #define MMS_PACKET_UDP_TIMING   4
46
47
48 #define MMS_CMD_HEADERSIZE  48
49
50 #if 0
51 #define MMS_STREAM_VIDEO    0x0001
52 #define MMS_STREAM_AUDIO    0x0002
53 #define MMS_STREAM_UNKNOWN  0xffff
54 typedef struct mms_stream_s
55 {
56     int i_id;       /* 1 -> 127 */
57     int i_cat;      /* MMS_STREAM_VIDEO, MMS_STREAM_AUDIO */
58     int i_bitrate;  /* -1 if unknown */
59     int i_selected;
60
61 } mms_stream_t;
62 #endif
63
64 #define MMS_BUFFER_SIZE 100000
65 struct access_sys_t
66 {
67     int                 i_proto;        /* MMS_PROTO_TCP, MMS_PROTO_UDP */
68     input_socket_t      socket_tcp;     /* TCP socket for communication with server */
69     input_socket_t      socket_udp;     /* Optional UDP socket for data(media/header packet) */
70                                         /* send by server */
71     char                *psz_bind_addr; /* used by udp */
72
73     url_t               *p_url;         /* connect to this server */
74
75     //asf_stream_t        stream[128];    /* in asf never more than 1->127 streams */
76     asf_header_t        asfh;
77
78     off_t               i_pos;          /* position of next byte to be read */
79
80     /* */
81     uint8_t             buffer_tcp[MMS_BUFFER_SIZE];
82     int                 i_buffer_tcp;
83
84     uint8_t             buffer_udp[MMS_BUFFER_SIZE];
85     int                 i_buffer_udp;
86
87     /* data necessary to send data to server */
88     guid_t      guid;
89     int         i_command_level;
90     int         i_seq_num;
91     uint32_t    i_header_packet_id_type;
92     uint32_t    i_media_packet_id_type;
93
94     int         i_packet_seq_num;
95
96     uint8_t     *p_cmd;     /* latest command read */
97     int         i_cmd;      /* allocated at the begining */
98
99     uint8_t     *p_header;  /* allocated by mms_ReadPacket */
100     int         i_header;
101
102     uint8_t     *p_media;   /* allocated by mms_ReadPacket */
103     size_t      i_media;
104     size_t      i_media_used;
105
106     /* extracted informations */
107     int         i_command;
108     int         i_eos;
109
110     /* from 0x01 answer (not yet set) */
111     char        *psz_server_version;
112     char        *psz_tool_version;
113     char        *psz_update_player_url;
114     char        *psz_encryption_type;
115
116     /* from 0x06 answer */
117     uint32_t    i_flags_broadcast;
118     uint32_t    i_media_length;
119     size_t      i_packet_length;
120     uint32_t    i_packet_count;
121     int         i_max_bit_rate;
122     int         i_header_size;
123
124 };
125