[Mplayer-cvslog] CVS: main/libmpcodecs ve_qtvideo.c,1.8,1.9

Sascha Sommer CVS syncmail at mplayerhq.hu
Tue Apr 13 17:04:28 CEST 2004


CVS change done by Sascha Sommer CVS

Update of /cvsroot/mplayer/main/libmpcodecs
In directory mail:/var2/tmp/cvs-serv6736/libmpcodecs

Modified Files:
	ve_qtvideo.c 
Log Message:
printf -> mp_msg; print error msg when qtmlClient.dll is missing

Index: ve_qtvideo.c
===================================================================
RCS file: /cvsroot/mplayer/main/libmpcodecs/ve_qtvideo.c,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -r1.8 -r1.9
--- ve_qtvideo.c	24 Mar 2004 15:16:36 -0000	1.8
+++ ve_qtvideo.c	13 Apr 2004 15:04:25 -0000	1.9
@@ -145,13 +145,13 @@
     cdesc.componentFlagsMask=0;
 
 
-    printf("Count = %d\n",CountComponents(&cdesc));
+    mp_msg(MSGT_MENCODER,MSGL_DBG2,"Count = %d\n",CountComponents(&cdesc));
     compressor=FindNextComponent(NULL,&cdesc);
     if(!compressor){
-	printf("Cannot find requested component\n");
+	mp_msg(MSGT_MENCODER,MSGL_ERR,"Cannot find requested component\n");
 	return(0);
     }
-    printf("Found it! ID = 0x%X\n",compressor);
+    mp_msg(MSGT_MENCODER,MSGL_DBG2,"Found it! ID = 0x%X\n",compressor);
 
 //	cres= FindCodec (fourcc,anyCodec,&compressor,&decompressor );
 //	printf("FindCodec returned:%i compressor: 0x%X decompressor: 0x%X\n",cres&0xFFFF,compressor,decompressor);
@@ -195,7 +195,7 @@
         0,
         mpi->planes[0],
         stride);
-    printf("NewGWorldFromPtr returned:%i\n",cres&0xFFFF);
+    mp_msg(MSGT_MENCODER,MSGL_DBG2,"NewGWorldFromPtr returned:%i\n",cres&0xFFFF);
     //dunno what todo about this
     frame_prev = malloc(stride * height);
     cres = QTNewGWorldFromPtr(
@@ -207,8 +207,8 @@
         0,
         frame_prev,
         stride);
-    printf("height:%i width:%i stride:%i\n",height,width,stride);
-    printf("NewGWorldFromPtr returned:%i\n",cres&0xFFFF);
+    mp_msg(MSGT_MENCODER,MSGL_DBG2,"height:%i width:%i stride:%i\n",height,width,stride);
+    mp_msg(MSGT_MENCODER,MSGL_DBG2,"NewGWorldFromPtr returned:%i\n",cres&0xFFFF);
     cres=  GetMaxCompressionSize (
        GetGWorldPixMap(frame_GWorld_in),
        &FrameRect,
@@ -217,7 +217,7 @@
        bswap_32(format),
        compressor,
        &framesizemax );
-    printf("GetMaxCompressionSize returned:%i : MaxSize:%i\n",cres&0xFFFF,framesizemax);
+    mp_msg(MSGT_MENCODER,MSGL_DBG2,"GetMaxCompressionSize returned:%i : MaxSize:%i\n",cres&0xFFFF,framesizemax);
     frame_comp=malloc(framesizemax);
 
     desc = (ImageDescriptionHandle)NewHandleClear(MAX_IDSIZE); //memory where the desc will be stored
@@ -238,8 +238,8 @@
        0,
        0,
        desc);
-    printf("CompressSequenceBegin returned:%i\n",cres&0xFFFF);
-    printf("Sequence ID:%i\n",seq);
+    mp_msg(MSGT_MENCODER,MSGL_DBG2,"CompressSequenceBegin returned:%i\n",cres&0xFFFF);
+    mp_msg(MSGT_MENCODER,MSGL_DBG2,"Sequence ID:%i\n",seq);
 
     dump_ImageDescription(*desc);
     codec_inited++;
@@ -254,7 +254,7 @@
         &similarity,
         0);
 
-    if(cres&0xFFFF)printf("CompressSequenceFrame returned:%i\n",cres&0xFFFF);
+    if(cres&0xFFFF)mp_msg(MSGT_MENCODER,MSGL_DBG2,"CompressSequenceFrame returned:%i\n",cres&0xFFFF);
 #if 0
     printf("Size %i->%i   \n",stride*height,compressedsize);
     printf("Ratio: %i:1\n",(stride*height)/compressedsize);
@@ -262,7 +262,7 @@
     muxer_write_chunk(mux_v, compressedsize , similarity?0:0x10);
 
     if(((*desc)->idSize)>MAX_IDSIZE){
-	printf("FATAL! idSize=%d too big, increase MAX_IDSIZE in ve_qtvideo.c!\n",((*desc)->idSize));
+	mp_msg(MSGT_MENCODER,MSGL_ERR,"FATAL! idSize=%d too big, increase MAX_IDSIZE in ve_qtvideo.c!\n",((*desc)->idSize));
     } else {
 	// according to QT docs, imagedescription may be changed while encoding
 	// a frame (even its size may (and does!) change!)
@@ -297,6 +297,10 @@
     Setup_LDT_Keeper();
 #endif
     handler = LoadLibraryA("qtmlClient.dll");
+    if(!handler){
+        mp_msg(MSGT_MENCODER,MSGL_ERR,"unable to load qtmlClient.dll\n");
+        return 0;
+    }
     InitializeQTML = (OSErr (*)(long))GetProcAddress(handler, "InitializeQTML");
     GetGWorldPixMap = (PixMapHandle (*)(GWorldPtr))GetProcAddress(handler, "GetGWorldPixMap");
     QTNewGWorldFromPtr = (OSErr(*)(GWorldPtr *,OSType,const Rect *,CTabHandle,void*,GWorldFlags,void *,long))GetProcAddress(handler, "QTNewGWorldFromPtr");
@@ -310,12 +314,12 @@
     CountComponents = (long (*)(ComponentDescription*))GetProcAddress(handler, "CountComponents");
     GetComponentInfo = (OSErr (*)(Component,ComponentDescription*,Handle,Handle,Handle))GetProcAddress(handler, "GetComponentInfo");
     if(!InitializeQTML  ||!CompressSequenceBegin){
-        printf("invalid qt DLL!\n");
+        mp_msg(MSGT_MENCODER,MSGL_ERR,"invalid qt DLL!\n");
         return 0;
     }
     //printf("%i,%i,%i\n",mmioFOURCC('S','V','Q','1'),'SVQ1',bswap_32(mmioFOURCC('S','V','Q','1')));
     cres=InitializeQTML(6+16);
-    printf("InitializeQTML returned %i\n",cres);
+    mp_msg(MSGT_MENCODER,MSGL_DBG2,"InitializeQTML returned %i\n",cres);
     return 1;
 }
 




More information about the MPlayer-cvslog mailing list