]> git.sesse.net Git - vlc/blob - modules/access/mms/mmstu.h
f41ae1bbfb01ae286531631f00f3f820dd3122c2
[vlc] / modules / access / mms / mmstu.h
1 /*****************************************************************************
2  * mms.h: MMS access plug-in
3  *****************************************************************************
4  * Copyright (C) 2001, 2002 VideoLAN
5  * $Id$
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 #define MMS_PACKET_ANY          0
25 #define MMS_PACKET_CMD          1
26 #define MMS_PACKET_HEADER       2
27 #define MMS_PACKET_MEDIA        3
28 #define MMS_PACKET_UDP_TIMING   4
29
30
31 #define MMS_CMD_HEADERSIZE  48
32
33 #define MMS_BUFFER_SIZE 100000
34 struct access_sys_t
35 {
36     int                 i_proto;        /* MMS_PROTO_TCP, MMS_PROTO_UDP */
37     int                 i_handle_tcp;   /* TCP socket for communication with server */
38     int                 i_handle_udp;   /* Optional UDP socket for data(media/header packet) */
39                                         /* send by server */
40     char                *psz_bind_addr; /* used by udp */
41
42     vlc_url_t           url;
43
44     asf_header_t        asfh;
45
46     /* */
47     uint8_t             buffer_tcp[MMS_BUFFER_SIZE];
48     int                 i_buffer_tcp;
49
50     uint8_t             buffer_udp[MMS_BUFFER_SIZE];
51     int                 i_buffer_udp;
52
53     /* data necessary to send data to server */
54     guid_t      guid;
55     int         i_command_level;
56     int         i_seq_num;
57     uint32_t    i_header_packet_id_type;
58     uint32_t    i_media_packet_id_type;
59
60     int         i_packet_seq_num;
61
62     uint8_t     *p_cmd;     /* latest command read */
63     int         i_cmd;      /* allocated at the begining */
64
65     uint8_t     *p_header;  /* allocated by mms_ReadPacket */
66     int         i_header;
67
68     uint8_t     *p_media;   /* allocated by mms_ReadPacket */
69     size_t      i_media;
70     size_t      i_media_used;
71
72     /* extracted information */
73     int         i_command;
74
75     /* from 0x01 answer (not yet set) */
76     char        *psz_server_version;
77     char        *psz_tool_version;
78     char        *psz_update_player_url;
79     char        *psz_encryption_type;
80
81     /* from 0x06 answer */
82     uint32_t    i_flags_broadcast;
83     uint32_t    i_media_length;
84     size_t      i_packet_length;
85     uint32_t    i_packet_count;
86     int         i_max_bit_rate;
87     int         i_header_size;
88
89     /* */
90     vlc_bool_t  b_seekable;
91 };
92