]> git.sesse.net Git - vlc/blob - modules/access/mms/mmstu.h
demux: asf: do ES audio selection for mms (fix #8797, #3400, #3797)
[vlc] / modules / access / mms / mmstu.h
1 /*****************************************************************************
2  * mmstu.h: MMS access plug-in
3  *****************************************************************************
4  * Copyright (C) 2001, 2002 VLC authors and 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 it
10  * under the terms of the GNU Lesser General Public License as published by
11  * the Free Software Foundation; either version 2.1 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 Lesser General Public License for more details.
18  *
19  * You should have received a copy of the GNU Lesser General Public License
20  * along with this program; if not, write to the Free Software Foundation,
21  * Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
22  *****************************************************************************/
23
24 #ifndef _MMSTU_H_
25 #define _MMSTU_H_ 1
26
27 #define MMS_PACKET_ANY          0
28 #define MMS_PACKET_CMD          1
29 #define MMS_PACKET_HEADER       2
30 #define MMS_PACKET_MEDIA        3
31 #define MMS_PACKET_UDP_TIMING   4
32
33 #define MMS_CMD_HEADERSIZE  48
34
35 #define MMS_BUFFER_SIZE 100000
36
37 struct access_sys_t
38 {
39     int         i_proto;        /* MMS_PROTO_TCP, MMS_PROTO_UDP */
40     int         i_handle_tcp;   /* TCP socket for communication with server */
41     int         i_handle_udp;   /* Optional UDP socket for data(media/header packet) */
42                                 /* send by server */
43     char        sz_bind_addr[NI_MAXNUMERICHOST]; /* used by udp */
44
45     vlc_url_t   url;
46     uint64_t    i_size;
47
48     asf_header_t    asfh;
49
50     unsigned    i_timeout;
51
52     /* */
53     uint8_t     buffer_tcp[MMS_BUFFER_SIZE];
54     int         i_buffer_tcp;
55
56     uint8_t     buffer_udp[MMS_BUFFER_SIZE];
57     int         i_buffer_udp;
58
59     /* data necessary to send data to server */
60     guid_t      guid;
61     int         i_command_level;
62     int         i_seq_num;
63     uint32_t    i_header_packet_id_type;
64     uint32_t    i_media_packet_id_type;
65
66     int         i_packet_seq_num;
67
68     uint8_t     *p_cmd;     /* latest command read */
69     size_t      i_cmd;      /* allocated at the begining */
70
71     uint8_t     *p_header;  /* allocated by mms_ReadPacket */
72     size_t      i_header;
73
74     uint8_t     *p_media;   /* allocated by mms_ReadPacket */
75     size_t      i_media;
76     size_t      i_media_used;
77
78     /* extracted information */
79     int         i_command;
80
81     /* from 0x01 answer (not yet set) */
82     char        *psz_server_version;
83     char        *psz_tool_version;
84     char        *psz_update_player_url;
85     char        *psz_encryption_type;
86
87     /* from 0x06 answer */
88     uint32_t    i_flags_broadcast;
89     uint32_t    i_media_length;
90     size_t      i_packet_length;
91     uint32_t    i_packet_count;
92     int         i_max_bit_rate;
93     size_t      i_header_size;
94
95     /* misc */
96     bool  b_seekable;
97
98     vlc_mutex_t  lock_netwrite;
99     bool         b_keep_alive;
100     vlc_thread_t keep_alive;
101 };
102
103 #endif