changeset 18004:bcd805923554

Part2 of several printf2mp_msg changes in patch from Otvos Attila oattila AT chello DOT hu with LOTS of modifications by me
author reynaldo
date Fri, 31 Mar 2006 00:15:47 +0000
parents 9fc72c7291d5
children 1aed2b2c2983
files help/help_mp-en.h libmpcodecs/ad_libdv.c libmpcodecs/vd_dmo.c libmpcodecs/vd_dshow.c libmpcodecs/vd_ffmpeg.c libmpcodecs/vd_vfw.c libmpcodecs/ve_lavc.c libmpcodecs/ve_raw.c libmpcodecs/ve_vfw.c libmpcodecs/vf.c libmpcodecs/vf_crop.c libmpcodecs/vf_cropdetect.c libmpcodecs/vf_expand.c libmpcodecs/vf_fame.c libmpcodecs/vf_format.c libmpcodecs/vf_framestep.c libmpcodecs/vf_noformat.c libmpcodecs/vf_palette.c libmpcodecs/vf_phase.c libmpcodecs/vf_test.c libmpcodecs/vf_tile.c libmpcodecs/vf_yuy2.c libmpcodecs/vf_yvu9.c
diffstat 23 files changed, 139 insertions(+), 67 deletions(-) [+]
line wrap: on
line diff
--- a/help/help_mp-en.h	Thu Mar 30 23:47:03 2006 +0000
+++ b/help/help_mp-en.h	Fri Mar 31 00:15:47 2006 +0000
@@ -1487,3 +1487,60 @@
 #define MSGTR_LIBMENU_UnknownMenuCommand "[MENU] Unknown command: '%s'.\n"
 #define MSGTR_LIBMENU_FailedToOpenMenu "[MENU] Failed to open menu: '%s'.\n"
 
+// ========================== LIBMPCODECS ===================================
+
+// libmpcodecs/ad_libdv.c
+#define MSGTR_MPCODECS_AudioFramesizeDiffers "[AD_LIBDV] Warning! Audio framesize differs! read=%d  hdr=%d.\n"
+
+// libmpcodecs/vd_dmo.c vd_dshow.c vd_vfw.c
+#define MSGTR_MPCODECS_CouldntAllocateImageForCinepakCodec "[VD_DMO] Couldn't allocate image for cinepak codec.\n"
+
+// libmpcodecs/vd_ffmpeg.c
+#define MSGTR_MPCODECS_XVMCAcceleratedCodec "[VD_FFMPEG] XVMC accelerated codec.\n"
+#define MSGTR_MPCODECS_ArithmeticMeanOfQP "[VD_FFMPEG] Arithmetic mean of QP: %2.4f, Harmonic mean of QP: %2.4f\n"
+#define MSGTR_MPCODECS_DRIFailure "[VD_FFMPEG] DRI failure.\n"
+#define MSGTR_MPCODECS_CouldntAllocateImageForCodec "[VD_FFMPEG] Couldn't allocate image for codec.\n"
+#define MSGTR_MPCODECS_XVMCAcceleratedMPEG2 "[VD_FFMPEG] XVMC accelerated MPEG2.\n"
+#define MSGTR_MPCODECS_TryingPixfmt "[VD_FFMPEG] Trying pixfmt=%d.\n"
+#define MSGTR_MPCODECS_McGetBufferShouldWorkOnlyWithXVMC "[VD_FFMPEG] The mc_get_buffer should work only with XVMC acceleration!!"
+#define MSGTR_MPCODECS_UnexpectedInitVoError "[VD_FFMPEG] Unexpected init_vo error.\n"
+#define MSGTR_MPCODECS_UnrecoverableErrorRenderBuffersNotTaken "[VD_FFMPEG] Unrecoverable error, render buffers not taken.\n"
+#define MSGTR_MPCODECS_OnlyBuffersAllocatedByVoXvmcAllowed "[VD_FFMPEG] Only buffers allocated by vo_xvmc allowed.\n"
+
+// libmpcodecs/ve_lavc.c
+#define MSGTR_MPCODECS_HighQualityEncodingSelected "[VE_LAVC] High quality encoding selected (non real time)!\n"
+#define MSGTR_MPCODECS_UsingConstantQscale "[VE_LAVC] Using constant qscale = %f (VBR).\n"
+
+// libmpcodecs/ve_raw.c
+#define MSGTR_MPCODECS_OutputWithFourccNotSupported "[VE_RAW] Raw output with fourcc [%x] not supported!\n"
+#define MSGTR_MPCODECS_NoVfwCodecSpecified "[VE_RAW] Required VfW codec not specified!!\n"
+
+// libmpcodecs/vf_crop.c
+#define MSGTR_MPCODECS_CropBadPositionWidthHeight "[CROP] Bad position/width/height - cropped area outside of the original!\n"
+
+// libmpcodecs/vf_cropdetect.c
+#define MSGTR_MPCODECS_CropArea "[CROP] Crop area: X: %d..%d  Y: %d..%d  (-vf crop=%d:%d:%d:%d).\n"
+
+// libmpcodecs/vf_format.c, vf_palette.c, vf_noformat.c
+#define MSGTR_MPCODECS_UnknownFormatName "[VF_FORMAT] Unknown format name: '%s'.\n"
+
+// libmpcodecs/vf_framestep.c vf_noformat.c vf_palette.c vf_tile.c
+#define MSGTR_MPCODECS_ErrorParsingArgument "[VF_FRAMESTEP] Error parsing argument.\n"
+
+// libmpcodecs/ve_vfw.c
+#define MSGTR_MPCODECS_CompressorType "Compressor type: %.4lx\n"
+#define MSGTR_MPCODECS_CompressorSubtype "Compressor subtype: %.4lx\n"
+#define MSGTR_MPCODECS_CompressorFlags "Compressor flags: %lu, version %lu, ICM version: %lu\n"
+#define MSGTR_MPCODECS_Flags "Flags:"
+#define MSGTR_MPCODECS_Quality " quality"
+
+// libmpcodecs/vf_expand.c
+#define MSGTR_MPCODECS_FullDRNotPossible "Full DR not possible, trying SLICES instead!\n"
+#define MSGTR_MPCODECS_WarnNextFilterDoesntSupportSlices  "WARNING! next filter doesn't support SLICES, get ready for sig11...\n"
+#define MSGTR_MPCODECS_FunWhydowegetNULL "Why do we get NULL \n"
+
+// libmpcodecs/vf_fame.c
+#define MSGTR_MPCODECS_FatalCantOpenlibFAME "FATAL: cannot open libFAME!\n"
+
+// libmpcodecs/vf_test.c, vf_yuy2.c, vf_yvu9.c
+#define MSGTR_MPCODECS_WarnNextFilterDoesntSupport "%s not supported by next filter/vo :(\n"
--- a/libmpcodecs/ad_libdv.c	Thu Mar 30 23:47:03 2006 +0000
+++ b/libmpcodecs/ad_libdv.c	Fri Mar 31 00:15:47 2006 +0000
@@ -6,6 +6,8 @@
 #include <math.h>
 
 #include "config.h"
