comparison asf_streaming.c @ 833:b8cecdc0c67f

Starting implementation of ASF network streaming.
author bertrand
date Fri, 18 May 2001 16:14:06 +0000
parents
children ab94c4cf96d8
comparison
equal deleted inserted replaced
832:369697a87773 833:b8cecdc0c67f
1 #include "asf.h"
2
3 #include <string.h>
4
5 static ASF_StreamType_e stream_type;
6
7 void asf_streaming(char *data, int length) {
8 ASF_stream_chunck_t *stream_chunck=(ASF_stream_chunck_t*)data;
9 printf("ASF stream chunck size=%d\n", stream_chunck->length);
10
11 switch(stream_chunck->type) {
12 case 0x4324: // Clear ASF configuration
13 printf(" --> Clearing ASF stream configuration!\n");
14 break;
15 case 0x4424: // Data follows
16 printf(" --> Data follows\n");
17 break;
18 case 0x4524: // Transfer complete
19 printf(" --> Transfer complete\n");
20 break;
21 case 0x4824: // ASF header chunk follows
22 printf(" --> ASF header chunk follows\n");
23 break;
24 default:
25 printf("======> Unknown stream type %d\n", stream_chunck->type );
26 }
27 }
28
29 void asf_steam_type(char *content_type, char *features) {
30 stream_type = ASF_Unknown_e;
31 if( !strcasecmp(content_type, "application/octet-stream") ) {
32 if( strstr(features, "broadcast")) {
33 printf("-----> Live stream <-------\n");
34 stream_type = ASF_Live_e;
35 } else {
36 printf("-----> Prerecorded <-------\n");
37 stream_type = ASF_Prerecorded_e;
38 }
39 } else {
40 if( (!strcasecmp(content_type, "audio/x-ms-wax")) ||
41 (!strcasecmp(content_type, "audio/x-ms-wma")) ||
42 (!strcasecmp(content_type, "video/x-ms-asf")) ||
43 (!strcasecmp(content_type, "video/x-ms-afs")) ||
44 (!strcasecmp(content_type, "video/x-ms-wvx")) ||
45 (!strcasecmp(content_type, "video/x-ms-wmv")) ||
46 (!strcasecmp(content_type, "video/x-ms-wma")) ) {
47 printf("-----> Redirector <-------\n");
48 stream_type = ASF_Redirector_e;
49 } else {
50 printf("-----> unknown content-type: %s\n", content_type );
51 stream_type = ASF_Unknown_e;
52 }
53 }
54 }