annotate codecs.c @ 11:77b0a5c5e9e1

DGA support
author arpi_esp
date Tue, 27 Feb 2001 00:23:54 +0000
parents 3b5f5d1c5041
children 2df337e28820
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
1
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1 //#define ANGELPOTION
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
2
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
3 char* get_vids_codec_name(){
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
4 // unsigned long fccHandler=avi_header.video.fccHandler;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
5 unsigned long fccHandler=avi_header.bih.biCompression;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
6 avi_header.yuv_supported=0;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
7 avi_header.yuv_hack_needed=0;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
8 avi_header.flipped=0;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
9 switch(fccHandler){
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
10 case mmioFOURCC('M', 'P', 'G', '4'):
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
11 case mmioFOURCC('m', 'p', 'g', '4'):
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
12 case mmioFOURCC('M', 'P', '4', '2'):
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
13 case mmioFOURCC('m', 'p', '4', '2'):
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
14 // case mmioFOURCC('M', 'P', '4', '3'):
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
15 // case mmioFOURCC('m', 'p', '4', '3'):
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
16 printf("Video in Microsoft MPEG-4 format\n");
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
17 avi_header.yuv_supported=1;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
18 avi_header.yuv_hack_needed=1;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
19 #ifdef ANGELPOTION
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
20 return "APmpg4v1.dll";
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
21 #endif
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
22 return "mpg4c32.dll";
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
23 case mmioFOURCC('M', 'P', '4', '3'):
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
24 case mmioFOURCC('m', 'p', '4', '3'):
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
25 printf("Video in MPEG-4 v3 (really DivX) format\n");
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
26 avi_header.bih.biCompression=mmioFOURCC('d', 'i', 'v', '3'); // hack
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
27 avi_header.yuv_supported=1;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
28 avi_header.yuv_hack_needed=1;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
29 #ifdef ANGELPOTION
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
30 return "APmpg4v1.dll";
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
31 #endif
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
32 return "divxc32.dll";
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
33
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
34 case mmioFOURCC('D', 'I', 'V', 'X'):
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
35 case mmioFOURCC('d', 'i', 'v', 'x'):
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
36 return "DivX.dll";
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
37
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
38 case mmioFOURCC('D', 'I', 'V', '3'):
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
39 case mmioFOURCC('d', 'i', 'v', '3'):
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
40 case mmioFOURCC('D', 'I', 'V', '4'):
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
41 case mmioFOURCC('d', 'i', 'v', '4'):
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
42 case mmioFOURCC('M', 'P', '4', '1'):
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
43 case mmioFOURCC('m', 'p', '4', '1'):
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
44 printf("Video in DivX ;-) format\n");
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
45 avi_header.yuv_supported=1;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
46 avi_header.yuv_hack_needed=1;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
47 #ifdef ANGELPOTION
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
48 return "APmpg4v1.dll";
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
49 #endif
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
50 return "divxc32.dll";
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
51
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
52 case mmioFOURCC('I', 'V', '5', '0'):
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
53 case mmioFOURCC('i', 'v', '5', '0'):
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
54 printf("Video in Indeo Video 5 format\n");
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
55 avi_header.yuv_supported=1; // YUV pic is upside-down :(
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
56 return "ir50_32.dll";
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
57
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
58 case mmioFOURCC('I', 'V', '4', '1'):
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
59 case mmioFOURCC('i', 'v', '4', '1'):
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
60 printf("Video in Indeo Video 4.1 format\n");
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
61 avi_header.flipped=1;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
62 avi_header.no_32bpp_support=1;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
63 return "ir41_32.dll";
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
64
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
65 case mmioFOURCC('I', 'V', '3', '2'):
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
66 case mmioFOURCC('i', 'v', '3', '2'):
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
67 printf("Video in Indeo Video 3.2 format\n");
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
68 avi_header.flipped=1;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
69 avi_header.no_32bpp_support=1;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
70 return "ir32_32.dll";
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
71
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
72 case mmioFOURCC('c', 'v', 'i', 'd'):
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
73 printf("Video in Cinepak format\n");
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
74 avi_header.yuv_supported=1;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
75 return "iccvid.dll";
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
76
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
77 //*** Only 16bit .DLL available (can't load under linux) ***
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
78 // case mmioFOURCC('V', 'C', 'R', '1'):
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
79 // printf("Video in ATI VCR1 format\n");
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
80 // return "ativcr1.dll";
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
81
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
82 case mmioFOURCC('V', 'C', 'R', '2'):
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
83 printf("Video in ATI VCR2 format\n");
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
84 avi_header.yuv_supported=1;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
85 return "ativcr2.dll";
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
86
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
87 case mmioFOURCC('A', 'S', 'V', '1'):
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
88 printf("Asus ASV-1 format\n");
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
89 // avi_header.yuv_supported=1;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
90 return "asusasvd.dll";
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
91
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
92 case mmioFOURCC('A', 'S', 'V', '2'):
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
93 printf("Asus ASV-2 format\n");
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
94 // avi_header.yuv_supported=1;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
95 avi_header.flipped=1;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
96 // avi_header.bih.biCompression=mmioFOURCC('A', 'S', 'V', '1');
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
97 // return "asusasvd.dll";
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
98 return "asusasv2.dll";
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
99
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
100 case mmioFOURCC('I', '2', '6', '3'):
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
101 case mmioFOURCC('i', '2', '6', '3'):
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
102 printf("Video in I263 format\n");
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
103 return "i263_32.drv";
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
104
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
105 case mmioFOURCC('M', 'J', 'P', 'G'):
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
106 printf("Video in MJPEG format\n");
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
107 avi_header.yuv_supported=1;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
108 return "M3JPEG32.dll";
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
109 // return "mcmjpg32.dll";
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
110 // return "m3jpeg32.dll";
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
111 // return "libavi_mjpeg.so";
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
112 }
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
113 printf("UNKNOWN video codec: %.4s (0x%0X)\n",&fccHandler,fccHandler);
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
114 printf("If you know this video format and codec, you can edit codecs.c in the source!\n");
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
115 printf("Please contact the author, send this movie to be supported by future version.\n");
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
116 return NULL;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
117 }
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
118
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
119 char* get_auds_codec_name(){
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
120 int id=((WAVEFORMATEX*)avi_header.wf_ext)->wFormatTag;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
121 switch (id){
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
122 case 0x161://DivX audio
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
123 // ((WAVEFORMATEX*)avi_header.wf_ext)->wFormatTag=0x160; //hack
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
124 case 0x160://DivX audio
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
125 avi_header.audio_seekable=0;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
126 return "divxa32.acm"; // tested, OK.
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
127 case 0x2://MS ADPCM
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
128 avi_header.audio_seekable=0;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
129 return "msadp32.acm"; // tested, OK.
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
130 case 0x55://MPEG l3
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
131 avi_header.audio_seekable=1;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
132 return "l3codeca.acm"; // tested, OK. faster than mp3lib on intel
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
133 case 0x11://IMA ADPCM
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
134 return "imaadp32.acm"; // segfault :(
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
135 case 0x31://MS GSM
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
136 case 0x32://MS GSM
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
137 return "msgsm32.acm"; // segfault :( - not req. has internal now!
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
138 case 0x75://VoxWare
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
139 return "voxmsdec.ax"; // directshow, not yet supported just a try
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
140 // case 0x06://???
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
141 // return "lhacm.acm";
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
142 // return "msg711.acm";
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
143 // return "tssoft32.acm";
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
144 }
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
145 printf("UNKNOWN audio codec: 0x%0X\n",id);
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
146 printf("If you know this audio format and codec, you can edit codecs.c in the source!\n");
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
147 printf("Please contact the author, send this movie to be supported by future version.\n");
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
148 return NULL;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
149 }
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
150