comparison asf.h @ 1342:baf646413408

ASF support for non-x86 cpus
author jkeil
date Thu, 19 Jul 2001 15:15:21 +0000
parents 40b11384693b
children b895f95e7657
comparison
equal deleted inserted replaced
1341:5628c341f4ff 1342:baf646413408
1 #ifndef __ASF_H 1 #ifndef __ASF_H
2 #define __ASF_H 2 #define __ASF_H
3 3
4 #include "config.h" /* for WORDS_BIGENDIAN */
4 #include <inttypes.h> 5 #include <inttypes.h>
5 6 #include "bswap.h"
7 #ifdef STREAMING
6 #include "network.h" 8 #include "network.h"
9 #endif
7 10
8 #ifndef MIN 11 #ifndef MIN
9 #define MIN(a,b) ((a<b)?a:b) 12 #define MIN(a,b) ((a<b)?a:b)
10 #endif 13 #endif
11 14
112 ASF_Prerecorded_e, 115 ASF_Prerecorded_e,
113 ASF_Redirector_e 116 ASF_Redirector_e
114 } ASF_StreamType_e; 117 } ASF_StreamType_e;
115 118
116 119
120 /*
121 * Some macros to swap little endian structures read from an ASF file
122 * into machine endian format
123 */
124 #ifdef WORDS_BIGENDIAN
125 #define le2me_ASF_obj_header_t(h) { \
126 (h)->size = le2me_64((h)->size); \
127 }
128 #define le2me_ASF_header_t(h) { \
129 le2me_ASF_obj_header_t(&(h)->objh); \
130 (h)->cno = le2me_32((h)->cno); \
131 }
132 #define le2me_ASF_stream_header_t(h) { \
133 (h)->unk1 = le2me_64((h)->unk1); \
134 (h)->type_size = le2me_32((h)->type_size); \
135 (h)->stream_size = le2me_32((h)->stream_size); \
136 (h)->stream_no = le2me_16((h)->stream_no); \
137 (h)->unk2 = le2me_32((h)->unk2); \
138 }
139 #define le2me_ASF_file_header_t(h) { \
140 (h)->file_size = le2me_64((h)->file_size); \
141 (h)->creat_time = le2me_64((h)->creat_time); \
142 (h)->packets = le2me_64((h)->packets); \
143 (h)->end_timestamp = le2me_64((h)->end_timestamp); \
144 (h)->duration = le2me_64((h)->duration); \
145 (h)->start_timestamp = le2me_32((h)->start_timestamp); \
146 (h)->unk1 = le2me_32((h)->unk1); \
147 (h)->flags = le2me_32((h)->flags); \
148 (h)->packetsize = le2me_32((h)->packetsize); \
149 (h)->packetsize2 = le2me_32((h)->packetsize2); \
150 (h)->frame_size = le2me_32((h)->frame_size); \
151 }
152 #define le2me_ASF_content_description_t(h) { \
153 (h)->title_size = le2me_16((h)->title_size); \
154 (h)->author_size = le2me_16((h)->author_size); \
155 (h)->copyright_size = le2me_16((h)->copyright_size); \
156 (h)->comment_size = le2me_16((h)->comment_size); \
157 (h)->rating_size = le2me_16((h)->rating_size); \
158 }
159 #else
160 #define le2me_ASF_obj_header_t(h) /**/
161 #define le2me_ASF_header_t(h) /**/
162 #define le2me_ASF_stream_header_t(h) /**/
163 #define le2me_ASF_file_header_t(h) /**/
164 #define le2me_ASF_content_description_t(h) /**/
165 #endif
166
167
168 #ifdef STREAMING
117 int asf_http_streaming_type(char *content_type, char *features); 169 int asf_http_streaming_type(char *content_type, char *features);
118 int asf_http_streaming_start( streaming_ctrl_t *streaming_ctrl ); 170 int asf_http_streaming_start( streaming_ctrl_t *streaming_ctrl );
119 int asf_http_streaming_read( streaming_ctrl_t *streaming_ctrl ); 171 int asf_http_streaming_read( streaming_ctrl_t *streaming_ctrl );
120 172
121 int asf_streaming(char *data, int length, int *drop_packet ); 173 int asf_streaming(char *data, int length, int *drop_packet );
174 #endif
122 175
123 #endif 176 #endif