* modules/demux/asf/.cvsignore : put the good one.
[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.1 2002/11/12 00:54:40 fenrir Exp $
6  *
7  * Authors: Christophe Massiot <massiot@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 typedef struct guid_s
32 {   
33     u32 v1; /* le */
34     u16 v2; /* le */
35     u16 v3; /* le */
36     u8  v4[8];
37 } guid_t;
38
39 static inline int CmpGuid( const guid_t *p_guid1, const guid_t *p_guid2 )
40 {
41     return( ( p_guid1->v1 == p_guid2->v1 &&
42               p_guid1->v2 == p_guid2->v2 &&
43               p_guid1->v3 == p_guid2->v3 &&
44               p_guid1->v4[0] == p_guid2->v4[0] &&
45               p_guid1->v4[1] == p_guid2->v4[1] &&
46               p_guid1->v4[2] == p_guid2->v4[2] &&
47               p_guid1->v4[3] == p_guid2->v4[3] &&
48               p_guid1->v4[4] == p_guid2->v4[4] &&
49               p_guid1->v4[5] == p_guid2->v4[5] &&
50               p_guid1->v4[6] == p_guid2->v4[6] &&
51               p_guid1->v4[7] == p_guid2->v4[7] ) ? 1 : 0 );
52 }
53
54 static inline void GenerateGuid( guid_t *p_guid )
55 {
56     int i;
57
58     srand( mdate() & 0xffffffff );
59     
60     /* FIXME should be generated using random data */
61     p_guid->v1 = 0xbabac001;
62     p_guid->v2 = ( (u64)rand() << 16 ) / RAND_MAX;
63     p_guid->v3 = ( (u64)rand() << 16 ) / RAND_MAX;
64     for( i = 0; i < 8; i++ )
65     {
66         p_guid->v4[i] = ( (u64)rand() * 256 ) / RAND_MAX;
67     }
68 }
69
70 #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"
71 #define GUID_PRINT( guid )  \
72     (guid).v1,              \
73     (guid).v2,              \
74     (guid).v3,              \
75     (guid).v4[0],(guid).v4[1],(guid).v4[2],(guid).v4[3],    \
76     (guid).v4[4],(guid).v4[5],(guid).v4[6],(guid).v4[7]
77
78 static const guid_t asf_object_header_guid =
79 {
80     0x75B22630,
81     0x668E,
82     0x11CF,
83     { 0xA6,0xD9, 0x00,0xAA,0x00,0x62,0xCE,0x6C }
84 };
85
86 static const guid_t asf_object_stream_properties_guid =
87 {
88     0xB7DC0791,
89     0xA9B7,
90     0x11CF,
91     { 0x8E,0xE6, 0x00,0xC0,0x0C,0x20,0x53,0x65 }
92 };
93
94 static const guid_t asf_object_stream_type_audio =
95 {
96     0xF8699E40,
97     0x5B4D,
98     0x11CF,
99     { 0xA8,0xFD, 0x00,0x80,0x5F,0x5C,0x44,0x2B }
100 };
101
102 static const guid_t asf_object_stream_type_video =
103 {
104     0xbc19efc0,
105     0x5B4D,
106     0x11CF,
107     { 0xA8,0xFD, 0x00,0x80,0x5F,0x5C,0x44,0x2B }
108 };
109
110 static const guid_t asf_object_bitrate_properties_guid =
111 {
112     0x7BF875CE,
113     0x468D,
114     0x11D1,
115     { 0x8D,0x82,0x00,0x60,0x97,0xC9,0xA2,0xB2 }
116 };
117
118 static const guid_t asf_object_bitrate_mutual_exclusion_guid =
119 {
120     0xD6E229DC,
121     0x35DA,
122     0x11D1,
123     { 0x90,0x34,0x00,0xA0,0xC9,0x03,0x49,0xBE }
124 };
125
126