annotate libmpdemux/aviprint.c @ 6580:5059143aa020

-sws 6 (luma bicubic & chroma bilinear)
author michael
date Thu, 27 Jun 2002 19:17:25 +0000
parents 242e10c13f89
children 1e47c2e7aa8e
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
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
1728d249c783 missing unistd.h (requires for off_t under freebsd)
arpi
parents: 602
diff changeset
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
587
8511095c5283 stage#1 completed: c files no more included from mplayer.c
arpi_esp
parents: 353
diff changeset
8 #include "stream.h"
8511095c5283 stage#1 completed: c files no more included from mplayer.c
arpi_esp
parents: 353
diff changeset
9 #include "demuxer.h"
8511095c5283 stage#1 completed: c files no more included from mplayer.c
arpi_esp
parents: 353
diff changeset
10
8511095c5283 stage#1 completed: c files no more included from mplayer.c
arpi_esp
parents: 353
diff changeset
11 #include "wine/mmreg.h"
8511095c5283 stage#1 completed: c files no more included from mplayer.c
arpi_esp
parents: 353
diff changeset
12 #include "wine/avifmt.h"
8511095c5283 stage#1 completed: c files no more included from mplayer.c
arpi_esp
parents: 353
diff changeset
13 #include "wine/vfw.h"
8511095c5283 stage#1 completed: c files no more included from mplayer.c
arpi_esp
parents: 353
diff changeset
14
8511095c5283 stage#1 completed: c files no more included from mplayer.c
arpi_esp
parents: 353
diff changeset
15 //#include "codec-cfg.h"
8511095c5283 stage#1 completed: c files no more included from mplayer.c
arpi_esp
parents: 353
diff changeset
16 //#include "stheader.h"
8511095c5283 stage#1 completed: c files no more included from mplayer.c
arpi_esp
parents: 353
diff changeset
17
1456
8c57a5a3c645 printfs cleanup - moved to higher -v level or moved to stderr
arpi
parents: 1430
diff changeset
18 void print_avih_flags(MainAVIHeader *h){
8c57a5a3c645 printfs cleanup - moved to higher -v level or moved to stderr
arpi
parents: 1430
diff changeset
19 printf("MainAVIHeader.dwFlags: (%ld)%s%s%s%s%s%s\n",h->dwFlags,
1
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
20 (h->dwFlags&AVIF_HASINDEX)?" HAS_INDEX":"",
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
21 (h->dwFlags&AVIF_MUSTUSEINDEX)?" MUST_USE_INDEX":"",
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
22 (h->dwFlags&AVIF_ISINTERLEAVED)?" IS_INTERLEAVED":"",
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
23 (h->dwFlags&AVIF_TRUSTCKTYPE)?" TRUST_CKTYPE":"",
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
24 (h->dwFlags&AVIF_WASCAPTUREFILE)?" WAS_CAPTUREFILE":"",
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
25 (h->dwFlags&AVIF_COPYRIGHTED)?" COPYRIGHTED":""
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
26 );
1456
8c57a5a3c645 printfs cleanup - moved to higher -v level or moved to stderr
arpi
parents: 1430
diff changeset
27 }
8c57a5a3c645 printfs cleanup - moved to higher -v level or moved to stderr
arpi
parents: 1430
diff changeset
28
8c57a5a3c645 printfs cleanup - moved to higher -v level or moved to stderr
arpi
parents: 1430
diff changeset
29 void print_avih(MainAVIHeader *h){
8c57a5a3c645 printfs cleanup - moved to higher -v level or moved to stderr
arpi
parents: 1430
diff changeset
30 printf("======= AVI Header =======\n");
8c57a5a3c645 printfs cleanup - moved to higher -v level or moved to stderr
arpi
parents: 1430
diff changeset
31 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
32 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
33 printf("padding: %ld\n",h->dwPaddingGranularity);
8c57a5a3c645 printfs cleanup - moved to higher -v level or moved to stderr
arpi
parents: 1430
diff changeset
34 print_avih_flags(h);
602
1d71e691c059 warnings killed
szabii
parents: 587
diff changeset
35 printf("frames total: %ld initial: %ld\n",h->dwTotalFrames,h->dwInitialFrames);
1d71e691c059 warnings killed
szabii
parents: 587
diff changeset
36 printf("streams: %ld\n",h->dwStreams);
1d71e691c059 warnings killed
szabii
parents: 587
diff changeset
37 printf("Suggested BufferSize: %ld\n",h->dwSuggestedBufferSize);
1d71e691c059 warnings killed
szabii
parents: 587
diff changeset
38 printf("Size: %ld x %ld\n",h->dwWidth,h->dwHeight);
1
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
39 }
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
40
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
41 void print_strh(AVIStreamHeader *h){
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
42 printf("======= STREAM Header =======\n");
602
1d71e691c059 warnings killed
szabii
parents: 587
diff changeset
43 printf("Type: %.4s FCC: %.4s (%X)\n",(char *)&h->fccType,(char *)&h->fccHandler,(unsigned int)h->fccHandler);
1d71e691c059 warnings killed
szabii
parents: 587
diff changeset
44 printf("Flags: %ld\n",h->dwFlags);
1
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
45 printf("Priority: %d Language: %d\n",h->wPriority,h->wLanguage);
602
1d71e691c059 warnings killed
szabii
parents: 587
diff changeset
46 printf("InitialFrames: %ld\n",h->dwInitialFrames);
1d71e691c059 warnings killed
szabii
parents: 587
diff changeset
47 printf("Rate: %ld/%ld = %5.3f\n",h->dwRate,h->dwScale,(float)h->dwRate/(float)h->dwScale);
1d71e691c059 warnings killed
szabii
parents: 587
diff changeset
48 printf("Start: %ld Len: %ld\n",h->dwStart,h->dwLength);
1d71e691c059 warnings killed
szabii
parents: 587
diff changeset
49 printf("Suggested BufferSize: %ld\n",h->dwSuggestedBufferSize);
1d71e691c059 warnings killed
szabii
parents: 587
diff changeset
50 printf("Quality %ld\n",h->dwQuality);
1d71e691c059 warnings killed
szabii
parents: 587
diff changeset
51 printf("Sample size: %ld\n",h->dwSampleSize);
1
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
52 }
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
53
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
54 void print_wave_header(WAVEFORMATEX *h){
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
55 printf("======= WAVE Format =======\n");
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
56 printf("Format Tag: %d (0x%X)\n",h->wFormatTag,h->wFormatTag);
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
57 printf("Channels: %d\n",h->nChannels);
602
1d71e691c059 warnings killed
szabii
parents: 587
diff changeset
58 printf("Samplerate: %ld\n",h->nSamplesPerSec);
1d71e691c059 warnings killed
szabii
parents: 587
diff changeset
59 printf("avg byte/sec: %ld\n",h->nAvgBytesPerSec);
1
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
60 printf("Block align: %d\n",h->nBlockAlign);
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
61 printf("bits/sample: %d\n",h->wBitsPerSample);
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
62 printf("cbSize: %d\n",h->cbSize);
5711
arpi
parents: 5688
diff changeset
63 if(h->wFormatTag==0x55 && h->cbSize>=12){
5688
ad7d3044bea4 show extended mp3 info
arpi
parents: 2555
diff changeset
64 MPEGLAYER3WAVEFORMAT* h2=h;
ad7d3044bea4 show extended mp3 info
arpi
parents: 2555
diff changeset
65 printf("mp3.wID=%d\n",h2->wID);
ad7d3044bea4 show extended mp3 info
arpi
parents: 2555
diff changeset
66 printf("mp3.fdwFlags=0x%X\n",h2->fdwFlags);
ad7d3044bea4 show extended mp3 info
arpi
parents: 2555
diff changeset
67 printf("mp3.nBlockSize=%d\n",h2->nBlockSize);
ad7d3044bea4 show extended mp3 info
arpi
parents: 2555
diff changeset
68 printf("mp3.nFramesPerBlock=%d\n",h2->nFramesPerBlock);
ad7d3044bea4 show extended mp3 info
arpi
parents: 2555
diff changeset
69 printf("mp3.nCodecDelay=%d\n",h2->nCodecDelay);
ad7d3044bea4 show extended mp3 info
arpi
parents: 2555
diff changeset
70 }
5758
3b836c55666c dumping unknown extradata too
alex
parents: 5711
diff changeset
71 else if (h->cbSize > 0)
3b836c55666c dumping unknown extradata too
alex
parents: 5711
diff changeset
72 {
3b836c55666c dumping unknown extradata too
alex
parents: 5711
diff changeset
73 int i;
5896
242e10c13f89 Fix buggy extra header printing
albeu
parents: 5758
diff changeset
74 uint8_t* p = ((uint8_t*)h) + sizeof(WAVEFORMATEX);
5758
3b836c55666c dumping unknown extradata too
alex
parents: 5711
diff changeset
75 printf("Unknown extra header dump: ");
3b836c55666c dumping unknown extradata too
alex
parents: 5711
diff changeset
76 for (i = 0; i < h->cbSize; i++)
5896
242e10c13f89 Fix buggy extra header printing
albeu
parents: 5758
diff changeset
77 printf("[%x] ", *(p+i));
5758
3b836c55666c dumping unknown extradata too
alex
parents: 5711
diff changeset
78 printf("\n");
3b836c55666c dumping unknown extradata too
alex
parents: 5711
diff changeset
79 }
1
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
80 }
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
81
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
82
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
83 void print_video_header(BITMAPINFOHEADER *h){
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
84 printf("======= VIDEO Format ======\n");
602
1d71e691c059 warnings killed
szabii
parents: 587
diff changeset
85 printf(" biSize %ld\n", h->biSize);
1d71e691c059 warnings killed
szabii
parents: 587
diff changeset
86 printf(" biWidth %ld\n", h->biWidth);
1d71e691c059 warnings killed
szabii
parents: 587
diff changeset
87 printf(" biHeight %ld\n", h->biHeight);
1
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
88 printf(" biPlanes %d\n", h->biPlanes);
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
89 printf(" biBitCount %d\n", h->biBitCount);
602
1d71e691c059 warnings killed
szabii
parents: 587
diff changeset
90 printf(" biCompression %ld='%.4s'\n", h->biCompression, (char *)&h->biCompression);
1d71e691c059 warnings killed
szabii
parents: 587
diff changeset
91 printf(" biSizeImage %ld\n", h->biSizeImage);
1
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
92 printf("===========================\n");
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
93 }
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
94
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
95
587
8511095c5283 stage#1 completed: c files no more included from mplayer.c
arpi_esp
parents: 353
diff changeset
96 void print_index(AVIINDEXENTRY *idx,int idx_size){
1
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
97 int i;
1485
b895f95e7657 AVI demuxer cleanups, fileformat-dependent stuff moved to priv_t
arpi
parents: 1456
diff changeset
98 unsigned int pos[256];
b895f95e7657 AVI demuxer cleanups, fileformat-dependent stuff moved to priv_t
arpi
parents: 1456
diff changeset
99 unsigned int num[256];
b895f95e7657 AVI demuxer cleanups, fileformat-dependent stuff moved to priv_t
arpi
parents: 1456
diff changeset
100 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
101 for(i=0;i<idx_size;i++){
1485
b895f95e7657 AVI demuxer cleanups, fileformat-dependent stuff moved to priv_t
arpi
parents: 1456
diff changeset
102 int id=avi_stream_id(idx[i].ckid);
b895f95e7657 AVI demuxer cleanups, fileformat-dependent stuff moved to priv_t
arpi
parents: 1456
diff changeset
103 if(id<0 || id>255) id=255;
b895f95e7657 AVI demuxer cleanups, fileformat-dependent stuff moved to priv_t
arpi
parents: 1456
diff changeset
104 printf("%5d: %.4s %4X %08X len:%6ld pos:%7d->%7.3f %7d->%7.3f\n",i,
602
1d71e691c059 warnings killed
szabii
parents: 587
diff changeset
105 (char *)&idx[i].ckid,
1d71e691c059 warnings killed
szabii
parents: 587
diff changeset
106 (unsigned int)idx[i].dwFlags,
1d71e691c059 warnings killed
szabii
parents: 587
diff changeset
107 (unsigned int)idx[i].dwChunkOffset,
587
8511095c5283 stage#1 completed: c files no more included from mplayer.c
arpi_esp
parents: 353
diff changeset
108 // idx[i].dwChunkOffset+demuxer->movi_start,
1485
b895f95e7657 AVI demuxer cleanups, fileformat-dependent stuff moved to priv_t
arpi
parents: 1456
diff changeset
109 idx[i].dwChunkLength,
b895f95e7657 AVI demuxer cleanups, fileformat-dependent stuff moved to priv_t
arpi
parents: 1456
diff changeset
110 pos[id],(float)pos[id]/18747.0f,
b895f95e7657 AVI demuxer cleanups, fileformat-dependent stuff moved to priv_t
arpi
parents: 1456
diff changeset
111 num[id],(float)num[id]/23.976f
1
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
112 );
1485
b895f95e7657 AVI demuxer cleanups, fileformat-dependent stuff moved to priv_t
arpi
parents: 1456
diff changeset
113 pos[id]+=idx[i].dwChunkLength;
b895f95e7657 AVI demuxer cleanups, fileformat-dependent stuff moved to priv_t
arpi
parents: 1456
diff changeset
114 ++num[id];
1
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
115 }
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
116 }
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
117
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
118