* mms: reduce mtu (avoid too much delay with slow connection)
[vlc.git] / modules / access / mms / asf.h
1 /*****************************************************************************
2  * asf.h: MMS access plug-in
3  *****************************************************************************
4  * Copyright (C) 2001, 2002 VideoLAN
5  * $Id: asf.h,v 1.5 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 /****************************************************************************
25  * XXX:
26  *  Definitions and data duplicated from asf demuxers but I want access
27  * and demux plugins to be independant
28  *
29  ****************************************************************************/
30
31 #define ASF_STREAM_VIDEO    0x0001
32 #define ASF_STREAM_AUDIO    0x0002
33 #define ASF_STREAM_UNKNOWN  0xffff
34
35 typedef struct asf_stream_s
36 {
37     int i_id;       /* 1 -> 127 */
38     int i_cat;      /* ASF_STREAM_VIDEO, ASF_STREAM_AUDIO */
39     int i_bitrate;  /* -1 if unknown */
40     int i_selected;
41
42 } asf_stream_t;
43
44 typedef struct
45 {
46     int64_t      i_file_size;
47     int64_t      i_data_packets_count;
48     int32_t      i_min_data_packet_size;
49
50     asf_stream_t stream[128];
51
52 } asf_header_t;
53
54
55 typedef struct guid_s
56 {
57     uint32_t v1; /* le */
58     uint16_t v2; /* le */
59     uint16_t v3; /* le */
60     uint8_t  v4[8];
61 } guid_t;
62
63
64 void E_( GenerateGuid )     ( guid_t * );
65 void E_( asf_HeaderParse )  ( asf_header_t *, uint8_t *, int );
66 void E_( asf_StreamSelect ) ( asf_header_t *,
67                               int i_bitrate_max, vlc_bool_t b_all, vlc_bool_t b_audio,
68                               vlc_bool_t b_video );
69
70
71 #define GUID_FMT "%8.8x-%4.4x-%4.4x-%2.2x%2.2x%2.2x%2.2x%2.2x%2.2x%2.2x%2.2x"
72 #define GUID_PRINT( guid )  \
73     (guid).v1,              \
74     (guid).v2,              \
75     (guid).v3,              \
76     (guid).v4[0],(guid).v4[1],(guid).v4[2],(guid).v4[3],    \
77     (guid).v4[4],(guid).v4[5],(guid).v4[6],(guid).v4[7]
78
79 static const guid_t asf_object_header_guid =
80 {
81     0x75B22630,
82     0x668E,
83     0x11CF,
84     { 0xA6,0xD9, 0x00,0xAA,0x00,0x62,0xCE,0x6C }
85 };
86
87 static const guid_t asf_object_file_properties_guid =
88 {
89     0x8cabdca1,
90     0xa947,
91     0x11cf,
92     { 0x8e,0xe4, 0x00,0xC0,0x0C,0x20,0x53,0x65 }
93 };
94
95 static const guid_t asf_object_stream_properties_guid =
96 {
97     0xB7DC0791,
98     0xA9B7,
99     0x11CF,
100     { 0x8E,0xE6, 0x00,0xC0,0x0C,0x20,0x53,0x65 }
101 };
102
103 static const guid_t asf_object_stream_type_audio =
104 {
105     0xF8699E40,
106     0x5B4D,
107     0x11CF,
108     { 0xA8,0xFD, 0x00,0x80,0x5F,0x5C,0x44,0x2B }
109 };
110
111 static const guid_t asf_object_stream_type_video =
112 {
113     0xbc19efc0,
114     0x5B4D,
115     0x11CF,
116     { 0xA8,0xFD, 0x00,0x80,0x5F,0x5C,0x44,0x2B }
117 };
118
119 static const guid_t asf_object_bitrate_properties_guid =
120 {
121     0x7BF875CE,
122     0x468D,
123     0x11D1,
124     { 0x8D,0x82,0x00,0x60,0x97,0xC9,0xA2,0xB2 }
125 };
126
127 static const guid_t asf_object_bitrate_mutual_exclusion_guid =
128 {
129     0xD6E229DC,
130     0x35DA,
131     0x11D1,
132     { 0x90,0x34,0x00,0xA0,0xC9,0x03,0x49,0xBE }
133 };
134
135