annotate codecs.c @ 134:c1ca5e8df170

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