annotate aviprint.c @ 256:2428ebe4a98d

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