diff options
author | reynaldo <reynaldo@b3059339-0415-0410-9bf9-f77b7e298cf2> | 2006-03-31 00:15:47 +0000 |
---|---|---|
committer | reynaldo <reynaldo@b3059339-0415-0410-9bf9-f77b7e298cf2> | 2006-03-31 00:15:47 +0000 |
commit | b4c74fb28e7012d2c682896418e5ee573e3614f7 (patch) | |
tree | 0ea489773dbba06af0a37771c11f917ec78c7edc /libmpcodecs | |
parent | e5782cf37b2f6e340d17a8a9eec6d6461f1fee42 (diff) | |
download | mpv-b4c74fb28e7012d2c682896418e5ee573e3614f7.tar.bz2 mpv-b4c74fb28e7012d2c682896418e5ee573e3614f7.tar.xz |
Part2 of several printf2mp_msg changes in patch from Otvos Attila oattila AT chello DOT hu with LOTS of modifications by me
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@18005 b3059339-0415-0410-9bf9-f77b7e298cf2
Diffstat (limited to 'libmpcodecs')
-rw-r--r-- | libmpcodecs/ad_libdv.c | 4 | ||||
-rw-r--r-- | libmpcodecs/vd_dmo.c | 2 | ||||
-rw-r--r-- | libmpcodecs/vd_dshow.c | 2 | ||||
-rw-r--r-- | libmpcodecs/vd_ffmpeg.c | 32 | ||||
-rw-r--r-- | libmpcodecs/vd_vfw.c | 2 | ||||
-rw-r--r-- | libmpcodecs/ve_lavc.c | 6 | ||||
-rw-r--r-- | libmpcodecs/ve_raw.c | 3 | ||||
-rw-r--r-- | libmpcodecs/ve_vfw.c | 44 | ||||
-rw-r--r-- | libmpcodecs/vf.c | 2 | ||||
-rw-r--r-- | libmpcodecs/vf_crop.c | 3 | ||||
-rw-r--r-- | libmpcodecs/vf_cropdetect.c | 3 | ||||
-rw-r--r-- | libmpcodecs/vf_expand.c | 7 | ||||
-rw-r--r-- | libmpcodecs/vf_fame.c | 3 | ||||
-rw-r--r-- | libmpcodecs/vf_format.c | 3 | ||||
-rw-r--r-- | libmpcodecs/vf_framestep.c | 5 | ||||
-rw-r--r-- | libmpcodecs/vf_noformat.c | 3 | ||||
-rw-r--r-- | libmpcodecs/vf_palette.c | 3 | ||||
-rw-r--r-- | libmpcodecs/vf_phase.c | 10 | ||||
-rw-r--r-- | libmpcodecs/vf_test.c | 3 | ||||
-rw-r--r-- | libmpcodecs/vf_tile.c | 3 | ||||
-rw-r--r-- | libmpcodecs/vf_yuy2.c | 3 | ||||
-rw-r--r-- | libmpcodecs/vf_yvu9.c | 3 |
22 files changed, 82 insertions, 67 deletions
diff --git a/libmpcodecs/ad_libdv.c b/libmpcodecs/ad_libdv.c index a193369047..9107035be1 100644 --- a/libmpcodecs/ad_libdv.c +++ b/libmpcodecs/ad_libdv.c @@ -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 @@ static int decode_audio(sh_audio_t *audio, unsigned char *buf, int minlen, int m 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)) diff --git a/libmpcodecs/vd_dmo.c b/libmpcodecs/vd_dmo.c index 2e0e884d2a..737c0e2374 100644 --- a/libmpcodecs/vd_dmo.c +++ b/libmpcodecs/vd_dmo.c @@ -77,7 +77,7 @@ static mp_image_t* decode(sh_video_t *sh,void* data,int len,int flags){ 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; } diff --git a/libmpcodecs/vd_dshow.c b/libmpcodecs/vd_dshow.c index d603b5b7ad..6f0923636f 100644 --- a/libmpcodecs/vd_dshow.c +++ b/libmpcodecs/vd_dshow.c @@ -106,7 +106,7 @@ static mp_image_t* decode(sh_video_t *sh,void* data,int len,int flags){ 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; } diff --git a/libmpcodecs/vd_ffmpeg.c b/libmpcodecs/vd_ffmpeg.c index 457375bb87..6666452fa8 100644 --- a/libmpcodecs/vd_ffmpeg.c +++ b/libmpcodecs/vd_ffmpeg.c @@ -248,7 +248,7 @@ static int init(sh_video_t *sh){ #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 @@ static int init(sh_video_t *sh){ 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 @@ static void uninit(sh_video_t *sh){ 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 @@ static int get_buffer(AVCodecContext *avctx, AVFrame *pic){ 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 @@ static mp_image_t* decode(sh_video_t *sh,void* data,int len,int flags){ 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 @@ int i; 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 @@ int i; } #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 @@ static int mc_get_buffer(AVCodecContext *avctx, AVFrame *pic){ // 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 @@ static int mc_get_buffer(AVCodecContext *avctx, AVFrame *pic){ 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 @@ static int mc_get_buffer(AVCodecContext *avctx, AVFrame *pic){ 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 @@ static int mc_get_buffer(AVCodecContext *avctx, AVFrame *pic){ 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 @@ static void mc_release_buffer(AVCodecContext *avctx, AVFrame *pic){ //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; diff --git a/libmpcodecs/vd_vfw.c b/libmpcodecs/vd_vfw.c index bbb70b05d2..6f94b0f5b5 100644 --- a/libmpcodecs/vd_vfw.c +++ b/libmpcodecs/vd_vfw.c @@ -303,7 +303,7 @@ static mp_image_t* decode(sh_video_t *sh,void* data,int len,int flags){ 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; } diff --git a/libmpcodecs/ve_lavc.c b/libmpcodecs/ve_lavc.c index 715b86fde0..8fcac43ddb 100644 --- a/libmpcodecs/ve_lavc.c +++ b/libmpcodecs/ve_lavc.c @@ -590,7 +590,7 @@ static int config(struct vf_instance_s* vf, 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 @@ static int config(struct vf_instance_s* vf, /* 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 @@ static void uninit(struct vf_instance_s* vf){ 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), diff --git a/libmpcodecs/ve_raw.c b/libmpcodecs/ve_raw.c index aeffee2e64..804266b867 100644 --- a/libmpcodecs/ve_raw.c +++ b/libmpcodecs/ve_raw.c @@ -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 @@ static int set_format(struct vf_instance_s *vf, unsigned int fmt) { 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; } diff --git a/libmpcodecs/ve_vfw.c b/libmpcodecs/ve_vfw.c index 43d7ed3363..7dfc84a29c 100644 --- a/libmpcodecs/ve_vfw.c +++ b/libmpcodecs/ve_vfw.c @@ -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 @@ static BITMAPINFOHEADER* vfw_open_encoder(char *dll_name, BITMAPINFOHEADER *inpu 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 @@ static int vfw_start_encoder(BITMAPINFOHEADER *input_bih, BITMAPINFOHEADER *outp 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 @@ static int vf_open(vf_instance_t *vf, char* args){ 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')); diff --git a/libmpcodecs/vf.c b/libmpcodecs/vf.c index f7fb37ba76..f34bca1044 100644 --- a/libmpcodecs/vf.c +++ b/libmpcodecs/vf.c @@ -318,7 +318,7 @@ mp_image_t* vf_get_image(vf_instance_t* vf, unsigned int outfmt, int mp_imgtype, // 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 { } { diff --git a/libmpcodecs/vf_crop.c b/libmpcodecs/vf_crop.c index d5d373513b..200a3e783c 100644 --- a/libmpcodecs/vf_crop.c +++ b/libmpcodecs/vf_crop.c @@ -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 @@ static int config(struct vf_instance_s* vf, // 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){ diff --git a/libmpcodecs/vf_cropdetect.c b/libmpcodecs/vf_cropdetect.c index d72c1dcb95..3f0d7a3e7e 100644 --- a/libmpcodecs/vf_cropdetect.c +++ b/libmpcodecs/vf_cropdetect.c @@ -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 @@ if(++vf->priv->fno>2){ // ignore first 2 frames - they may be empty 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); diff --git a/libmpcodecs/vf_expand.c b/libmpcodecs/vf_expand.c index 1549b20681..e420597437 100644 --- a/libmpcodecs/vf_expand.c +++ b/libmpcodecs/vf_expand.c @@ -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 @@ static void get_image(struct vf_instance_s* vf, mp_image_t *mpi){ #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 @@ static void start_slice(struct vf_instance_s* vf, mp_image_t *mpi){ 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 void draw_slice(struct vf_instance_s* vf, 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); diff --git a/libmpcodecs/vf_fame.c b/libmpcodecs/vf_fame.c index f5f7696a9d..6eeb29530d 100644 --- a/libmpcodecs/vf_fame.c +++ b/libmpcodecs/vf_fame.c @@ -5,6 +5,7 @@ #include "config.h" #include "mp_msg.h" +#include "help_mp.h" //#ifdef USE_LIBFAME @@ -103,7 +104,7 @@ static int open(vf_instance_t *vf, char* args){ 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; } diff --git a/libmpcodecs/vf_format.c b/libmpcodecs/vf_format.c index f9a1c0a096..fef17eb908 100644 --- a/libmpcodecs/vf_format.c +++ b/libmpcodecs/vf_format.c @@ -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 @@ static int open(vf_instance_t *vf, char* args){ 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;} } diff --git a/libmpcodecs/vf_framestep.c b/libmpcodecs/vf_framestep.c index ee438c5625..b48c5108a4 100644 --- a/libmpcodecs/vf_framestep.c +++ b/libmpcodecs/vf_framestep.c @@ -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 @@ static int put_image(struct vf_instance_s* vf, mp_image_t *mpi, double pts) */ if (priv->dump_iframe) { if (mpi->pict_type == 1) { - printf("I!\n"); + mp_msg(MSGT_VFILTER, MSGL_INFO, "I!\n"); } } @@ -172,7 +173,7 @@ static int open(vf_instance_t *vf, char* args) 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); } } diff --git a/libmpcodecs/vf_noformat.c b/libmpcodecs/vf_noformat.c index 8c857d9d4e..1b16aab9f7 100644 --- a/libmpcodecs/vf_noformat.c +++ b/libmpcodecs/vf_noformat.c @@ -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 @@ static int open(vf_instance_t *vf, char* args){ 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;} } diff --git a/libmpcodecs/vf_palette.c b/libmpcodecs/vf_palette.c index e41b9e07d0..05b614b1fc 100644 --- a/libmpcodecs/vf_palette.c +++ b/libmpcodecs/vf_palette.c @@ -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 @@ static int open(vf_instance_t *vf, char* args){ 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); } } diff --git a/libmpcodecs/vf_phase.c b/libmpcodecs/vf_phase.c index 36e1fdcf48..42957cd77e 100644 --- a/libmpcodecs/vf_phase.c +++ b/libmpcodecs/vf_phase.c @@ -168,11 +168,11 @@ static enum mode analyze_plane(unsigned char *old, unsigned char *new, 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; diff --git a/libmpcodecs/vf_test.c b/libmpcodecs/vf_test.c index 483dea79ef..aaaca4d4b8 100644 --- a/libmpcodecs/vf_test.c +++ b/libmpcodecs/vf_test.c @@ -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 @@ static int config(struct vf_instance_s* vf, 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; } diff --git a/libmpcodecs/vf_tile.c b/libmpcodecs/vf_tile.c index 8f5a7949f7..d4aa1fec83 100644 --- a/libmpcodecs/vf_tile.c +++ b/libmpcodecs/vf_tile.c @@ -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 @@ static int open(vf_instance_t *vf, char* args) // 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 */ diff --git a/libmpcodecs/vf_yuy2.c b/libmpcodecs/vf_yuy2.c index fe74b066fb..8310a53efc 100644 --- a/libmpcodecs/vf_yuy2.c +++ b/libmpcodecs/vf_yuy2.c @@ -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 @@ static int config(struct vf_instance_s* vf, 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; } diff --git a/libmpcodecs/vf_yvu9.c b/libmpcodecs/vf_yvu9.c index 72d6c37903..654a90dbd7 100644 --- a/libmpcodecs/vf_yvu9.c +++ b/libmpcodecs/vf_yvu9.c @@ -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 @@ static int config(struct vf_instance_s* vf, 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; } |