annotate asf.h @ 888:c7561094bc2c

*** empty log message ***
author gabucino
date Sat, 26 May 2001 23:03:28 +0000
parents ab94c4cf96d8
children 11879db9d4cc
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
833
b8cecdc0c67f Starting implementation of ASF network streaming.
bertrand
parents:
diff changeset
1 #ifndef ASF_H
b8cecdc0c67f Starting implementation of ASF network streaming.
bertrand
parents:
diff changeset
2 #define ASF_H
b8cecdc0c67f Starting implementation of ASF network streaming.
bertrand
parents:
diff changeset
3
b8cecdc0c67f Starting implementation of ASF network streaming.
bertrand
parents:
diff changeset
4 #include <inttypes.h>
b8cecdc0c67f Starting implementation of ASF network streaming.
bertrand
parents:
diff changeset
5
871
ab94c4cf96d8 Continue implementation of ASF streaming.
bertrand
parents: 833
diff changeset
6 #ifndef MIN
ab94c4cf96d8 Continue implementation of ASF streaming.
bertrand
parents: 833
diff changeset
7 #define MIN(a,b) ((a<b)?a:b)
ab94c4cf96d8 Continue implementation of ASF streaming.
bertrand
parents: 833
diff changeset
8 #endif
ab94c4cf96d8 Continue implementation of ASF streaming.
bertrand
parents: 833
diff changeset
9
833
b8cecdc0c67f Starting implementation of ASF network streaming.
bertrand
parents:
diff changeset
10 ///////////////////////
b8cecdc0c67f Starting implementation of ASF network streaming.
bertrand
parents:
diff changeset
11 // MS GUID definition
b8cecdc0c67f Starting implementation of ASF network streaming.
bertrand
parents:
diff changeset
12 ///////////////////////
b8cecdc0c67f Starting implementation of ASF network streaming.
bertrand
parents:
diff changeset
13 #ifndef GUID_DEFINED
b8cecdc0c67f Starting implementation of ASF network streaming.
bertrand
parents:
diff changeset
14 #define GUID_DEFINED
b8cecdc0c67f Starting implementation of ASF network streaming.
bertrand
parents:
diff changeset
15 // Size of GUID is 16 bytes!
b8cecdc0c67f Starting implementation of ASF network streaming.
bertrand
parents:
diff changeset
16 typedef struct __attribute__((packed)) {
b8cecdc0c67f Starting implementation of ASF network streaming.
bertrand
parents:
diff changeset
17 uint32_t Data1; // 4 bytes
b8cecdc0c67f Starting implementation of ASF network streaming.
bertrand
parents:
diff changeset
18 uint16_t Data2; // 2 bytes
b8cecdc0c67f Starting implementation of ASF network streaming.
bertrand
parents:
diff changeset
19 uint16_t Data3; // 2 bytes
b8cecdc0c67f Starting implementation of ASF network streaming.
bertrand
parents:
diff changeset
20 uint8_t Data4[8]; // 8 bytes
b8cecdc0c67f Starting implementation of ASF network streaming.
bertrand
parents:
diff changeset
21 } GUID_t;
b8cecdc0c67f Starting implementation of ASF network streaming.
bertrand
parents:
diff changeset
22 #endif
b8cecdc0c67f Starting implementation of ASF network streaming.
bertrand
parents:
diff changeset
23
b8cecdc0c67f Starting implementation of ASF network streaming.
bertrand
parents:
diff changeset
24 ///////////////////////
b8cecdc0c67f Starting implementation of ASF network streaming.
bertrand
parents:
diff changeset
25 // ASF Object Header
b8cecdc0c67f Starting implementation of ASF network streaming.
bertrand
parents:
diff changeset
26 ///////////////////////
b8cecdc0c67f Starting implementation of ASF network streaming.
bertrand
parents:
diff changeset
27 typedef struct __attribute__((packed)) {
b8cecdc0c67f Starting implementation of ASF network streaming.
bertrand
parents:
diff changeset
28 uint8_t guid[16];
b8cecdc0c67f Starting implementation of ASF network streaming.
bertrand
parents:
diff changeset
29 uint64_t size;
b8cecdc0c67f Starting implementation of ASF network streaming.
bertrand
parents:
diff changeset
30 } ASF_obj_header_t;
b8cecdc0c67f Starting implementation of ASF network streaming.
bertrand
parents:
diff changeset
31
b8cecdc0c67f Starting implementation of ASF network streaming.
bertrand
parents:
diff changeset
32 ////////////////
b8cecdc0c67f Starting implementation of ASF network streaming.
bertrand
parents:
diff changeset
33 // ASF Header
b8cecdc0c67f Starting implementation of ASF network streaming.
bertrand
parents:
diff changeset
34 ////////////////
b8cecdc0c67f Starting implementation of ASF network streaming.
bertrand
parents:
diff changeset
35 typedef struct __attribute__((packed)) {
b8cecdc0c67f Starting implementation of ASF network streaming.
bertrand
parents:
diff changeset
36 ASF_obj_header_t objh;
b8cecdc0c67f Starting implementation of ASF network streaming.
bertrand
parents:
diff changeset
37 uint32_t cno; // number of subchunks
b8cecdc0c67f Starting implementation of ASF network streaming.
bertrand
parents:
diff changeset
38 uint8_t v1; // unknown (0x01)
b8cecdc0c67f Starting implementation of ASF network streaming.
bertrand
parents:
diff changeset
39 uint8_t v2; // unknown (0x02)
b8cecdc0c67f Starting implementation of ASF network streaming.
bertrand
parents:
diff changeset
40 } ASF_header_t;
b8cecdc0c67f Starting implementation of ASF network streaming.
bertrand
parents:
diff changeset
41
b8cecdc0c67f Starting implementation of ASF network streaming.
bertrand
parents:
diff changeset
42 /////////////////////
b8cecdc0c67f Starting implementation of ASF network streaming.
bertrand
parents:
diff changeset
43 // ASF File Header
b8cecdc0c67f Starting implementation of ASF network streaming.
bertrand
parents:
diff changeset
44 /////////////////////
b8cecdc0c67f Starting implementation of ASF network streaming.
bertrand
parents:
diff changeset
45 typedef struct __attribute__((packed)) {
b8cecdc0c67f Starting implementation of ASF network streaming.
bertrand
parents:
diff changeset
46 uint8_t client[16]; // Client GUID
b8cecdc0c67f Starting implementation of ASF network streaming.
bertrand
parents:
diff changeset
47 uint64_t file_size;
b8cecdc0c67f Starting implementation of ASF network streaming.
bertrand
parents:
diff changeset
48 uint64_t creat_time; //File creation time FILETIME 8
b8cecdc0c67f Starting implementation of ASF network streaming.
bertrand
parents:
diff changeset
49 uint64_t packets; //Number of packets UINT64 8
b8cecdc0c67f Starting implementation of ASF network streaming.
bertrand
parents:
diff changeset
50 uint64_t end_timestamp; //Timestamp of the end position UINT64 8
b8cecdc0c67f Starting implementation of ASF network streaming.
bertrand
parents:
diff changeset
51 uint64_t duration; //Duration of the playback UINT64 8
b8cecdc0c67f Starting implementation of ASF network streaming.
bertrand
parents:
diff changeset
52 uint32_t start_timestamp; //Timestamp of the start position UINT32 4
b8cecdc0c67f Starting implementation of ASF network streaming.
bertrand
parents:
diff changeset
53 uint32_t unk1; //Unknown, maybe reserved ( usually contains 0 ) UINT32 4
b8cecdc0c67f Starting implementation of ASF network streaming.
bertrand
parents:
diff changeset
54 uint32_t flags; //Unknown, maybe flags ( usually contains 2 ) UINT32 4
b8cecdc0c67f Starting implementation of ASF network streaming.
bertrand
parents:
diff changeset
55 uint32_t packetsize; //Size of packet, in bytes UINT32 4
b8cecdc0c67f Starting implementation of ASF network streaming.
bertrand
parents:
diff changeset
56 uint32_t packetsize2; //Size of packet ( confirm ) UINT32 4
b8cecdc0c67f Starting implementation of ASF network streaming.
bertrand
parents:
diff changeset
57 uint32_t frame_size; //Size of uncompressed video frame UINT32 4
b8cecdc0c67f Starting implementation of ASF network streaming.
bertrand
parents:
diff changeset
58 } ASF_file_header_t;
b8cecdc0c67f Starting implementation of ASF network streaming.
bertrand
parents:
diff changeset
59
b8cecdc0c67f Starting implementation of ASF network streaming.
bertrand
parents:
diff changeset
60 ///////////////////////
b8cecdc0c67f Starting implementation of ASF network streaming.
bertrand
parents:
diff changeset
61 // ASF Stream Header
b8cecdc0c67f Starting implementation of ASF network streaming.
bertrand
parents:
diff changeset
62 ///////////////////////
b8cecdc0c67f Starting implementation of ASF network streaming.
bertrand
parents:
diff changeset
63 typedef struct __attribute__((packed)) {
b8cecdc0c67f Starting implementation of ASF network streaming.
bertrand
parents:
diff changeset
64 uint8_t type[16]; // Stream type (audio/video) GUID 16
b8cecdc0c67f Starting implementation of ASF network streaming.
bertrand
parents:
diff changeset
65 uint8_t concealment[16]; // Audio error concealment type GUID 16
b8cecdc0c67f Starting implementation of ASF network streaming.
bertrand
parents:
diff changeset
66 uint64_t unk1; // Unknown, maybe reserved ( usually contains 0 ) UINT64 8
b8cecdc0c67f Starting implementation of ASF network streaming.
bertrand
parents:
diff changeset
67 uint32_t type_size; //Total size of type-specific data UINT32 4
b8cecdc0c67f Starting implementation of ASF network streaming.
bertrand
parents:
diff changeset
68 uint32_t stream_size; //Size of stream-specific data UINT32 4
b8cecdc0c67f Starting implementation of ASF network streaming.
bertrand
parents:
diff changeset
69 uint16_t stream_no; //Stream number UINT16 2
b8cecdc0c67f Starting implementation of ASF network streaming.
bertrand
parents:
diff changeset
70 uint32_t unk2; //Unknown UINT32 4
b8cecdc0c67f Starting implementation of ASF network streaming.
bertrand
parents:
diff changeset
71 } ASF_stream_header_t;
b8cecdc0c67f Starting implementation of ASF network streaming.
bertrand
parents:
diff changeset
72
b8cecdc0c67f Starting implementation of ASF network streaming.
bertrand
parents:
diff changeset
73 ///////////////////////////
b8cecdc0c67f Starting implementation of ASF network streaming.
bertrand
parents:
diff changeset
74 // ASF Content Description
b8cecdc0c67f Starting implementation of ASF network streaming.
bertrand
parents:
diff changeset
75 ///////////////////////////
b8cecdc0c67f Starting implementation of ASF network streaming.
bertrand
parents:
diff changeset
76 typedef struct __attribute__((packed)) {
b8cecdc0c67f Starting implementation of ASF network streaming.
bertrand
parents:
diff changeset
77 uint16_t title_size;
b8cecdc0c67f Starting implementation of ASF network streaming.
bertrand
parents:
diff changeset
78 uint16_t author_size;
b8cecdc0c67f Starting implementation of ASF network streaming.
bertrand
parents:
diff changeset
79 uint16_t copyright_size;
b8cecdc0c67f Starting implementation of ASF network streaming.
bertrand
parents:
diff changeset
80 uint16_t comment_size;
b8cecdc0c67f Starting implementation of ASF network streaming.
bertrand
parents:
diff changeset
81 uint16_t rating_size;
b8cecdc0c67f Starting implementation of ASF network streaming.
bertrand
parents:
diff changeset
82 } ASF_content_description_t;
b8cecdc0c67f Starting implementation of ASF network streaming.
bertrand
parents:
diff changeset
83
b8cecdc0c67f Starting implementation of ASF network streaming.
bertrand
parents:
diff changeset
84 ////////////////////////
b8cecdc0c67f Starting implementation of ASF network streaming.
bertrand
parents:
diff changeset
85 // ASF Segment Header
b8cecdc0c67f Starting implementation of ASF network streaming.
bertrand
parents:
diff changeset
86 ////////////////////////
b8cecdc0c67f Starting implementation of ASF network streaming.
bertrand
parents:
diff changeset
87 typedef struct __attribute__((packed)) {
b8cecdc0c67f Starting implementation of ASF network streaming.
bertrand
parents:
diff changeset
88 uint8_t streamno;
b8cecdc0c67f Starting implementation of ASF network streaming.
bertrand
parents:
diff changeset
89 uint8_t seq;
b8cecdc0c67f Starting implementation of ASF network streaming.
bertrand
parents:
diff changeset
90 uint32_t x;
b8cecdc0c67f Starting implementation of ASF network streaming.
bertrand
parents:
diff changeset
91 uint8_t flag;
b8cecdc0c67f Starting implementation of ASF network streaming.
bertrand
parents:
diff changeset
92 } ASF_segmhdr_t;
b8cecdc0c67f Starting implementation of ASF network streaming.
bertrand
parents:
diff changeset
93
b8cecdc0c67f Starting implementation of ASF network streaming.
bertrand
parents:
diff changeset
94 //////////////////////
b8cecdc0c67f Starting implementation of ASF network streaming.
bertrand
parents:
diff changeset
95 // ASF Stream Chunck
b8cecdc0c67f Starting implementation of ASF network streaming.
bertrand
parents:
diff changeset
96 //////////////////////
b8cecdc0c67f Starting implementation of ASF network streaming.
bertrand
parents:
diff changeset
97 typedef struct __attribute__((packed)) {
b8cecdc0c67f Starting implementation of ASF network streaming.
bertrand
parents:
diff changeset
98 uint16_t type;
871
ab94c4cf96d8 Continue implementation of ASF streaming.
bertrand
parents: 833
diff changeset
99 uint16_t size;
833
b8cecdc0c67f Starting implementation of ASF network streaming.
bertrand
parents:
diff changeset
100 uint32_t sequence_number;
b8cecdc0c67f Starting implementation of ASF network streaming.
bertrand
parents:
diff changeset
101 uint16_t unknown;
871
ab94c4cf96d8 Continue implementation of ASF streaming.
bertrand
parents: 833
diff changeset
102 uint16_t size_confirm;
833
b8cecdc0c67f Starting implementation of ASF network streaming.
bertrand
parents:
diff changeset
103 } ASF_stream_chunck_t;
b8cecdc0c67f Starting implementation of ASF network streaming.
bertrand
parents:
diff changeset
104
b8cecdc0c67f Starting implementation of ASF network streaming.
bertrand
parents:
diff changeset
105
b8cecdc0c67f Starting implementation of ASF network streaming.
bertrand
parents:
diff changeset
106 // Definition of the differents type of ASF streaming
b8cecdc0c67f Starting implementation of ASF network streaming.
bertrand
parents:
diff changeset
107 typedef enum {
b8cecdc0c67f Starting implementation of ASF network streaming.
bertrand
parents:
diff changeset
108 ASF_Unknown_e,
b8cecdc0c67f Starting implementation of ASF network streaming.
bertrand
parents:
diff changeset
109 ASF_Live_e,
b8cecdc0c67f Starting implementation of ASF network streaming.
bertrand
parents:
diff changeset
110 ASF_Prerecorded_e,
b8cecdc0c67f Starting implementation of ASF network streaming.
bertrand
parents:
diff changeset
111 ASF_Redirector_e
b8cecdc0c67f Starting implementation of ASF network streaming.
bertrand
parents:
diff changeset
112 } ASF_StreamType_e;
b8cecdc0c67f Starting implementation of ASF network streaming.
bertrand
parents:
diff changeset
113
b8cecdc0c67f Starting implementation of ASF network streaming.
bertrand
parents:
diff changeset
114 #endif