From: kramm Date: Fri, 8 Oct 2004 08:08:14 +0000 (+0000) Subject: added some log messages. X-Git-Tag: release-0-6-2~8 X-Git-Url: http://git.asbjorn.it/?a=commitdiff_plain;h=f6a3cc71c731c0144b1e137d1bdbe24afdc1c755;p=swftools.git added some log messages. --- diff --git a/avi2swf/videoreader_vfw.cc b/avi2swf/videoreader_vfw.cc index b40c378..a5d2483 100644 --- a/avi2swf/videoreader_vfw.cc +++ b/avi2swf/videoreader_vfw.cc @@ -53,8 +53,9 @@ typedef struct _videoreader_vfw_internal { } videoreader_vfw_internal_t; static int avifile_initialized = 0; +static int verbose; -#define _TRACE_ {printf("%s: %d (%s)\n",__FILE__,__LINE__,__func__);fflush(stdout);} +#define _TRACE_ {printf("vfw: %s: %d (%s)\n",__FILE__,__LINE__,__func__);fflush(stdout);} static bool videoreader_vfw_eof(videoreader_t* vr) { @@ -93,6 +94,10 @@ static int bitmap_to_rgba(BITMAPINFOHEADER*bi, void*buffer, const int dest_width const int endy = flip? dest_height : -1; const int yinc = flip? 1 : -1; + if(verbose) { + printf("vfw: Convering scanlines %d to %d from bpp %d, %d stepping, flip=%d\n", starty, endy, bi->biBitCount, yinc, flip); + } + if(bi->biBitCount==1) { UCHAR*img = data; int y; @@ -244,6 +249,8 @@ static void videoreader_vfw_setparameter(videoreader_t*vr, char*name, char*value videoreader_vfw_internal_t* i = (videoreader_vfw_internal_t*)vr->internal; if(!strcmp(name, "flip")) { i->flip = atoi(value); + } else if(!strcmp(name, "verbose")) { + verbose = atoi(value); } } @@ -278,6 +285,10 @@ int videoreader_vfw_open(videoreader_t* vr, char* filename) /* calculate framerate */ i->fps = (double)info.dwRate/(double)info.dwScale; + if(verbose) { + printf("vfw: file %s has %f fps, and %d streams\n", i->fps, info.dwStreams); + } + unsigned int t=0; while(tvs) { + if(verbose) { + printf("vfw: video stream: %dx%d, %.2f\n", i->width, i->height, i->fps); + } vr->width = i->width; vr->height = i->height; vr->fps = i->fps; @@ -335,6 +349,9 @@ int videoreader_vfw_open(videoreader_t* vr, char* filename) fprintf(stderr, "AVIReader: Warning: No video stream\n"); } if(i->as) { + if(verbose) { + printf("vfw: audio stream: %d channels, %d samples/sec", i->channels, i->samplerate); + } vr->channels = i->channels; vr->samplerate = i->samplerate; } else {