+#include "mp_msg.h"
+#include "help_mp.h"
 
 #ifdef HAVE_LIBDV095
 
@@ -86,7 +88,7 @@
    dv_parse_header(decoder, dv_audio_frame);
    
    if(xx!=decoder->frame_size)
-       printf("warning! audio framesize differs! read=%d  hdr=%d  \n",
+       mp_msg(MSGT_GLOBAL,MSGL_WARN,MSGTR_MPCODECS_AudioFramesizeDiffers,
            xx, decoder->frame_size);
 
    if (dv_decode_full_audio(decoder, dv_audio_frame,(int16_t**) audioBuffers))
--- a/libmpcodecs/vd_dmo.c	Thu Mar 30 23:47:03 2006 +0000
+++ b/libmpcodecs/vd_dmo.c	Fri Mar 31 00:15:47 2006 +0000
@@ -77,7 +77,7 @@
 	sh->disp_w, sh->disp_h);
     
     if(!mpi){	// temporary!
-	printf("couldn't allocate image for cinepak codec\n");
+	mp_msg(MSGT_DECVIDEO,MSGL_WARN,MSGTR_MPCODECS_CouldntAllocateImageForCinepakCodec);
 	return NULL;
     }
 
--- a/libmpcodecs/vd_dshow.c	Thu Mar 30 23:47:03 2006 +0000
+++ b/libmpcodecs/vd_dshow.c	Fri Mar 31 00:15:47 2006 +0000
@@ -106,7 +106,7 @@
 	sh->disp_w, sh->disp_h);
     
     if(!mpi){	// temporary!
-	printf("couldn't allocate image for cinepak codec\n");
+	mp_msg(MSGT_DECVIDEO,MSGL_WARN,MSGTR_MPCODECS_CouldntAllocateImageForCinepakCodec);
 	return NULL;
     }
 
--- a/libmpcodecs/vd_ffmpeg.c	Thu Mar 30 23:47:03 2006 +0000
+++ b/libmpcodecs/vd_ffmpeg.c	Fri Mar 31 00:15:47 2006 +0000
@@ -248,7 +248,7 @@
 #else
     if(lavc_codec->id == CODEC_ID_MPEG2VIDEO_XVMC){
 #endif
-        printf("vd_ffmpeg: XVMC accelerated codec\n");
+        mp_msg(MSGT_DECVIDEO, MSGL_INFO, MSGTR_MPCODECS_XVMCAcceleratedCodec);
         assert(ctx->do_dr1);//these are must to!
         assert(ctx->do_slices); //it is (vo_)ffmpeg bug if this fails
         avctx->flags|= CODEC_FLAG_EMU_EDGE;//do i need that??!!
@@ -333,8 +333,8 @@
 	    uint8_t *p = avctx->extradata;
 	    
 	    for (x=0; x<avctx->extradata_size; x++)
-		printf("[%x] ", p[x]);
-	    printf("\n");
+		mp_msg(MSGT_DECVIDEO, MSGL_INFO,"[%x] ", p[x]);
+	    mp_msg(MSGT_DECVIDEO, MSGL_INFO,"\n");
 	}
 #endif
     }
