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 printf("Format Tag: %d (0x%X)\n",h->wFormatTag,h->wFormatTag);
|
|
37 printf("Channels: %d\n",h->nChannels);
|
|
38 printf("Samplerate: %d\n",h->nSamplesPerSec);
|
|
39 printf("avg byte/sec: %d\n",h->nAvgBytesPerSec);
|
|
40 printf("Block align: %d\n",h->nBlockAlign);
|
|
41 printf("bits/sample: %d\n",h->wBitsPerSample);
|
|
42 printf("cbSize: %d\n",h->cbSize);
|
|
43 }
|
|
44
|
|
45
|
|
46 void print_video_header(BITMAPINFOHEADER *h){
|
|
47 printf("======= VIDEO Format ======\n");
|
|
48 printf(" biSize %d\n", h->biSize);
|
|
49 printf(" biWidth %d\n", h->biWidth);
|
|
50 printf(" biHeight %d\n", h->biHeight);
|
|
51 printf(" biPlanes %d\n", h->biPlanes);
|
|
52 printf(" biBitCount %d\n", h->biBitCount);
|
|
53 printf(" biCompression %d='%.4s'\n", h->biCompression, &h->biCompression);
|
|
54 printf(" biSizeImage %d\n", h->biSizeImage);
|
|
55 printf("===========================\n");
|
|
56 }
|
|
57
|
|
58
|
|
59 void print_index(){
|
|
60 int i;
|
|
61 for(i=0;i<avi_header.idx_size;i++){
|
|
62 printf("%5d: %.4s %4X %08X (%08X) %d\n",i,
|
|
63 &avi_header.idx[i].ckid,
|
|
64 avi_header.idx[i].dwFlags,
|
|
65 avi_header.idx[i].dwChunkOffset,
|
|
66 avi_header.idx[i].dwChunkOffset+avi_header.movi_start,
|
|
67 avi_header.idx[i].dwChunkLength
|
|
68 );
|
|
69 }
|
|
70 }
|
|
71
|
|
72
|