changeset 4676:f6a2d81c52ac

fixed old testing part
author alex
date Tue, 12 Feb 2002 17:52:30 +0000
parents d8a577a52437
children 305a0c20bde4
files codec-cfg.c
diffstat 1 files changed, 21 insertions(+), 8 deletions(-) [+]
line wrap: on
line diff
--- a/codec-cfg.c	Tue Feb 12 17:33:27 2002 +0000
+++ b/codec-cfg.c	Tue Feb 12 17:52:30 2002 +0000
@@ -2,6 +2,11 @@
  * codec.conf parser
  * by Szabolcs Berecz <szabi@inf.elte.hu>
  * (C) 2001
+ *
+ * to compile tester app: gcc -Iloader/ -DTESTING -o codec-cfg codec-cfg.c
+ * to compile CODECS2HTML: gcc -Iloader/ -DCODECS2HTML -o codecs2html codecs-cfg.c
+ *
+ * TODO: implement informat in CODECS2HTML too
  */
 
 #define DEBUG
@@ -903,25 +908,27 @@
 #ifdef TESTING
 int main(void)
 {
-	codecs_t **codecs, *c;
+	codecs_t *c;
         int i,j, nr_codecs, state;
 
-	if (!(codecs = parse_codec_cfg("etc/codecs.conf")))
+	if (!(parse_codec_cfg("etc/codecs.conf")))
 		return 0;
-	if (!codecs[0])
+	if (!video_codecs)
 		printf("no videoconfig.\n");
-	if (!codecs[1])
+	if (!audio_codecs)
 		printf("no audioconfig.\n");
 
 	printf("videocodecs:\n");
-	c = codecs[0];
+	c = video_codecs;
 	nr_codecs = nr_vcodecs;
 	state = 0;
 next:
 	if (c) {
-		printf("number of codecs: %d\n", nr_codecs);
+		printf("number of %scodecs: %d\n", state==0?"video":"audio",
+		    nr_codecs);
 		for(i=0;i<nr_codecs;i++, c++){
-		    printf("\n============== codec %02d ===============\n",i);
+		    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);
@@ -941,6 +948,12 @@
 		      }
 		    }
 
+		    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");
@@ -950,7 +963,7 @@
 	}
 	if (!state) {
 		printf("audiocodecs:\n");
-		c = codecs[1];
+		c = audio_codecs;
 		nr_codecs = nr_acodecs;
 		state = 1;
 		goto next;