comparison libmpdemux/aviprint.c @ 2310:9e059416eea6

libdemuxer...
author arpi
date Sat, 20 Oct 2001 18:49:08 +0000
parents aviprint.c@b895f95e7657
children d0e1c32ad432
comparison
equal deleted inserted replaced
2309:3128b9d8b4ea 2310:9e059416eea6
1
2 #include <stdio.h>
3 #include <stdlib.h>
4 #include <unistd.h>
5
6 //extern int verbose; // defined in mplayer.c
7
8 #include "stream.h"
9 #include "demuxer.h"
10
11 #include "wine/mmreg.h"
12 #include "wine/avifmt.h"
13 #include "wine/vfw.h"
14
15 //#include "codec-cfg.h"
16 //#include "stheader.h"
17
18 void print_avih_flags(MainAVIHeader *h){
19 printf("MainAVIHeader.dwFlags: (%ld)%s%s%s%s%s%s\n",h->dwFlags,
20 (h->dwFlags&AVIF_HASINDEX)?" HAS_INDEX":"",
21 (h->dwFlags&AVIF_MUSTUSEINDEX)?" MUST_USE_INDEX":"",
22 (h->dwFlags&AVIF_ISINTERLEAVED)?" IS_INTERLEAVED":"",
23 (h->dwFlags&AVIF_TRUSTCKTYPE)?" TRUST_CKTYPE":"",
24 (h->dwFlags&AVIF_WASCAPTUREFILE)?" WAS_CAPTUREFILE":"",
25 (h->dwFlags&AVIF_COPYRIGHTED)?" COPYRIGHTED":""
26 );
27 }
28
29 void print_avih(MainAVIHeader *h){
30 printf("======= AVI Header =======\n");
31 printf("us/frame: %ld (fps=%5.3f)\n",h->dwMicroSecPerFrame,1000000.0f/(float)h->dwMicroSecPerFrame);
32 printf("max bytes/sec: %ld\n",h->dwMaxBytesPerSec);
33 printf("padding: %ld\n",h->dwPaddingGranularity);
34 print_avih_flags(h);
35 printf("frames total: %ld initial: %ld\n",h->dwTotalFrames,h->dwInitialFrames);
36 printf("streams: %ld\n",h->dwStreams);
37 printf("Suggested BufferSize: %ld\n",h->dwSuggestedBufferSize);
38 printf("Size: %ld x %ld\n",h->dwWidth,h->dwHeight);
39 }
40
41 void print_strh(AVIStreamHeader *h){
42 printf("======= STREAM Header =======\n");
43 printf("Type: %.4s FCC: %.4s (%X)\n",(char *)&h->fccType,(char *)&h->fccHandler,(unsigned int)h->fccHandler);
44 printf("Flags: %ld\n",h->dwFlags);
45 printf("Priority: %d Language: %d\n",h->wPriority,h->wLanguage);
46 printf("InitialFrames: %ld\n",h->dwInitialFrames);
47 printf("Rate: %ld/%ld = %5.3f\n",h->dwRate,h->dwScale,(float)h->dwRate/(float)h->dwScale);
48 printf("Start: %ld Len: %ld\n",h->dwStart,h->dwLength);
49 printf("Suggested BufferSize: %ld\n",h->dwSuggestedBufferSize);
50 printf("Quality %ld\n",h->dwQuality);
51 printf("Sample size: %ld\n",h->dwSampleSize);
52 }
53
54 void print_wave_header(WAVEFORMATEX *h){
55
56 printf("======= WAVE Format =======\n");
57 printf("Format Tag: %d (0x%X)\n",h->wFormatTag,h->wFormatTag);
58 printf("Channels: %d\n",h->nChannels);
59 printf("Samplerate: %ld\n",h->nSamplesPerSec);
60 printf("avg byte/sec: %ld\n",h->nAvgBytesPerSec);
61 printf("Block align: %d\n",h->nBlockAlign);
62 printf("bits/sample: %d\n",h->wBitsPerSample);
63 printf("cbSize: %d\n",h->cbSize);
64 }
65
66
67 void print_video_header(BITMAPINFOHEADER *h){
68 printf("======= VIDEO Format ======\n");
69 printf(" biSize %ld\n", h->biSize);
70 printf(" biWidth %ld\n", h->biWidth);
71 printf(" biHeight %ld\n", h->biHeight);
72 printf(" biPlanes %d\n", h->biPlanes);
73 printf(" biBitCount %d\n", h->biBitCount);
74 printf(" biCompression %ld='%.4s'\n", h->biCompression, (char *)&h->biCompression);
75 printf(" biSizeImage %ld\n", h->biSizeImage);
76 printf("===========================\n");
77 }
78
79
80 void print_index(AVIINDEXENTRY *idx,int idx_size){
81 int i;
82 unsigned int pos[256];
83 unsigned int num[256];
84 for(i=0;i<256;i++) num[i]=pos[i]=0;
85 for(i=0;i<idx_size;i++){
86 int id=avi_stream_id(idx[i].ckid);
87 if(id<0 || id>255) id=255;
88 printf("%5d: %.4s %4X %08X len:%6ld pos:%7d->%7.3f %7d->%7.3f\n",i,
89 (char *)&idx[i].ckid,
90 (unsigned int)idx[i].dwFlags,
91 (unsigned int)idx[i].dwChunkOffset,
92 // idx[i].dwChunkOffset+demuxer->movi_start,
93 idx[i].dwChunkLength,
94 pos[id],(float)pos[id]/18747.0f,
95 num[id],(float)num[id]/23.976f
96 );
97 pos[id]+=idx[i].dwChunkLength;
98 ++num[id];
99 }
100 }
101
102