Mercurial > mplayer.hg
annotate libmpdemux/aviprint.c @ 2509:22ee3be96a7f
forgot, sorry
author | nick |
---|---|
date | Sun, 28 Oct 2001 11:47:22 +0000 |
parents | d0e1c32ad432 |
children | 66837325b929 |
rev | line source |
---|---|
587
8511095c5283
stage#1 completed: c files no more included from mplayer.c
arpi_esp
parents:
353
diff
changeset
|
1 |
8511095c5283
stage#1 completed: c files no more included from mplayer.c
arpi_esp
parents:
353
diff
changeset
|
2 #include <stdio.h> |
8511095c5283
stage#1 completed: c files no more included from mplayer.c
arpi_esp
parents:
353
diff
changeset
|
3 #include <stdlib.h> |
1430 | 4 #include <unistd.h> |
587
8511095c5283
stage#1 completed: c files no more included from mplayer.c
arpi_esp
parents:
353
diff
changeset
|
5 |
8511095c5283
stage#1 completed: c files no more included from mplayer.c
arpi_esp
parents:
353
diff
changeset
|
6 #include "stream.h" |
8511095c5283
stage#1 completed: c files no more included from mplayer.c
arpi_esp
parents:
353
diff
changeset
|
7 #include "demuxer.h" |
8511095c5283
stage#1 completed: c files no more included from mplayer.c
arpi_esp
parents:
353
diff
changeset
|
8 |
8511095c5283
stage#1 completed: c files no more included from mplayer.c
arpi_esp
parents:
353
diff
changeset
|
9 #include "wine/mmreg.h" |
8511095c5283
stage#1 completed: c files no more included from mplayer.c
arpi_esp
parents:
353
diff
changeset
|
10 #include "wine/avifmt.h" |
8511095c5283
stage#1 completed: c files no more included from mplayer.c
arpi_esp
parents:
353
diff
changeset
|
11 #include "wine/vfw.h" |
8511095c5283
stage#1 completed: c files no more included from mplayer.c
arpi_esp
parents:
353
diff
changeset
|
12 |
8511095c5283
stage#1 completed: c files no more included from mplayer.c
arpi_esp
parents:
353
diff
changeset
|
13 //#include "codec-cfg.h" |
8511095c5283
stage#1 completed: c files no more included from mplayer.c
arpi_esp
parents:
353
diff
changeset
|
14 //#include "stheader.h" |
8511095c5283
stage#1 completed: c files no more included from mplayer.c
arpi_esp
parents:
353
diff
changeset
|
15 |
1456
8c57a5a3c645
printfs cleanup - moved to higher -v level or moved to stderr
arpi
parents:
1430
diff
changeset
|
16 void print_avih_flags(MainAVIHeader *h){ |
8c57a5a3c645
printfs cleanup - moved to higher -v level or moved to stderr
arpi
parents:
1430
diff
changeset
|
17 printf("MainAVIHeader.dwFlags: (%ld)%s%s%s%s%s%s\n",h->dwFlags, |
1 | 18 (h->dwFlags&AVIF_HASINDEX)?" HAS_INDEX":"", |
19 (h->dwFlags&AVIF_MUSTUSEINDEX)?" MUST_USE_INDEX":"", | |
20 (h->dwFlags&AVIF_ISINTERLEAVED)?" IS_INTERLEAVED":"", | |
21 (h->dwFlags&AVIF_TRUSTCKTYPE)?" TRUST_CKTYPE":"", | |
22 (h->dwFlags&AVIF_WASCAPTUREFILE)?" WAS_CAPTUREFILE":"", | |
23 (h->dwFlags&AVIF_COPYRIGHTED)?" COPYRIGHTED":"" | |
24 ); | |
1456
8c57a5a3c645
printfs cleanup - moved to higher -v level or moved to stderr
arpi
parents:
1430
diff
changeset
|
25 } |
8c57a5a3c645
printfs cleanup - moved to higher -v level or moved to stderr
arpi
parents:
1430
diff
changeset
|
26 |
8c57a5a3c645
printfs cleanup - moved to higher -v level or moved to stderr
arpi
parents:
1430
diff
changeset
|
27 void print_avih(MainAVIHeader *h){ |
8c57a5a3c645
printfs cleanup - moved to higher -v level or moved to stderr
arpi
parents:
1430
diff
changeset
|
28 printf("======= AVI Header =======\n"); |
8c57a5a3c645
printfs cleanup - moved to higher -v level or moved to stderr
arpi
parents:
1430
diff
changeset
|
29 printf("us/frame: %ld (fps=%5.3f)\n",h->dwMicroSecPerFrame,1000000.0f/(float)h->dwMicroSecPerFrame); |
8c57a5a3c645
printfs cleanup - moved to higher -v level or moved to stderr
arpi
parents:
1430
diff
changeset
|
30 printf("max bytes/sec: %ld\n",h->dwMaxBytesPerSec); |
8c57a5a3c645
printfs cleanup - moved to higher -v level or moved to stderr
arpi
parents:
1430
diff
changeset
|
31 printf("padding: %ld\n",h->dwPaddingGranularity); |
8c57a5a3c645
printfs cleanup - moved to higher -v level or moved to stderr
arpi
parents:
1430
diff
changeset
|
32 print_avih_flags(h); |
602 | 33 printf("frames total: %ld initial: %ld\n",h->dwTotalFrames,h->dwInitialFrames); |
34 printf("streams: %ld\n",h->dwStreams); | |
35 printf("Suggested BufferSize: %ld\n",h->dwSuggestedBufferSize); | |
36 printf("Size: %ld x %ld\n",h->dwWidth,h->dwHeight); | |
1 | 37 } |
38 | |
39 void print_strh(AVIStreamHeader *h){ | |
40 printf("======= STREAM Header =======\n"); | |
602 | 41 printf("Type: %.4s FCC: %.4s (%X)\n",(char *)&h->fccType,(char *)&h->fccHandler,(unsigned int)h->fccHandler); |
42 printf("Flags: %ld\n",h->dwFlags); | |
1 | 43 printf("Priority: %d Language: %d\n",h->wPriority,h->wLanguage); |
602 | 44 printf("InitialFrames: %ld\n",h->dwInitialFrames); |
45 printf("Rate: %ld/%ld = %5.3f\n",h->dwRate,h->dwScale,(float)h->dwRate/(float)h->dwScale); | |
46 printf("Start: %ld Len: %ld\n",h->dwStart,h->dwLength); | |
47 printf("Suggested BufferSize: %ld\n",h->dwSuggestedBufferSize); | |
48 printf("Quality %ld\n",h->dwQuality); | |
49 printf("Sample size: %ld\n",h->dwSampleSize); | |
1 | 50 } |
51 | |
52 void print_wave_header(WAVEFORMATEX *h){ | |
53 | |
54 printf("======= WAVE Format =======\n"); | |
55 printf("Format Tag: %d (0x%X)\n",h->wFormatTag,h->wFormatTag); | |
56 printf("Channels: %d\n",h->nChannels); | |
602 | 57 printf("Samplerate: %ld\n",h->nSamplesPerSec); |
58 printf("avg byte/sec: %ld\n",h->nAvgBytesPerSec); | |
1 | 59 printf("Block align: %d\n",h->nBlockAlign); |
60 printf("bits/sample: %d\n",h->wBitsPerSample); | |
61 printf("cbSize: %d\n",h->cbSize); | |
62 } | |
63 | |
64 | |
65 void print_video_header(BITMAPINFOHEADER *h){ | |
66 printf("======= VIDEO Format ======\n"); | |
602 | 67 printf(" biSize %ld\n", h->biSize); |
68 printf(" biWidth %ld\n", h->biWidth); | |
69 printf(" biHeight %ld\n", h->biHeight); | |
1 | 70 printf(" biPlanes %d\n", h->biPlanes); |
71 printf(" biBitCount %d\n", h->biBitCount); | |
602 | 72 printf(" biCompression %ld='%.4s'\n", h->biCompression, (char *)&h->biCompression); |
73 printf(" biSizeImage %ld\n", h->biSizeImage); | |
1 | 74 printf("===========================\n"); |
75 } | |
76 | |
77 | |
587
8511095c5283
stage#1 completed: c files no more included from mplayer.c
arpi_esp
parents:
353
diff
changeset
|
78 void print_index(AVIINDEXENTRY *idx,int idx_size){ |
1 | 79 int i; |
1485
b895f95e7657
AVI demuxer cleanups, fileformat-dependent stuff moved to priv_t
arpi
parents:
1456
diff
changeset
|
80 unsigned int pos[256]; |
b895f95e7657
AVI demuxer cleanups, fileformat-dependent stuff moved to priv_t
arpi
parents:
1456
diff
changeset
|
81 unsigned int num[256]; |
b895f95e7657
AVI demuxer cleanups, fileformat-dependent stuff moved to priv_t
arpi
parents:
1456
diff
changeset
|
82 for(i=0;i<256;i++) num[i]=pos[i]=0; |
587
8511095c5283
stage#1 completed: c files no more included from mplayer.c
arpi_esp
parents:
353
diff
changeset
|
83 for(i=0;i<idx_size;i++){ |
1485
b895f95e7657
AVI demuxer cleanups, fileformat-dependent stuff moved to priv_t
arpi
parents:
1456
diff
changeset
|
84 int id=avi_stream_id(idx[i].ckid); |
b895f95e7657
AVI demuxer cleanups, fileformat-dependent stuff moved to priv_t
arpi
parents:
1456
diff
changeset
|
85 if(id<0 || id>255) id=255; |
b895f95e7657
AVI demuxer cleanups, fileformat-dependent stuff moved to priv_t
arpi
parents:
1456
diff
changeset
|
86 printf("%5d: %.4s %4X %08X len:%6ld pos:%7d->%7.3f %7d->%7.3f\n",i, |
602 | 87 (char *)&idx[i].ckid, |
88 (unsigned int)idx[i].dwFlags, | |
89 (unsigned int)idx[i].dwChunkOffset, | |
587
8511095c5283
stage#1 completed: c files no more included from mplayer.c
arpi_esp
parents:
353
diff
changeset
|
90 // idx[i].dwChunkOffset+demuxer->movi_start, |
1485
b895f95e7657
AVI demuxer cleanups, fileformat-dependent stuff moved to priv_t
arpi
parents:
1456
diff
changeset
|
91 idx[i].dwChunkLength, |
b895f95e7657
AVI demuxer cleanups, fileformat-dependent stuff moved to priv_t
arpi
parents:
1456
diff
changeset
|
92 pos[id],(float)pos[id]/18747.0f, |
b895f95e7657
AVI demuxer cleanups, fileformat-dependent stuff moved to priv_t
arpi
parents:
1456
diff
changeset
|
93 num[id],(float)num[id]/23.976f |
1 | 94 ); |
1485
b895f95e7657
AVI demuxer cleanups, fileformat-dependent stuff moved to priv_t
arpi
parents:
1456
diff
changeset
|
95 pos[id]+=idx[i].dwChunkLength; |
b895f95e7657
AVI demuxer cleanups, fileformat-dependent stuff moved to priv_t
arpi
parents:
1456
diff
changeset
|
96 ++num[id]; |
1 | 97 } |
98 } | |
99 | |
100 |