1
|
1 //#define ANGELPOTION
|
175
|
2 //#define USE_DIRECTSHOW
|
|
3
|
190
|
4 static GUID wmv1_clsid={0x4facbba1, 0xffd8, 0x4cd7,
|
|
5 {0x82, 0x28, 0x61, 0xe2, 0xf6, 0x5c, 0xb1, 0xae}};
|
|
6 static GUID wmv2_clsid={0x521fb373, 0x7654, 0x49f2,
|
|
7 {0xbd, 0xb1, 0x0c, 0x6e, 0x66, 0x60, 0x71, 0x4f}};
|
|
8 static GUID CLSID_MorganMjpeg={0x6988b440, 0x8352, 0x11d3,
|
|
9 {0x9b, 0xda, 0xca, 0x86, 0x73, 0x7c, 0x71, 0x68}};
|
|
10 static GUID CLSID_Acelp={0x4009f700, 0xaeba, 0x11d1,
|
|
11 {0x83, 0x44, 0x00, 0xc0, 0x4f, 0xb9, 0x2e, 0xb7}};
|
|
12 static GUID CLSID_Voxware={0x73f7a062, 0x8829, 0x11d1,
|
|
13 {0xb5, 0x50, 0x00, 0x60, 0x97, 0x24, 0x2d, 0x8d}};
|
|
14 static GUID CLSID_DivxDecompressorCF={0x82CCd3E0, 0xF71A, 0x11D0,
|
175
|
15 { 0x9f, 0xe5, 0x00, 0x60, 0x97, 0x78, 0xaa, 0xaa}};
|
190
|
16 static GUID CLSID_IV50_Decoder={0x30355649, 0x0000, 0x0010,
|
|
17 {0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71}};
|
|
18 static GUID dvsd_clsid={0xB1B77C00, 0xC3E4, 0x11CF,
|
|
19 {0xAF, 0x79, 0x00, 0xAA, 0x00, 0xB6, 0x7A, 0x42}};
|
255
|
20 static GUID CLSID_TM20DecompressorCF={0x4cb63e61, 0xc611, 0x11D0,
|
|
21 { 0x83, 0xaa, 0x00, 0x00, 0x92, 0x90, 0x01, 0x84}};
|
190
|
22
|
1
|
23
|
|
24 char* get_vids_codec_name(){
|
|
25 // unsigned long fccHandler=avi_header.video.fccHandler;
|
|
26 unsigned long fccHandler=avi_header.bih.biCompression;
|
|
27 avi_header.yuv_supported=0;
|
|
28 avi_header.yuv_hack_needed=0;
|
|
29 avi_header.flipped=0;
|
175
|
30 avi_header.vids_guid=NULL;
|
|
31
|
1
|
32 switch(fccHandler){
|
|
33 case mmioFOURCC('M', 'P', 'G', '4'):
|
|
34 case mmioFOURCC('m', 'p', 'g', '4'):
|
|
35 case mmioFOURCC('M', 'P', '4', '2'):
|
|
36 case mmioFOURCC('m', 'p', '4', '2'):
|
|
37 // case mmioFOURCC('M', 'P', '4', '3'):
|
|
38 // case mmioFOURCC('m', 'p', '4', '3'):
|
|
39 printf("Video in Microsoft MPEG-4 format\n");
|
|
40 avi_header.yuv_supported=1;
|
|
41 avi_header.yuv_hack_needed=1;
|
|
42 #ifdef ANGELPOTION
|
|
43 return "APmpg4v1.dll";
|
|
44 #endif
|
|
45 return "mpg4c32.dll";
|
125
|
46
|
1
|
47 case mmioFOURCC('M', 'P', '4', '3'):
|
|
48 case mmioFOURCC('m', 'p', '4', '3'):
|
|
49 printf("Video in MPEG-4 v3 (really DivX) format\n");
|
|
50 avi_header.bih.biCompression=mmioFOURCC('d', 'i', 'v', '3'); // hack
|
|
51 avi_header.yuv_supported=1;
|
192
|
52 #ifdef USE_DIRECTSHOW
|
|
53 avi_header.vids_guid=&CLSID_DivxDecompressorCF;
|
|
54 return "divx_c32.ax";
|
|
55 #else
|
1
|
56 avi_header.yuv_hack_needed=1;
|
|
57 #ifdef ANGELPOTION
|
|
58 return "APmpg4v1.dll";
|
192
|
59 #else
|
|
60 return "divxc32.dll";
|
1
|
61 #endif
|
192
|
62 #endif
|
1
|
63
|
|
64 case mmioFOURCC('D', 'I', 'V', 'X'):
|
|
65 case mmioFOURCC('d', 'i', 'v', 'x'):
|
|
66 return "DivX.dll";
|
|
67
|
125
|
68 case mmioFOURCC('D', 'I', 'V', '5'):
|
|
69 case mmioFOURCC('d', 'i', 'v', '5'):
|
|
70 case mmioFOURCC('D', 'I', 'V', '6'):
|
|
71 case mmioFOURCC('d', 'i', 'v', '6'):
|
|
72 avi_header.bih.biCompression-=0x02000000; // div5->div3, div6->div4
|
1
|
73 case mmioFOURCC('D', 'I', 'V', '3'):
|
|
74 case mmioFOURCC('d', 'i', 'v', '3'):
|
|
75 case mmioFOURCC('D', 'I', 'V', '4'):
|
|
76 case mmioFOURCC('d', 'i', 'v', '4'):
|
|
77 case mmioFOURCC('M', 'P', '4', '1'):
|
|
78 case mmioFOURCC('m', 'p', '4', '1'):
|
|
79 printf("Video in DivX ;-) format\n");
|
|
80 avi_header.yuv_supported=1;
|
175
|
81 #ifdef USE_DIRECTSHOW
|
|
82 avi_header.vids_guid=&CLSID_DivxDecompressorCF;
|
|
83 return "divx_c32.ax";
|
|
84 #else
|
1
|
85 avi_header.yuv_hack_needed=1;
|
|
86 #ifdef ANGELPOTION
|
|
87 return "APmpg4v1.dll";
|
175
|
88 #else
|
|
89 return "divxc32.dll";
|
1
|
90 #endif
|
175
|
91 #endif
|
1
|
92
|
|
93 case mmioFOURCC('I', 'V', '5', '0'):
|
|
94 case mmioFOURCC('i', 'v', '5', '0'):
|
|
95 printf("Video in Indeo Video 5 format\n");
|
|
96 avi_header.yuv_supported=1; // YUV pic is upside-down :(
|
|
97 return "ir50_32.dll";
|
|
98
|
|
99 case mmioFOURCC('I', 'V', '4', '1'):
|
|
100 case mmioFOURCC('i', 'v', '4', '1'):
|
|
101 printf("Video in Indeo Video 4.1 format\n");
|
|
102 avi_header.flipped=1;
|
|
103 avi_header.no_32bpp_support=1;
|
|
104 return "ir41_32.dll";
|
|
105
|
|
106 case mmioFOURCC('I', 'V', '3', '2'):
|
|
107 case mmioFOURCC('i', 'v', '3', '2'):
|
|
108 printf("Video in Indeo Video 3.2 format\n");
|
|
109 avi_header.flipped=1;
|
|
110 avi_header.no_32bpp_support=1;
|
|
111 return "ir32_32.dll";
|
|
112
|
|
113 case mmioFOURCC('c', 'v', 'i', 'd'):
|
|
114 printf("Video in Cinepak format\n");
|
|
115 avi_header.yuv_supported=1;
|
|
116 return "iccvid.dll";
|
|
117
|
124
|
118 case mmioFOURCC('c', 'r', 'a', 'm'):
|
|
119 case mmioFOURCC('C', 'R', 'A', 'M'):
|
|
120 printf("Video in CRAM format\n");
|
|
121 avi_header.no_32bpp_support=1;
|
|
122 //avi_header.yuv_supported=1;
|
|
123 return "msvidc32.dll";
|
|
124
|
1
|
125 //*** Only 16bit .DLL available (can't load under linux) ***
|
|
126 // case mmioFOURCC('V', 'C', 'R', '1'):
|
|
127 // printf("Video in ATI VCR1 format\n");
|
|
128 // return "ativcr1.dll";
|
|
129
|
|
130 case mmioFOURCC('V', 'C', 'R', '2'):
|
|
131 printf("Video in ATI VCR2 format\n");
|
|
132 avi_header.yuv_supported=1;
|
|
133 return "ativcr2.dll";
|
|
134
|
|
135 case mmioFOURCC('A', 'S', 'V', '1'):
|
|
136 printf("Asus ASV-1 format\n");
|
|
137 // avi_header.yuv_supported=1;
|
|
138 return "asusasvd.dll";
|
|
139
|
|
140 case mmioFOURCC('A', 'S', 'V', '2'):
|
|
141 printf("Asus ASV-2 format\n");
|
|
142 // avi_header.yuv_supported=1;
|
|
143 avi_header.flipped=1;
|
|
144 // avi_header.bih.biCompression=mmioFOURCC('A', 'S', 'V', '1');
|
|
145 // return "asusasvd.dll";
|
|
146 return "asusasv2.dll";
|
|
147
|
|
148 case mmioFOURCC('I', '2', '6', '3'):
|
|
149 case mmioFOURCC('i', '2', '6', '3'):
|
|
150 printf("Video in I263 format\n");
|
271
|
151 avi_header.yuv_supported=1;
|
1
|
152 return "i263_32.drv";
|
|
153
|
|
154 case mmioFOURCC('M', 'J', 'P', 'G'):
|
|
155 printf("Video in MJPEG format\n");
|
|
156 avi_header.yuv_supported=1;
|
129
|
157 // return "M3JPEG32.dll";
|
|
158 return "mcmjpg32.dll";
|
1
|
159 // return "m3jpeg32.dll";
|
|
160 // return "libavi_mjpeg.so";
|
190
|
161
|
|
162 case mmioFOURCC('W', 'M', 'V', '1'):
|
|
163 printf("Video in Windows Media Video 1 format\n");
|
|
164 avi_header.yuv_supported=1;
|
|
165 avi_header.vids_guid=&wmv1_clsid;
|
|
166 return "wmvds32.ax";
|
|
167
|
255
|
168 case mmioFOURCC('H', 'F', 'Y', 'U'):
|
|
169 printf("HuffYUV\n");
|
|
170 avi_header.yuv_supported=1;
|
|
171 return "huffyuv.dll";
|
|
172
|
|
173 case mmioFOURCC('Z', 'L', 'I', 'B'):
|
|
174 printf("ZLIB\n");
|
|
175 avi_header.yuv_supported=1;
|
|
176 return "avizlib.dll";
|
|
177
|
|
178 case mmioFOURCC('M', 'S', 'Z', 'H'):
|
|
179 printf("MSZH\n");
|
|
180 avi_header.yuv_supported=1;
|
|
181 return "avimszh.dll";
|
|
182
|
|
183 #ifdef USE_DIRECTSHOW
|
|
184 case mmioFOURCC('T', 'M', '2', '0'):
|
|
185 printf("Video in TrueMotion 2.0 format\n");
|
|
186 avi_header.yuv_supported=1;
|
|
187 avi_header.vids_guid=&CLSID_TM20DecompressorCF;
|
|
188 return "tm20dec.ax";
|
|
189 #endif
|
190
|
190
|
1
|
191 }
|
|
192 printf("UNKNOWN video codec: %.4s (0x%0X)\n",&fccHandler,fccHandler);
|
|
193 printf("If you know this video format and codec, you can edit codecs.c in the source!\n");
|
|
194 printf("Please contact the author, send this movie to be supported by future version.\n");
|
|
195 return NULL;
|
|
196 }
|
|
197
|
|
198 char* get_auds_codec_name(){
|
|
199 int id=((WAVEFORMATEX*)avi_header.wf_ext)->wFormatTag;
|
175
|
200 avi_header.auds_guid=NULL;
|
1
|
201 switch (id){
|
|
202 case 0x161://DivX audio
|
|
203 // ((WAVEFORMATEX*)avi_header.wf_ext)->wFormatTag=0x160; //hack
|
|
204 case 0x160://DivX audio
|
|
205 avi_header.audio_seekable=0;
|
|
206 return "divxa32.acm"; // tested, OK.
|
|
207 case 0x2://MS ADPCM
|
|
208 avi_header.audio_seekable=0;
|
|
209 return "msadp32.acm"; // tested, OK.
|
|
210 case 0x55://MPEG l3
|
|
211 avi_header.audio_seekable=1;
|
|
212 return "l3codeca.acm"; // tested, OK. faster than mp3lib on intel
|
|
213 case 0x11://IMA ADPCM
|
|
214 return "imaadp32.acm"; // segfault :(
|
|
215 case 0x31://MS GSM
|
|
216 case 0x32://MS GSM
|
255
|
217 return "msgsm32.acm"; // OK after FS patch
|
1
|
218 case 0x75://VoxWare
|
190
|
219 avi_header.auds_guid=&CLSID_Voxware;
|
255
|
220 return "voxmsdec.ax"; // OK after FS patch
|
1
|
221 // case 0x06://???
|
|
222 // return "lhacm.acm";
|
|
223 // return "msg711.acm";
|
|
224 // return "tssoft32.acm";
|
|
225 }
|
|
226 printf("UNKNOWN audio codec: 0x%0X\n",id);
|
|
227 printf("If you know this audio format and codec, you can edit codecs.c in the source!\n");
|
|
228 printf("Please contact the author, send this movie to be supported by future version.\n");
|
|
229 return NULL;
|
|
230 }
|
|
231
|