2001-04-09 20:21:07 +00:00
|
|
|
/*
|
|
|
|
* codec.conf parser
|
2002-02-12 17:52:30 +00:00
|
|
|
*
|
2007-03-12 08:52:45 +00:00
|
|
|
* to compile test application:
|
|
|
|
* cc -I. -DTESTING -o codec-cfg-test codec-cfg.c mp_msg.o osdep/getch2.o -ltermcap
|
2005-04-30 16:09:44 +00:00
|
|
|
* to compile CODECS2HTML:
|
2006-03-07 15:40:49 +00:00
|
|
|
* gcc -DCODECS2HTML -o codecs2html codec-cfg.c mp_msg.o
|
2002-02-12 17:52:30 +00:00
|
|
|
*
|
|
|
|
* TODO: implement informat in CODECS2HTML too
|
2010-01-30 23:24:23 +00:00
|
|
|
*
|
|
|
|
* Copyright (C) 2001 Szabolcs Berecz <szabi@inf.elte.hu>
|
|
|
|
*
|
|
|
|
* This file is part of MPlayer.
|
|
|
|
*
|
|
|
|
* MPlayer is free software; you can redistribute it and/or modify
|
|
|
|
* it under the terms of the GNU General Public License as published by
|
|
|
|
* the Free Software Foundation; either version 2 of the License, or
|
|
|
|
* (at your option) any later version.
|
|
|
|
*
|
|
|
|
* MPlayer is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU General Public License along
|
|
|
|
* with MPlayer; if not, write to the Free Software Foundation, Inc.,
|
|
|
|
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
2001-04-09 20:21:07 +00:00
|
|
|
*/
|
2001-04-07 21:27:57 +00:00
|
|
|
|
2001-04-09 20:21:07 +00:00
|
|
|
#define DEBUG
|
2001-04-07 21:27:57 +00:00
|
|
|
|
2001-12-27 18:38:10 +00:00
|
|
|
//disable asserts
|
2009-07-06 23:26:13 +00:00
|
|
|
#define NDEBUG
|
2001-12-27 18:38:10 +00:00
|
|
|
|
2001-04-06 23:20:46 +00:00
|
|
|
#include <stdio.h>
|
|
|
|
#include <stdlib.h>
|
|
|
|
#include <fcntl.h>
|
|
|
|
#include <unistd.h>
|
|
|
|
#include <errno.h>
|
|
|
|
#include <ctype.h>
|
|
|
|
#include <assert.h>
|
|
|
|
#include <string.h>
|
2008-12-02 18:41:47 +00:00
|
|
|
#include <stdint.h>
|
2001-04-06 23:20:46 +00:00
|
|
|
|
2002-03-23 18:59:36 +00:00
|
|
|
#include "config.h"
|
2002-05-02 11:00:16 +00:00
|
|
|
#include "mp_msg.h"
|
2006-03-12 23:06:09 +00:00
|
|
|
#ifdef CODECS2HTML
|
2009-07-06 16:54:38 +00:00
|
|
|
#define mp_tmsg mp_msg
|
2006-03-12 23:06:09 +00:00
|
|
|
#ifdef __GNUC__
|
|
|
|
#define mp_msg(t, l, m, args...) fprintf(stderr, m, ##args)
|
|
|
|
#else
|
2007-07-30 13:06:26 +00:00
|
|
|
#define mp_msg(t, l, ...) fprintf(stderr, __VA_ARGS__)
|
2006-03-12 23:06:09 +00:00
|
|
|
#endif
|
|
|
|
#endif
|
2002-03-23 18:59:36 +00:00
|
|
|
|
2004-10-12 11:29:21 +00:00
|
|
|
|
2005-04-30 16:15:07 +00:00
|
|
|
#include "libmpcodecs/img_format.h"
|
2001-04-06 23:20:46 +00:00
|
|
|
#include "codec-cfg.h"
|
|
|
|
|
2010-06-19 18:31:35 +00:00
|
|
|
#ifdef CODECS2HTML
|
|
|
|
#define CODEC_CFG_MIN 20100000
|
|
|
|
#else
|
2002-12-15 23:45:19 +00:00
|
|
|
#include "codecs.conf.h"
|
|
|
|
#endif
|
|
|
|
|
2008-12-02 18:41:47 +00:00
|
|
|
#define mmioFOURCC( ch0, ch1, ch2, ch3 ) \
|
|
|
|
( (uint32_t)(uint8_t)(ch0) | ( (uint32_t)(uint8_t)(ch1) << 8 ) | \
|
|
|
|
( (uint32_t)(uint8_t)(ch2) << 16 ) | ( (uint32_t)(uint8_t)(ch3) << 24 ) )
|
|
|
|
|
2002-05-02 11:00:16 +00:00
|
|
|
#define PRINT_LINENUM mp_msg(MSGT_CODECCFG,MSGL_ERR," at line %d\n", line_num)
|
2001-04-06 23:20:46 +00:00
|
|
|
|
2010-05-03 23:34:38 +00:00
|
|
|
#define MAX_NR_TOKEN 16
|
2001-04-06 23:20:46 +00:00
|
|
|
|
2010-05-03 23:34:38 +00:00
|
|
|
#define MAX_LINE_LEN 1000
|
2001-04-06 23:20:46 +00:00
|
|
|
|
2010-05-03 23:34:38 +00:00
|
|
|
#define RET_EOF -1
|
|
|
|
#define RET_EOL -2
|
2001-04-06 23:20:46 +00:00
|
|
|
|
2010-05-03 23:34:38 +00:00
|
|
|
#define TYPE_VIDEO 0
|
|
|
|
#define TYPE_AUDIO 1
|
2001-04-06 23:20:46 +00:00
|
|
|
|
2010-06-19 18:31:35 +00:00
|
|
|
static int codecs_conf_release;
|
2004-01-08 18:02:31 +00:00
|
|
|
char * codecs_file = NULL;
|
|
|
|
|
2001-04-07 21:27:57 +00:00
|
|
|
static int add_to_fourcc(char *s, char *alias, unsigned int *fourcc,
|
2010-05-03 23:34:38 +00:00
|
|
|
unsigned int *map)
|
2001-04-06 23:20:46 +00:00
|
|
|
{
|
2010-05-03 23:34:38 +00:00
|
|
|
int i, j, freeslots;
|
|
|
|
unsigned int tmp;
|
|
|
|
|
|
|
|
/* find first unused slot */
|
|
|
|
for (i = 0; i < CODECS_MAX_FOURCC && fourcc[i] != 0xffffffff; i++)
|
|
|
|
/* NOTHING */;
|
|
|
|
freeslots = CODECS_MAX_FOURCC - i;
|
|
|
|
if (!freeslots)
|
|
|
|
goto err_out_too_many;
|
|
|
|
|
|
|
|
do {
|
2011-07-07 04:38:24 +00:00
|
|
|
tmp = mmioFOURCC(s[0], s[1], s[2], s[3]);
|
2010-05-03 23:34:38 +00:00
|
|
|
for (j = 0; j < i; j++)
|
|
|
|
if (tmp == fourcc[j])
|
|
|
|
goto err_out_duplicated;
|
|
|
|
fourcc[i] = tmp;
|
2011-07-07 04:38:24 +00:00
|
|
|
map[i] = alias ? mmioFOURCC(alias[0], alias[1], alias[2], alias[3]) : tmp;
|
2010-05-03 23:34:38 +00:00
|
|
|
s += 4;
|
|
|
|
i++;
|
|
|
|
} while ((*(s++) == ',') && --freeslots);
|
|
|
|
|
|
|
|
if (!freeslots)
|
|
|
|
goto err_out_too_many;
|
|
|
|
if (*(--s) != '\0')
|
|
|
|
goto err_out_parse_error;
|
|
|
|
return 1;
|
2001-04-10 20:09:23 +00:00
|
|
|
err_out_duplicated:
|
2010-05-07 19:02:47 +00:00
|
|
|
mp_tmsg(MSGT_CODECCFG,MSGL_ERR,"duplicated FourCC");
|
2010-05-03 23:34:38 +00:00
|
|
|
return 0;
|
2001-04-10 20:09:23 +00:00
|
|
|
err_out_too_many:
|
2010-05-07 19:02:47 +00:00
|
|
|
mp_tmsg(MSGT_CODECCFG,MSGL_ERR,"too many FourCCs/formats...");
|
2010-05-03 23:34:38 +00:00
|
|
|
return 0;
|
2001-04-11 20:55:14 +00:00
|
|
|
err_out_parse_error:
|
2010-05-07 19:02:47 +00:00
|
|
|
mp_tmsg(MSGT_CODECCFG,MSGL_ERR,"parse error");
|
2010-05-03 23:34:38 +00:00
|
|
|
return 0;
|
2001-04-06 23:20:46 +00:00
|
|
|
}
|
|
|
|
|
2002-10-17 00:20:44 +00:00
|
|
|
static int add_to_format(char *s, char *alias,unsigned int *fourcc, unsigned int *fourccmap)
|
2001-04-06 23:20:46 +00:00
|
|
|
{
|
2010-05-03 23:34:38 +00:00
|
|
|
int i, j;
|
|
|
|
char *endptr;
|
|
|
|
|
|
|
|
/* find first unused slot */
|
|
|
|
for (i = 0; i < CODECS_MAX_FOURCC && fourcc[i] != 0xffffffff; i++)
|
|
|
|
/* NOTHING */;
|
|
|
|
if (i == CODECS_MAX_FOURCC) {
|
2010-05-07 19:02:47 +00:00
|
|
|
mp_tmsg(MSGT_CODECCFG,MSGL_ERR,"too many FourCCs/formats...");
|
2010-05-03 23:34:38 +00:00
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
fourcc[i]=strtoul(s,&endptr,0);
|
|
|
|
if (*endptr != '\0') {
|
2010-05-07 19:02:47 +00:00
|
|
|
mp_tmsg(MSGT_CODECCFG,MSGL_ERR,"parse error (format ID not a number?)");
|
2010-05-03 23:34:38 +00:00
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
if(alias){
|
|
|
|
fourccmap[i]=strtoul(alias,&endptr,0);
|
|
|
|
if (*endptr != '\0') {
|
2010-05-07 19:02:47 +00:00
|
|
|
mp_tmsg(MSGT_CODECCFG,MSGL_ERR,"parse error (format ID alias not a number?)");
|
2010-05-03 23:34:38 +00:00
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
} else
|
|
|
|
fourccmap[i]=fourcc[i];
|
|
|
|
|
|
|
|
for (j = 0; j < i; j++)
|
|
|
|
if (fourcc[j] == fourcc[i]) {
|
2010-05-07 19:02:47 +00:00
|
|
|
mp_tmsg(MSGT_CODECCFG,MSGL_ERR,"duplicated format ID");
|
2010-05-03 23:34:38 +00:00
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
return 1;
|
2001-04-06 23:20:46 +00:00
|
|
|
}
|
2001-04-07 00:51:38 +00:00
|
|
|
|
2010-05-07 19:02:47 +00:00
|
|
|
static const struct {
|
|
|
|
const char *name;
|
|
|
|
const unsigned int num;
|
|
|
|
} fmt_table[] = {
|
|
|
|
// note: due to parser deficiencies/simplicity, if one format
|
|
|
|
// name matches the beginning of another, the longer one _must_
|
|
|
|
// come first in this list.
|
|
|
|
{"YV12", IMGFMT_YV12},
|
|
|
|
{"I420", IMGFMT_I420},
|
|
|
|
{"IYUV", IMGFMT_IYUV},
|
|
|
|
{"NV12", IMGFMT_NV12},
|
|
|
|
{"NV21", IMGFMT_NV21},
|
|
|
|
{"YVU9", IMGFMT_YVU9},
|
|
|
|
{"IF09", IMGFMT_IF09},
|
|
|
|
{"444P16LE", IMGFMT_444P16_LE},
|
|
|
|
{"444P16BE", IMGFMT_444P16_BE},
|
|
|
|
{"422P16LE", IMGFMT_422P16_LE},
|
|
|
|
{"422P16BE", IMGFMT_422P16_BE},
|
|
|
|
{"420P16LE", IMGFMT_420P16_LE},
|
|
|
|
{"420P16BE", IMGFMT_420P16_BE},
|
|
|
|
{"444P16", IMGFMT_444P16},
|
2011-06-25 22:22:53 +00:00
|
|
|
{"444P10", IMGFMT_444P10},
|
|
|
|
{"444P9", IMGFMT_444P9},
|
2010-05-07 19:02:47 +00:00
|
|
|
{"422P16", IMGFMT_422P16},
|
2011-06-25 22:22:53 +00:00
|
|
|
{"422P10", IMGFMT_422P10},
|
2010-05-07 19:02:47 +00:00
|
|
|
{"420P16", IMGFMT_420P16},
|
2011-06-25 22:22:53 +00:00
|
|
|
{"420P10", IMGFMT_420P10},
|
|
|
|
{"420P9", IMGFMT_420P9},
|
2010-05-07 19:02:47 +00:00
|
|
|
{"420A", IMGFMT_420A},
|
|
|
|
{"444P", IMGFMT_444P},
|
|
|
|
{"422P", IMGFMT_422P},
|
|
|
|
{"411P", IMGFMT_411P},
|
|
|
|
{"440P", IMGFMT_440P},
|
|
|
|
{"Y800", IMGFMT_Y800},
|
|
|
|
{"Y8", IMGFMT_Y8},
|
|
|
|
|
|
|
|
{"YUY2", IMGFMT_YUY2},
|
|
|
|
{"UYVY", IMGFMT_UYVY},
|
|
|
|
{"YVYU", IMGFMT_YVYU},
|
|
|
|
|
|
|
|
{"RGB48LE", IMGFMT_RGB48LE},
|
|
|
|
{"RGB48BE", IMGFMT_RGB48BE},
|
|
|
|
{"RGB4", IMGFMT_RGB4},
|
|
|
|
{"RGB8", IMGFMT_RGB8},
|
|
|
|
{"RGB15", IMGFMT_RGB15},
|
|
|
|
{"RGB16", IMGFMT_RGB16},
|
|
|
|
{"RGB24", IMGFMT_RGB24},
|
|
|
|
{"RGB32", IMGFMT_RGB32},
|
|
|
|
{"BGR4", IMGFMT_BGR4},
|
|
|
|
{"BGR8", IMGFMT_BGR8},
|
|
|
|
{"BGR15", IMGFMT_BGR15},
|
|
|
|
{"BGR16", IMGFMT_BGR16},
|
|
|
|
{"BGR24", IMGFMT_BGR24},
|
|
|
|
{"BGR32", IMGFMT_BGR32},
|
|
|
|
{"RGB1", IMGFMT_RGB1},
|
|
|
|
{"BGR1", IMGFMT_BGR1},
|
|
|
|
|
|
|
|
{"MPES", IMGFMT_MPEGPES},
|
|
|
|
|
|
|
|
{"IDCT_MPEG2",IMGFMT_XVMC_IDCT_MPEG2},
|
|
|
|
{"MOCO_MPEG2",IMGFMT_XVMC_MOCO_MPEG2},
|
|
|
|
|
|
|
|
{"VDPAU_MPEG1",IMGFMT_VDPAU_MPEG1},
|
|
|
|
{"VDPAU_MPEG2",IMGFMT_VDPAU_MPEG2},
|
|
|
|
{"VDPAU_H264",IMGFMT_VDPAU_H264},
|
|
|
|
{"VDPAU_WMV3",IMGFMT_VDPAU_WMV3},
|
|
|
|
{"VDPAU_VC1",IMGFMT_VDPAU_VC1},
|
|
|
|
{"VDPAU_MPEG4",IMGFMT_VDPAU_MPEG4},
|
|
|
|
|
|
|
|
{NULL, 0}
|
|
|
|
};
|
2001-04-14 17:55:20 +00:00
|
|
|
|
2001-04-24 02:14:14 +00:00
|
|
|
|
2002-02-12 17:33:27 +00:00
|
|
|
static int add_to_inout(char *sfmt, char *sflags, unsigned int *outfmt,
|
2010-05-03 23:34:38 +00:00
|
|
|
unsigned char *outflags)
|
2001-04-24 02:14:14 +00:00
|
|
|
{
|
|
|
|
|
2010-05-03 23:34:38 +00:00
|
|
|
static char *flagstr[] = {
|
|
|
|
"flip",
|
|
|
|
"noflip",
|
|
|
|
"yuvhack",
|
|
|
|
"query",
|
|
|
|
"static",
|
|
|
|
NULL
|
|
|
|
};
|
|
|
|
|
|
|
|
int i, j, freeslots;
|
|
|
|
unsigned char flags;
|
|
|
|
|
|
|
|
for (i = 0; i < CODECS_MAX_OUTFMT && outfmt[i] != 0xffffffff; i++)
|
|
|
|
/* NOTHING */;
|
|
|
|
freeslots = CODECS_MAX_OUTFMT - i;
|
|
|
|
if (!freeslots)
|
|
|
|
goto err_out_too_many;
|
|
|
|
|
|
|
|
flags = 0;
|
|
|
|
if(sflags) {
|
|
|
|
do {
|
|
|
|
for (j = 0; flagstr[j] != NULL; j++)
|
|
|
|
if (!strncmp(sflags, flagstr[j],
|
|
|
|
strlen(flagstr[j])))
|
|
|
|
break;
|
|
|
|
if (flagstr[j] == NULL)
|
|
|
|
goto err_out_parse_error;
|
|
|
|
flags|=(1<<j);
|
|
|
|
sflags+=strlen(flagstr[j]);
|
|
|
|
} while (*(sflags++) == ',');
|
|
|
|
|
|
|
|
if (*(--sflags) != '\0')
|
|
|
|
goto err_out_parse_error;
|
|
|
|
}
|
|
|
|
|
|
|
|
do {
|
|
|
|
for (j = 0; fmt_table[j].name != NULL; j++)
|
|
|
|
if (!strncmp(sfmt, fmt_table[j].name, strlen(fmt_table[j].name)))
|
|
|
|
break;
|
|
|
|
if (fmt_table[j].name == NULL)
|
|
|
|
goto err_out_parse_error;
|
|
|
|
outfmt[i] = fmt_table[j].num;
|
|
|
|
outflags[i] = flags;
|
|
|
|
++i;
|
|
|
|
sfmt+=strlen(fmt_table[j].name);
|
|
|
|
} while ((*(sfmt++) == ',') && --freeslots);
|
|
|
|
|
|
|
|
if (!freeslots)
|
|
|
|
goto err_out_too_many;
|
|
|
|
|
|
|
|
if (*(--sfmt) != '\0')
|
|
|
|
goto err_out_parse_error;
|
|
|
|
|
|
|
|
return 1;
|
2001-04-10 20:09:23 +00:00
|
|
|
err_out_too_many:
|
2010-05-07 19:02:47 +00:00
|
|
|
mp_tmsg(MSGT_CODECCFG,MSGL_ERR,"too many out...");
|
2010-05-03 23:34:38 +00:00
|
|
|
return 0;
|
2001-04-11 20:55:14 +00:00
|
|
|
err_out_parse_error:
|
2010-05-07 19:02:47 +00:00
|
|
|
mp_tmsg(MSGT_CODECCFG,MSGL_ERR,"parse error");
|
2010-05-03 23:34:38 +00:00
|
|
|
return 0;
|
2001-04-06 23:20:46 +00:00
|
|
|
}
|
|
|
|
|
2001-04-10 20:09:23 +00:00
|
|
|
static int validate_codec(codecs_t *c, int type)
|
2001-04-09 20:21:07 +00:00
|
|
|
{
|
2010-05-03 23:34:38 +00:00
|
|
|
unsigned int i;
|
|
|
|
char *tmp_name = c->name;
|
2001-04-10 20:09:23 +00:00
|
|
|
|
2010-05-03 23:34:38 +00:00
|
|
|
for (i = 0; i < strlen(tmp_name) && isalnum(tmp_name[i]); i++)
|
|
|
|
/* NOTHING */;
|
2001-12-09 18:25:09 +00:00
|
|
|
|
2010-05-03 23:34:38 +00:00
|
|
|
if (i < strlen(tmp_name)) {
|
2010-05-07 19:02:47 +00:00
|
|
|
mp_tmsg(MSGT_CODECCFG,MSGL_ERR,"\ncodec(%s) name is not valid!\n", c->name);
|
2010-05-03 23:34:38 +00:00
|
|
|
return 0;
|
|
|
|
}
|
2001-12-09 18:25:09 +00:00
|
|
|
|
2010-05-03 23:34:38 +00:00
|
|
|
if (!c->info)
|
|
|
|
c->info = strdup(c->name);
|
2001-12-09 18:25:09 +00:00
|
|
|
|
|
|
|
#if 0
|
2010-05-03 23:34:38 +00:00
|
|
|
if (c->fourcc[0] == 0xffffffff) {
|
2010-05-07 19:02:47 +00:00
|
|
|
mp_tmsg(MSGT_CODECCFG,MSGL_ERR,"\ncodec(%s) does not have FourCC/format!\n", c->name);
|
2010-05-03 23:34:38 +00:00
|
|
|
return 0;
|
|
|
|
}
|
2004-11-14 11:39:23 +00:00
|
|
|
#endif
|
2001-12-09 18:25:09 +00:00
|
|
|
|
2010-05-03 23:34:38 +00:00
|
|
|
if (!c->drv) {
|
2010-05-07 19:02:47 +00:00
|
|
|
mp_tmsg(MSGT_CODECCFG,MSGL_ERR,"\ncodec(%s) does not have a driver!\n", c->name);
|
2010-05-03 23:34:38 +00:00
|
|
|
return 0;
|
|
|
|
}
|
2001-12-09 18:25:09 +00:00
|
|
|
|
|
|
|
#if 0
|
2010-10-11 12:33:57 +00:00
|
|
|
//FIXME: codec->driver == 4;... <- this should not be put in here...
|
|
|
|
//FIXME: Where are they defined ????????????
|
2010-05-03 23:34:38 +00:00
|
|
|
if (!c->dll && (c->driver == 4 ||
|
2010-05-07 19:02:47 +00:00
|
|
|
(c->driver == 2 && type == TYPE_VIDEO))) {
|
|
|
|
mp_tmsg(MSGT_CODECCFG,MSGL_ERR,"\ncodec(%s) needs a 'dll'!\n", c->name);
|
2010-05-03 23:34:38 +00:00
|
|
|
return 0;
|
|
|
|
}
|
2010-10-11 12:33:57 +00:00
|
|
|
// FIXME: Can guid.f1 be 0? How does one know that it was not given?
|
2010-05-03 23:34:38 +00:00
|
|
|
// if (!(codec->flags & CODECS_FLAG_AUDIO) && codec->driver == 4)
|
2001-04-10 20:09:23 +00:00
|
|
|
|
2010-05-03 23:34:38 +00:00
|
|
|
if (type == TYPE_VIDEO)
|
|
|
|
if (c->outfmt[0] == 0xffffffff) {
|
2010-05-07 19:02:47 +00:00
|
|
|
mp_tmsg(MSGT_CODECCFG,MSGL_ERR,"\ncodec(%s) needs an 'outfmt'!\n", c->name);
|
2010-05-03 23:34:38 +00:00
|
|
|
return 0;
|
|
|
|
}
|
2001-04-10 20:47:37 +00:00
|
|
|
#endif
|
2010-05-03 23:34:38 +00:00
|
|
|
return 1;
|
2001-04-09 20:21:07 +00:00
|
|
|
}
|
2001-04-06 23:20:46 +00:00
|
|
|
|
2001-04-09 20:21:07 +00:00
|
|
|
static int add_comment(char *s, char **d)
|
2001-04-06 23:20:46 +00:00
|
|
|
{
|
2010-05-03 23:34:38 +00:00
|
|
|
int pos;
|
|
|
|
|
|
|
|
if (!*d)
|
|
|
|
pos = 0;
|
|
|
|
else {
|
|
|
|
pos = strlen(*d);
|
|
|
|
(*d)[pos++] = '\n';
|
|
|
|
}
|
|
|
|
if (!(*d = realloc(*d, pos + strlen(s) + 1))) {
|
2010-05-07 19:02:47 +00:00
|
|
|
mp_tmsg(MSGT_CODECCFG,MSGL_FATAL,"Can't allocate memory for comment. ");
|
2010-05-03 23:34:38 +00:00
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
strcpy(*d + pos, s);
|
|
|
|
return 1;
|
2001-04-09 20:21:07 +00:00
|
|
|
}
|
2001-04-06 23:20:46 +00:00
|
|
|
|
2001-04-11 20:55:14 +00:00
|
|
|
static short get_cpuflags(char *s)
|
|
|
|
{
|
2010-05-03 23:34:38 +00:00
|
|
|
static char *flagstr[] = {
|
|
|
|
"mmx",
|
|
|
|
"sse",
|
|
|
|
"3dnow",
|
|
|
|
NULL
|
|
|
|
};
|
|
|
|
int i;
|
|
|
|
short flags = 0;
|
|
|
|
|
|
|
|
do {
|
|
|
|
for (i = 0; flagstr[i]; i++)
|
|
|
|
if (!strncmp(s, flagstr[i], strlen(flagstr[i])))
|
|
|
|
break;
|
|
|
|
if (!flagstr[i])
|
|
|
|
goto err_out_parse_error;
|
|
|
|
flags |= 1<<i;
|
|
|
|
s += strlen(flagstr[i]);
|
|
|
|
} while (*(s++) == ',');
|
|
|
|
|
|
|
|
if (*(--s) != '\0')
|
|
|
|
goto err_out_parse_error;
|
|
|
|
|
|
|
|
return flags;
|
2001-04-11 20:55:14 +00:00
|
|
|
err_out_parse_error:
|
2010-05-03 23:34:38 +00:00
|
|
|
return 0;
|
2001-04-11 20:55:14 +00:00
|
|
|
}
|
|
|
|
|
2001-04-10 20:09:23 +00:00
|
|
|
static FILE *fp;
|
|
|
|
static int line_num = 0;
|
|
|
|
static char *line;
|
|
|
|
static char *token[MAX_NR_TOKEN];
|
2002-05-26 22:39:38 +00:00
|
|
|
static int read_nextline = 1;
|
2001-04-10 20:09:23 +00:00
|
|
|
|
|
|
|
static int get_token(int min, int max)
|
|
|
|
{
|
2010-05-03 23:34:38 +00:00
|
|
|
static int line_pos;
|
|
|
|
int i;
|
|
|
|
char c;
|
|
|
|
|
|
|
|
if (max >= MAX_NR_TOKEN) {
|
2010-05-07 19:02:47 +00:00
|
|
|
mp_tmsg(MSGT_CODECCFG,MSGL_ERR,"get_token(): max >= MAX_MR_TOKEN!");
|
2010-05-03 23:34:38 +00:00
|
|
|
goto out_eof;
|
|
|
|
}
|
|
|
|
|
|
|
|
memset(token, 0x00, sizeof(*token) * max);
|
|
|
|
|
|
|
|
if (read_nextline) {
|
|
|
|
if (!fgets(line, MAX_LINE_LEN, fp))
|
|
|
|
goto out_eof;
|
|
|
|
line_pos = 0;
|
|
|
|
++line_num;
|
|
|
|
read_nextline = 0;
|
|
|
|
}
|
|
|
|
for (i = 0; i < max; i++) {
|
|
|
|
while (isspace(line[line_pos]))
|
|
|
|
++line_pos;
|
|
|
|
if (line[line_pos] == '\0' || line[line_pos] == '#' ||
|
|
|
|
line[line_pos] == ';') {
|
|
|
|
read_nextline = 1;
|
|
|
|
if (i >= min)
|
|
|
|
goto out_ok;
|
|
|
|
goto out_eol;
|
|
|
|
}
|
|
|
|
token[i] = line + line_pos;
|
|
|
|
c = line[line_pos];
|
|
|
|
if (c == '"' || c == '\'') {
|
|
|
|
token[i]++;
|
|
|
|
while (line[++line_pos] != c && line[line_pos])
|
|
|
|
/* NOTHING */;
|
|
|
|
} else {
|
|
|
|
for (/* NOTHING */; !isspace(line[line_pos]) &&
|
|
|
|
line[line_pos]; line_pos++)
|
|
|
|
/* NOTHING */;
|
|
|
|
}
|
|
|
|
if (!line[line_pos]) {
|
|
|
|
read_nextline = 1;
|
|
|
|
if (i >= min - 1)
|
|
|
|
goto out_ok;
|
|
|
|
goto out_eol;
|
|
|
|
}
|
|
|
|
line[line_pos] = '\0';
|
|
|
|
line_pos++;
|
|
|
|
}
|
2001-04-10 20:09:23 +00:00
|
|
|
out_ok:
|
2010-05-03 23:34:38 +00:00
|
|
|
return i;
|
2001-04-10 20:09:23 +00:00
|
|
|
out_eof:
|
2010-05-03 23:34:38 +00:00
|
|
|
read_nextline = 1;
|
|
|
|
return RET_EOF;
|
2001-04-10 20:09:23 +00:00
|
|
|
out_eol:
|
2010-05-03 23:34:38 +00:00
|
|
|
return RET_EOL;
|
2001-04-10 20:09:23 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
static codecs_t *video_codecs=NULL;
|
|
|
|
static codecs_t *audio_codecs=NULL;
|
|
|
|
static int nr_vcodecs = 0;
|
|
|
|
static int nr_acodecs = 0;
|
|
|
|
|
2006-07-09 17:45:36 +00:00
|
|
|
int parse_codec_cfg(const char *cfgfile)
|
2001-04-09 20:21:07 +00:00
|
|
|
{
|
2010-05-03 23:34:38 +00:00
|
|
|
codecs_t *codec = NULL; // current codec
|
|
|
|
codecs_t **codecsp = NULL;// points to audio_codecs or to video_codecs
|
|
|
|
char *endptr; // strtoul()...
|
|
|
|
int *nr_codecsp;
|
|
|
|
int codec_type; /* TYPE_VIDEO/TYPE_AUDIO */
|
|
|
|
int tmp, i;
|
2009-07-06 23:26:13 +00:00
|
|
|
|
2010-05-03 23:34:38 +00:00
|
|
|
// in case we call it a second time
|
|
|
|
codecs_uninit_free();
|
2009-07-06 23:26:13 +00:00
|
|
|
|
2010-05-03 23:34:38 +00:00
|
|
|
nr_vcodecs = 0;
|
|
|
|
nr_acodecs = 0;
|
2001-12-27 18:38:10 +00:00
|
|
|
|
2010-05-03 23:34:38 +00:00
|
|
|
if(cfgfile==NULL) {
|
2002-12-15 23:45:19 +00:00
|
|
|
#ifdef CODECS2HTML
|
2010-05-03 23:34:38 +00:00
|
|
|
return 0;
|
2002-12-15 23:45:19 +00:00
|
|
|
#else
|
2011-04-28 07:36:00 +00:00
|
|
|
/* following casts are harmless since {video,audio}_codecs will stay
|
|
|
|
* untouched in this case */
|
|
|
|
video_codecs = (codecs_t *)builtin_video_codecs;
|
|
|
|
audio_codecs = (codecs_t *)builtin_audio_codecs;
|
2010-05-03 23:34:38 +00:00
|
|
|
nr_vcodecs = sizeof(builtin_video_codecs)/sizeof(codecs_t);
|
|
|
|
nr_acodecs = sizeof(builtin_audio_codecs)/sizeof(codecs_t);
|
|
|
|
return 1;
|
2002-12-15 23:45:19 +00:00
|
|
|
#endif
|
2010-05-03 23:34:38 +00:00
|
|
|
}
|
|
|
|
|
2010-05-07 19:02:47 +00:00
|
|
|
mp_tmsg(MSGT_CODECCFG,MSGL_V,"Reading %s: ", cfgfile);
|
2010-05-03 23:34:38 +00:00
|
|
|
|
|
|
|
if ((fp = fopen(cfgfile, "r")) == NULL) {
|
2010-05-07 19:02:47 +00:00
|
|
|
mp_tmsg(MSGT_CODECCFG,MSGL_V,"Can't open '%s': %s\n", cfgfile, strerror(errno));
|
2010-05-03 23:34:38 +00:00
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
if ((line = malloc(MAX_LINE_LEN + 1)) == NULL) {
|
2010-05-07 19:02:47 +00:00
|
|
|
mp_tmsg(MSGT_CODECCFG,MSGL_FATAL,"Can't get memory for 'line': %s\n", strerror(errno));
|
2010-05-03 23:34:38 +00:00
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
read_nextline = 1;
|
|
|
|
|
|
|
|
/*
|
|
|
|
* this only catches release lines at the start of
|
|
|
|
* codecs.conf, before audiocodecs and videocodecs.
|
|
|
|
*/
|
|
|
|
while ((tmp = get_token(1, 1)) == RET_EOL)
|
|
|
|
/* NOTHING */;
|
|
|
|
if (tmp == RET_EOF)
|
|
|
|
goto out;
|
|
|
|
if (!strcmp(token[0], "release")) {
|
|
|
|
if (get_token(1, 2) < 0)
|
|
|
|
goto err_out_parse_error;
|
|
|
|
tmp = atoi(token[0]);
|
|
|
|
if (tmp < CODEC_CFG_MIN)
|
|
|
|
goto err_out_release_num;
|
2010-06-19 18:31:35 +00:00
|
|
|
codecs_conf_release = tmp;
|
2010-05-03 23:34:38 +00:00
|
|
|
while ((tmp = get_token(1, 1)) == RET_EOL)
|
|
|
|
/* NOTHING */;
|
|
|
|
if (tmp == RET_EOF)
|
|
|
|
goto out;
|
|
|
|
} else
|
|
|
|
goto err_out_release_num;
|
|
|
|
|
|
|
|
/*
|
|
|
|
* check if the next block starts with 'audiocodec' or
|
|
|
|
* with 'videocodec'
|
|
|
|
*/
|
|
|
|
if (!strcmp(token[0], "audiocodec") || !strcmp(token[0], "videocodec"))
|
|
|
|
goto loop_enter;
|
|
|
|
goto err_out_parse_error;
|
|
|
|
|
|
|
|
while ((tmp = get_token(1, 1)) != RET_EOF) {
|
|
|
|
if (tmp == RET_EOL)
|
|
|
|
continue;
|
|
|
|
if (!strcmp(token[0], "audiocodec") ||
|
|
|
|
!strcmp(token[0], "videocodec")) {
|
|
|
|
if (!validate_codec(codec, codec_type))
|
|
|
|
goto err_out_not_valid;
|
|
|
|
loop_enter:
|
|
|
|
if (*token[0] == 'v') {
|
|
|
|
codec_type = TYPE_VIDEO;
|
|
|
|
nr_codecsp = &nr_vcodecs;
|
|
|
|
codecsp = &video_codecs;
|
|
|
|
} else if (*token[0] == 'a') {
|
|
|
|
codec_type = TYPE_AUDIO;
|
|
|
|
nr_codecsp = &nr_acodecs;
|
|
|
|
codecsp = &audio_codecs;
|
2001-04-11 20:55:14 +00:00
|
|
|
#ifdef DEBUG
|
2010-05-03 23:34:38 +00:00
|
|
|
} else {
|
|
|
|
mp_msg(MSGT_CODECCFG,MSGL_ERR,"picsba\n");
|
|
|
|
goto err_out;
|
2001-04-11 20:55:14 +00:00
|
|
|
#endif
|
2010-05-03 23:34:38 +00:00
|
|
|
}
|
|
|
|
if (!(*codecsp = realloc(*codecsp,
|
|
|
|
sizeof(codecs_t) * (*nr_codecsp + 2)))) {
|
2010-05-07 19:02:47 +00:00
|
|
|
mp_tmsg(MSGT_CODECCFG,MSGL_FATAL,"Can't realloc '*codecsp': %s\n", strerror(errno));
|
2010-05-03 23:34:38 +00:00
|
|
|
goto err_out;
|
|
|
|
}
|
|
|
|
codec=*codecsp + *nr_codecsp;
|
|
|
|
++*nr_codecsp;
|
|
|
|
memset(codec,0,sizeof(codecs_t));
|
|
|
|
memset(codec->fourcc, 0xff, sizeof(codec->fourcc));
|
|
|
|
memset(codec->outfmt, 0xff, sizeof(codec->outfmt));
|
|
|
|
memset(codec->infmt, 0xff, sizeof(codec->infmt));
|
|
|
|
|
|
|
|
if (get_token(1, 1) < 0)
|
|
|
|
goto err_out_parse_error;
|
|
|
|
for (i = 0; i < *nr_codecsp - 1; i++) {
|
|
|
|
if(( (*codecsp)[i].name!=NULL) &&
|
|
|
|
(!strcmp(token[0], (*codecsp)[i].name)) ) {
|
2010-05-07 19:02:47 +00:00
|
|
|
mp_tmsg(MSGT_CODECCFG,MSGL_ERR,"Codec name '%s' isn't unique.", token[0]);
|
2010-05-03 23:34:38 +00:00
|
|
|
goto err_out_print_linenum;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if (!(codec->name = strdup(token[0]))) {
|
2010-05-07 19:02:47 +00:00
|
|
|
mp_tmsg(MSGT_CODECCFG,MSGL_ERR,"Can't strdup -> 'name': %s\n", strerror(errno));
|
2010-05-03 23:34:38 +00:00
|
|
|
goto err_out;
|
|
|
|
}
|
|
|
|
} else if (!strcmp(token[0], "info")) {
|
|
|
|
if (codec->info || get_token(1, 1) < 0)
|
|
|
|
goto err_out_parse_error;
|
|
|
|
if (!(codec->info = strdup(token[0]))) {
|
2010-05-07 19:02:47 +00:00
|
|
|
mp_tmsg(MSGT_CODECCFG,MSGL_ERR,"Can't strdup -> 'info': %s\n", strerror(errno));
|
2010-05-03 23:34:38 +00:00
|
|
|
goto err_out;
|
|
|
|
}
|
|
|
|
} else if (!strcmp(token[0], "comment")) {
|
|
|
|
if (get_token(1, 1) < 0)
|
|
|
|
goto err_out_parse_error;
|
|
|
|
add_comment(token[0], &codec->comment);
|
|
|
|
} else if (!strcmp(token[0], "fourcc")) {
|
|
|
|
if (get_token(1, 2) < 0)
|
|
|
|
goto err_out_parse_error;
|
|
|
|
if (!add_to_fourcc(token[0], token[1],
|
|
|
|
codec->fourcc,
|
|
|
|
codec->fourccmap))
|
|
|
|
goto err_out_print_linenum;
|
|
|
|
} else if (!strcmp(token[0], "format")) {
|
|
|
|
if (get_token(1, 2) < 0)
|
|
|
|
goto err_out_parse_error;
|
|
|
|
if (!add_to_format(token[0], token[1],
|
|
|
|
codec->fourcc,codec->fourccmap))
|
|
|
|
goto err_out_print_linenum;
|
|
|
|
} else if (!strcmp(token[0], "driver")) {
|
|
|
|
if (get_token(1, 1) < 0)
|
|
|
|
goto err_out_parse_error;
|
|
|
|
if (!(codec->drv = strdup(token[0]))) {
|
2010-05-07 19:02:47 +00:00
|
|
|
mp_tmsg(MSGT_CODECCFG,MSGL_ERR,"Can't strdup -> 'driver': %s\n", strerror(errno));
|
2010-05-03 23:34:38 +00:00
|
|
|
goto err_out;
|
|
|
|
}
|
|
|
|
} else if (!strcmp(token[0], "dll")) {
|
|
|
|
if (get_token(1, 1) < 0)
|
|
|
|
goto err_out_parse_error;
|
|
|
|
if (!(codec->dll = strdup(token[0]))) {
|
2010-05-07 19:02:47 +00:00
|
|
|
mp_tmsg(MSGT_CODECCFG,MSGL_ERR,"Can't strdup -> 'dll': %s", strerror(errno));
|
2010-05-03 23:34:38 +00:00
|
|
|
goto err_out;
|
|
|
|
}
|
|
|
|
} else if (!strcmp(token[0], "guid")) {
|
|
|
|
if (get_token(11, 11) < 0)
|
|
|
|
goto err_out_parse_error;
|
|
|
|
codec->guid.f1=strtoul(token[0],&endptr,0);
|
|
|
|
if ((*endptr != ',' || *(endptr + 1) != '\0') &&
|
|
|
|
*endptr != '\0')
|
|
|
|
goto err_out_parse_error;
|
|
|
|
codec->guid.f2=strtoul(token[1],&endptr,0);
|
|
|
|
if ((*endptr != ',' || *(endptr + 1) != '\0') &&
|
|
|
|
*endptr != '\0')
|
|
|
|
goto err_out_parse_error;
|
|
|
|
codec->guid.f3=strtoul(token[2],&endptr,0);
|
|
|
|
if ((*endptr != ',' || *(endptr + 1) != '\0') &&
|
|
|
|
*endptr != '\0')
|
|
|
|
goto err_out_parse_error;
|
|
|
|
for (i = 0; i < 8; i++) {
|
|
|
|
codec->guid.f4[i]=strtoul(token[i + 3],&endptr,0);
|
|
|
|
if ((*endptr != ',' || *(endptr + 1) != '\0') &&
|
|
|
|
*endptr != '\0')
|
|
|
|
goto err_out_parse_error;
|
|
|
|
}
|
|
|
|
} else if (!strcmp(token[0], "out")) {
|
|
|
|
if (get_token(1, 2) < 0)
|
|
|
|
goto err_out_parse_error;
|
|
|
|
if (!add_to_inout(token[0], token[1], codec->outfmt,
|
|
|
|
codec->outflags))
|
|
|
|
goto err_out_print_linenum;
|
|
|
|
} else if (!strcmp(token[0], "in")) {
|
|
|
|
if (get_token(1, 2) < 0)
|
|
|
|
goto err_out_parse_error;
|
|
|
|
if (!add_to_inout(token[0], token[1], codec->infmt,
|
|
|
|
codec->inflags))
|
|
|
|
goto err_out_print_linenum;
|
|
|
|
} else if (!strcmp(token[0], "flags")) {
|
|
|
|
if (get_token(1, 1) < 0)
|
|
|
|
goto err_out_parse_error;
|
|
|
|
if (!strcmp(token[0], "seekable"))
|
|
|
|
codec->flags |= CODECS_FLAG_SEEKABLE;
|
2010-05-07 19:02:47 +00:00
|
|
|
else if (!strcmp(token[0], "align16"))
|
2010-05-03 23:34:38 +00:00
|
|
|
codec->flags |= CODECS_FLAG_ALIGN16;
|
|
|
|
else
|
|
|
|
goto err_out_parse_error;
|
|
|
|
} else if (!strcmp(token[0], "status")) {
|
|
|
|
if (get_token(1, 1) < 0)
|
|
|
|
goto err_out_parse_error;
|
|
|
|
if (!strcasecmp(token[0], "working"))
|
|
|
|
codec->status = CODECS_STATUS_WORKING;
|
|
|
|
else if (!strcasecmp(token[0], "crashing"))
|
|
|
|
codec->status = CODECS_STATUS_NOT_WORKING;
|
|
|
|
else if (!strcasecmp(token[0], "untested"))
|
|
|
|
codec->status = CODECS_STATUS_UNTESTED;
|
|
|
|
else if (!strcasecmp(token[0], "buggy"))
|
|
|
|
codec->status = CODECS_STATUS_PROBLEMS;
|
|
|
|
else
|
|
|
|
goto err_out_parse_error;
|
|
|
|
} else if (!strcmp(token[0], "cpuflags")) {
|
|
|
|
if (get_token(1, 1) < 0)
|
|
|
|
goto err_out_parse_error;
|
|
|
|
if (!(codec->cpuflags = get_cpuflags(token[0])))
|
|
|
|
goto err_out_parse_error;
|
|
|
|
} else
|
|
|
|
goto err_out_parse_error;
|
|
|
|
}
|
|
|
|
if (!validate_codec(codec, codec_type))
|
|
|
|
goto err_out_not_valid;
|
2010-05-07 19:02:47 +00:00
|
|
|
mp_tmsg(MSGT_CODECCFG,MSGL_INFO,"%d audio & %d video codecs\n", nr_acodecs, nr_vcodecs);
|
2010-05-03 23:34:38 +00:00
|
|
|
if(video_codecs) video_codecs[nr_vcodecs].name = NULL;
|
|
|
|
if(audio_codecs) audio_codecs[nr_acodecs].name = NULL;
|
2001-04-06 23:20:46 +00:00
|
|
|
out:
|
2010-05-03 23:34:38 +00:00
|
|
|
free(line);
|
|
|
|
line=NULL;
|
|
|
|
fclose(fp);
|
|
|
|
return 1;
|
2001-12-27 18:38:10 +00:00
|
|
|
|
2001-04-10 20:09:23 +00:00
|
|
|
err_out_parse_error:
|
2010-05-07 19:02:47 +00:00
|
|
|
mp_tmsg(MSGT_CODECCFG,MSGL_ERR,"parse error");
|
2001-04-11 20:55:14 +00:00
|
|
|
err_out_print_linenum:
|
2010-05-03 23:34:38 +00:00
|
|
|
PRINT_LINENUM;
|
2001-04-06 23:20:46 +00:00
|
|
|
err_out:
|
2010-05-03 23:34:38 +00:00
|
|
|
codecs_uninit_free();
|
2001-12-27 18:38:10 +00:00
|
|
|
|
2010-05-03 23:34:38 +00:00
|
|
|
free(line);
|
|
|
|
line=NULL;
|
|
|
|
line_num = 0;
|
|
|
|
fclose(fp);
|
|
|
|
return 0;
|
2001-04-10 20:09:23 +00:00
|
|
|
err_out_not_valid:
|
2010-05-07 19:02:47 +00:00
|
|
|
mp_tmsg(MSGT_CODECCFG,MSGL_ERR,"Codec is not defined correctly.");
|
2010-05-03 23:34:38 +00:00
|
|
|
goto err_out_print_linenum;
|
2002-05-26 22:39:38 +00:00
|
|
|
err_out_release_num:
|
2010-05-07 19:02:47 +00:00
|
|
|
mp_tmsg(MSGT_CODECCFG,MSGL_ERR,"This codecs.conf is too old and incompatible with this MPlayer release!");
|
2010-05-03 23:34:38 +00:00
|
|
|
goto err_out_print_linenum;
|
2001-04-06 23:20:46 +00:00
|
|
|
}
|
|
|
|
|
2004-10-30 10:09:52 +00:00
|
|
|
static void codecs_free(codecs_t* codecs,int count) {
|
2010-05-03 23:34:38 +00:00
|
|
|
int i;
|
|
|
|
for ( i = 0; i < count; i++)
|
|
|
|
if ( codecs[i].name ) {
|
2010-11-07 12:47:40 +00:00
|
|
|
free(codecs[i].name);
|
|
|
|
free(codecs[i].info);
|
|
|
|
free(codecs[i].comment);
|
|
|
|
free(codecs[i].dll);
|
|
|
|
free(codecs[i].drv);
|
2010-05-03 23:34:38 +00:00
|
|
|
}
|
2010-11-07 12:47:40 +00:00
|
|
|
free(codecs);
|
2004-10-30 10:09:52 +00:00
|
|
|
}
|
|
|
|
|
2006-02-09 14:08:03 +00:00
|
|
|
void codecs_uninit_free(void) {
|
2010-05-03 23:34:38 +00:00
|
|
|
if (video_codecs)
|
|
|
|
codecs_free(video_codecs,nr_vcodecs);
|
|
|
|
video_codecs=NULL;
|
|
|
|
if (audio_codecs)
|
|
|
|
codecs_free(audio_codecs,nr_acodecs);
|
|
|
|
audio_codecs=NULL;
|
2004-10-30 10:09:52 +00:00
|
|
|
}
|
|
|
|
|
2001-04-10 23:18:01 +00:00
|
|
|
codecs_t *find_audio_codec(unsigned int fourcc, unsigned int *fourccmap,
|
2010-05-03 23:34:38 +00:00
|
|
|
codecs_t *start, int force)
|
2001-04-10 20:09:23 +00:00
|
|
|
{
|
2010-05-03 23:34:38 +00:00
|
|
|
return find_codec(fourcc, fourccmap, start, 1, force);
|
2001-04-10 20:09:23 +00:00
|
|
|
}
|
|
|
|
|
2001-04-10 23:18:01 +00:00
|
|
|
codecs_t *find_video_codec(unsigned int fourcc, unsigned int *fourccmap,
|
2010-05-03 23:34:38 +00:00
|
|
|
codecs_t *start, int force)
|
2001-04-10 20:09:23 +00:00
|
|
|
{
|
2010-05-03 23:34:38 +00:00
|
|
|
return find_codec(fourcc, fourccmap, start, 0, force);
|
2001-04-10 20:09:23 +00:00
|
|
|
}
|
|
|
|
|
2001-04-10 23:18:01 +00:00
|
|
|
codecs_t* find_codec(unsigned int fourcc,unsigned int *fourccmap,
|
2010-05-03 23:34:38 +00:00
|
|
|
codecs_t *start, int audioflag, int force)
|
2001-04-10 20:09:23 +00:00
|
|
|
{
|
2010-05-03 23:34:38 +00:00
|
|
|
int i, j;
|
|
|
|
codecs_t *c;
|
2001-04-10 20:09:23 +00:00
|
|
|
|
2001-04-24 22:55:52 +00:00
|
|
|
#if 0
|
2010-05-03 23:34:38 +00:00
|
|
|
if (start) {
|
|
|
|
for (/* NOTHING */; start->name; start++) {
|
|
|
|
for (j = 0; j < CODECS_MAX_FOURCC; j++) {
|
|
|
|
if (start->fourcc[j] == fourcc) {
|
|
|
|
if (fourccmap)
|
|
|
|
*fourccmap = start->fourccmap[j];
|
|
|
|
return start;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
} else
|
2001-04-24 22:55:52 +00:00
|
|
|
#endif
|
2010-05-03 23:34:38 +00:00
|
|
|
{
|
|
|
|
if (audioflag) {
|
|
|
|
i = nr_acodecs;
|
|
|
|
c = audio_codecs;
|
|
|
|
} else {
|
|
|
|
i = nr_vcodecs;
|
|
|
|
c = video_codecs;
|
|
|
|
}
|
|
|
|
if(!i) return NULL;
|
|
|
|
for (/* NOTHING */; i--; c++) {
|
|
|
|
if(start && c<=start) continue;
|
|
|
|
for (j = 0; j < CODECS_MAX_FOURCC; j++) {
|
|
|
|
// FIXME: do NOT hardwire 'null' name here:
|
|
|
|
if (c->fourcc[j]==fourcc || !strcmp(c->drv,"null")) {
|
|
|
|
if (fourccmap)
|
|
|
|
*fourccmap = c->fourccmap[j];
|
|
|
|
return c;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if (force) return c;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return NULL;
|
2001-04-07 21:27:57 +00:00
|
|
|
}
|
|
|
|
|
2008-01-12 14:05:46 +00:00
|
|
|
void stringset_init(stringset_t *set) {
|
2010-05-03 23:34:38 +00:00
|
|
|
*set = calloc(1, sizeof(char *));
|
2002-09-26 01:28:32 +00:00
|
|
|
}
|
|
|
|
|
2008-01-12 14:05:46 +00:00
|
|
|
void stringset_free(stringset_t *set) {
|
2010-05-03 23:34:38 +00:00
|
|
|
int count = 0;
|
|
|
|
while ((*set)[count]) free((*set)[count++]);
|
|
|
|
free(*set);
|
|
|
|
*set = NULL;
|
2008-01-12 14:05:46 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void stringset_add(stringset_t *set, const char *str) {
|
2010-05-03 23:34:38 +00:00
|
|
|
int count = 0;
|
|
|
|
while ((*set)[count]) count++;
|
|
|
|
count++;
|
|
|
|
*set = realloc(*set, sizeof(char *) * (count + 1));
|
|
|
|
(*set)[count - 1] = strdup(str);
|
|
|
|
(*set)[count] = NULL;
|
2008-01-12 14:05:46 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
int stringset_test(stringset_t *set, const char *str) {
|
2010-05-03 23:34:38 +00:00
|
|
|
stringset_t s;
|
|
|
|
for (s = *set; *s; s++)
|
|
|
|
if (strcmp(*s, str) == 0)
|
|
|
|
return 1;
|
|
|
|
return 0;
|
2002-03-25 03:02:57 +00:00
|
|
|
}
|
|
|
|
|
2001-09-27 12:59:35 +00:00
|
|
|
void list_codecs(int audioflag){
|
2010-05-03 23:34:38 +00:00
|
|
|
int i;
|
|
|
|
codecs_t *c;
|
|
|
|
|
|
|
|
if (audioflag) {
|
|
|
|
i = nr_acodecs;
|
|
|
|
c = audio_codecs;
|
|
|
|
mp_msg(MSGT_CODECCFG,MSGL_INFO,"ac: afm: status: info: [lib/dll]\n");
|
|
|
|
} else {
|
|
|
|
i = nr_vcodecs;
|
|
|
|
c = video_codecs;
|
|
|
|
mp_msg(MSGT_CODECCFG,MSGL_INFO,"vc: vfm: status: info: [lib/dll]\n");
|
|
|
|
}
|
|
|
|
if(!i) return;
|
|
|
|
for (/* NOTHING */; i--; c++) {
|
|
|
|
char* s="unknown ";
|
|
|
|
switch(c->status){
|
|
|
|
case CODECS_STATUS_WORKING: s="working ";break;
|
|
|
|
case CODECS_STATUS_PROBLEMS: s="problems";break;
|
|
|
|
case CODECS_STATUS_NOT_WORKING: s="crashing";break;
|
|
|
|
case CODECS_STATUS_UNTESTED: s="untested";break;
|
|
|
|
}
|
|
|
|
if(c->dll)
|
|
|
|
mp_msg(MSGT_CODECCFG,MSGL_INFO,"%-11s %-9s %s %s [%s]\n",c->name,c->drv,s,c->info,c->dll);
|
|
|
|
else
|
|
|
|
mp_msg(MSGT_CODECCFG,MSGL_INFO,"%-11s %-9s %s %s\n",c->name,c->drv,s,c->info);
|
|
|
|
}
|
2001-09-27 12:59:35 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2001-04-24 02:14:14 +00:00
|
|
|
#ifdef CODECS2HTML
|
2010-06-19 18:37:06 +00:00
|
|
|
static void wrapline(FILE *f2,char *s){
|
2001-04-24 02:14:14 +00:00
|
|
|
int c;
|
|
|
|
if(!s){
|
|
|
|
fprintf(f2,"-");
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
while((c=*s++)){
|
|
|
|
if(c==',') fprintf(f2,"<br>"); else fputc(c,f2);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2010-06-19 18:44:43 +00:00
|
|
|
static void parsehtml(FILE *f1,FILE *f2,codecs_t *codec){
|
2010-05-03 23:34:38 +00:00
|
|
|
int c,d;
|
|
|
|
while((c=fgetc(f1))>=0){
|
|
|
|
if(c!='%'){
|
|
|
|
fputc(c,f2);
|
|
|
|
continue;
|
2001-04-24 02:14:14 +00:00
|
|
|
}
|
2010-05-03 23:34:38 +00:00
|
|
|
d=fgetc(f1);
|
|
|
|
|
|
|
|
switch(d){
|
|
|
|
case '.':
|
|
|
|
return; // end of section
|
|
|
|
case 'n':
|
|
|
|
wrapline(f2,codec->name); break;
|
|
|
|
case 'i':
|
|
|
|
wrapline(f2,codec->info); break;
|
|
|
|
case 'c':
|
|
|
|
wrapline(f2,codec->comment); break;
|
|
|
|
case 'd':
|
|
|
|
wrapline(f2,codec->dll); break;
|
|
|
|
case 'D':
|
|
|
|
fprintf(f2,"%c",!strcmp(codec->drv,"dshow")?'+':'-'); break;
|
|
|
|
case 'F':
|
|
|
|
for(d=0;d<CODECS_MAX_FOURCC;d++)
|
|
|
|
if(!d || codec->fourcc[d]!=0xFFFFFFFF)
|
|
|
|
fprintf(f2,"%s%.4s",d?"<br>":"",(codec->fourcc[d]==0xFFFFFFFF || codec->fourcc[d]<0x20202020)?!d?"-":"":(char*) &codec->fourcc[d]);
|
|
|
|
break;
|
|
|
|
case 'f':
|
|
|
|
for(d=0;d<CODECS_MAX_FOURCC;d++)
|
|
|
|
if(codec->fourcc[d]!=0xFFFFFFFF)
|
|
|
|
fprintf(f2,"%s0x%X",d?"<br>":"",codec->fourcc[d]);
|
|
|
|
break;
|
|
|
|
case 'Y':
|
|
|
|
for(d=0;d<CODECS_MAX_OUTFMT;d++)
|
|
|
|
if(codec->outfmt[d]!=0xFFFFFFFF){
|
|
|
|
for (c=0; fmt_table[c].name; c++)
|
|
|
|
if(fmt_table[c].num==codec->outfmt[d]) break;
|
|
|
|
if(fmt_table[c].name)
|
|
|
|
fprintf(f2,"%s%s",d?"<br>":"",fmt_table[c].name);
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
default:
|
|
|
|
fputc(c,f2);
|
|
|
|
fputc(d,f2);
|
|
|
|
}
|
|
|
|
}
|
2001-04-24 02:14:14 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void skiphtml(FILE *f1){
|
2010-05-03 23:34:38 +00:00
|
|
|
int c,d;
|
|
|
|
while((c=fgetc(f1))>=0){
|
|
|
|
if(c!='%'){
|
|
|
|
continue;
|
2001-04-24 02:14:14 +00:00
|
|
|
}
|
2010-05-03 23:34:38 +00:00
|
|
|
d=fgetc(f1);
|
|
|
|
if(d=='.') return; // end of section
|
|
|
|
}
|
2001-04-24 02:14:14 +00:00
|
|
|
}
|
|
|
|
|
2009-04-09 09:53:35 +00:00
|
|
|
static void print_int_array(const unsigned int* a, int size)
|
2002-12-15 23:45:19 +00:00
|
|
|
{
|
2010-05-03 23:34:38 +00:00
|
|
|
printf("{ ");
|
|
|
|
while (size--)
|
|
|
|
if(abs(*a)<256)
|
|
|
|
printf("%d%s", *a++, size?", ":"");
|
|
|
|
else
|
|
|
|
printf("0x%X%s", *a++, size?", ":"");
|
|
|
|
printf(" }");
|
2002-12-15 23:45:19 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
static void print_char_array(const unsigned char* a, int size)
|
|
|
|
{
|
2010-05-03 23:34:38 +00:00
|
|
|
printf("{ ");
|
|
|
|
while (size--)
|
|
|
|
if((*a)<10)
|
|
|
|
printf("%d%s", *a++, size?", ":"");
|
|
|
|
else
|
|
|
|
printf("0x%02x%s", *a++, size?", ":"");
|
|
|
|
printf(" }");
|
2002-12-15 23:45:19 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
static void print_string(const char* s)
|
|
|
|
{
|
2010-05-03 23:34:38 +00:00
|
|
|
if (!s) printf("NULL");
|
|
|
|
else printf("\"%s\"", s);
|
2002-12-15 23:45:19 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
int main(int argc, char* argv[])
|
2001-04-24 02:14:14 +00:00
|
|
|
{
|
2010-05-03 23:34:38 +00:00
|
|
|
codecs_t *cl;
|
|
|
|
FILE *f1;
|
|
|
|
FILE *f2;
|
|
|
|
int c,d,i;
|
|
|
|
int pos;
|
|
|
|
int section=-1;
|
|
|
|
int nr_codecs;
|
|
|
|
int win32=-1;
|
|
|
|
int dshow=-1;
|
|
|
|
int win32ex=-1;
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Take path to codecs.conf from command line, or fall back on
|
|
|
|
* etc/codecs.conf
|
|
|
|
*/
|
|
|
|
if (!(nr_codecs = parse_codec_cfg((argc>1)?argv[1]:"etc/codecs.conf")))
|
|
|
|
exit(1);
|
2010-06-19 18:31:35 +00:00
|
|
|
if (codecs_conf_release < CODEC_CFG_MIN)
|
|
|
|
exit(1);
|
2010-05-03 23:34:38 +00:00
|
|
|
|
|
|
|
if (argc > 1) {
|
|
|
|
int i, j;
|
|
|
|
const char* nm[2];
|
|
|
|
codecs_t* cod[2];
|
|
|
|
int nr[2];
|
|
|
|
|
|
|
|
nm[0] = "builtin_video_codecs";
|
|
|
|
cod[0] = video_codecs;
|
|
|
|
nr[0] = nr_vcodecs;
|
|
|
|
|
|
|
|
nm[1] = "builtin_audio_codecs";
|
|
|
|
cod[1] = audio_codecs;
|
|
|
|
nr[1] = nr_acodecs;
|
|
|
|
|
|
|
|
printf("/* GENERATED FROM %s, DO NOT EDIT! */\n\n",argv[1]);
|
2010-05-07 19:02:47 +00:00
|
|
|
printf("#include <stddef.h>\n");
|
|
|
|
printf("#include \"codec-cfg.h\"\n\n");
|
2010-06-19 18:31:35 +00:00
|
|
|
printf("#define CODEC_CFG_MIN %i\n\n", codecs_conf_release);
|
2010-05-03 23:34:38 +00:00
|
|
|
|
|
|
|
for (i=0; i<2; i++) {
|
|
|
|
printf("const codecs_t %s[] = {\n", nm[i]);
|
|
|
|
for (j = 0; j < nr[i]; j++) {
|
|
|
|
printf("{");
|
|
|
|
|
|
|
|
print_int_array(cod[i][j].fourcc, CODECS_MAX_FOURCC);
|
|
|
|
printf(", /* fourcc */\n");
|
|
|
|
|
|
|
|
print_int_array(cod[i][j].fourccmap, CODECS_MAX_FOURCC);
|
|
|
|
printf(", /* fourccmap */\n");
|
|
|
|
|
|
|
|
print_int_array(cod[i][j].outfmt, CODECS_MAX_OUTFMT);
|
|
|
|
printf(", /* outfmt */\n");
|
|
|
|
|
|
|
|
print_char_array(cod[i][j].outflags, CODECS_MAX_OUTFMT);
|
|
|
|
printf(", /* outflags */\n");
|
|
|
|
|
|
|
|
print_int_array(cod[i][j].infmt, CODECS_MAX_INFMT);
|
|
|
|
printf(", /* infmt */\n");
|
|
|
|
|
|
|
|
print_char_array(cod[i][j].inflags, CODECS_MAX_INFMT);
|
|
|
|
printf(", /* inflags */\n");
|
|
|
|
|
|
|
|
print_string(cod[i][j].name); printf(", /* name */\n");
|
|
|
|
print_string(cod[i][j].info); printf(", /* info */\n");
|
|
|
|
print_string(cod[i][j].comment); printf(", /* comment */\n");
|
|
|
|
print_string(cod[i][j].dll); printf(", /* dll */\n");
|
|
|
|
print_string(cod[i][j].drv); printf(", /* drv */\n");
|
|
|
|
|
|
|
|
printf("{ 0x%08lx, %hu, %hu,",
|
|
|
|
cod[i][j].guid.f1,
|
|
|
|
cod[i][j].guid.f2,
|
|
|
|
cod[i][j].guid.f3);
|
|
|
|
print_char_array(cod[i][j].guid.f4, sizeof(cod[i][j].guid.f4));
|
|
|
|
printf(" }, /* GUID */\n");
|
|
|
|
printf("%hd /* flags */, %hd /* status */, %hd /* cpuflags */ }\n",
|
|
|
|
cod[i][j].flags,
|
|
|
|
cod[i][j].status,
|
|
|
|
cod[i][j].cpuflags);
|
|
|
|
if (j < nr[i]) printf(",\n");
|
2001-04-24 02:14:14 +00:00
|
|
|
}
|
2010-05-03 23:34:38 +00:00
|
|
|
printf("};\n\n");
|
|
|
|
}
|
|
|
|
exit(0);
|
|
|
|
}
|
|
|
|
|
|
|
|
f1=fopen("DOCS/tech/codecs-in.html","rb"); if(!f1) exit(1);
|
|
|
|
f2=fopen("DOCS/codecs-status.html","wb"); if(!f2) exit(1);
|
|
|
|
|
|
|
|
while((c=fgetc(f1))>=0){
|
|
|
|
if(c!='%'){
|
|
|
|
fputc(c,f2);
|
|
|
|
continue;
|
|
|
|
}
|
|
|
|
d=fgetc(f1);
|
|
|
|
if(d>='0' && d<='9'){
|
|
|
|
// begin section
|
|
|
|
section=d-'0';
|
|
|
|
//printf("BEGIN %d\n",section);
|
|
|
|
if(section>=5){
|
|
|
|
// audio
|
|
|
|
cl = audio_codecs;
|
|
|
|
nr_codecs = nr_acodecs;
|
|
|
|
dshow=7;win32=4;
|
|
|
|
} else {
|
|
|
|
// video
|
|
|
|
cl = video_codecs;
|
|
|
|
nr_codecs = nr_vcodecs;
|
|
|
|
dshow=4;win32=2;win32ex=6;
|
|
|
|
}
|
|
|
|
pos=ftell(f1);
|
|
|
|
for(i=0;i<nr_codecs;i++){
|
|
|
|
fseek(f1,pos,SEEK_SET);
|
|
|
|
switch(section){
|
|
|
|
case 0:
|
|
|
|
case 5:
|
|
|
|
if(cl[i].status==CODECS_STATUS_WORKING)
|
|
|
|
// if(!(!strcmp(cl[i].drv,"vfw") || !strcmp(cl[i].drv,"dshow") || !strcmp(cl[i].drv,"vfwex") || !strcmp(cl[i].drv,"acm")))
|
2010-06-19 18:44:43 +00:00
|
|
|
parsehtml(f1,f2,&cl[i]);
|
2010-05-03 23:34:38 +00:00
|
|
|
break;
|
2002-11-16 05:31:27 +00:00
|
|
|
#if 0
|
2010-05-03 23:34:38 +00:00
|
|
|
case 1:
|
|
|
|
case 6:
|
|
|
|
if(cl[i].status==CODECS_STATUS_WORKING)
|
|
|
|
if((!strcmp(cl[i].drv,"vfw") || !strcmp(cl[i].drv,"dshow") || !strcmp(cl[i].drv,"vfwex") || !strcmp(cl[i].drv,"acm")))
|
2010-06-19 18:44:43 +00:00
|
|
|
parsehtml(f1,f2,&cl[i]);
|
2010-05-03 23:34:38 +00:00
|
|
|
break;
|
|
|
|
#endif
|
|
|
|
case 2:
|
|
|
|
case 7:
|
|
|
|
if(cl[i].status==CODECS_STATUS_PROBLEMS)
|
2010-06-19 18:44:43 +00:00
|
|
|
parsehtml(f1,f2,&cl[i]);
|
2010-05-03 23:34:38 +00:00
|
|
|
break;
|
|
|
|
case 3:
|
|
|
|
case 8:
|
|
|
|
if(cl[i].status==CODECS_STATUS_NOT_WORKING)
|
2010-06-19 18:44:43 +00:00
|
|
|
parsehtml(f1,f2,&cl[i]);
|
2010-05-03 23:34:38 +00:00
|
|
|
break;
|
|
|
|
case 4:
|
|
|
|
case 9:
|
|
|
|
if(cl[i].status==CODECS_STATUS_UNTESTED)
|
2010-06-19 18:44:43 +00:00
|
|
|
parsehtml(f1,f2,&cl[i]);
|
2010-05-03 23:34:38 +00:00
|
|
|
break;
|
|
|
|
default:
|
|
|
|
printf("Warning! unimplemented section: %d\n",section);
|
2001-04-24 02:14:14 +00:00
|
|
|
}
|
2010-05-03 23:34:38 +00:00
|
|
|
}
|
|
|
|
fseek(f1,pos,SEEK_SET);
|
|
|
|
skiphtml(f1);
|
2009-07-06 23:26:13 +00:00
|
|
|
|
2010-05-03 23:34:38 +00:00
|
|
|
continue;
|
2001-04-24 02:14:14 +00:00
|
|
|
}
|
2010-05-03 23:34:38 +00:00
|
|
|
fputc(c,f2);
|
|
|
|
fputc(d,f2);
|
|
|
|
}
|
2009-07-06 23:26:13 +00:00
|
|
|
|
2010-05-03 23:34:38 +00:00
|
|
|
fclose(f2);
|
|
|
|
fclose(f1);
|
|
|
|
return 0;
|
2001-04-24 02:14:14 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
#endif
|
|
|
|
|
2001-04-06 23:20:46 +00:00
|
|
|
#ifdef TESTING
|
|
|
|
int main(void)
|
|
|
|
{
|
2010-05-03 23:34:38 +00:00
|
|
|
codecs_t *c;
|
|
|
|
int i,j, nr_codecs, state;
|
|
|
|
|
|
|
|
if (!(parse_codec_cfg("etc/codecs.conf")))
|
|
|
|
return 0;
|
|
|
|
if (!video_codecs)
|
|
|
|
printf("no videoconfig.\n");
|
|
|
|
if (!audio_codecs)
|
|
|
|
printf("no audioconfig.\n");
|
|
|
|
|
|
|
|
printf("videocodecs:\n");
|
|
|
|
c = video_codecs;
|
|
|
|
nr_codecs = nr_vcodecs;
|
|
|
|
state = 0;
|
2001-04-10 20:09:23 +00:00
|
|
|
next:
|
2010-05-03 23:34:38 +00:00
|
|
|
if (c) {
|
|
|
|
printf("number of %scodecs: %d\n", state==0?"video":"audio",
|
|
|
|
nr_codecs);
|
|
|
|
for(i=0;i<nr_codecs;i++, c++){
|
|
|
|
printf("\n============== %scodec %02d ===============\n",
|
|
|
|
state==0?"video":"audio",i);
|
|
|
|
printf("name='%s'\n",c->name);
|
|
|
|
printf("info='%s'\n",c->info);
|
|
|
|
printf("comment='%s'\n",c->comment);
|
|
|
|
printf("dll='%s'\n",c->dll);
|
|
|
|
/* printf("flags=%X driver=%d status=%d cpuflags=%d\n",
|
|
|
|
c->flags, c->driver, c->status, c->cpuflags); */
|
|
|
|
printf("flags=%X status=%d cpuflags=%d\n",
|
|
|
|
c->flags, c->status, c->cpuflags);
|
|
|
|
|
|
|
|
for(j=0;j<CODECS_MAX_FOURCC;j++){
|
|
|
|
if(c->fourcc[j]!=0xFFFFFFFF){
|
|
|
|
printf("fourcc %02d: %08X (%.4s) ===> %08X (%.4s)\n",j,c->fourcc[j],(char *) &c->fourcc[j],c->fourccmap[j],(char *) &c->fourccmap[j]);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
for(j=0;j<CODECS_MAX_OUTFMT;j++){
|
|
|
|
if(c->outfmt[j]!=0xFFFFFFFF){
|
|
|
|
printf("outfmt %02d: %08X (%.4s) flags: %d\n",j,c->outfmt[j],(char *) &c->outfmt[j],c->outflags[j]);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
for(j=0;j<CODECS_MAX_INFMT;j++){
|
|
|
|
if(c->infmt[j]!=0xFFFFFFFF){
|
|
|
|
printf("infmt %02d: %08X (%.4s) flags: %d\n",j,c->infmt[j],(char *) &c->infmt[j],c->inflags[j]);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
printf("GUID: %08lX %04X %04X",c->guid.f1,c->guid.f2,c->guid.f3);
|
|
|
|
for(j=0;j<8;j++) printf(" %02X",c->guid.f4[j]);
|
|
|
|
printf("\n");
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if (!state) {
|
|
|
|
printf("audiocodecs:\n");
|
|
|
|
c = audio_codecs;
|
|
|
|
nr_codecs = nr_acodecs;
|
|
|
|
state = 1;
|
|
|
|
goto next;
|
|
|
|
}
|
|
|
|
return 0;
|
2001-04-06 23:20:46 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
#endif
|