1
|
1 void print_avih(MainAVIHeader *h){
|
|
2 printf("======= AVI Header =======\n");
|
|
3 printf("us/frame: %d (fps=%5.3f)\n",h->dwMicroSecPerFrame,1000000.0f/(float)h->dwMicroSecPerFrame);
|
|
4 printf("max bytes/sec: %d\n",h->dwMaxBytesPerSec);
|
|
5 printf("padding: %d\n",h->dwPaddingGranularity);
|
|
6 printf("flags: (%d)%s%s%s%s%s%s\n",h->dwFlags,
|
|
7 (h->dwFlags&AVIF_HASINDEX)?" HAS_INDEX":"",
|
|
8 (h->dwFlags&AVIF_MUSTUSEINDEX)?" MUST_USE_INDEX":"",
|
|
9 (h->dwFlags&AVIF_ISINTERLEAVED)?" IS_INTERLEAVED":"",
|
|
10 (h->dwFlags&AVIF_TRUSTCKTYPE)?" TRUST_CKTYPE":"",
|
|
11 (h->dwFlags&AVIF_WASCAPTUREFILE)?" WAS_CAPTUREFILE":"",
|
|
12 (h->dwFlags&AVIF_COPYRIGHTED)?" COPYRIGHTED":""
|
|
13 );
|
|
14 printf("frames total: %d initial: %d\n",h->dwTotalFrames,h->dwInitialFrames);
|
|
15 printf("streams: %d\n",h->dwStreams);
|
|
16 printf("Suggested BufferSize: %d\n",h->dwSuggestedBufferSize);
|
|
17 printf("Size: %d x %d\n",h->dwWidth,h->dwHeight);
|
|
18 }
|
|
19
|
|
20 void print_strh(AVIStreamHeader *h){
|
|
21 printf("======= STREAM Header =======\n");
|
|
22 printf("Type: %.4s FCC: %.4s (%X)\n",&h->fccType,&h->fccHandler,h->fccHandler);
|
|
23 printf("Flags: %d\n",h->dwFlags);
|
|
24 printf("Priority: %d Language: %d\n",h->wPriority,h->wLanguage);
|
|
25 printf("InitialFrames: %d\n",h->dwInitialFrames);
|
|
26 printf("Rate: %d/%d = %5.3f\n",h->dwRate,h->dwScale,(float)h->dwRate/(float)h->dwScale);
|
|
27 printf("Start: %d Len: %d\n",h->dwStart,h->dwLength);
|
|
28 printf("Suggested BufferSize: %d\n",h->dwSuggestedBufferSize);
|
|
29 printf("Quality %d\n",h->dwQuality);
|
|
30 printf("Sample size: %d\n",h->dwSampleSize);
|
|
31 }
|
|
32
|
|
33 void print_wave_header(WAVEFORMATEX *h){
|
|
34
|
|
35 printf("======= WAVE Format =======\n");
|
|
36
|
|
37 printf("Format Tag: %d (0x%X)\n",h->wFormatTag,h->wFormatTag);
|
|
38 printf("Channels: %d\n",h->nChannels);
|
|
39 printf("Samplerate: %d\n",h->nSamplesPerSec);
|
|
40 printf("avg byte/sec: %d\n",h->nAvgBytesPerSec);
|
|
41 printf("Block align: %d\n",h->nBlockAlign);
|
|
42 printf("bits/sample: %d\n",h->wBitsPerSample);
|
|
43 printf("cbSize: %d\n",h->cbSize);
|
|
44
|
|
45 switch(h->wFormatTag){
|
|
46 case 0x01: printf("Audio in PCM format\n");break;
|
|
47 case 0x50: printf("Audio in MPEG Layer 1/2 format\n");break;
|
|
48 case 0x55: printf("Audio in MPEG Layer-3 format\n");break; // ACM
|
|
49 case 0x02: printf("Audio in MS ADPCM format\n");break; // ACM
|
|
50 case 0x11: printf("Audio in IMA ADPCM format\n");break; // ACM
|
|
51 case 0x31:
|
|
52 case 0x32: printf("Audio in MS GSM 6.10 format\n");break; // ACM
|
|
53 case 0x75: printf("Audio in VoxWare format\n");break; // DShow
|
|
54 case 0x160:
|
|
55 case 0x161: printf("Audio in DivX WMA format\n");break; // ACM
|
|
56 default: printf("Audio in UNKNOWN (id=0x%X) format\n",h->wFormatTag);
|
|
57 }
|
|
58
|
|
59 }
|
|
60
|
|
61
|
|
62 void print_video_header(BITMAPINFOHEADER *h){
|
|
63 printf("======= VIDEO Format ======\n");
|
|
64 printf(" biSize %d\n", h->biSize);
|
|
65 printf(" biWidth %d\n", h->biWidth);
|
|
66 printf(" biHeight %d\n", h->biHeight);
|
|
67 printf(" biPlanes %d\n", h->biPlanes);
|
|
68 printf(" biBitCount %d\n", h->biBitCount);
|
|
69 printf(" biCompression %d='%.4s'\n", h->biCompression, &h->biCompression);
|
|
70 printf(" biSizeImage %d\n", h->biSizeImage);
|
|
71 printf("===========================\n");
|
|
72 }
|
|
73
|
|
74
|
|
75 void print_index(){
|
|
76 int i;
|
|
77 for(i=0;i<avi_header.idx_size;i++){
|
|
78 printf("%5d: %.4s %4X %08X (%08X) %d\n",i,
|
|
79 &avi_header.idx[i].ckid,
|
|
80 avi_header.idx[i].dwFlags,
|
|
81 avi_header.idx[i].dwChunkOffset,
|
|
82 avi_header.idx[i].dwChunkOffset+avi_header.movi_start,
|
|
83 avi_header.idx[i].dwChunkLength
|
|
84 );
|
|
85 }
|
|
86 }
|
|
87
|
|
88
|