@@ -433,9 +433,9 @@
     if(lavc_param_vstats){
         int i;
         for(i=1; i<32; i++){
-            printf("QP: %d, count: %d\n", i, ctx->qp_stat[i]);
+            mp_msg(MSGT_DECVIDEO, MSGL_INFO,"QP: %d, count: %d\n", i, ctx->qp_stat[i]);
         }
-        printf("Arithmetic mean of QP: %2.4f, Harmonic mean of QP: %2.4f\n", 
+        mp_msg(MSGT_DECVIDEO, MSGL_INFO,MSGTR_MPCODECS_ArithmeticMeanOfQP, 
             ctx->qp_sum / avctx->coded_frame->coded_picture_number,
             1.0/(ctx->inv_qp_sum / avctx->coded_frame->coded_picture_number)
             );
@@ -634,7 +634,7 @@
   if (!pic->buffer_hints) {
 #endif
     if(ctx->b_count>1 || ctx->ip_count>2){
-        printf("DR1 failure\n");
+        mp_msg(MSGT_DECVIDEO, MSGL_WARN, MSGTR_MPCODECS_DRIFailure);
 
         ctx->do_dr1=0; //FIXME
         avctx->get_buffer= avcodec_default_get_buffer;
@@ -921,7 +921,7 @@
     mpi=mpcodecs_get_image(sh, MP_IMGTYPE_EXPORT, MP_IMGFLAG_PRESERVE,
 	avctx->width, avctx->height);
     if(!mpi){	// temporary!
-	printf("couldn't allocate image for codec\n");
+	mp_msg(MSGT_DECVIDEO, MSGL_WARN, MSGTR_MPCODECS_CouldntAllocateImageForCodec);
 	return NULL;
     }
     
@@ -971,7 +971,7 @@
         avctx->get_buffer= mc_get_buffer;
         avctx->release_buffer= mc_release_buffer;
         avctx->draw_horiz_band = mc_render_slice;
-        printf("vd_ffmpeg: XVMC accelerated MPEG2\n");
+        mp_msg(MSGT_DECVIDEO, MSGL_INFO, MSGTR_MPCODECS_XVMCAcceleratedMPEG2);
         assert(ctx->do_dr1);//these are must to!
         assert(ctx->do_slices); //it is (vo_)ffmpeg bug if this fails
         avctx->flags|= CODEC_FLAG_EMU_EDGE;//do i need that??!!
@@ -979,7 +979,7 @@
     }
 #endif
     for(i=0;fmt[i]!=-1;i++){
-        printf("trying pixfmt=%d\n",i);
+        mp_msg(MSGT_DECVIDEO, MSGL_INFO, MSGTR_MPCODECS_TryingPixfmt,i);
         if( init_vo(sh,fmt[i]) >= 0)
 	    return fmt[i];
     }
@@ -997,7 +997,7 @@
     
 //  printf("vd_ffmpeg::mc_get_buffer (xvmc) %d %d %d\n", pic->reference, ctx->ip_count, ctx->b_count);
     if(!avctx->xvmc_acceleration){
-        printf("vd_ffmpeg::mc_get_buffer should work only with XVMC acceleration !!");
+        mp_msg(MSGT_DECVIDEO, MSGL_INFO, MSGTR_MPCODECS_McGetBufferShouldWorkOnlyWithXVMC);
         assert(0);
         exit(1);
 //        return -1;//!!fixme check error conditions
@@ -1005,10 +1005,10 @@
     assert(avctx->draw_horiz_band == mc_render_slice);
     assert(avctx->release_buffer == mc_release_buffer);
     if( mp_msg_test(MSGT_DECVIDEO,MSGL_DBG5) )
-        printf("vd_ffmpeg::mc_get_buffer\n");
+        mp_msg(MSGT_DECVIDEO, MSGL_DBG5, "vd_ffmpeg::mc_get_buffer\n");
 
     if(init_vo(sh,avctx->pix_fmt) < 0){
-        printf("vd_ffmpeg: Unexpected init_vo error\n");
+        mp_msg(MSGT_DECVIDEO, MSGL_WARN, MSGTR_MPCODECS_UnexpectedInitVoError);
         exit(1);
 //        return -1;//!!fixme check error conditions
     }
@@ -1025,14 +1025,14 @@
     mpi= mpcodecs_get_image(sh, MP_IMGTYPE_IPB,flags ,
                             avctx->width, avctx->height);
     if(mpi==NULL){
-        printf("Unrecoverable error, render buffers not taken\n");
+        mp_msg(MSGT_DECVIDEO, MSGL_ERR, MSGTR_MPCODECS_UnrecoverableErrorRenderBuffersNotTaken);
         assert(0);
         exit(1);
 //        return -1;//!!fixme check error conditions in ffmpeg
     };
     
     if( (mpi->flags & MP_IMGFLAG_DIRECT) == 0){
-        printf("Only buffers allocated by vo_xvmc allowed\n");
+        mp_msg(MSGT_DECVIDEO, MSGL_ERR, MSGTR_MPCODECS_OnlyBuffersAllocatedByVoXvmcAllowed);
         assert(0);
         exit(1);
 //        return -1;//!!fixme check error conditions in ffmpeg
@@ -1072,7 +1072,7 @@
 
     render=(xvmc_render_state_t*)mpi->priv;//same as data[2]
     if( mp_msg_test(MSGT_DECVIDEO,MSGL_DBG5) )
-        printf("vd_ffmpeg::mc_get_buffer (render=%p)\n",render);
+        mp_msg(MSGT_DECVIDEO, MSGL_DBG5, "vd_ffmpeg::mc_get_buffer (render=%p)\n",render);
     assert(render != 0);
     assert(render->magic == MP_XVMC_RENDER_MAGIC);
     render->state |= MP_XVMC_STATE_PREDICTION;
@@ -1099,7 +1099,7 @@
 //mark the surface as not requared for prediction
     render=(xvmc_render_state_t*)pic->data[2];//same as mpi->priv
     if( mp_msg_test(MSGT_DECVIDEO,MSGL_DBG5) )
-        printf("vd_ffmpeg::mc_release_buffer (render=%p)\n",render);
+        mp_msg(MSGT_DECVIDEO, MSGL_DBG5, "vd_ffmpeg::mc_release_buffer (render=%p)\n",render);
     assert(render!=NULL);
     assert(render->magic==MP_XVMC_RENDER_MAGIC);
     render->state&=~MP_XVMC_STATE_PREDICTION;
--- a/libmpcodecs/vd_vfw.c	Thu Mar 30 23:47:03 2006 +0000
+++ b/libmpcodecs/vd_vfw.c	Fri Mar 31 00:15:47 2006 +0000
@@ -303,7 +303,7 @@
 	MP_IMGTYPE_STATIC : MP_IMGTYPE_TEMP, MP_IMGFLAG_ACCEPT_WIDTH, 
 	sh->disp_w, sh->disp_h);
     if(!mpi){	// temporary!
-	printf("couldn't allocate image for cinepak codec\n");
+	mp_msg(MSGT_DECVIDEO,MSGL_WARN,MSGTR_MPCODECS_CouldntAllocateImageForCinepakCodec);
 	return NULL;
     }
 
--- a/libmpcodecs/ve_lavc.c	Thu Mar 30 23:47:03 2006 +0000
+++ b/libmpcodecs/ve_lavc.c	Fri Mar 31 00:15:47 2006 +0000
@@ -590,7 +590,7 @@
     lavc_venc_context->flags = 0;
     if (lavc_param_mb_decision)
     {
-	printf("High quality encoding selected (non real time)!\n");
+	mp_msg(MSGT_MENCODER, MSGL_INFO, MSGTR_MPCODECS_HighQualityEncodingSelected);
 #if LIBAVCODEC_BUILD < 4673
         lavc_venc_context->flags = CODEC_FLAG_HQ;
 #else
@@ -740,7 +740,7 @@
     /* fixed qscale :p */
     if (lavc_param_vqscale)
     {
-	printf("Using constant qscale = %f (VBR)\n", lavc_param_vqscale);
+	mp_msg(MSGT_MENCODER, MSGL_INFO, MSGTR_MPCODECS_UsingConstantQscale, lavc_param_vqscale);
 	lavc_venc_context->flags |= CODEC_FLAG_QSCALE;
 #if LIBAVCODEC_BUILD >= 4668
         lavc_venc_context->global_quality= 
@@ -968,7 +968,7 @@
         double f= lavc_venc_context->width*lavc_venc_context->height*255.0*255.0;
         f*= lavc_venc_context->coded_frame->coded_picture_number;
         
-        printf("PSNR: Y:%2.2f, Cb:%2.2f, Cr:%2.2f, All:%2.2f\n",
+        mp_msg(MSGT_MENCODER, MSGL_INFO, "PSNR: Y:%2.2f, Cb:%2.2f, Cr:%2.2f, All:%2.2f\n",
             psnr(lavc_venc_context->error[0]/f),
             psnr(lavc_venc_context->error[1]*4/f),
             psnr(lavc_venc_context->error[2]*4/f),
--- a/libmpcodecs/ve_raw.c	Thu Mar 30 23:47:03 2006 +0000
+++ b/libmpcodecs/ve_raw.c	Fri Mar 31 00:15:47 2006 +0000
@@ -4,6 +4,7 @@
 
 #include "config.h"
 #include "mp_msg.h"
+#include "help_mp.h"
 
 #include "codec-cfg.h"
 #include "stream.h"
@@ -68,7 +69,7 @@
 	mux_v->bih->biBitCount = 16;
 	break;
     default:
-	printf("ve_raw: raw output with fourcc [%x] not supported!\n", fmt);
+	mp_msg(MSGT_MENCODER, MSGL_INFO, MSGTR_MPCODECS_OutputWithFourccNotSupported, fmt);
 	mux_v->bih->biCompression = 0;
 	return 0;
     }
--- a/libmpcodecs/ve_vfw.c	Thu Mar 30 23:47:03 2006 +0000
+++ b/libmpcodecs/ve_vfw.c	Fri Mar 31 00:15:47 2006 +0000
@@ -8,6 +8,7 @@
 #ifdef USE_WIN32DLL
 
 #include "mp_msg.h"
+#include "help_mp.h"
 
 #include "codec-cfg.h"
 //#include "stream.h"
@@ -66,34 +67,34 @@
     mp_msg(MSGT_WIN32,MSGL_ERR,"ICOpen failed! unknown codec / wrong parameters?\n");
     return NULL;
   }
-  printf("HIC: %x\n", encoder_hic);
+  mp_msg(MSGT_WIN32,MSGL_INFO,"HIC: %x\n", encoder_hic);
 
 #if 1
 {
   ICINFO icinfo;
 
   ret = ICGetInfo(encoder_hic, &icinfo, sizeof(ICINFO));
-  printf("%ld - %ld - %d\n", ret, icinfo.dwSize, sizeof(ICINFO));
-printf("Compressor type: %.4lx\n", icinfo.fccType);
-printf("Compressor subtype: %.4lx\n", icinfo.fccHandler);
-printf("Compressor flags: %lu, version %lu, ICM version: %lu\n",
+  mp_msg(MSGT_WIN32,MSGL_INFO,"%ld - %ld - %d\n", ret, icinfo.dwSize, sizeof(ICINFO));
+  mp_msg(MSGT_WIN32,MSGL_INFO,MSGTR_MPCODECS_CompressorType, icinfo.fccType);
+  mp_msg(MSGT_WIN32,MSGL_INFO,MSGTR_MPCODECS_CompressorSubtype, icinfo.fccHandler);
+  mp_msg(MSGT_WIN32,MSGL_INFO,MSGTR_MPCODECS_CompressorFlags,
     icinfo.dwFlags, icinfo.dwVersion, icinfo.dwVersionICM);
 //printf("Compressor name: %s\n", icinfo.szName);
 //printf("Compressor description: %s\n", icinfo.szDescription);
 
-printf("Flags:");
+mp_msg(MSGT_WIN32,MSGL_INFO,MSGTR_MPCODECS_Flags);
 if (icinfo.dwFlags & VIDCF_QUALITY)
-    printf(" quality");
+    mp_msg(MSGT_WIN32,MSGL_INFO,MSGTR_MPCODECS_Quality);
 if (icinfo.dwFlags & VIDCF_FASTTEMPORALD)
-    printf(" fast-decompr");
+    mp_msg(MSGT_WIN32,MSGL_INFO," fast-decompr");
 if (icinfo.dwFlags & VIDCF_QUALITYTIME)
-    printf(" temp-quality");
-printf("\n");
+    mp_msg(MSGT_WIN32,MSGL_INFO," temp-quality");
+mp_msg(MSGT_WIN32,MSGL_INFO,"\n");
 }
 #endif
 
   temp_len = ICCompressGetFormatSize(encoder_hic, input_bih);
-  printf("ICCompressGetFormatSize ret: %d\n", temp_len);
+  mp_msg(MSGT_WIN32,MSGL_INFO,"ICCompressGetFormatSize ret: %d\n", temp_len);
 
   if (temp_len < sizeof(BITMAPINFOHEADER)) temp_len=sizeof(BITMAPINFOHEADER);
 
@@ -161,16 +162,15 @@
     mp_msg(MSGT_WIN32,MSGL_ERR,"ICCompressBegin failed: Error %d\n", (int)ret);
 //    return 0;
   } else
-  mp_msg(MSGT_WIN32,MSGL_V,"ICCompressBegin OK\n");
-
-    printf(" Output format after query/begin:\n");
-	printf("  biSize %d\n", output_bih->biSize);
-	printf("  biWidth %d\n", output_bih->biWidth);
-	printf("  biHeight %d\n", output_bih->biHeight);
-	printf("  biPlanes %d\n", output_bih->biPlanes);
-	printf("  biBitCount %d\n", output_bih->biBitCount);
-	printf("  biCompression 0x%x ('%.4s')\n", output_bih->biCompression, (char *)&output_bih->biCompression);
-	printf("  biSizeImage %d\n", output_bih->biSizeImage);
+    mp_msg(MSGT_WIN32,MSGL_V,"ICCompressBegin OK\n");
+    mp_msg(MSGT_WIN32,MSGL_INFO," Output format after query/begin:\n");
+    mp_msg(MSGT_WIN32,MSGL_INFO,"  biSize %d\n", output_bih->biSize);
+    mp_msg(MSGT_WIN32,MSGL_INFO,"  biWidth %d\n", output_bih->biWidth);
+    mp_msg(MSGT_WIN32,MSGL_INFO,"  biHeight %d\n", output_bih->biHeight);
+    mp_msg(MSGT_WIN32,MSGL_INFO,"  biPlanes %d\n", output_bih->biPlanes);
+    mp_msg(MSGT_WIN32,MSGL_INFO,"  biBitCount %d\n", output_bih->biBitCount);
+    mp_msg(MSGT_WIN32,MSGL_INFO,"  biCompression 0x%x ('%.4s')\n", output_bih->biCompression, (char *)&output_bih->biCompression);
+    mp_msg(MSGT_WIN32,MSGL_INFO,"  biSizeImage %d\n", output_bih->biSizeImage);
   
   encoder_buf_size=input_bih->biSizeImage;
   encoder_buf=malloc(encoder_buf_size);
@@ -270,7 +270,7 @@
 
     if (!vfw_param_codec)
     {
-	printf("No VfW codec specified! It's required!\n");
+	mp_msg(MSGT_WIN32,MSGL_WARN, MSGTR_MPCODECS_NoVfwCodecSpecified);
 	return 0;
     }
 //    mux_v->bih=vfw_open_encoder("divxc32.dll",vfw_bih,mmioFOURCC('D', 'I', 'V', '3'));
--- a/libmpcodecs/vf.c	Thu Mar 30 23:47:03 2006 +0000
+++ b/libmpcodecs/vf.c	Fri Mar 31 00:15:47 2006 +0000
@@ -318,7 +318,7 @@
 		// need to re-allocate buffer memory:
 		free(mpi->planes[0]);
 		mpi->flags&=~MP_IMGFLAG_ALLOCATED;
-		printf("vf.c: have to REALLOCATE buffer memory :(\n");
+		mp_msg(MSGT_VFILTER,MSGL_V,"vf.c: have to REALLOCATE buffer memory :(\n");
 	    }
 //	} else {
 	} {
--- a/libmpcodecs/vf_crop.c	Thu Mar 30 23:47:03 2006 +0000
+++ b/libmpcodecs/vf_crop.c	Fri Mar 31 00:15:47 2006 +0000
@@ -4,6 +4,7 @@
 
 #include "config.h"
 #include "mp_msg.h"
+#include "help_mp.h"
 
 #include "img_format.h"
 #include "mp_image.h"
@@ -57,7 +58,7 @@
     // check:
     if(vf->priv->crop_w+vf->priv->crop_x>width ||
        vf->priv->crop_h+vf->priv->crop_y>height){
-	printf("crop: bad position/width/height - cropped area is out of the original!\n");
+	mp_msg(MSGT_VFILTER, MSGL_WARN, MSGTR_MPCODECS_CropBadPositionWidthHeight);
 	return 0;
     }
     if(!opt_screen_size_x && !opt_screen_size_y){
--- a/libmpcodecs/vf_cropdetect.c	Thu Mar 30 23:47:03 2006 +0000
+++ b/libmpcodecs/vf_cropdetect.c	Fri Mar 31 00:15:47 2006 +0000
@@ -5,6 +5,7 @@
 
 #include "config.h"
 #include "mp_msg.h"
+#include "help_mp.h"
 
 #include "img_format.h"
 #include "mp_image.h"
@@ -127,7 +128,7 @@
     h -= shrink_by;
     y += (shrink_by / 2 + 1) & ~1;
 
-    printf("crop area: X: %d..%d  Y: %d..%d  (-vf crop=%d:%d:%d:%d)\n",
+    mp_msg(MSGT_VFILTER, MSGL_INFO, MSGTR_MPCODECS_CropArea,
 	vf->priv->x1,vf->priv->x2,
 	vf->priv->y1,vf->priv->y2,
 	w,h,x,y);
--- a/libmpcodecs/vf_expand.c	Thu Mar 30 23:47:03 2006 +0000
+++ b/libmpcodecs/vf_expand.c	Fri Mar 31 00:15:47 2006 +0000
@@ -6,6 +6,7 @@
 
 #include "config.h"
 #include "mp_msg.h"
+#include "help_mp.h"
 
 #include "img_format.h"
 #include "mp_image.h"
@@ -232,7 +233,7 @@
 #if 1
 	if((vf->dmpi->flags & MP_IMGFLAG_DRAW_CALLBACK) &&
 	  !(vf->dmpi->flags & MP_IMGFLAG_DIRECT)){
-	    printf("Full DR not possible, trying SLICES instead!\n");
+	    mp_msg(MSGT_VFILTER, MSGL_INFO, MSGTR_MPCODECS_FullDRNotPossible);
 	    return;
 	}
 #endif
@@ -273,7 +274,7 @@
             MAX(vf->priv->exp_w, mpi->width +vf->priv->exp_x), 
             MAX(vf->priv->exp_h, mpi->height+vf->priv->exp_y));
     if(!(vf->dmpi->flags&MP_IMGFLAG_DRAW_CALLBACK))
-	printf("WARNING! next filter doesn't support SLICES, get ready for sig11...\n"); // shouldn't happen.
+	mp_msg(MSGT_VFILTER, MSGL_WARN, MSGTR_MPCODECS_WarnNextFilterDoesntSupportSlices); // shouldn't happen.
     vf->priv->first_slice = 1;
 }
 
@@ -332,7 +333,7 @@
 static int put_image(struct vf_instance_s* vf, mp_image_t *mpi, double pts){
     if(mpi->flags&MP_IMGFLAG_DIRECT || mpi->flags&MP_IMGFLAG_DRAW_CALLBACK){
 	vf->dmpi=mpi->priv;
-	if(!vf->dmpi) { printf("Why do we get NULL \n"); return 0; }
+	if(!vf->dmpi) { mp_msg(MSGT_VFILTER, MSGL_WARN, MSGTR_MPCODECS_FunWhydowegetNULL); return 0; }
 	mpi->priv=NULL;
 #ifdef OSD_SUPPORT
 	if(vf->priv->osd) draw_osd(vf,mpi->w,mpi->h);
--- a/libmpcodecs/vf_fame.c	Thu Mar 30 23:47:03 2006 +0000
+++ b/libmpcodecs/vf_fame.c	Fri Mar 31 00:15:47 2006 +0000
@@ -5,6 +5,7 @@
 
 #include "config.h"
 #include "mp_msg.h"
+#include "help_mp.h"
 
 //#ifdef USE_LIBFAME
 
@@ -103,7 +104,7 @@
 
     vf->priv->ctx=fame_open();
     if(!vf->priv->ctx){
-	printf("FATAL: cannot open libFAME!\n");
+	mp_msg(MSGT_VFILTER, MSGL_ERR, MSGTR_MPCODECS_FatalCantOpenlibFAME);
 	return 0;
     }
 
--- a/libmpcodecs/vf_format.c	Thu Mar 30 23:47:03 2006 +0000
+++ b/libmpcodecs/vf_format.c	Fri Mar 31 00:15:47 2006 +0000
@@ -5,6 +5,7 @@
 
 #include "config.h"
 #include "mp_msg.h"
+#include "help_mp.h"
 
 #include "img_format.h"
 #include "mp_image.h"
@@ -65,7 +66,7 @@
 	if(!strcasecmp(args,"argb")) vf->priv->fmt=IMGFMT_ARGB; else
 	if(!strcasecmp(args,"bgra")) vf->priv->fmt=IMGFMT_BGRA; else
 	if(!strcasecmp(args,"abgr")) vf->priv->fmt=IMGFMT_ABGR; else
-	{ printf("Unknown format name: '%s'\n",args);return 0;}
+	{ mp_msg(MSGT_VFILTER, MSGL_WARN, MSGTR_MPCODECS_UnknownFormatName, args);return 0;}
     }
         
 
--- a/libmpcodecs/vf_framestep.c	Thu Mar 30 23:47:03 2006 +0000
+++ b/libmpcodecs/vf_framestep.c	Fri Mar 31 00:15:47 2006 +0000
@@ -53,6 +53,7 @@
 
 #include "config.h"
 #include "mp_msg.h"
+#include "help_mp.h"
 #include "cpudetect.h"
 
 #include "img_format.h"
@@ -88,7 +89,7 @@
      */
     if (priv->dump_iframe) {
         if (mpi->pict_type == 1) {
-            printf("I!\n");
+            mp_msg(MSGT_VFILTER, MSGL_INFO, "I!\n");
         }
     }
 
@@ -172,7 +173,7 @@
                 if (*args != '\0') {
                     p->frame_step = atoi(args);
                     if (p->frame_step <= 0) {
-                        printf("Error parsing argument\n");
+                        mp_msg(MSGT_VFILTER, MSGL_WARN, MSGTR_MPCODECS_ErrorParsingArgument);
                         return(0);
                     }
                 }
--- a/libmpcodecs/vf_noformat.c	Thu Mar 30 23:47:03 2006 +0000
+++ b/libmpcodecs/vf_noformat.c	Fri Mar 31 00:15:47 2006 +0000
@@ -5,6 +5,7 @@
 
 #include "config.h"
 #include "mp_msg.h"
+#include "help_mp.h"
 
 #include "img_format.h"
 #include "mp_image.h"
@@ -65,7 +66,7 @@
 	if(!strcasecmp(args,"argb")) vf->priv->fmt=IMGFMT_ARGB; else
 	if(!strcasecmp(args,"bgra")) vf->priv->fmt=IMGFMT_BGRA; else
 	if(!strcasecmp(args,"abgr")) vf->priv->fmt=IMGFMT_ABGR; else
-	{ printf("Unknown format name: '%s'\n",args);return 0;}
+	{ mp_msg(MSGT_VFILTER, MSGL_WARN, MSGTR_MPCODECS_UnknownFormatName, args);return 0;}
     }
         
 
--- a/libmpcodecs/vf_palette.c	Thu Mar 30 23:47:03 2006 +0000
+++ b/libmpcodecs/vf_palette.c	Fri Mar 31 00:15:47 2006 +0000
@@ -5,6 +5,7 @@
 
 #include "config.h"
 #include "mp_msg.h"
+#include "help_mp.h"
 
 #include "img_format.h"
 #include "mp_image.h"
@@ -187,7 +188,7 @@
 	if (!strcasecmp(args,"bgr24")) vf->priv->fmt=IMGFMT_BGR24; else
 	if (!strcasecmp(args,"bgr32")) vf->priv->fmt=IMGFMT_BGR32; else
 	{
-	    printf("Unknown forced format name: '%s'\n", args);
+	    mp_msg(MSGT_VFILTER, MSGL_WARN, MSGTR_MPCODECS_UnknownFormatName, args);
 	    return(0);
 	}
     }
--- a/libmpcodecs/vf_phase.c	Thu Mar 30 23:47:03 2006 +0000
+++ b/libmpcodecs/vf_phase.c	Fri Mar 31 00:15:47 2006 +0000
@@ -168,11 +168,11 @@
 
    if( mp_msg_test(MSGT_VFILTER,MSGL_V) )
       {
-      printf("%c", mode==BOTTOM_FIRST?'b':mode==TOP_FIRST?'t':'p');
-      if(tdiff==65536.0) printf("     N/A "); else printf(" %8.2f", tdiff);
-      if(bdiff==65536.0) printf("     N/A "); else printf(" %8.2f", bdiff);
-      if(pdiff==65536.0) printf("     N/A "); else printf(" %8.2f", pdiff);
-      printf("        \n");
+      mp_msg(MSGT_VFILTER, MSGL_INFO, "%c", mode==BOTTOM_FIRST?'b':mode==TOP_FIRST?'t':'p');
+      if(tdiff==65536.0) mp_msg(MSGT_VFILTER, MSGL_INFO,"     N/A "); else mp_msg(MSGT_VFILTER, MSGL_INFO," %8.2f", tdiff);
+      if(bdiff==65536.0) mp_msg(MSGT_VFILTER, MSGL_INFO,"     N/A "); else mp_msg(MSGT_VFILTER, MSGL_INFO," %8.2f", bdiff);
+      if(pdiff==65536.0) mp_msg(MSGT_VFILTER, MSGL_INFO,"     N/A "); else mp_msg(MSGT_VFILTER, MSGL_INFO," %8.2f", pdiff);
+      mp_msg(MSGT_VFILTER, MSGL_INFO,"        \n");
       }
 
    return mode;
--- a/libmpcodecs/vf_test.c	Thu Mar 30 23:47:03 2006 +0000
+++ b/libmpcodecs/vf_test.c	Fri Mar 31 00:15:47 2006 +0000
@@ -23,6 +23,7 @@
 
 #include "config.h"
 #include "mp_msg.h"
+#include "help_mp.h"
 
 #include "img_format.h"
 #include "mp_image.h"
@@ -51,7 +52,7 @@
 	unsigned int flags, unsigned int outfmt){
 
     if(vf_next_query_format(vf,IMGFMT_YV12)<=0){
-	printf("yv12 not supported by next filter/vo :(\n");
+	mp_msg(MSGT_VFILTER, MSGL_WARN, MSGTR_MPCODECS_WarnNextFilterDoesntSupport, "YV12");
 	return 0;
     }
 
--- a/libmpcodecs/vf_tile.c	Thu Mar 30 23:47:03 2006 +0000
+++ b/libmpcodecs/vf_tile.c	Fri Mar 31 00:15:47 2006 +0000
@@ -39,6 +39,7 @@
 
 #include "config.h"
 #include "mp_msg.h"
+#include "help_mp.h"
 #include "cpudetect.h"
 
 #include "img_format.h"
@@ -278,7 +279,7 @@
 //    er |= parse_int( &args, &p->bkgSet, 0 );
 
     if (er) {
-        printf("Error parsing argument\n");
+        mp_msg(MSGT_VFILTER, MSGL_ERR, MSGTR_MPCODECS_ErrorParsingArgument);
         return(0);
     }
     /* Load some default */
--- a/libmpcodecs/vf_yuy2.c	Thu Mar 30 23:47:03 2006 +0000
+++ b/libmpcodecs/vf_yuy2.c	Fri Mar 31 00:15:47 2006 +0000
@@ -5,6 +5,7 @@
 
 #include "config.h"
 #include "mp_msg.h"
+#include "help_mp.h"
 
 #include "img_format.h"
 #include "mp_image.h"
@@ -23,7 +24,7 @@
     sws_rgb2rgb_init(get_sws_cpuflags());
     
     if(vf_next_query_format(vf,IMGFMT_YUY2)<=0){
-	printf("yuy2 not supported by next filter/vo :(\n");
+	mp_msg(MSGT_VFILTER, MSGL_WARN, MSGTR_MPCODECS_WarnNextFilterDoesntSupport, "YUY2");
 	return 0;
     }
     
--- a/libmpcodecs/vf_yvu9.c	Thu Mar 30 23:47:03 2006 +0000
+++ b/libmpcodecs/vf_yvu9.c	Fri Mar 31 00:15:47 2006 +0000
@@ -5,6 +5,7 @@
 
 #include "config.h"
 #include "mp_msg.h"
+#include "help_mp.h"
 
 #include "img_format.h"
 #include "mp_image.h"
@@ -20,7 +21,7 @@
 	unsigned int flags, unsigned int outfmt){
     
     if(vf_next_query_format(vf,IMGFMT_YV12)<=0){
-	printf("yv12 not supported by next filter/vo :(\n");
+	mp_msg(MSGT_VFILTER, MSGL_WARN, MSGTR_MPCODECS_WarnNextFilterDoesntSupport, "YVU9");
 	return 0;
     }