Mercurial > mplayer.hg
annotate codec-cfg.c @ 34923:eb76937af57e
Support FFmpeg pix_fmts YUV4xxP12*, YUV4xxP14*, GBR12P* and GBR14P*.
author | cehoyos |
---|---|
date | Thu, 12 Jul 2012 19:55:53 +0000 |
parents | 0eba64545a27 |
children | 19212dea7a97 |
rev | line source |
---|---|
319 | 1 /* |
2 * codec.conf parser | |
4676 | 3 * |
22501 | 4 * to compile test application: |
5 * cc -I. -DTESTING -o codec-cfg-test codec-cfg.c mp_msg.o osdep/getch2.o -ltermcap | |
15303 | 6 * to compile CODECS2HTML: |
33246 | 7 * gcc -DCODECS2HTML -o codecs2html codec-cfg.c |
4676 | 8 * |
9 * TODO: implement informat in CODECS2HTML too | |
30429
c1a3f1bbba26
Add license header to all top-level files missing them.
diego
parents:
30115
diff
changeset
|
10 * |
c1a3f1bbba26
Add license header to all top-level files missing them.
diego
parents:
30115
diff
changeset
|
11 * Copyright (C) 2001 Szabolcs Berecz <szabi@inf.elte.hu> |
c1a3f1bbba26
Add license header to all top-level files missing them.
diego
parents:
30115
diff
changeset
|
12 * |
c1a3f1bbba26
Add license header to all top-level files missing them.
diego
parents:
30115
diff
changeset
|
13 * This file is part of MPlayer. |
c1a3f1bbba26
Add license header to all top-level files missing them.
diego
parents:
30115
diff
changeset
|
14 * |
c1a3f1bbba26
Add license header to all top-level files missing them.
diego
parents:
30115
diff
changeset
|
15 * MPlayer is free software; you can redistribute it and/or modify |
c1a3f1bbba26
Add license header to all top-level files missing them.
diego
parents:
30115
diff
changeset
|
16 * it under the terms of the GNU General Public License as published by |
c1a3f1bbba26
Add license header to all top-level files missing them.
diego
parents:
30115
diff
changeset
|
17 * the Free Software Foundation; either version 2 of the License, or |
c1a3f1bbba26
Add license header to all top-level files missing them.
diego
parents:
30115
diff
changeset
|
18 * (at your option) any later version. |
c1a3f1bbba26
Add license header to all top-level files missing them.
diego
parents:
30115
diff
changeset
|
19 * |
c1a3f1bbba26
Add license header to all top-level files missing them.
diego
parents:
30115
diff
changeset
|
20 * MPlayer is distributed in the hope that it will be useful, |
c1a3f1bbba26
Add license header to all top-level files missing them.
diego
parents:
30115
diff
changeset
|
21 * but WITHOUT ANY WARRANTY; without even the implied warranty of |
c1a3f1bbba26
Add license header to all top-level files missing them.
diego
parents:
30115
diff
changeset
|
22 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
c1a3f1bbba26
Add license header to all top-level files missing them.
diego
parents:
30115
diff
changeset
|
23 * GNU General Public License for more details. |
c1a3f1bbba26
Add license header to all top-level files missing them.
diego
parents:
30115
diff
changeset
|
24 * |
c1a3f1bbba26
Add license header to all top-level files missing them.
diego
parents:
30115
diff
changeset
|
25 * You should have received a copy of the GNU General Public License along |
c1a3f1bbba26
Add license header to all top-level files missing them.
diego
parents:
30115
diff
changeset
|
26 * with MPlayer; if not, write to the Free Software Foundation, Inc., |
c1a3f1bbba26
Add license header to all top-level files missing them.
diego
parents:
30115
diff
changeset
|
27 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. |
319 | 28 */ |
303 | 29 |
319 | 30 #define DEBUG |
303 | 31 |
3798
d1e3ad5bcd8f
fixed few segfaults, make parse_codec_cfg() return int
iive
parents:
3787
diff
changeset
|
32 //disable asserts |
29263
0f1b5b68af32
whitespace cosmetics: Remove all trailing whitespace.
diego
parents:
29115
diff
changeset
|
33 #define NDEBUG |
3798
d1e3ad5bcd8f
fixed few segfaults, make parse_codec_cfg() return int
iive
parents:
3787
diff
changeset
|
34 |
297 | 35 #include <stdio.h> |
36 #include <stdlib.h> | |
37 #include <fcntl.h> | |
38 #include <unistd.h> | |
39 #include <errno.h> | |
40 #include <ctype.h> | |
41 #include <assert.h> | |
42 #include <string.h> | |
43 | |
5284
0a58c2ef1da1
added missing #include config.h, removed LIBVO2 ifdef.
arpi
parents:
5263
diff
changeset
|
44 #include "config.h" |
5937 | 45 #include "mp_msg.h" |
17841
73db10d5f2e3
remove mp_msg.c dependency when compiling codec-cfg binary.
reimar
parents:
17763
diff
changeset
|
46 #ifdef CODECS2HTML |
73db10d5f2e3
remove mp_msg.c dependency when compiling codec-cfg binary.
reimar
parents:
17763
diff
changeset
|
47 #ifdef __GNUC__ |
73db10d5f2e3
remove mp_msg.c dependency when compiling codec-cfg binary.
reimar
parents:
17763
diff
changeset
|
48 #define mp_msg(t, l, m, args...) fprintf(stderr, m, ##args) |
73db10d5f2e3
remove mp_msg.c dependency when compiling codec-cfg binary.
reimar
parents:
17763
diff
changeset
|
49 #else |
23910
8fcfdfcd6c41
C99 varargs in macros can not be empty, adjust definition so it compiles
reimar
parents:
23806
diff
changeset
|
50 #define mp_msg(t, l, ...) fprintf(stderr, __VA_ARGS__) |
17841
73db10d5f2e3
remove mp_msg.c dependency when compiling codec-cfg binary.
reimar
parents:
17763
diff
changeset
|
51 #endif |
73db10d5f2e3
remove mp_msg.c dependency when compiling codec-cfg binary.
reimar
parents:
17763
diff
changeset
|
52 #endif |
5284
0a58c2ef1da1
added missing #include config.h, removed LIBVO2 ifdef.
arpi
parents:
5263
diff
changeset
|
53 |
13619 | 54 #include "help_mp.h" |
55 | |
33561
1ff6737f2177
Avoid including aviheader.h only for mmioFOURCC, it has too many
reimar
parents:
33364
diff
changeset
|
56 #include "libavutil/avutil.h" |
15305 | 57 #include "libmpcodecs/img_format.h" |
297 | 58 #include "codec-cfg.h" |
59 | |
31406
0fd1b3f1fe69
Auto-update CODEC_CFG_MIN value to release value in etc/codecs.conf.
reimar
parents:
31159
diff
changeset
|
60 #ifdef CODECS2HTML |
0fd1b3f1fe69
Auto-update CODEC_CFG_MIN value to release value in etc/codecs.conf.
reimar
parents:
31159
diff
changeset
|
61 #define CODEC_CFG_MIN 20100000 |
0fd1b3f1fe69
Auto-update CODEC_CFG_MIN value to release value in etc/codecs.conf.
reimar
parents:
31159
diff
changeset
|
62 #else |
8467
3ca9cc46df5c
Fallback to builtin (generated from etc/codecs.conf at compile time)
arpi
parents:
8211
diff
changeset
|
63 #include "codecs.conf.h" |
3ca9cc46df5c
Fallback to builtin (generated from etc/codecs.conf at compile time)
arpi
parents:
8211
diff
changeset
|
64 #endif |
3ca9cc46df5c
Fallback to builtin (generated from etc/codecs.conf at compile time)
arpi
parents:
8211
diff
changeset
|
65 |
5937 | 66 #define PRINT_LINENUM mp_msg(MSGT_CODECCFG,MSGL_ERR," at line %d\n", line_num) |
328 | 67 |
31077 | 68 #define MAX_NR_TOKEN 16 |
297 | 69 |
31077 | 70 #define MAX_LINE_LEN 1000 |
297 | 71 |
31077 | 72 #define RET_EOF -1 |
73 #define RET_EOL -2 | |
297 | 74 |
31077 | 75 #define TYPE_VIDEO 0 |
76 #define TYPE_AUDIO 1 | |
297 | 77 |
31406
0fd1b3f1fe69
Auto-update CODEC_CFG_MIN value to release value in etc/codecs.conf.
reimar
parents:
31159
diff
changeset
|
78 static int codecs_conf_release; |
11759
29eea271490e
add -codecs-file for selecting a specific codecs.conf on the comand line
attila
parents:
11388
diff
changeset
|
79 char * codecs_file = NULL; |
29eea271490e
add -codecs-file for selecting a specific codecs.conf on the comand line
attila
parents:
11388
diff
changeset
|
80 |
303 | 81 static int add_to_fourcc(char *s, char *alias, unsigned int *fourcc, |
31077 | 82 unsigned int *map) |
297 | 83 { |
31077 | 84 int i, j, freeslots; |
85 unsigned int tmp; | |
319 | 86 |
31077 | 87 /* find first unused slot */ |
88 for (i = 0; i < CODECS_MAX_FOURCC && fourcc[i] != 0xffffffff; i++) | |
89 /* NOTHING */; | |
90 freeslots = CODECS_MAX_FOURCC - i; | |
91 if (!freeslots) | |
92 goto err_out_too_many; | |
319 | 93 |
31077 | 94 do { |
33561
1ff6737f2177
Avoid including aviheader.h only for mmioFOURCC, it has too many
reimar
parents:
33364
diff
changeset
|
95 tmp = MKTAG(s[0], s[1], s[2], s[3]); |
31077 | 96 for (j = 0; j < i; j++) |
97 if (tmp == fourcc[j]) | |
98 goto err_out_duplicated; | |
99 fourcc[i] = tmp; | |
33561
1ff6737f2177
Avoid including aviheader.h only for mmioFOURCC, it has too many
reimar
parents:
33364
diff
changeset
|
100 map[i] = alias ? MKTAG(alias[0], alias[1], alias[2], alias[3]) : tmp; |
31077 | 101 s += 4; |
102 i++; | |
103 } while ((*(s++) == ',') && --freeslots); | |
319 | 104 |
31077 | 105 if (!freeslots) |
106 goto err_out_too_many; | |
107 if (*(--s) != '\0') | |
108 goto err_out_parse_error; | |
109 return 1; | |
328 | 110 err_out_duplicated: |
31077 | 111 mp_msg(MSGT_CODECCFG,MSGL_ERR,MSGTR_DuplicateFourcc); |
112 return 0; | |
328 | 113 err_out_too_many: |
31077 | 114 mp_msg(MSGT_CODECCFG,MSGL_ERR,MSGTR_TooManyFourccs); |
115 return 0; | |
361 | 116 err_out_parse_error: |
31077 | 117 mp_msg(MSGT_CODECCFG,MSGL_ERR,MSGTR_ParseError); |
118 return 0; | |
319 | 119 } |
120 | |
7770 | 121 static int add_to_format(char *s, char *alias,unsigned int *fourcc, unsigned int *fourccmap) |
319 | 122 { |
31077 | 123 int i, j; |
124 char *endptr; | |
297 | 125 |
31077 | 126 /* find first unused slot */ |
127 for (i = 0; i < CODECS_MAX_FOURCC && fourcc[i] != 0xffffffff; i++) | |
128 /* NOTHING */; | |
129 if (i == CODECS_MAX_FOURCC) { | |
130 mp_msg(MSGT_CODECCFG,MSGL_ERR,MSGTR_TooManyFourccs); | |
131 return 0; | |
132 } | |
297 | 133 |
31077 | 134 fourcc[i]=strtoul(s,&endptr,0); |
135 if (*endptr != '\0') { | |
136 mp_msg(MSGT_CODECCFG,MSGL_ERR,MSGTR_ParseErrorFIDNotNumber); | |
137 return 0; | |
138 } | |
7770 | 139 |
31077 | 140 if(alias){ |
141 fourccmap[i]=strtoul(alias,&endptr,0); | |
142 if (*endptr != '\0') { | |
143 mp_msg(MSGT_CODECCFG,MSGL_ERR,MSGTR_ParseErrorFIDAliasNotNumber); | |
144 return 0; | |
145 } | |
146 } else | |
147 fourccmap[i]=fourcc[i]; | |
7770 | 148 |
31077 | 149 for (j = 0; j < i; j++) |
150 if (fourcc[j] == fourcc[i]) { | |
151 mp_msg(MSGT_CODECCFG,MSGL_ERR,MSGTR_DuplicateFID); | |
152 return 0; | |
153 } | |
300 | 154 |
31077 | 155 return 1; |
297 | 156 } |
157 | |
31159 | 158 static const struct { |
159 const char *name; | |
160 const unsigned int num; | |
161 } fmt_table[] = { | |
162 // note: due to parser deficiencies/simplicity, if one format | |
163 // name matches the beginning of another, the longer one _must_ | |
164 // come first in this list. | |
34191 | 165 {"YV12", IMGFMT_YV12}, |
166 {"I420", IMGFMT_I420}, | |
167 {"IYUV", IMGFMT_IYUV}, | |
168 {"NV12", IMGFMT_NV12}, | |
169 {"NV21", IMGFMT_NV21}, | |
170 {"YVU9", IMGFMT_YVU9}, | |
171 {"IF09", IMGFMT_IF09}, | |
172 {"444P16LE", IMGFMT_444P16_LE}, | |
173 {"444P16BE", IMGFMT_444P16_BE}, | |
174 {"444P10LE", IMGFMT_444P10_LE}, | |
175 {"444P10BE", IMGFMT_444P10_BE}, | |
176 {"422P16LE", IMGFMT_422P16_LE}, | |
177 {"422P16BE", IMGFMT_422P16_BE}, | |
178 {"420P16LE", IMGFMT_420P16_LE}, | |
179 {"420P16BE", IMGFMT_420P16_BE}, | |
180 {"444P16", IMGFMT_444P16}, | |
34923
eb76937af57e
Support FFmpeg pix_fmts YUV4xxP12*, YUV4xxP14*, GBR12P* and GBR14P*.
cehoyos
parents:
34805
diff
changeset
|
181 {"444P14", IMGFMT_444P14}, |
eb76937af57e
Support FFmpeg pix_fmts YUV4xxP12*, YUV4xxP14*, GBR12P* and GBR14P*.
cehoyos
parents:
34805
diff
changeset
|
182 {"444P12", IMGFMT_444P12}, |
34191 | 183 {"444P10", IMGFMT_444P10}, |
184 {"444P9", IMGFMT_444P9}, | |
185 {"422P16", IMGFMT_422P16}, | |
34923
eb76937af57e
Support FFmpeg pix_fmts YUV4xxP12*, YUV4xxP14*, GBR12P* and GBR14P*.
cehoyos
parents:
34805
diff
changeset
|
186 {"422P14", IMGFMT_422P14}, |
eb76937af57e
Support FFmpeg pix_fmts YUV4xxP12*, YUV4xxP14*, GBR12P* and GBR14P*.
cehoyos
parents:
34805
diff
changeset
|
187 {"422P12", IMGFMT_422P12}, |
34191 | 188 {"422P10", IMGFMT_422P10}, |
34436 | 189 {"422P9", IMGFMT_422P9}, |
34191 | 190 {"420P16", IMGFMT_420P16}, |
34923
eb76937af57e
Support FFmpeg pix_fmts YUV4xxP12*, YUV4xxP14*, GBR12P* and GBR14P*.
cehoyos
parents:
34805
diff
changeset
|
191 {"420P14", IMGFMT_420P14}, |
eb76937af57e
Support FFmpeg pix_fmts YUV4xxP12*, YUV4xxP14*, GBR12P* and GBR14P*.
cehoyos
parents:
34805
diff
changeset
|
192 {"420P12", IMGFMT_420P12}, |
34191 | 193 {"420P10", IMGFMT_420P10}, |
194 {"420P9", IMGFMT_420P9}, | |
195 {"420A", IMGFMT_420A}, | |
196 {"444P", IMGFMT_444P}, | |
34565 | 197 {"444A", IMGFMT_444A}, |
34191 | 198 {"422P", IMGFMT_422P}, |
34805
0eba64545a27
Improve Avid Meridien (AVUI) decoding with FFmpeg.
cehoyos
parents:
34793
diff
changeset
|
199 {"422A", IMGFMT_422A}, |
34191 | 200 {"411P", IMGFMT_411P}, |
201 {"440P", IMGFMT_440P}, | |
202 {"Y800", IMGFMT_Y800}, | |
203 {"Y8", IMGFMT_Y8}, | |
408 | 204 |
34191 | 205 {"YUY2", IMGFMT_YUY2}, |
206 {"UYVY", IMGFMT_UYVY}, | |
207 {"YVYU", IMGFMT_YVYU}, | |
408 | 208 |
34572 | 209 {"RGB64LE", IMGFMT_RGB64LE}, |
210 {"RGB64BE", IMGFMT_RGB64BE}, | |
34191 | 211 {"RGB48LE", IMGFMT_RGB48LE}, |
212 {"RGB48BE", IMGFMT_RGB48BE}, | |
213 {"RGB4", IMGFMT_RGB4}, | |
214 {"RGB8", IMGFMT_RGB8}, | |
215 {"RGB15", IMGFMT_RGB15}, | |
216 {"RGB16", IMGFMT_RGB16}, | |
217 {"RGB24", IMGFMT_RGB24}, | |
218 {"RGB32", IMGFMT_RGB32}, | |
34501 | 219 {"RGBA", IMGFMT_RGBA}, |
34191 | 220 {"BGR4", IMGFMT_BGR4}, |
221 {"BGR8", IMGFMT_BGR8}, | |
34793
1ce075a9932b
Support new colour spaces for FFmpeg camstudio decoding on big-endian.
cehoyos
parents:
34572
diff
changeset
|
222 {"BGR15LE", IMGFMT_BGR15LE}, |
34191 | 223 {"BGR15", IMGFMT_BGR15}, |
224 {"BGR16", IMGFMT_BGR16}, | |
225 {"BGR24", IMGFMT_BGR24}, | |
226 {"BGR32", IMGFMT_BGR32}, | |
34509
bdca973d87a5
Fix 32-bit targa playback with current FFmpeg on big-endian.
cehoyos
parents:
34501
diff
changeset
|
227 {"BGRA", IMGFMT_BGRA}, |
34191 | 228 {"RGB1", IMGFMT_RGB1}, |
229 {"BGR1", IMGFMT_BGR1}, | |
230 {"GBR24P", IMGFMT_GBR24P}, | |
34923
eb76937af57e
Support FFmpeg pix_fmts YUV4xxP12*, YUV4xxP14*, GBR12P* and GBR14P*.
cehoyos
parents:
34805
diff
changeset
|
231 {"GBR12P", IMGFMT_GBR12P}, |
eb76937af57e
Support FFmpeg pix_fmts YUV4xxP12*, YUV4xxP14*, GBR12P* and GBR14P*.
cehoyos
parents:
34805
diff
changeset
|
232 {"GBR14P", IMGFMT_GBR14P}, |
1871 | 233 |
34191 | 234 {"MPES", IMGFMT_MPEGPES}, |
235 {"ZRMJPEGNI", IMGFMT_ZRMJPEGNI}, | |
236 {"ZRMJPEGIT", IMGFMT_ZRMJPEGIT}, | |
237 {"ZRMJPEGIB", IMGFMT_ZRMJPEGIB}, | |
10316 | 238 |
34191 | 239 {"IDCT_MPEG2", IMGFMT_XVMC_IDCT_MPEG2}, |
240 {"MOCO_MPEG2", IMGFMT_XVMC_MOCO_MPEG2}, | |
10316 | 241 |
34191 | 242 {"VDPAU_MPEG1", IMGFMT_VDPAU_MPEG1}, |
243 {"VDPAU_MPEG2", IMGFMT_VDPAU_MPEG2}, | |
244 {"VDPAU_H264", IMGFMT_VDPAU_H264}, | |
245 {"VDPAU_WMV3", IMGFMT_VDPAU_WMV3}, | |
246 {"VDPAU_VC1", IMGFMT_VDPAU_VC1}, | |
247 {"VDPAU_MPEG4", IMGFMT_VDPAU_MPEG4}, | |
28516
79b0bd20433e
Add support for image formats and codecs used by VDPAU
reimar
parents:
27343
diff
changeset
|
248 |
31159 | 249 {NULL, 0} |
250 }; | |
408 | 251 |
607 | 252 |
4675 | 253 static int add_to_inout(char *sfmt, char *sflags, unsigned int *outfmt, |
31077 | 254 unsigned char *outflags) |
607 | 255 { |
256 | |
31077 | 257 static char *flagstr[] = { |
258 "flip", | |
259 "noflip", | |
260 "yuvhack", | |
261 "query", | |
262 "static", | |
263 NULL | |
264 }; | |
299 | 265 |
31077 | 266 int i, j, freeslots; |
267 unsigned char flags; | |
297 | 268 |
31077 | 269 for (i = 0; i < CODECS_MAX_OUTFMT && outfmt[i] != 0xffffffff; i++) |
270 /* NOTHING */; | |
271 freeslots = CODECS_MAX_OUTFMT - i; | |
272 if (!freeslots) | |
273 goto err_out_too_many; | |
297 | 274 |
31077 | 275 flags = 0; |
276 if(sflags) { | |
277 do { | |
278 for (j = 0; flagstr[j] != NULL; j++) | |
279 if (!strncmp(sflags, flagstr[j], | |
280 strlen(flagstr[j]))) | |
281 break; | |
282 if (flagstr[j] == NULL) | |
283 goto err_out_parse_error; | |
284 flags|=(1<<j); | |
285 sflags+=strlen(flagstr[j]); | |
286 } while (*(sflags++) == ','); | |
361 | 287 |
31077 | 288 if (*(--sflags) != '\0') |
289 goto err_out_parse_error; | |
290 } | |
297 | 291 |
31077 | 292 do { |
293 for (j = 0; fmt_table[j].name != NULL; j++) | |
294 if (!strncmp(sfmt, fmt_table[j].name, strlen(fmt_table[j].name))) | |
295 break; | |
296 if (fmt_table[j].name == NULL) | |
297 goto err_out_parse_error; | |
298 outfmt[i] = fmt_table[j].num; | |
299 outflags[i] = flags; | |
300 ++i; | |
301 sfmt+=strlen(fmt_table[j].name); | |
302 } while ((*(sfmt++) == ',') && --freeslots); | |
319 | 303 |
31077 | 304 if (!freeslots) |
305 goto err_out_too_many; | |
319 | 306 |
31077 | 307 if (*(--sfmt) != '\0') |
308 goto err_out_parse_error; | |
29263
0f1b5b68af32
whitespace cosmetics: Remove all trailing whitespace.
diego
parents:
29115
diff
changeset
|
309 |
31077 | 310 return 1; |
328 | 311 err_out_too_many: |
31077 | 312 mp_msg(MSGT_CODECCFG,MSGL_ERR,MSGTR_TooManyOut); |
313 return 0; | |
361 | 314 err_out_parse_error: |
31077 | 315 mp_msg(MSGT_CODECCFG,MSGL_ERR,MSGTR_ParseError); |
316 return 0; | |
297 | 317 } |
318 | |
7180
28677d779205
-afm/-vfm migration from ID (int) to NAME (string) - simplifies code and makes dlopen()'ing possible
arpi
parents:
6927
diff
changeset
|
319 #if 0 |
303 | 320 static short get_driver(char *s,int audioflag) |
297 | 321 { |
31077 | 322 static char *audiodrv[] = { |
323 "null", | |
324 "mp3lib", | |
325 "pcm", | |
326 "libac3", | |
327 "acm", | |
328 "alaw", | |
329 "msgsm", | |
330 "dshow", | |
331 "dvdpcm", | |
332 "hwac3", | |
333 "libvorbis", | |
334 "ffmpeg", | |
335 "libmad", | |
336 "msadpcm", | |
337 "liba52", | |
338 "g72x", | |
339 "imaadpcm", | |
340 "dk4adpcm", | |
341 "dk3adpcm", | |
342 "roqaudio", | |
343 "faad", | |
344 "realaud", | |
345 "libdv", | |
346 NULL | |
347 }; | |
348 static char *videodrv[] = { | |
349 "null", | |
350 "libmpeg2", | |
351 "vfw", | |
352 "dshow", | |
353 "ffmpeg", | |
354 "vfwex", | |
355 "raw", | |
356 "msrle", | |
357 "xanim", | |
358 "msvidc", | |
359 "fli", | |
360 "cinepak", | |
361 "qtrle", | |
362 "nuv", | |
363 "cyuv", | |
364 "qtsmc", | |
365 "ducktm1", | |
366 "roqvideo", | |
367 "qtrpza", | |
368 "mpng", | |
369 "ijpg", | |
370 "zlib", | |
371 "mpegpes", | |
372 "zrmjpeg", | |
373 "realvid", | |
374 "xvid", | |
375 "libdv", | |
376 NULL | |
377 }; | |
378 char **drv=audioflag?audiodrv:videodrv; | |
379 int i; | |
6863 | 380 |
31077 | 381 for(i=0;drv[i];i++) if(!strcmp(s,drv[i])) return i; |
301 | 382 |
31077 | 383 return -1; |
297 | 384 } |
7180
28677d779205
-afm/-vfm migration from ID (int) to NAME (string) - simplifies code and makes dlopen()'ing possible
arpi
parents:
6927
diff
changeset
|
385 #endif |
297 | 386 |
328 | 387 static int validate_codec(codecs_t *c, int type) |
319 | 388 { |
31077 | 389 unsigned int i; |
390 char *tmp_name = c->name; | |
328 | 391 |
31077 | 392 for (i = 0; i < strlen(tmp_name) && isalnum(tmp_name[i]); i++) |
393 /* NOTHING */; | |
3408 | 394 |
31077 | 395 if (i < strlen(tmp_name)) { |
396 mp_msg(MSGT_CODECCFG,MSGL_ERR,MSGTR_InvalidCodecName, c->name); | |
397 return 0; | |
398 } | |
3408 | 399 |
31077 | 400 if (!c->info) |
401 c->info = strdup(c->name); | |
3408 | 402 |
403 #if 0 | |
31077 | 404 if (c->fourcc[0] == 0xffffffff) { |
405 mp_msg(MSGT_CODECCFG,MSGL_ERR,MSGTR_CodecLacksFourcc, c->name); | |
406 return 0; | |
407 } | |
13936
589b227e3367
fix crash when a "driver" line is missing in codecs.conf.
reimar
parents:
13807
diff
changeset
|
408 #endif |
3408 | 409 |
31077 | 410 if (!c->drv) { |
411 mp_msg(MSGT_CODECCFG,MSGL_ERR,MSGTR_CodecLacksDriver, c->name); | |
412 return 0; | |
413 } | |
3408 | 414 |
415 #if 0 | |
32394
914208d188b9
Remove #warning preprocessor directives or replace them by suitable comments.
diego
parents:
31409
diff
changeset
|
416 //FIXME: codec->driver == 4;... <- this should not be put in here... |
914208d188b9
Remove #warning preprocessor directives or replace them by suitable comments.
diego
parents:
31409
diff
changeset
|
417 //FIXME: Where are they defined ???????????? |
31077 | 418 if (!c->dll && (c->driver == 4 || |
419 (c->driver == 2 && type == TYPE_VIDEO))) { | |
420 mp_msg(MSGT_CODECCFG,MSGL_ERR,MSGTR_CodecNeedsDLL, c->name); | |
421 return 0; | |
422 } | |
32394
914208d188b9
Remove #warning preprocessor directives or replace them by suitable comments.
diego
parents:
31409
diff
changeset
|
423 // FIXME: Can guid.f1 be 0? How does one know that it was not given? |
31077 | 424 // if (!(codec->flags & CODECS_FLAG_AUDIO) && codec->driver == 4) |
328 | 425 |
31077 | 426 if (type == TYPE_VIDEO) |
427 if (c->outfmt[0] == 0xffffffff) { | |
428 mp_msg(MSGT_CODECCFG,MSGL_ERR,MSGTR_CodecNeedsOutfmt, c->name); | |
429 return 0; | |
430 } | |
329 | 431 #endif |
31077 | 432 return 1; |
319 | 433 } |
434 | |
435 static int add_comment(char *s, char **d) | |
436 { | |
31077 | 437 int pos; |
319 | 438 |
31077 | 439 if (!*d) |
440 pos = 0; | |
441 else { | |
442 pos = strlen(*d); | |
443 (*d)[pos++] = '\n'; | |
444 } | |
445 if (!(*d = realloc(*d, pos + strlen(s) + 1))) { | |
446 mp_msg(MSGT_CODECCFG,MSGL_FATAL,MSGTR_CantAllocateComment); | |
447 return 0; | |
448 } | |
449 strcpy(*d + pos, s); | |
450 return 1; | |
319 | 451 } |
297 | 452 |
361 | 453 static short get_cpuflags(char *s) |
454 { | |
31077 | 455 static char *flagstr[] = { |
456 "mmx", | |
457 "sse", | |
458 "3dnow", | |
459 NULL | |
460 }; | |
461 int i; | |
462 short flags = 0; | |
361 | 463 |
31077 | 464 do { |
465 for (i = 0; flagstr[i]; i++) | |
466 if (!strncmp(s, flagstr[i], strlen(flagstr[i]))) | |
467 break; | |
468 if (!flagstr[i]) | |
469 goto err_out_parse_error; | |
470 flags |= 1<<i; | |
471 s += strlen(flagstr[i]); | |
472 } while (*(s++) == ','); | |
361 | 473 |
31077 | 474 if (*(--s) != '\0') |
475 goto err_out_parse_error; | |
361 | 476 |
31077 | 477 return flags; |
361 | 478 err_out_parse_error: |
31077 | 479 return 0; |
361 | 480 } |
481 | |
328 | 482 static FILE *fp; |
483 static int line_num = 0; | |
484 static char *line; | |
485 static char *token[MAX_NR_TOKEN]; | |
6200
e604be87613d
codecs.conf versioning - patch by Joey Parrish <joey@yunamusic.com>
arpi
parents:
6103
diff
changeset
|
486 static int read_nextline = 1; |
328 | 487 |
488 static int get_token(int min, int max) | |
297 | 489 { |
31077 | 490 static int line_pos; |
491 int i; | |
492 char c; | |
328 | 493 |
31077 | 494 if (max >= MAX_NR_TOKEN) { |
495 mp_msg(MSGT_CODECCFG,MSGL_ERR,MSGTR_GetTokenMaxNotLessThanMAX_NR_TOKEN); | |
496 goto out_eof; | |
497 } | |
328 | 498 |
31077 | 499 memset(token, 0x00, sizeof(*token) * max); |
328 | 500 |
31077 | 501 if (read_nextline) { |
502 if (!fgets(line, MAX_LINE_LEN, fp)) | |
503 goto out_eof; | |
504 line_pos = 0; | |
505 ++line_num; | |
506 read_nextline = 0; | |
507 } | |
508 for (i = 0; i < max; i++) { | |
509 while (isspace(line[line_pos])) | |
510 ++line_pos; | |
511 if (line[line_pos] == '\0' || line[line_pos] == '#' || | |
512 line[line_pos] == ';') { | |
513 read_nextline = 1; | |
514 if (i >= min) | |
515 goto out_ok; | |
516 goto out_eol; | |
517 } | |
518 token[i] = line + line_pos; | |
519 c = line[line_pos]; | |
520 if (c == '"' || c == '\'') { | |
521 token[i]++; | |
522 while (line[++line_pos] != c && line[line_pos]) | |
523 /* NOTHING */; | |
524 } else { | |
525 for (/* NOTHING */; !isspace(line[line_pos]) && | |
526 line[line_pos]; line_pos++) | |
527 /* NOTHING */; | |
528 } | |
529 if (!line[line_pos]) { | |
530 read_nextline = 1; | |
531 if (i >= min - 1) | |
532 goto out_ok; | |
533 goto out_eol; | |
534 } | |
535 line[line_pos] = '\0'; | |
536 line_pos++; | |
537 } | |
328 | 538 out_ok: |
31077 | 539 return i; |
328 | 540 out_eof: |
31077 | 541 read_nextline = 1; |
542 return RET_EOF; | |
328 | 543 out_eol: |
31077 | 544 return RET_EOL; |
328 | 545 } |
546 | |
547 static codecs_t *video_codecs=NULL; | |
548 static codecs_t *audio_codecs=NULL; | |
549 static int nr_vcodecs = 0; | |
550 static int nr_acodecs = 0; | |
551 | |
18980
ed69754aa58d
Marks several string parameters as const when they are not modified in the function, Patch by Stefan Huehner, stefan AT huehner-org
reynaldo
parents:
18034
diff
changeset
|
552 int parse_codec_cfg(const char *cfgfile) |
328 | 553 { |
31077 | 554 codecs_t *codec = NULL; // current codec |
555 codecs_t **codecsp = NULL;// points to audio_codecs or to video_codecs | |
556 char *endptr; // strtoul()... | |
557 int *nr_codecsp; | |
558 int codec_type; /* TYPE_VIDEO/TYPE_AUDIO */ | |
559 int tmp, i; | |
29263
0f1b5b68af32
whitespace cosmetics: Remove all trailing whitespace.
diego
parents:
29115
diff
changeset
|
560 |
31077 | 561 // in case we call it a second time |
562 codecs_uninit_free(); | |
29263
0f1b5b68af32
whitespace cosmetics: Remove all trailing whitespace.
diego
parents:
29115
diff
changeset
|
563 |
31077 | 564 nr_vcodecs = 0; |
565 nr_acodecs = 0; | |
297 | 566 |
31077 | 567 if(cfgfile==NULL) { |
8467
3ca9cc46df5c
Fallback to builtin (generated from etc/codecs.conf at compile time)
arpi
parents:
8211
diff
changeset
|
568 #ifdef CODECS2HTML |
31077 | 569 return 0; |
8467
3ca9cc46df5c
Fallback to builtin (generated from etc/codecs.conf at compile time)
arpi
parents:
8211
diff
changeset
|
570 #else |
31077 | 571 video_codecs = builtin_video_codecs; |
572 audio_codecs = builtin_audio_codecs; | |
573 nr_vcodecs = sizeof(builtin_video_codecs)/sizeof(codecs_t); | |
574 nr_acodecs = sizeof(builtin_audio_codecs)/sizeof(codecs_t); | |
575 return 1; | |
8467
3ca9cc46df5c
Fallback to builtin (generated from etc/codecs.conf at compile time)
arpi
parents:
8211
diff
changeset
|
576 #endif |
31077 | 577 } |
29263
0f1b5b68af32
whitespace cosmetics: Remove all trailing whitespace.
diego
parents:
29115
diff
changeset
|
578 |
33844
77bf38091051
Clarify console output when reading optional configuration files.
diego
parents:
33843
diff
changeset
|
579 mp_msg(MSGT_CODECCFG, MSGL_V, "Reading optional codecs config file %s: ", cfgfile); |
297 | 580 |
31077 | 581 if ((fp = fopen(cfgfile, "r")) == NULL) { |
33844
77bf38091051
Clarify console output when reading optional configuration files.
diego
parents:
33843
diff
changeset
|
582 mp_msg(MSGT_CODECCFG, MSGL_V, "%s\n", strerror(errno)); |
31077 | 583 return 0; |
584 } | |
297 | 585 |
31077 | 586 if ((line = malloc(MAX_LINE_LEN + 1)) == NULL) { |
587 mp_msg(MSGT_CODECCFG,MSGL_FATAL,MSGTR_CantGetMemoryForLine, strerror(errno)); | |
588 return 0; | |
589 } | |
590 read_nextline = 1; | |
297 | 591 |
31077 | 592 /* |
593 * this only catches release lines at the start of | |
594 * codecs.conf, before audiocodecs and videocodecs. | |
595 */ | |
596 while ((tmp = get_token(1, 1)) == RET_EOL) | |
597 /* NOTHING */; | |
598 if (tmp == RET_EOF) | |
599 goto out; | |
600 if (!strcmp(token[0], "release")) { | |
601 if (get_token(1, 2) < 0) | |
602 goto err_out_parse_error; | |
603 tmp = atoi(token[0]); | |
604 if (tmp < CODEC_CFG_MIN) | |
605 goto err_out_release_num; | |
31406
0fd1b3f1fe69
Auto-update CODEC_CFG_MIN value to release value in etc/codecs.conf.
reimar
parents:
31159
diff
changeset
|
606 codecs_conf_release = tmp; |
31077 | 607 while ((tmp = get_token(1, 1)) == RET_EOL) |
608 /* NOTHING */; | |
609 if (tmp == RET_EOF) | |
610 goto out; | |
611 } else | |
612 goto err_out_release_num; | |
6200
e604be87613d
codecs.conf versioning - patch by Joey Parrish <joey@yunamusic.com>
arpi
parents:
6103
diff
changeset
|
613 |
31077 | 614 /* |
615 * check if the next block starts with 'audiocodec' or | |
616 * with 'videocodec' | |
617 */ | |
618 if (!strcmp(token[0], "audiocodec") || !strcmp(token[0], "videocodec")) | |
619 goto loop_enter; | |
620 goto err_out_parse_error; | |
328 | 621 |
31077 | 622 while ((tmp = get_token(1, 1)) != RET_EOF) { |
623 if (tmp == RET_EOL) | |
624 continue; | |
625 if (!strcmp(token[0], "audiocodec") || | |
626 !strcmp(token[0], "videocodec")) { | |
627 if (!validate_codec(codec, codec_type)) | |
628 goto err_out_not_valid; | |
629 loop_enter: | |
630 if (*token[0] == 'v') { | |
631 codec_type = TYPE_VIDEO; | |
632 nr_codecsp = &nr_vcodecs; | |
633 codecsp = &video_codecs; | |
634 } else if (*token[0] == 'a') { | |
635 codec_type = TYPE_AUDIO; | |
636 nr_codecsp = &nr_acodecs; | |
637 codecsp = &audio_codecs; | |
361 | 638 #ifdef DEBUG |
31077 | 639 } else { |
640 mp_msg(MSGT_CODECCFG,MSGL_ERR,"picsba\n"); | |
641 goto err_out; | |
361 | 642 #endif |
31077 | 643 } |
644 if (!(*codecsp = realloc(*codecsp, | |
645 sizeof(codecs_t) * (*nr_codecsp + 2)))) { | |
646 mp_msg(MSGT_CODECCFG,MSGL_FATAL,MSGTR_CantReallocCodecsp, strerror(errno)); | |
647 goto err_out; | |
648 } | |
649 codec=*codecsp + *nr_codecsp; | |
650 ++*nr_codecsp; | |
651 memset(codec,0,sizeof(codecs_t)); | |
652 memset(codec->fourcc, 0xff, sizeof(codec->fourcc)); | |
653 memset(codec->outfmt, 0xff, sizeof(codec->outfmt)); | |
654 memset(codec->infmt, 0xff, sizeof(codec->infmt)); | |
29263
0f1b5b68af32
whitespace cosmetics: Remove all trailing whitespace.
diego
parents:
29115
diff
changeset
|
655 |
31077 | 656 if (get_token(1, 1) < 0) |
657 goto err_out_parse_error; | |
658 for (i = 0; i < *nr_codecsp - 1; i++) { | |
659 if(( (*codecsp)[i].name!=NULL) && | |
660 (!strcmp(token[0], (*codecsp)[i].name)) ) { | |
661 mp_msg(MSGT_CODECCFG,MSGL_ERR,MSGTR_CodecNameNotUnique, token[0]); | |
662 goto err_out_print_linenum; | |
663 } | |
664 } | |
665 if (!(codec->name = strdup(token[0]))) { | |
666 mp_msg(MSGT_CODECCFG,MSGL_ERR,MSGTR_CantStrdupName, strerror(errno)); | |
667 goto err_out; | |
668 } | |
669 } else if (!strcmp(token[0], "info")) { | |
670 if (codec->info || get_token(1, 1) < 0) | |
671 goto err_out_parse_error; | |
672 if (!(codec->info = strdup(token[0]))) { | |
673 mp_msg(MSGT_CODECCFG,MSGL_ERR,MSGTR_CantStrdupInfo, strerror(errno)); | |
674 goto err_out; | |
675 } | |
676 } else if (!strcmp(token[0], "comment")) { | |
677 if (get_token(1, 1) < 0) | |
678 goto err_out_parse_error; | |
679 add_comment(token[0], &codec->comment); | |
680 } else if (!strcmp(token[0], "fourcc")) { | |
681 if (get_token(1, 2) < 0) | |
682 goto err_out_parse_error; | |
683 if (!add_to_fourcc(token[0], token[1], | |
684 codec->fourcc, | |
685 codec->fourccmap)) | |
686 goto err_out_print_linenum; | |
687 } else if (!strcmp(token[0], "format")) { | |
688 if (get_token(1, 2) < 0) | |
689 goto err_out_parse_error; | |
690 if (!add_to_format(token[0], token[1], | |
691 codec->fourcc,codec->fourccmap)) | |
692 goto err_out_print_linenum; | |
693 } else if (!strcmp(token[0], "driver")) { | |
694 if (get_token(1, 1) < 0) | |
695 goto err_out_parse_error; | |
696 if (!(codec->drv = strdup(token[0]))) { | |
697 mp_msg(MSGT_CODECCFG,MSGL_ERR,MSGTR_CantStrdupDriver, strerror(errno)); | |
698 goto err_out; | |
699 } | |
700 } else if (!strcmp(token[0], "dll")) { | |
701 if (get_token(1, 1) < 0) | |
702 goto err_out_parse_error; | |
703 if (!(codec->dll = strdup(token[0]))) { | |
704 mp_msg(MSGT_CODECCFG,MSGL_ERR,MSGTR_CantStrdupDLL, strerror(errno)); | |
705 goto err_out; | |
706 } | |
707 } else if (!strcmp(token[0], "guid")) { | |
708 if (get_token(11, 11) < 0) | |
709 goto err_out_parse_error; | |
710 codec->guid.f1=strtoul(token[0],&endptr,0); | |
711 if ((*endptr != ',' || *(endptr + 1) != '\0') && | |
712 *endptr != '\0') | |
713 goto err_out_parse_error; | |
714 codec->guid.f2=strtoul(token[1],&endptr,0); | |
715 if ((*endptr != ',' || *(endptr + 1) != '\0') && | |
716 *endptr != '\0') | |
717 goto err_out_parse_error; | |
718 codec->guid.f3=strtoul(token[2],&endptr,0); | |
719 if ((*endptr != ',' || *(endptr + 1) != '\0') && | |
720 *endptr != '\0') | |
721 goto err_out_parse_error; | |
722 for (i = 0; i < 8; i++) { | |
723 codec->guid.f4[i]=strtoul(token[i + 3],&endptr,0); | |
724 if ((*endptr != ',' || *(endptr + 1) != '\0') && | |
725 *endptr != '\0') | |
726 goto err_out_parse_error; | |
727 } | |
728 } else if (!strcmp(token[0], "out")) { | |
729 if (get_token(1, 2) < 0) | |
730 goto err_out_parse_error; | |
731 if (!add_to_inout(token[0], token[1], codec->outfmt, | |
732 codec->outflags)) | |
733 goto err_out_print_linenum; | |
734 } else if (!strcmp(token[0], "in")) { | |
735 if (get_token(1, 2) < 0) | |
736 goto err_out_parse_error; | |
737 if (!add_to_inout(token[0], token[1], codec->infmt, | |
738 codec->inflags)) | |
739 goto err_out_print_linenum; | |
740 } else if (!strcmp(token[0], "flags")) { | |
741 if (get_token(1, 1) < 0) | |
742 goto err_out_parse_error; | |
743 if (!strcmp(token[0], "seekable")) | |
744 codec->flags |= CODECS_FLAG_SEEKABLE; | |
745 else | |
746 if (!strcmp(token[0], "align16")) | |
747 codec->flags |= CODECS_FLAG_ALIGN16; | |
748 else | |
749 goto err_out_parse_error; | |
750 } else if (!strcmp(token[0], "status")) { | |
751 if (get_token(1, 1) < 0) | |
752 goto err_out_parse_error; | |
753 if (!strcasecmp(token[0], "working")) | |
754 codec->status = CODECS_STATUS_WORKING; | |
755 else if (!strcasecmp(token[0], "crashing")) | |
756 codec->status = CODECS_STATUS_NOT_WORKING; | |
757 else if (!strcasecmp(token[0], "untested")) | |
758 codec->status = CODECS_STATUS_UNTESTED; | |
759 else if (!strcasecmp(token[0], "buggy")) | |
760 codec->status = CODECS_STATUS_PROBLEMS; | |
761 else | |
762 goto err_out_parse_error; | |
763 } else if (!strcmp(token[0], "cpuflags")) { | |
764 if (get_token(1, 1) < 0) | |
765 goto err_out_parse_error; | |
766 if (!(codec->cpuflags = get_cpuflags(token[0]))) | |
767 goto err_out_parse_error; | |
768 } else | |
769 goto err_out_parse_error; | |
770 } | |
771 if (!validate_codec(codec, codec_type)) | |
772 goto err_out_not_valid; | |
773 mp_msg(MSGT_CODECCFG,MSGL_INFO,MSGTR_AudioVideoCodecTotals, nr_acodecs, nr_vcodecs); | |
774 if(video_codecs) video_codecs[nr_vcodecs].name = NULL; | |
775 if(audio_codecs) audio_codecs[nr_acodecs].name = NULL; | |
297 | 776 out: |
31077 | 777 free(line); |
778 line=NULL; | |
779 fclose(fp); | |
780 return 1; | |
3798
d1e3ad5bcd8f
fixed few segfaults, make parse_codec_cfg() return int
iive
parents:
3787
diff
changeset
|
781 |
328 | 782 err_out_parse_error: |
31077 | 783 mp_msg(MSGT_CODECCFG,MSGL_ERR,MSGTR_ParseError); |
361 | 784 err_out_print_linenum: |
31077 | 785 PRINT_LINENUM; |
297 | 786 err_out: |
31077 | 787 codecs_uninit_free(); |
3798
d1e3ad5bcd8f
fixed few segfaults, make parse_codec_cfg() return int
iive
parents:
3787
diff
changeset
|
788 |
31077 | 789 free(line); |
790 line=NULL; | |
791 line_num = 0; | |
792 fclose(fp); | |
793 return 0; | |
328 | 794 err_out_not_valid: |
31077 | 795 mp_msg(MSGT_CODECCFG,MSGL_ERR,MSGTR_CodecDefinitionIncorrect); |
796 goto err_out_print_linenum; | |
6200
e604be87613d
codecs.conf versioning - patch by Joey Parrish <joey@yunamusic.com>
arpi
parents:
6103
diff
changeset
|
797 err_out_release_num: |
31077 | 798 mp_msg(MSGT_CODECCFG,MSGL_ERR,MSGTR_OutdatedCodecsConf); |
799 goto err_out_print_linenum; | |
297 | 800 } |
801 | |
13807
b014091b4417
Memory Free function Fix, based on patch by Wei Jiang <jiangw98@yahoo.com>
faust3
parents:
13619
diff
changeset
|
802 static void codecs_free(codecs_t* codecs,int count) { |
31077 | 803 int i; |
804 for ( i = 0; i < count; i++) | |
805 if ( codecs[i].name ) { | |
32511
b39155e98ac3
Remove some useless NULL pointer checks before invoking free() on the pointer.
diego
parents:
32394
diff
changeset
|
806 free(codecs[i].name); |
b39155e98ac3
Remove some useless NULL pointer checks before invoking free() on the pointer.
diego
parents:
32394
diff
changeset
|
807 free(codecs[i].info); |
b39155e98ac3
Remove some useless NULL pointer checks before invoking free() on the pointer.
diego
parents:
32394
diff
changeset
|
808 free(codecs[i].comment); |
b39155e98ac3
Remove some useless NULL pointer checks before invoking free() on the pointer.
diego
parents:
32394
diff
changeset
|
809 free(codecs[i].dll); |
b39155e98ac3
Remove some useless NULL pointer checks before invoking free() on the pointer.
diego
parents:
32394
diff
changeset
|
810 free(codecs[i].drv); |
31077 | 811 } |
32511
b39155e98ac3
Remove some useless NULL pointer checks before invoking free() on the pointer.
diego
parents:
32394
diff
changeset
|
812 free(codecs); |
13807
b014091b4417
Memory Free function Fix, based on patch by Wei Jiang <jiangw98@yahoo.com>
faust3
parents:
13619
diff
changeset
|
813 } |
b014091b4417
Memory Free function Fix, based on patch by Wei Jiang <jiangw98@yahoo.com>
faust3
parents:
13619
diff
changeset
|
814 |
17566
f580a7755ac5
Patch by Stefan Huehner / stefan % huehner ! org \
rathann
parents:
17120
diff
changeset
|
815 void codecs_uninit_free(void) { |
31077 | 816 if (video_codecs) |
817 codecs_free(video_codecs,nr_vcodecs); | |
818 video_codecs=NULL; | |
819 if (audio_codecs) | |
820 codecs_free(audio_codecs,nr_acodecs); | |
821 audio_codecs=NULL; | |
13807
b014091b4417
Memory Free function Fix, based on patch by Wei Jiang <jiangw98@yahoo.com>
faust3
parents:
13619
diff
changeset
|
822 } |
b014091b4417
Memory Free function Fix, based on patch by Wei Jiang <jiangw98@yahoo.com>
faust3
parents:
13619
diff
changeset
|
823 |
332 | 824 codecs_t *find_audio_codec(unsigned int fourcc, unsigned int *fourccmap, |
31077 | 825 codecs_t *start, int force) |
328 | 826 { |
31077 | 827 return find_codec(fourcc, fourccmap, start, 1, force); |
328 | 828 } |
829 | |
332 | 830 codecs_t *find_video_codec(unsigned int fourcc, unsigned int *fourccmap, |
31077 | 831 codecs_t *start, int force) |
328 | 832 { |
31077 | 833 return find_codec(fourcc, fourccmap, start, 0, force); |
328 | 834 } |
835 | |
332 | 836 codecs_t* find_codec(unsigned int fourcc,unsigned int *fourccmap, |
31077 | 837 codecs_t *start, int audioflag, int force) |
328 | 838 { |
31077 | 839 int i, j; |
840 codecs_t *c; | |
328 | 841 |
628 | 842 #if 0 |
31077 | 843 if (start) { |
844 for (/* NOTHING */; start->name; start++) { | |
845 for (j = 0; j < CODECS_MAX_FOURCC; j++) { | |
846 if (start->fourcc[j] == fourcc) { | |
847 if (fourccmap) | |
848 *fourccmap = start->fourccmap[j]; | |
849 return start; | |
850 } | |
851 } | |
852 } | |
853 } else | |
628 | 854 #endif |
31077 | 855 { |
856 if (audioflag) { | |
857 i = nr_acodecs; | |
858 c = audio_codecs; | |
859 } else { | |
860 i = nr_vcodecs; | |
861 c = video_codecs; | |
862 } | |
863 if(!i) return NULL; | |
864 for (/* NOTHING */; i--; c++) { | |
865 if(start && c<=start) continue; | |
866 for (j = 0; j < CODECS_MAX_FOURCC; j++) { | |
867 // FIXME: do NOT hardwire 'null' name here: | |
868 if (c->fourcc[j]==fourcc || !strcmp(c->drv,"null")) { | |
869 if (fourccmap) | |
870 *fourccmap = c->fourccmap[j]; | |
871 return c; | |
872 } | |
873 } | |
874 if (force) return c; | |
875 } | |
876 } | |
877 return NULL; | |
303 | 878 } |
879 | |
25661
293aeec83153
Replace the persistent CODECS_FLAG_SELECTED by a local "stringset" with
reimar
parents:
25247
diff
changeset
|
880 void stringset_init(stringset_t *set) { |
31077 | 881 *set = calloc(1, sizeof(char *)); |
25661
293aeec83153
Replace the persistent CODECS_FLAG_SELECTED by a local "stringset" with
reimar
parents:
25247
diff
changeset
|
882 } |
293aeec83153
Replace the persistent CODECS_FLAG_SELECTED by a local "stringset" with
reimar
parents:
25247
diff
changeset
|
883 |
293aeec83153
Replace the persistent CODECS_FLAG_SELECTED by a local "stringset" with
reimar
parents:
25247
diff
changeset
|
884 void stringset_free(stringset_t *set) { |
31077 | 885 int count = 0; |
886 while ((*set)[count]) free((*set)[count++]); | |
887 free(*set); | |
888 *set = NULL; | |
7505 | 889 } |
890 | |
25661
293aeec83153
Replace the persistent CODECS_FLAG_SELECTED by a local "stringset" with
reimar
parents:
25247
diff
changeset
|
891 void stringset_add(stringset_t *set, const char *str) { |
31077 | 892 int count = 0; |
893 while ((*set)[count]) count++; | |
894 count++; | |
895 *set = realloc(*set, sizeof(char *) * (count + 1)); | |
896 (*set)[count - 1] = strdup(str); | |
897 (*set)[count] = NULL; | |
25661
293aeec83153
Replace the persistent CODECS_FLAG_SELECTED by a local "stringset" with
reimar
parents:
25247
diff
changeset
|
898 } |
293aeec83153
Replace the persistent CODECS_FLAG_SELECTED by a local "stringset" with
reimar
parents:
25247
diff
changeset
|
899 |
293aeec83153
Replace the persistent CODECS_FLAG_SELECTED by a local "stringset" with
reimar
parents:
25247
diff
changeset
|
900 int stringset_test(stringset_t *set, const char *str) { |
31077 | 901 stringset_t s; |
902 for (s = *set; *s; s++) | |
903 if (strcmp(*s, str) == 0) | |
904 return 1; | |
905 return 0; | |
5325
9c326f199060
tagging selected codec to avoid trying the same codec several times
arpi
parents:
5284
diff
changeset
|
906 } |
9c326f199060
tagging selected codec to avoid trying the same codec several times
arpi
parents:
5284
diff
changeset
|
907 |
1983 | 908 void list_codecs(int audioflag){ |
31077 | 909 int i; |
910 codecs_t *c; | |
1983 | 911 |
31077 | 912 if (audioflag) { |
913 i = nr_acodecs; | |
914 c = audio_codecs; | |
915 mp_msg(MSGT_CODECCFG,MSGL_INFO,"ac: afm: status: info: [lib/dll]\n"); | |
916 } else { | |
917 i = nr_vcodecs; | |
918 c = video_codecs; | |
919 mp_msg(MSGT_CODECCFG,MSGL_INFO,"vc: vfm: status: info: [lib/dll]\n"); | |
920 } | |
921 if(!i) return; | |
922 for (/* NOTHING */; i--; c++) { | |
923 char* s="unknown "; | |
924 switch(c->status){ | |
925 case CODECS_STATUS_WORKING: s="working ";break; | |
926 case CODECS_STATUS_PROBLEMS: s="problems";break; | |
927 case CODECS_STATUS_NOT_WORKING: s="crashing";break; | |
928 case CODECS_STATUS_UNTESTED: s="untested";break; | |
929 } | |
930 if(c->dll) | |
931 mp_msg(MSGT_CODECCFG,MSGL_INFO,"%-11s %-9s %s %s [%s]\n",c->name,c->drv,s,c->info,c->dll); | |
932 else | |
933 mp_msg(MSGT_CODECCFG,MSGL_INFO,"%-11s %-9s %s %s\n",c->name,c->drv,s,c->info); | |
934 } | |
1983 | 935 } |
936 | |
937 | |
607 | 938 #ifdef CODECS2HTML |
31408 | 939 static void wrapline(FILE *f2,char *s){ |
607 | 940 int c; |
941 if(!s){ | |
942 fprintf(f2,"-"); | |
943 return; | |
944 } | |
945 while((c=*s++)){ | |
946 if(c==',') fprintf(f2,"<br>"); else fputc(c,f2); | |
947 } | |
948 } | |
949 | |
31409 | 950 static void parsehtml(FILE *f1,FILE *f2,codecs_t *codec){ |
31077 | 951 int c,d; |
952 while((c=fgetc(f1))>=0){ | |
953 if(c!='%'){ | |
954 fputc(c,f2); | |
955 continue; | |
956 } | |
957 d=fgetc(f1); | |
29263
0f1b5b68af32
whitespace cosmetics: Remove all trailing whitespace.
diego
parents:
29115
diff
changeset
|
958 |
31077 | 959 switch(d){ |
960 case '.': | |
961 return; // end of section | |
962 case 'n': | |
963 wrapline(f2,codec->name); break; | |
964 case 'i': | |
965 wrapline(f2,codec->info); break; | |
966 case 'c': | |
967 wrapline(f2,codec->comment); break; | |
968 case 'd': | |
969 wrapline(f2,codec->dll); break; | |
970 case 'D': | |
971 fprintf(f2,"%c",!strcmp(codec->drv,"dshow")?'+':'-'); break; | |
972 case 'F': | |
973 for(d=0;d<CODECS_MAX_FOURCC;d++) | |
974 if(!d || codec->fourcc[d]!=0xFFFFFFFF) | |
975 fprintf(f2,"%s%.4s",d?"<br>":"",(codec->fourcc[d]==0xFFFFFFFF || codec->fourcc[d]<0x20202020)?!d?"-":"":(char*) &codec->fourcc[d]); | |
976 break; | |
977 case 'f': | |
978 for(d=0;d<CODECS_MAX_FOURCC;d++) | |
979 if(codec->fourcc[d]!=0xFFFFFFFF) | |
980 fprintf(f2,"%s0x%X",d?"<br>":"",codec->fourcc[d]); | |
981 break; | |
982 case 'Y': | |
983 for(d=0;d<CODECS_MAX_OUTFMT;d++) | |
984 if(codec->outfmt[d]!=0xFFFFFFFF){ | |
985 for (c=0; fmt_table[c].name; c++) | |
986 if(fmt_table[c].num==codec->outfmt[d]) break; | |
987 if(fmt_table[c].name) | |
988 fprintf(f2,"%s%s",d?"<br>":"",fmt_table[c].name); | |
989 } | |
990 break; | |
991 default: | |
992 fputc(c,f2); | |
993 fputc(d,f2); | |
607 | 994 } |
31077 | 995 } |
607 | 996 } |
997 | |
998 void skiphtml(FILE *f1){ | |
31077 | 999 int c,d; |
1000 while((c=fgetc(f1))>=0){ | |
1001 if(c!='%'){ | |
1002 continue; | |
607 | 1003 } |
31077 | 1004 d=fgetc(f1); |
1005 if(d=='.') return; // end of section | |
1006 } | |
607 | 1007 } |
1008 | |
29115
1e78a310487e
Change type of first argument of the print_int_array function from int to
diego
parents:
28747
diff
changeset
|
1009 static void print_int_array(const unsigned int* a, int size) |
8467
3ca9cc46df5c
Fallback to builtin (generated from etc/codecs.conf at compile time)
arpi
parents:
8211
diff
changeset
|
1010 { |
31077 | 1011 printf("{ "); |
1012 while (size--) | |
1013 if(abs(*a)<256) | |
1014 printf("%d%s", *a++, size?", ":""); | |
1015 else | |
1016 printf("0x%X%s", *a++, size?", ":""); | |
1017 printf(" }"); | |
8467
3ca9cc46df5c
Fallback to builtin (generated from etc/codecs.conf at compile time)
arpi
parents:
8211
diff
changeset
|
1018 } |
3ca9cc46df5c
Fallback to builtin (generated from etc/codecs.conf at compile time)
arpi
parents:
8211
diff
changeset
|
1019 |
3ca9cc46df5c
Fallback to builtin (generated from etc/codecs.conf at compile time)
arpi
parents:
8211
diff
changeset
|
1020 static void print_char_array(const unsigned char* a, int size) |
3ca9cc46df5c
Fallback to builtin (generated from etc/codecs.conf at compile time)
arpi
parents:
8211
diff
changeset
|
1021 { |
31077 | 1022 printf("{ "); |
1023 while (size--) | |
1024 if((*a)<10) | |
1025 printf("%d%s", *a++, size?", ":""); | |
1026 else | |
1027 printf("0x%02x%s", *a++, size?", ":""); | |
1028 printf(" }"); | |
8467
3ca9cc46df5c
Fallback to builtin (generated from etc/codecs.conf at compile time)
arpi
parents:
8211
diff
changeset
|
1029 } |
3ca9cc46df5c
Fallback to builtin (generated from etc/codecs.conf at compile time)
arpi
parents:
8211
diff
changeset
|
1030 |
3ca9cc46df5c
Fallback to builtin (generated from etc/codecs.conf at compile time)
arpi
parents:
8211
diff
changeset
|
1031 static void print_string(const char* s) |
3ca9cc46df5c
Fallback to builtin (generated from etc/codecs.conf at compile time)
arpi
parents:
8211
diff
changeset
|
1032 { |
31077 | 1033 if (!s) printf("NULL"); |
1034 else printf("\"%s\"", s); | |
8467
3ca9cc46df5c
Fallback to builtin (generated from etc/codecs.conf at compile time)
arpi
parents:
8211
diff
changeset
|
1035 } |
3ca9cc46df5c
Fallback to builtin (generated from etc/codecs.conf at compile time)
arpi
parents:
8211
diff
changeset
|
1036 |
3ca9cc46df5c
Fallback to builtin (generated from etc/codecs.conf at compile time)
arpi
parents:
8211
diff
changeset
|
1037 int main(int argc, char* argv[]) |
607 | 1038 { |
31077 | 1039 codecs_t *cl; |
1040 FILE *f1; | |
1041 FILE *f2; | |
1042 int c,d,i; | |
1043 int pos; | |
1044 int section=-1; | |
1045 int nr_codecs; | |
1046 int win32=-1; | |
1047 int dshow=-1; | |
1048 int win32ex=-1; | |
607 | 1049 |
31077 | 1050 /* |
1051 * Take path to codecs.conf from command line, or fall back on | |
1052 * etc/codecs.conf | |
1053 */ | |
1054 if (!(nr_codecs = parse_codec_cfg((argc>1)?argv[1]:"etc/codecs.conf"))) | |
1055 exit(1); | |
31406
0fd1b3f1fe69
Auto-update CODEC_CFG_MIN value to release value in etc/codecs.conf.
reimar
parents:
31159
diff
changeset
|
1056 if (codecs_conf_release < CODEC_CFG_MIN) |
0fd1b3f1fe69
Auto-update CODEC_CFG_MIN value to release value in etc/codecs.conf.
reimar
parents:
31159
diff
changeset
|
1057 exit(1); |
8467
3ca9cc46df5c
Fallback to builtin (generated from etc/codecs.conf at compile time)
arpi
parents:
8211
diff
changeset
|
1058 |
31077 | 1059 if (argc > 1) { |
1060 int i, j; | |
1061 const char* nm[2]; | |
1062 codecs_t* cod[2]; | |
1063 int nr[2]; | |
8467
3ca9cc46df5c
Fallback to builtin (generated from etc/codecs.conf at compile time)
arpi
parents:
8211
diff
changeset
|
1064 |
31077 | 1065 nm[0] = "builtin_video_codecs"; |
1066 cod[0] = video_codecs; | |
1067 nr[0] = nr_vcodecs; | |
29263
0f1b5b68af32
whitespace cosmetics: Remove all trailing whitespace.
diego
parents:
29115
diff
changeset
|
1068 |
31077 | 1069 nm[1] = "builtin_audio_codecs"; |
1070 cod[1] = audio_codecs; | |
1071 nr[1] = nr_acodecs; | |
29263
0f1b5b68af32
whitespace cosmetics: Remove all trailing whitespace.
diego
parents:
29115
diff
changeset
|
1072 |
31077 | 1073 printf("/* GENERATED FROM %s, DO NOT EDIT! */\n\n",argv[1]); |
31407 | 1074 printf("#include <stddef.h>\n"); |
1075 printf("#include \"codec-cfg.h\"\n\n"); | |
31406
0fd1b3f1fe69
Auto-update CODEC_CFG_MIN value to release value in etc/codecs.conf.
reimar
parents:
31159
diff
changeset
|
1076 printf("#define CODEC_CFG_MIN %i\n\n", codecs_conf_release); |
29263
0f1b5b68af32
whitespace cosmetics: Remove all trailing whitespace.
diego
parents:
29115
diff
changeset
|
1077 |
31077 | 1078 for (i=0; i<2; i++) { |
1079 printf("const codecs_t %s[] = {\n", nm[i]); | |
1080 for (j = 0; j < nr[i]; j++) { | |
1081 printf("{"); | |
8467
3ca9cc46df5c
Fallback to builtin (generated from etc/codecs.conf at compile time)
arpi
parents:
8211
diff
changeset
|
1082 |
31077 | 1083 print_int_array(cod[i][j].fourcc, CODECS_MAX_FOURCC); |
1084 printf(", /* fourcc */\n"); | |
29263
0f1b5b68af32
whitespace cosmetics: Remove all trailing whitespace.
diego
parents:
29115
diff
changeset
|
1085 |
31077 | 1086 print_int_array(cod[i][j].fourccmap, CODECS_MAX_FOURCC); |
1087 printf(", /* fourccmap */\n"); | |
29263
0f1b5b68af32
whitespace cosmetics: Remove all trailing whitespace.
diego
parents:
29115
diff
changeset
|
1088 |
31077 | 1089 print_int_array(cod[i][j].outfmt, CODECS_MAX_OUTFMT); |
1090 printf(", /* outfmt */\n"); | |
29263
0f1b5b68af32
whitespace cosmetics: Remove all trailing whitespace.
diego
parents:
29115
diff
changeset
|
1091 |
31077 | 1092 print_char_array(cod[i][j].outflags, CODECS_MAX_OUTFMT); |
1093 printf(", /* outflags */\n"); | |
29263
0f1b5b68af32
whitespace cosmetics: Remove all trailing whitespace.
diego
parents:
29115
diff
changeset
|
1094 |
31077 | 1095 print_int_array(cod[i][j].infmt, CODECS_MAX_INFMT); |
1096 printf(", /* infmt */\n"); | |
29263
0f1b5b68af32
whitespace cosmetics: Remove all trailing whitespace.
diego
parents:
29115
diff
changeset
|
1097 |
31077 | 1098 print_char_array(cod[i][j].inflags, CODECS_MAX_INFMT); |
1099 printf(", /* inflags */\n"); | |
29263
0f1b5b68af32
whitespace cosmetics: Remove all trailing whitespace.
diego
parents:
29115
diff
changeset
|
1100 |
31077 | 1101 print_string(cod[i][j].name); printf(", /* name */\n"); |
1102 print_string(cod[i][j].info); printf(", /* info */\n"); | |
1103 print_string(cod[i][j].comment); printf(", /* comment */\n"); | |
1104 print_string(cod[i][j].dll); printf(", /* dll */\n"); | |
1105 print_string(cod[i][j].drv); printf(", /* drv */\n"); | |
29263
0f1b5b68af32
whitespace cosmetics: Remove all trailing whitespace.
diego
parents:
29115
diff
changeset
|
1106 |
31077 | 1107 printf("{ 0x%08lx, %hu, %hu,", |
1108 cod[i][j].guid.f1, | |
1109 cod[i][j].guid.f2, | |
1110 cod[i][j].guid.f3); | |
1111 print_char_array(cod[i][j].guid.f4, sizeof(cod[i][j].guid.f4)); | |
1112 printf(" }, /* GUID */\n"); | |
1113 printf("%hd /* flags */, %hd /* status */, %hd /* cpuflags */ }\n", | |
1114 cod[i][j].flags, | |
1115 cod[i][j].status, | |
1116 cod[i][j].cpuflags); | |
1117 if (j < nr[i]) printf(",\n"); | |
607 | 1118 } |
31077 | 1119 printf("};\n\n"); |
1120 } | |
1121 exit(0); | |
1122 } | |
1123 | |
1124 f1=fopen("DOCS/tech/codecs-in.html","rb"); if(!f1) exit(1); | |
1125 f2=fopen("DOCS/codecs-status.html","wb"); if(!f2) exit(1); | |
1126 | |
1127 while((c=fgetc(f1))>=0){ | |
1128 if(c!='%'){ | |
1129 fputc(c,f2); | |
1130 continue; | |
1131 } | |
1132 d=fgetc(f1); | |
1133 if(d>='0' && d<='9'){ | |
1134 // begin section | |
1135 section=d-'0'; | |
1136 //printf("BEGIN %d\n",section); | |
1137 if(section>=5){ | |
1138 // audio | |
1139 cl = audio_codecs; | |
1140 nr_codecs = nr_acodecs; | |
1141 dshow=7;win32=4; | |
1142 } else { | |
1143 // video | |
1144 cl = video_codecs; | |
1145 nr_codecs = nr_vcodecs; | |
1146 dshow=4;win32=2;win32ex=6; | |
1147 } | |
1148 pos=ftell(f1); | |
1149 for(i=0;i<nr_codecs;i++){ | |
1150 fseek(f1,pos,SEEK_SET); | |
1151 switch(section){ | |
1152 case 0: | |
1153 case 5: | |
1154 if(cl[i].status==CODECS_STATUS_WORKING) | |
1155 // if(!(!strcmp(cl[i].drv,"vfw") || !strcmp(cl[i].drv,"dshow") || !strcmp(cl[i].drv,"vfwex") || !strcmp(cl[i].drv,"acm"))) | |
31409 | 1156 parsehtml(f1,f2,&cl[i]); |
31077 | 1157 break; |
8211 | 1158 #if 0 |
31077 | 1159 case 1: |
1160 case 6: | |
1161 if(cl[i].status==CODECS_STATUS_WORKING) | |
1162 if((!strcmp(cl[i].drv,"vfw") || !strcmp(cl[i].drv,"dshow") || !strcmp(cl[i].drv,"vfwex") || !strcmp(cl[i].drv,"acm"))) | |
31409 | 1163 parsehtml(f1,f2,&cl[i]); |
31077 | 1164 break; |
1165 #endif | |
1166 case 2: | |
1167 case 7: | |
1168 if(cl[i].status==CODECS_STATUS_PROBLEMS) | |
31409 | 1169 parsehtml(f1,f2,&cl[i]); |
31077 | 1170 break; |
1171 case 3: | |
1172 case 8: | |
1173 if(cl[i].status==CODECS_STATUS_NOT_WORKING) | |
31409 | 1174 parsehtml(f1,f2,&cl[i]); |
31077 | 1175 break; |
1176 case 4: | |
1177 case 9: | |
1178 if(cl[i].status==CODECS_STATUS_UNTESTED) | |
31409 | 1179 parsehtml(f1,f2,&cl[i]); |
31077 | 1180 break; |
1181 default: | |
1182 printf("Warning! unimplemented section: %d\n",section); | |
607 | 1183 } |
31077 | 1184 } |
1185 fseek(f1,pos,SEEK_SET); | |
1186 skiphtml(f1); | |
29263
0f1b5b68af32
whitespace cosmetics: Remove all trailing whitespace.
diego
parents:
29115
diff
changeset
|
1187 |
31077 | 1188 continue; |
607 | 1189 } |
31077 | 1190 fputc(c,f2); |
1191 fputc(d,f2); | |
1192 } | |
29263
0f1b5b68af32
whitespace cosmetics: Remove all trailing whitespace.
diego
parents:
29115
diff
changeset
|
1193 |
31077 | 1194 fclose(f2); |
1195 fclose(f1); | |
1196 return 0; | |
607 | 1197 } |
1198 | |
1199 #endif | |
1200 | |
297 | 1201 #ifdef TESTING |
1202 int main(void) | |
1203 { | |
31077 | 1204 codecs_t *c; |
1205 int i,j, nr_codecs, state; | |
297 | 1206 |
31077 | 1207 if (!(parse_codec_cfg("etc/codecs.conf"))) |
1208 return 0; | |
1209 if (!video_codecs) | |
1210 printf("no videoconfig.\n"); | |
1211 if (!audio_codecs) | |
1212 printf("no audioconfig.\n"); | |
328 | 1213 |
31077 | 1214 printf("videocodecs:\n"); |
1215 c = video_codecs; | |
1216 nr_codecs = nr_vcodecs; | |
1217 state = 0; | |
328 | 1218 next: |
31077 | 1219 if (c) { |
1220 printf("number of %scodecs: %d\n", state==0?"video":"audio", | |
1221 nr_codecs); | |
1222 for(i=0;i<nr_codecs;i++, c++){ | |
1223 printf("\n============== %scodec %02d ===============\n", | |
1224 state==0?"video":"audio",i); | |
1225 printf("name='%s'\n",c->name); | |
1226 printf("info='%s'\n",c->info); | |
1227 printf("comment='%s'\n",c->comment); | |
1228 printf("dll='%s'\n",c->dll); | |
1229 /* printf("flags=%X driver=%d status=%d cpuflags=%d\n", | |
1230 c->flags, c->driver, c->status, c->cpuflags); */ | |
1231 printf("flags=%X status=%d cpuflags=%d\n", | |
1232 c->flags, c->status, c->cpuflags); | |
300 | 1233 |
31077 | 1234 for(j=0;j<CODECS_MAX_FOURCC;j++){ |
1235 if(c->fourcc[j]!=0xFFFFFFFF){ | |
1236 printf("fourcc %02d: %08X (%.4s) ===> %08X (%.4s)\n",j,c->fourcc[j],(char *) &c->fourcc[j],c->fourccmap[j],(char *) &c->fourccmap[j]); | |
1237 } | |
1238 } | |
328 | 1239 |
31077 | 1240 for(j=0;j<CODECS_MAX_OUTFMT;j++){ |
1241 if(c->outfmt[j]!=0xFFFFFFFF){ | |
1242 printf("outfmt %02d: %08X (%.4s) flags: %d\n",j,c->outfmt[j],(char *) &c->outfmt[j],c->outflags[j]); | |
1243 } | |
1244 } | |
300 | 1245 |
31077 | 1246 for(j=0;j<CODECS_MAX_INFMT;j++){ |
1247 if(c->infmt[j]!=0xFFFFFFFF){ | |
1248 printf("infmt %02d: %08X (%.4s) flags: %d\n",j,c->infmt[j],(char *) &c->infmt[j],c->inflags[j]); | |
1249 } | |
1250 } | |
4676 | 1251 |
31077 | 1252 printf("GUID: %08lX %04X %04X",c->guid.f1,c->guid.f2,c->guid.f3); |
1253 for(j=0;j<8;j++) printf(" %02X",c->guid.f4[j]); | |
1254 printf("\n"); | |
300 | 1255 |
29263
0f1b5b68af32
whitespace cosmetics: Remove all trailing whitespace.
diego
parents:
29115
diff
changeset
|
1256 |
31077 | 1257 } |
1258 } | |
1259 if (!state) { | |
1260 printf("audiocodecs:\n"); | |
1261 c = audio_codecs; | |
1262 nr_codecs = nr_acodecs; | |
1263 state = 1; | |
1264 goto next; | |
1265 } | |
1266 return 0; | |
297 | 1267 } |
1268 | |
1269 #endif |