Mercurial > mplayer.hg
annotate libmpdemux/aviprint.c @ 12293:126690afcda7
release name, changes
author | alex |
---|---|
date | Mon, 26 Apr 2004 10:17:10 +0000 |
parents | 846ed866f86c |
children | 0db4a3a5b01d |
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 |
2555
66837325b929
config.h cleanup, few things added to steram/demuxer headers
arpi
parents:
2314
diff
changeset
|
6 #include "config.h" |
66837325b929
config.h cleanup, few things added to steram/demuxer headers
arpi
parents:
2314
diff
changeset
|
7 |
7471 | 8 // for avi_stream_id(): |
587
8511095c5283
stage#1 completed: c files no more included from mplayer.c
arpi_esp
parents:
353
diff
changeset
|
9 #include "stream.h" |
8511095c5283
stage#1 completed: c files no more included from mplayer.c
arpi_esp
parents:
353
diff
changeset
|
10 #include "demuxer.h" |
8511095c5283
stage#1 completed: c files no more included from mplayer.c
arpi_esp
parents:
353
diff
changeset
|
11 |
8511095c5283
stage#1 completed: c files no more included from mplayer.c
arpi_esp
parents:
353
diff
changeset
|
12 #include "wine/mmreg.h" |
8511095c5283
stage#1 completed: c files no more included from mplayer.c
arpi_esp
parents:
353
diff
changeset
|
13 #include "wine/avifmt.h" |
8511095c5283
stage#1 completed: c files no more included from mplayer.c
arpi_esp
parents:
353
diff
changeset
|
14 #include "wine/vfw.h" |
8511095c5283
stage#1 completed: c files no more included from mplayer.c
arpi_esp
parents:
353
diff
changeset
|
15 |
12036 | 16 #include "aviheader.h" |
17 | |
587
8511095c5283
stage#1 completed: c files no more included from mplayer.c
arpi_esp
parents:
353
diff
changeset
|
18 //#include "codec-cfg.h" |
8511095c5283
stage#1 completed: c files no more included from mplayer.c
arpi_esp
parents:
353
diff
changeset
|
19 //#include "stheader.h" |
8511095c5283
stage#1 completed: c files no more included from mplayer.c
arpi_esp
parents:
353
diff
changeset
|
20 |
1456
8c57a5a3c645
printfs cleanup - moved to higher -v level or moved to stderr
arpi
parents:
1430
diff
changeset
|
21 void print_avih_flags(MainAVIHeader *h){ |
8c57a5a3c645
printfs cleanup - moved to higher -v level or moved to stderr
arpi
parents:
1430
diff
changeset
|
22 printf("MainAVIHeader.dwFlags: (%ld)%s%s%s%s%s%s\n",h->dwFlags, |
1 | 23 (h->dwFlags&AVIF_HASINDEX)?" HAS_INDEX":"", |
24 (h->dwFlags&AVIF_MUSTUSEINDEX)?" MUST_USE_INDEX":"", | |
25 (h->dwFlags&AVIF_ISINTERLEAVED)?" IS_INTERLEAVED":"", | |
26 (h->dwFlags&AVIF_TRUSTCKTYPE)?" TRUST_CKTYPE":"", | |
27 (h->dwFlags&AVIF_WASCAPTUREFILE)?" WAS_CAPTUREFILE":"", | |
28 (h->dwFlags&AVIF_COPYRIGHTED)?" COPYRIGHTED":"" | |
29 ); | |
1456
8c57a5a3c645
printfs cleanup - moved to higher -v level or moved to stderr
arpi
parents:
1430
diff
changeset
|
30 } |
8c57a5a3c645
printfs cleanup - moved to higher -v level or moved to stderr
arpi
parents:
1430
diff
changeset
|
31 |
8c57a5a3c645
printfs cleanup - moved to higher -v level or moved to stderr
arpi
parents:
1430
diff
changeset
|
32 void print_avih(MainAVIHeader *h){ |
8c57a5a3c645
printfs cleanup - moved to higher -v level or moved to stderr
arpi
parents:
1430
diff
changeset
|
33 printf("======= AVI Header =======\n"); |
8c57a5a3c645
printfs cleanup - moved to higher -v level or moved to stderr
arpi
parents:
1430
diff
changeset
|
34 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
|
35 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
|
36 printf("padding: %ld\n",h->dwPaddingGranularity); |
8c57a5a3c645
printfs cleanup - moved to higher -v level or moved to stderr
arpi
parents:
1430
diff
changeset
|
37 print_avih_flags(h); |
602 | 38 printf("frames total: %ld initial: %ld\n",h->dwTotalFrames,h->dwInitialFrames); |
39 printf("streams: %ld\n",h->dwStreams); | |
40 printf("Suggested BufferSize: %ld\n",h->dwSuggestedBufferSize); | |
41 printf("Size: %ld x %ld\n",h->dwWidth,h->dwHeight); | |
10484
105077598ef3
dump extra bytes of bitmapinfoheader in verbose mode and make outputs consistent
alex
parents:
8123
diff
changeset
|
42 printf("==========================\n"); |
1 | 43 } |
44 | |
45 void print_strh(AVIStreamHeader *h){ | |
10484
105077598ef3
dump extra bytes of bitmapinfoheader in verbose mode and make outputs consistent
alex
parents:
8123
diff
changeset
|
46 printf("====== STREAM Header =====\n"); |
602 | 47 printf("Type: %.4s FCC: %.4s (%X)\n",(char *)&h->fccType,(char *)&h->fccHandler,(unsigned int)h->fccHandler); |
48 printf("Flags: %ld\n",h->dwFlags); | |
1 | 49 printf("Priority: %d Language: %d\n",h->wPriority,h->wLanguage); |
602 | 50 printf("InitialFrames: %ld\n",h->dwInitialFrames); |
51 printf("Rate: %ld/%ld = %5.3f\n",h->dwRate,h->dwScale,(float)h->dwRate/(float)h->dwScale); | |
52 printf("Start: %ld Len: %ld\n",h->dwStart,h->dwLength); | |
53 printf("Suggested BufferSize: %ld\n",h->dwSuggestedBufferSize); | |
54 printf("Quality %ld\n",h->dwQuality); | |
55 printf("Sample size: %ld\n",h->dwSampleSize); | |
10484
105077598ef3
dump extra bytes of bitmapinfoheader in verbose mode and make outputs consistent
alex
parents:
8123
diff
changeset
|
56 printf("==========================\n"); |
1 | 57 } |
58 | |
59 void print_wave_header(WAVEFORMATEX *h){ | |
60 printf("======= WAVE Format =======\n"); | |
61 printf("Format Tag: %d (0x%X)\n",h->wFormatTag,h->wFormatTag); | |
62 printf("Channels: %d\n",h->nChannels); | |
602 | 63 printf("Samplerate: %ld\n",h->nSamplesPerSec); |
64 printf("avg byte/sec: %ld\n",h->nAvgBytesPerSec); | |
1 | 65 printf("Block align: %d\n",h->nBlockAlign); |
66 printf("bits/sample: %d\n",h->wBitsPerSample); | |
67 printf("cbSize: %d\n",h->cbSize); | |
5711 | 68 if(h->wFormatTag==0x55 && h->cbSize>=12){ |
7127 | 69 MPEGLAYER3WAVEFORMAT* h2=(MPEGLAYER3WAVEFORMAT *)h; |
5688 | 70 printf("mp3.wID=%d\n",h2->wID); |
8123
9fc45fe0d444
*HUGE* set of compiler warning fixes, unused variables removal
arpi
parents:
7471
diff
changeset
|
71 printf("mp3.fdwFlags=0x%lX\n",h2->fdwFlags); |
5688 | 72 printf("mp3.nBlockSize=%d\n",h2->nBlockSize); |
73 printf("mp3.nFramesPerBlock=%d\n",h2->nFramesPerBlock); | |
74 printf("mp3.nCodecDelay=%d\n",h2->nCodecDelay); | |
75 } | |
5758 | 76 else if (h->cbSize > 0) |
77 { | |
78 int i; | |
5896 | 79 uint8_t* p = ((uint8_t*)h) + sizeof(WAVEFORMATEX); |
5758 | 80 printf("Unknown extra header dump: "); |
81 for (i = 0; i < h->cbSize; i++) | |
5896 | 82 printf("[%x] ", *(p+i)); |
5758 | 83 printf("\n"); |
84 } | |
10484
105077598ef3
dump extra bytes of bitmapinfoheader in verbose mode and make outputs consistent
alex
parents:
8123
diff
changeset
|
85 printf("===========================\n"); |
1 | 86 } |
87 | |
88 | |
89 void print_video_header(BITMAPINFOHEADER *h){ | |
90 printf("======= VIDEO Format ======\n"); | |
8123
9fc45fe0d444
*HUGE* set of compiler warning fixes, unused variables removal
arpi
parents:
7471
diff
changeset
|
91 printf(" biSize %d\n", h->biSize); |
9fc45fe0d444
*HUGE* set of compiler warning fixes, unused variables removal
arpi
parents:
7471
diff
changeset
|
92 printf(" biWidth %d\n", h->biWidth); |
9fc45fe0d444
*HUGE* set of compiler warning fixes, unused variables removal
arpi
parents:
7471
diff
changeset
|
93 printf(" biHeight %d\n", h->biHeight); |
1 | 94 printf(" biPlanes %d\n", h->biPlanes); |
95 printf(" biBitCount %d\n", h->biBitCount); | |
8123
9fc45fe0d444
*HUGE* set of compiler warning fixes, unused variables removal
arpi
parents:
7471
diff
changeset
|
96 printf(" biCompression %d='%.4s'\n", h->biCompression, (char *)&h->biCompression); |
9fc45fe0d444
*HUGE* set of compiler warning fixes, unused variables removal
arpi
parents:
7471
diff
changeset
|
97 printf(" biSizeImage %d\n", h->biSizeImage); |
10484
105077598ef3
dump extra bytes of bitmapinfoheader in verbose mode and make outputs consistent
alex
parents:
8123
diff
changeset
|
98 if (h->biSize > sizeof(BITMAPINFOHEADER)) |
105077598ef3
dump extra bytes of bitmapinfoheader in verbose mode and make outputs consistent
alex
parents:
8123
diff
changeset
|
99 { |
105077598ef3
dump extra bytes of bitmapinfoheader in verbose mode and make outputs consistent
alex
parents:
8123
diff
changeset
|
100 int i; |
105077598ef3
dump extra bytes of bitmapinfoheader in verbose mode and make outputs consistent
alex
parents:
8123
diff
changeset
|
101 uint8_t* p = ((uint8_t*)h) + sizeof(BITMAPINFOHEADER); |
105077598ef3
dump extra bytes of bitmapinfoheader in verbose mode and make outputs consistent
alex
parents:
8123
diff
changeset
|
102 printf("Unknown extra header dump: "); |
105077598ef3
dump extra bytes of bitmapinfoheader in verbose mode and make outputs consistent
alex
parents:
8123
diff
changeset
|
103 for (i = 0; i < h->biSize-sizeof(BITMAPINFOHEADER); i++) |
105077598ef3
dump extra bytes of bitmapinfoheader in verbose mode and make outputs consistent
alex
parents:
8123
diff
changeset
|
104 printf("[%x] ", *(p+i)); |
105077598ef3
dump extra bytes of bitmapinfoheader in verbose mode and make outputs consistent
alex
parents:
8123
diff
changeset
|
105 printf("\n"); |
105077598ef3
dump extra bytes of bitmapinfoheader in verbose mode and make outputs consistent
alex
parents:
8123
diff
changeset
|
106 } |
1 | 107 printf("===========================\n"); |
108 } | |
109 | |
12036 | 110 void print_vprp(VideoPropHeader *vprp){ |
111 int i; | |
112 printf("======= Video Properties Header =======\n"); | |
113 printf("Format: %d VideoStandard: %d\n", | |
114 vprp->VideoFormatToken,vprp->VideoStandard); | |
115 printf("VRefresh: %d HTotal: %d VTotal: %d\n", | |
116 vprp->dwVerticalRefreshRate, vprp->dwHTotalInT, vprp->dwVTotalInLines); | |
117 printf("FrameAspect: %d:%d Framewidth: %d Frameheight: %d\n", | |
118 vprp->dwFrameAspectRatio >> 16, vprp->dwFrameAspectRatio & 0xffff, | |
119 vprp->dwFrameWidthInPixels, vprp->dwFrameHeightInLines); | |
120 printf("Fields: %d\n", vprp->nbFieldPerFrame); | |
121 for (i=0; i<vprp->nbFieldPerFrame; i++) { | |
122 VIDEO_FIELD_DESC *vfd = &vprp->FieldInfo[i]; | |
123 printf(" == Field %d description ==\n", i); | |
124 printf(" CompressedBMHeight: %d CompressedBMWidth: %d\n", | |
125 vfd->CompressedBMHeight, vfd->CompressedBMWidth); | |
126 printf(" ValidBMHeight: %d ValidBMWidth: %d\n", | |
127 vfd->ValidBMHeight, vfd->ValidBMWidth); | |
128 printf(" ValidBMXOffset: %d ValidBMYOffset: %d\n", | |
129 vfd->ValidBMXOffset, vfd->ValidBMYOffset); | |
130 printf(" VideoXOffsetInT: %d VideoYValidStartLine: %d\n", | |
131 vfd->VideoXOffsetInT, vfd->VideoYValidStartLine); | |
132 } | |
133 printf("=======================================\n"); | |
134 } | |
1 | 135 |
587
8511095c5283
stage#1 completed: c files no more included from mplayer.c
arpi_esp
parents:
353
diff
changeset
|
136 void print_index(AVIINDEXENTRY *idx,int idx_size){ |
1 | 137 int i; |
1485
b895f95e7657
AVI demuxer cleanups, fileformat-dependent stuff moved to priv_t
arpi
parents:
1456
diff
changeset
|
138 unsigned int pos[256]; |
b895f95e7657
AVI demuxer cleanups, fileformat-dependent stuff moved to priv_t
arpi
parents:
1456
diff
changeset
|
139 unsigned int num[256]; |
b895f95e7657
AVI demuxer cleanups, fileformat-dependent stuff moved to priv_t
arpi
parents:
1456
diff
changeset
|
140 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
|
141 for(i=0;i<idx_size;i++){ |
1485
b895f95e7657
AVI demuxer cleanups, fileformat-dependent stuff moved to priv_t
arpi
parents:
1456
diff
changeset
|
142 int id=avi_stream_id(idx[i].ckid); |
b895f95e7657
AVI demuxer cleanups, fileformat-dependent stuff moved to priv_t
arpi
parents:
1456
diff
changeset
|
143 if(id<0 || id>255) id=255; |
12036 | 144 printf("%5d: %.4s %4X %016llX len:%6ld pos:%7d->%7.3f %7d->%7.3f\n",i, |
602 | 145 (char *)&idx[i].ckid, |
12036 | 146 (unsigned int)idx[i].dwFlags&0xffff, |
147 (uint64_t)AVI_IDX_OFFSET(&idx[i]), | |
587
8511095c5283
stage#1 completed: c files no more included from mplayer.c
arpi_esp
parents:
353
diff
changeset
|
148 // idx[i].dwChunkOffset+demuxer->movi_start, |
1485
b895f95e7657
AVI demuxer cleanups, fileformat-dependent stuff moved to priv_t
arpi
parents:
1456
diff
changeset
|
149 idx[i].dwChunkLength, |
b895f95e7657
AVI demuxer cleanups, fileformat-dependent stuff moved to priv_t
arpi
parents:
1456
diff
changeset
|
150 pos[id],(float)pos[id]/18747.0f, |
b895f95e7657
AVI demuxer cleanups, fileformat-dependent stuff moved to priv_t
arpi
parents:
1456
diff
changeset
|
151 num[id],(float)num[id]/23.976f |
1 | 152 ); |
1485
b895f95e7657
AVI demuxer cleanups, fileformat-dependent stuff moved to priv_t
arpi
parents:
1456
diff
changeset
|
153 pos[id]+=idx[i].dwChunkLength; |
b895f95e7657
AVI demuxer cleanups, fileformat-dependent stuff moved to priv_t
arpi
parents:
1456
diff
changeset
|
154 ++num[id]; |
1 | 155 } |
156 } | |
157 | |
12036 | 158 void print_avistdindex_chunk(avistdindex_chunk *h){ |
159 mp_msg (MSGT_HEADER, MSGL_V, "====== AVI Standard Index Header ========\n"); | |
160 mp_msg (MSGT_HEADER, MSGL_V, " FCC (%.4s) dwSize (%d) wLongsPerEntry(%d)\n", h->fcc, h->dwSize, h->wLongsPerEntry); | |
161 mp_msg (MSGT_HEADER, MSGL_V, " bIndexSubType (%d) bIndexType (%d)\n", h->bIndexSubType, h->bIndexType); | |
162 mp_msg (MSGT_HEADER, MSGL_V, " nEntriesInUse (%d) dwChunkId (%.4s)\n", h->nEntriesInUse, h->dwChunkId); | |
163 mp_msg (MSGT_HEADER, MSGL_V, " qwBaseOffset (0x%llX) dwReserved3 (%d)\n", h->qwBaseOffset, h->dwReserved3); | |
164 mp_msg (MSGT_HEADER, MSGL_V, "===========================\n"); | |
165 } | |
166 void print_avisuperindex_chunk(avisuperindex_chunk *h){ | |
167 mp_msg (MSGT_HEADER, MSGL_V, "====== AVI Super Index Header ========\n"); | |
168 mp_msg (MSGT_HEADER, MSGL_V, " FCC (%.4s) dwSize (%d) wLongsPerEntry(%d)\n", h->fcc, h->dwSize, h->wLongsPerEntry); | |
169 mp_msg (MSGT_HEADER, MSGL_V, " bIndexSubType (%d) bIndexType (%d)\n", h->bIndexSubType, h->bIndexType); | |
170 mp_msg (MSGT_HEADER, MSGL_V, " nEntriesInUse (%d) dwChunkId (%.4s)\n", h->nEntriesInUse, h->dwChunkId); | |
171 mp_msg (MSGT_HEADER, MSGL_V, " dwReserved[0] (%d) dwReserved[1] (%d) dwReserved[2] (%d)\n", | |
172 h->dwReserved[0], h->dwReserved[1], h->dwReserved[2]); | |
173 mp_msg (MSGT_HEADER, MSGL_V, "===========================\n"); | |
174 } | |
1 | 175 |