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