Mercurial > mplayer.hg
comparison codec-cfg.c @ 4676:f6a2d81c52ac
fixed old testing part
author | alex |
---|---|
date | Tue, 12 Feb 2002 17:52:30 +0000 |
parents | d8a577a52437 |
children | 4a6dde59834c |
comparison
equal
deleted
inserted
replaced
4675:d8a577a52437 | 4676:f6a2d81c52ac |
---|---|
1 /* | 1 /* |
2 * codec.conf parser | 2 * codec.conf parser |
3 * by Szabolcs Berecz <szabi@inf.elte.hu> | 3 * by Szabolcs Berecz <szabi@inf.elte.hu> |
4 * (C) 2001 | 4 * (C) 2001 |
5 * | |
6 * to compile tester app: gcc -Iloader/ -DTESTING -o codec-cfg codec-cfg.c | |
7 * to compile CODECS2HTML: gcc -Iloader/ -DCODECS2HTML -o codecs2html codecs-cfg.c | |
8 * | |
9 * TODO: implement informat in CODECS2HTML too | |
5 */ | 10 */ |
6 | 11 |
7 #define DEBUG | 12 #define DEBUG |
8 | 13 |
9 //disable asserts | 14 //disable asserts |
901 #endif | 906 #endif |
902 | 907 |
903 #ifdef TESTING | 908 #ifdef TESTING |
904 int main(void) | 909 int main(void) |
905 { | 910 { |
906 codecs_t **codecs, *c; | 911 codecs_t *c; |
907 int i,j, nr_codecs, state; | 912 int i,j, nr_codecs, state; |
908 | 913 |
909 if (!(codecs = parse_codec_cfg("etc/codecs.conf"))) | 914 if (!(parse_codec_cfg("etc/codecs.conf"))) |
910 return 0; | 915 return 0; |
911 if (!codecs[0]) | 916 if (!video_codecs) |
912 printf("no videoconfig.\n"); | 917 printf("no videoconfig.\n"); |
913 if (!codecs[1]) | 918 if (!audio_codecs) |
914 printf("no audioconfig.\n"); | 919 printf("no audioconfig.\n"); |
915 | 920 |
916 printf("videocodecs:\n"); | 921 printf("videocodecs:\n"); |
917 c = codecs[0]; | 922 c = video_codecs; |
918 nr_codecs = nr_vcodecs; | 923 nr_codecs = nr_vcodecs; |
919 state = 0; | 924 state = 0; |
920 next: | 925 next: |
921 if (c) { | 926 if (c) { |
922 printf("number of codecs: %d\n", nr_codecs); | 927 printf("number of %scodecs: %d\n", state==0?"video":"audio", |
928 nr_codecs); | |
923 for(i=0;i<nr_codecs;i++, c++){ | 929 for(i=0;i<nr_codecs;i++, c++){ |
924 printf("\n============== codec %02d ===============\n",i); | 930 printf("\n============== %scodec %02d ===============\n", |
931 state==0?"video":"audio",i); | |
925 printf("name='%s'\n",c->name); | 932 printf("name='%s'\n",c->name); |
926 printf("info='%s'\n",c->info); | 933 printf("info='%s'\n",c->info); |
927 printf("comment='%s'\n",c->comment); | 934 printf("comment='%s'\n",c->comment); |
928 printf("dll='%s'\n",c->dll); | 935 printf("dll='%s'\n",c->dll); |
929 printf("flags=%X driver=%d status=%d cpuflags=%d\n", | 936 printf("flags=%X driver=%d status=%d cpuflags=%d\n", |
939 if(c->outfmt[j]!=0xFFFFFFFF){ | 946 if(c->outfmt[j]!=0xFFFFFFFF){ |
940 printf("outfmt %02d: %08X (%.4s) flags: %d\n",j,c->outfmt[j],(char *) &c->outfmt[j],c->outflags[j]); | 947 printf("outfmt %02d: %08X (%.4s) flags: %d\n",j,c->outfmt[j],(char *) &c->outfmt[j],c->outflags[j]); |
941 } | 948 } |
942 } | 949 } |
943 | 950 |
951 for(j=0;j<CODECS_MAX_INFMT;j++){ | |
952 if(c->infmt[j]!=0xFFFFFFFF){ | |
953 printf("infmt %02d: %08X (%.4s) flags: %d\n",j,c->infmt[j],(char *) &c->infmt[j],c->inflags[j]); | |
954 } | |
955 } | |
956 | |
944 printf("GUID: %08lX %04X %04X",c->guid.f1,c->guid.f2,c->guid.f3); | 957 printf("GUID: %08lX %04X %04X",c->guid.f1,c->guid.f2,c->guid.f3); |
945 for(j=0;j<8;j++) printf(" %02X",c->guid.f4[j]); | 958 for(j=0;j<8;j++) printf(" %02X",c->guid.f4[j]); |
946 printf("\n"); | 959 printf("\n"); |
947 | 960 |
948 | 961 |
949 } | 962 } |
950 } | 963 } |
951 if (!state) { | 964 if (!state) { |
952 printf("audiocodecs:\n"); | 965 printf("audiocodecs:\n"); |
953 c = codecs[1]; | 966 c = audio_codecs; |
954 nr_codecs = nr_acodecs; | 967 nr_codecs = nr_acodecs; |
955 state = 1; | 968 state = 1; |
956 goto next; | 969 goto next; |
957 } | 970 } |
958 return 0; | 971 return 0; |