diff options
author | reynaldo <reynaldo@b3059339-0415-0410-9bf9-f77b7e298cf2> | 2006-04-24 04:23:53 +0000 |
---|---|---|
committer | reynaldo <reynaldo@b3059339-0415-0410-9bf9-f77b7e298cf2> | 2006-04-24 04:23:53 +0000 |
commit | 78417bf0ddb3e5711e6cc22ed98ed095286a0ece (patch) | |
tree | f7c5c3ca1c7ac07e6da82b70e3e1ce62e807a787 /libvo | |
parent | 141b72fe05ec33239e1be6ff6ce064a67440fb8f (diff) | |
download | mpv-78417bf0ddb3e5711e6cc22ed98ed095286a0ece.tar.bz2 mpv-78417bf0ddb3e5711e6cc22ed98ed095286a0ece.tar.xz |
Part 5 and final of otvos attila's oattila AT chello-hu mp_msg changes, with lots of corrections
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@18235 b3059339-0415-0410-9bf9-f77b7e298cf2
Diffstat (limited to 'libvo')
-rw-r--r-- | libvo/aspect.c | 6 | ||||
-rw-r--r-- | libvo/mga_common.c | 21 | ||||
-rw-r--r-- | libvo/vesa_lvo.c | 29 | ||||
-rw-r--r-- | libvo/video_out.c | 6 | ||||
-rw-r--r-- | libvo/vo_3dfx.c | 20 | ||||
-rw-r--r-- | libvo/vo_dxr3.c | 120 | ||||
-rw-r--r-- | libvo/vo_mga.c | 6 | ||||
-rw-r--r-- | libvo/vo_null.c | 4 | ||||
-rw-r--r-- | libvo/vo_png.c | 34 | ||||
-rw-r--r-- | libvo/vo_sdl.c | 87 | ||||
-rw-r--r-- | libvo/vo_svga.c | 61 | ||||
-rw-r--r-- | libvo/vo_syncfb.c | 30 | ||||
-rw-r--r-- | libvo/vo_tdfx_vid.c | 45 | ||||
-rw-r--r-- | libvo/vo_tdfxfb.c | 23 | ||||
-rw-r--r-- | libvo/vo_tga.c | 4 | ||||
-rw-r--r-- | libvo/vo_vesa.c | 130 | ||||
-rw-r--r-- | libvo/vo_x11.c | 3 | ||||
-rw-r--r-- | libvo/vo_xv.c | 2 | ||||
-rw-r--r-- | libvo/vosub_vidix.c | 49 |
19 files changed, 349 insertions, 331 deletions
diff --git a/libvo/aspect.c b/libvo/aspect.c index 0ecf02e858..f69286d00f 100644 --- a/libvo/aspect.c +++ b/libvo/aspect.c @@ -1,9 +1,9 @@ /* Stuff for correct aspect scaling. */ #include "aspect.h" #include "geometry.h" -#ifndef ASPECT_TEST +//#ifndef ASPECT_TEST #include "mp_msg.h" -#endif +//#endif //#define ASPECT_DEBUG @@ -105,7 +105,7 @@ void aspect(int *srcw, int *srch, int zoom){ #ifndef ASPECT_TEST mp_msg(MSGT_VO,MSGL_WARN,"aspect: Warning: no suitable new res found!\n"); #else - printf("error: no new size found that fits into res!\n"); + mp_msg(MSGT_VO,MSGL_WARN,"error: no new size found that fits into res!\n"); #endif } } diff --git a/libvo/mga_common.c b/libvo/mga_common.c index 52b6e2c340..83ca93acce 100644 --- a/libvo/mga_common.c +++ b/libvo/mga_common.c @@ -5,6 +5,7 @@ #include "postproc/rgb2rgb.h" #include "libmpcodecs/vf_scale.h" #include "mp_msg.h" +#include "help_mp.h" // mga_vid drawing functions static void set_window( void ); /* forward declaration to kill warnings */ @@ -138,7 +139,7 @@ vo_mga_flip_page(void) static int draw_frame(uint8_t *src[]) { - printf("!!! mga::draw_frame() called !!!\n"); + mp_msg(MSGT_VO,MSGL_WARN,"!!! mga::draw_frame() called !!!\n"); return 0; } @@ -226,7 +227,7 @@ static void mga_fullscreen() mga_vid_config.x_org=(vo_screenwidth-w)/2; mga_vid_config.y_org=(vo_screenheight-h)/2; if ( ioctl( f,MGA_VID_CONFIG,&mga_vid_config ) ) - printf( "Error in mga_vid_config ioctl (wrong mga_vid.o version?)" ); + mp_msg(MSGT_VO,MSGL_WARN, MSGTR_LIBVO_MGA_ErrorInConfigIoctl ); } static int control(uint32_t request, void *data, ...) @@ -248,7 +249,7 @@ static int control(uint32_t request, void *data, ...) if (ioctl(f,MGA_VID_GET_LUMA,&prev)) { perror("Error in mga_vid_config ioctl()"); - printf("Could not get luma values from the kernel module!\n"); + mp_msg(MSGT_VO,MSGL_WARN, MSGTR_LIBVO_MGA_CouldNotGetLumaValuesFromTheKernelModule); return VO_FALSE; } @@ -269,7 +270,7 @@ static int control(uint32_t request, void *data, ...) if (ioctl(f,MGA_VID_SET_LUMA,luma)) { perror("Error in mga_vid_config ioctl()"); - printf("Could not set luma values in the kernel module!\n"); + mp_msg(MSGT_VO,MSGL_WARN, MSGTR_LIBVO_MGA_CouldNotSetLumaValuesFromTheKernelModule); return VO_FALSE; } @@ -287,7 +288,7 @@ static int control(uint32_t request, void *data, ...) if (ioctl(f,MGA_VID_GET_LUMA,&luma)) { perror("Error in mga_vid_config ioctl()"); - printf("Could not get luma values from the kernel module!\n"); + mp_msg(MSGT_VO,MSGL_WARN, MSGTR_LIBVO_MGA_CouldNotGetLumaValuesFromTheKernelModule); return VO_FALSE; } @@ -310,7 +311,7 @@ static int control(uint32_t request, void *data, ...) if (vo_screenwidth && vo_screenheight) mga_fullscreen(); else - printf("Screen width/height unknown!\n"); + mp_msg(MSGT_VO,MSGL_WARN, MSGTR_LIBVO_MGA_ScreenWidthHeightUnknown); return VO_TRUE; case VOCTRL_GET_PANSCAN: if ( !vo_fs ) return VO_FALSE; @@ -367,7 +368,7 @@ static int mga_init(int width,int height,unsigned int format){ mga_vid_config.frame_size = ((width + 31) & ~31) * height * 2; mga_vid_config.format=MGA_VID_FORMAT_UYVY; break; default: - printf("mga: invalid output format %0X\n",format); + mp_msg(MSGT_VO,MSGL_WARN, MSGTR_LIBVO_MGA_InvalidOutputFormat,format); return (-1); } @@ -385,11 +386,11 @@ static int mga_init(int width,int height,unsigned int format){ if (ioctl(f,MGA_VID_CONFIG,&mga_vid_config)) { perror("Error in mga_vid_config ioctl()"); - printf("Your mga_vid driver version is incompatible with this MPlayer version!\n"); + mp_msg(MSGT_VO,MSGL_WARN, MSGTR_LIBVO_MGA_IncompatibleDriverVersion); return -1; } - printf("[mga] Using %d buffers.\n",mga_vid_config.num_frames); + mp_msg(MSGT_VO,MSGL_INFO, MSGTR_LIBVO_MGA_UsingBuffers,mga_vid_config.num_frames); frames[0] = (char*)mmap(0,mga_vid_config.frame_size*mga_vid_config.num_frames,PROT_WRITE,MAP_SHARED,f,0); frames[1] = frames[0] + 1*mga_vid_config.frame_size; @@ -427,7 +428,7 @@ static int preinit(const char *vo_subdevice) if(f == -1) { perror("open"); - printf("vo_mga: Couldn't open %s\n",devname); + mp_msg(MSGT_VO,MSGL_WARN, MSGTR_LIBVO_MGA_CouldntOpen,devname); return(-1); } diff --git a/libvo/vesa_lvo.c b/libvo/vesa_lvo.c index b108bfbfac..844c737679 100644 --- a/libvo/vesa_lvo.c +++ b/libvo/vesa_lvo.c @@ -21,6 +21,7 @@ #include "config.h" #include "mp_msg.h" +#include "help_mp.h" #include "vesa_lvo.h" #include "img_format.h" @@ -51,15 +52,14 @@ extern vo_functions_t video_out_vesa; int vlvo_preinit(const char *drvname) { - printf("vesa_lvo: This branch is no longer supported.\n" - "vesa_lvo: Please use -vo vesa:vidix instead\n"); + mp_msg(MSGT_VO,MSGL_WARN, MSGTR_LIBVO_VESA_ThisBranchIsNoLongerSupported); return -1; if( mp_msg_test(MSGT_VO,MSGL_DBG2) ) { - printf("vesa_lvo: vlvo_preinit(%s) was called\n",drvname); } + mp_msg(MSGT_VO,MSGL_DBG2, "vesa_lvo: vlvo_preinit(%s) was called\n",drvname);} lvo_handler = open(drvname,O_RDWR); if(lvo_handler == -1) { - printf("vesa_lvo: Couldn't open '%s'\n",drvname); + mp_msg(MSGT_VO,MSGL_WARN, MSGTR_LIBVO_VESA_CouldntOpen,drvname); return -1; } /* we are able to tune up this stuff depend on fourcc format */ @@ -76,11 +76,10 @@ int vlvo_init(unsigned src_width,unsigned src_height, unsigned dst_height,unsigned format,unsigned dest_bpp) { size_t i,awidth; - printf("vesa_lvo: This branch is no longer supported.\n" - "vesa_lvo: Please use -vo vesa:vidix instead\n"); + mp_msg(MSGT_VO,MSGL_WARN, MSGTR_LIBVO_VESA_ThisBranchIsNoLongerSupported); return -1; if( mp_msg_test(MSGT_VO,MSGL_DBG2) ) { - printf("vesa_lvo: vlvo_init() was called\n"); } + mp_msg(MSGT_VO,MSGL_DBG2, "vesa_lvo: vlvo_init() was called\n");} image_width = src_width; image_height = src_height; mga_vid_config.version=MGA_VID_VERSION; @@ -116,7 +115,7 @@ int vlvo_init(unsigned src_width,unsigned src_height, mga_vid_config.frame_size = awidth*src_height*4; break; default: - printf("vesa_lvo: invalid output format %s(%0X)\n",vo_format_name(format),format); + mp_msg(MSGT_VO,MSGL_WARN, MSGTR_LIBVO_VESA_InvalidOutputFormat,vo_format_name(format),format); return -1; } mga_vid_config.colkey_on=0; @@ -130,7 +129,7 @@ int vlvo_init(unsigned src_width,unsigned src_height, if (ioctl(lvo_handler,MGA_VID_CONFIG,&mga_vid_config)) { perror("vesa_lvo: Error in mga_vid_config ioctl()"); - printf("vesa_lvo: Your fb_vid driver version is incompatible with this MPlayer version!\n"); + mp_msg(MSGT_VO,MSGL_WARN, MSGTR_LIBVO_VESA_IncompatibleDriverVersion); return -1; } ioctl(lvo_handler,MGA_VID_ON,0); @@ -149,7 +148,7 @@ int vlvo_init(unsigned src_width,unsigned src_height, void vlvo_term( void ) { if( mp_msg_test(MSGT_VO,MSGL_DBG2) ) { - printf("vesa_lvo: vlvo_term() was called\n"); } + mp_msg(MSGT_VO,MSGL_DBG2, "vesa_lvo: vlvo_term() was called\n");} ioctl( lvo_handler,MGA_VID_OFF,0 ); munmap(frames[0],mga_vid_config.frame_size*mga_vid_config.num_frames); if(lvo_handler != -1) close(lvo_handler); @@ -198,7 +197,7 @@ uint32_t vlvo_draw_slice_420(uint8_t *image[], int stride[], int w,int h,int x,i uint32_t vlvo_draw_slice(uint8_t *image[], int stride[], int w,int h,int x,int y) { if( mp_msg_test(MSGT_VO,MSGL_DBG2) ) { - printf("vesa_lvo: vlvo_draw_slice() was called\n"); } + mp_msg(MSGT_VO,MSGL_DBG2, "vesa_lvo: vlvo_draw_slice() was called\n");} if(src_format == IMGFMT_YV12 || src_format == IMGFMT_I420 || src_format == IMGFMT_IYUV) vlvo_draw_slice_420(image,stride,w,h,x,y); else @@ -218,14 +217,14 @@ uint32_t vlvo_draw_frame(uint8_t *image[]) /* Note it's very strange but sometime for YUY2 draw_frame is called */ memcpy(lvo_mem,image[0],mga_vid_config.frame_size); if( mp_msg_test(MSGT_VO,MSGL_DBG2) ) { - printf("vesa_lvo: vlvo_draw_frame() was called\n"); } + mp_msg(MSGT_VO,MSGL_DBG2, "vesa_lvo: vlvo_flip_page() was called\n");} return 0; } void vlvo_flip_page(void) { if( mp_msg_test(MSGT_VO,MSGL_DBG2) ) { - printf("vesa_lvo: vlvo_flip_page() was called\n"); } + mp_msg(MSGT_VO,MSGL_DBG2, "vesa_lvo: vlvo_draw_osd() was called\n");} if(vo_doublebuffering) { ioctl(lvo_handler,MGA_VID_FSEL,&next_frame); @@ -284,7 +283,7 @@ static void draw_alpha(int x0,int y0, int w,int h, unsigned char* src, unsigned void vlvo_draw_osd(void) { if( mp_msg_test(MSGT_VO,MSGL_DBG2) ) { - printf("vesa_lvo: vlvo_draw_osd() was called\n"); } + mp_msg(MSGT_VO,MSGL_DBG2,"vesa_lvo: vlvo_draw_osd() was called\n"); } /* TODO: hw support */ #if 0 /* disable this stuff until new fbvid.h interface will be implemented @@ -297,7 +296,7 @@ void vlvo_draw_osd(void) uint32_t vlvo_query_info(uint32_t format) { if( mp_msg_test(MSGT_VO,MSGL_DBG2) ) { - printf("vesa_lvo: query_format was called: %x (%s)\n",format,vo_format_name(format)); } + mp_msg(MSGT_VO,MSGL_DBG2, "vesa_lvo: query_format was called: %x (%s)\n",format,vo_format_name(format)); } return VFCAP_CSP_SUPPORTED; } diff --git a/libvo/video_out.c b/libvo/video_out.c index 8d20a126f7..1aad5fb7f8 100644 --- a/libvo/video_out.c +++ b/libvo/video_out.c @@ -267,9 +267,9 @@ void list_video_out(void){ mp_msg(MSGT_GLOBAL, MSGL_INFO, "ID_VIDEO_OUTPUTS\n"); while (video_out_drivers[i]) { const vo_info_t *info = video_out_drivers[i++]->info; - printf("\t%s\t%s\n", info->short_name, info->name); + mp_msg(MSGT_GLOBAL, MSGL_INFO,"\t%s\t%s\n", info->short_name, info->name); } - printf("\n"); + mp_msg(MSGT_GLOBAL, MSGL_INFO,"\n"); } vo_functions_t* init_best_video_out(char** vo_list){ @@ -354,7 +354,7 @@ range_t *str2range(char *s) if (*s == ',') goto out_err; if (!(r = (range_t *) realloc(r, sizeof(*r) * (i + 2)))) { - printf("can't realloc 'r'\n"); + mp_msg(MSGT_GLOBAL, MSGL_WARN,"can't realloc 'r'\n"); return NULL; } tmp_min = strtod(s, &endptr); diff --git a/libvo/vo_3dfx.c b/libvo/vo_3dfx.c index 32198f5740..4759a40833 100644 --- a/libvo/vo_3dfx.c +++ b/libvo/vo_3dfx.c @@ -27,6 +27,8 @@ #include <string.h> #include "config.h" +#include "mp_msg.h" +#include "help_mp.h" #include "video_out.h" #include "video_out_internal.h" @@ -167,12 +169,12 @@ create_window(Display *display, char *title) bpp = attribs.depth; if (bpp != 16) { - printf("Only 16bpp supported!"); + mp_msg(MSGT_VO,MSGL_WARN, MSGTR_LIBVO_3DFX_Only16BppSupported); exit(-1); } XMatchVisualInfo(display,screen,bpp,TrueColor,&vinfo); - printf("visual id is %lx\n",vinfo.visualid); + mp_msg(MSGT_VO,MSGL_INFO, MSGTR_LIBVO_3DFX_VisualIdIs,vinfo.visualid); theCmap = XCreateColormap(display, RootWindow(display,screen), vinfo.visual, AllocNone); @@ -333,7 +335,7 @@ config(uint32_t width, uint32_t height, uint32_t d_width, uint32_t d_height, uin // Open driver device if ( fd == -1 ) { - printf("Device not opened /dev/3dfx\n"); + mp_msg(MSGT_VO,MSGL_WARN, MSGTR_LIBVO_3DFX_UnableToOpenDevice); return -1; } @@ -352,7 +354,7 @@ config(uint32_t width, uint32_t height, uint32_t d_width, uint32_t d_height, uin data.device = 0; if ((retval = ioctl(fd,_IOC(_IOC_READ,'3',3,0),&data)) < 0) { - printf("Error: %d\n",retval); + mp_msg(MSGT_VO,MSGL_WARN, MSGTR_LIBVO_3DFX_Error,retval); return -1; } @@ -363,7 +365,7 @@ config(uint32_t width, uint32_t height, uint32_t d_width, uint32_t d_height, uin data.device = 0; if ((retval = ioctl(fd,_IOC(_IOC_READ,'3',3,0),&data)) < 0) { - printf("Error: %d\n",retval); + mp_msg(MSGT_VO,MSGL_WARN, MSGTR_LIBVO_3DFX_Error,retval); return -1; } @@ -372,7 +374,7 @@ config(uint32_t width, uint32_t height, uint32_t d_width, uint32_t d_height, uin memBase1 = mmap(0,3*page_space,PROT_READ | PROT_WRITE,MAP_SHARED,fd,baseAddr1); if (memBase0 == (uint32_t *) 0xFFFFFFFF || memBase1 == (uint32_t *) 0xFFFFFFFF) { - printf("Couldn't map 3dfx memory areas: %p,%p,%d\n", + mp_msg(MSGT_VO,MSGL_WARN, MSGTR_LIBVO_3DFX_CouldntMapMemoryArea, memBase0,memBase1,errno); } @@ -411,7 +413,7 @@ config(uint32_t width, uint32_t height, uint32_t d_width, uint32_t d_height, uin atexit(restore); - printf("(display) 3dfx initialized %p\n",memBase1); + mp_msg(MSGT_VO,MSGL_INFO, MSGTR_LIBVO_3DFX_DisplayInitialized,memBase1); return 0; } @@ -483,13 +485,13 @@ static int preinit(const char *arg) { if ( (fd = open("/dev/3dfx",O_RDWR) ) == -1) { - printf("Couldn't open /dev/3dfx\n"); + mp_msg(MSGT_VO,MSGL_WARN, MSGTR_LIBVO_3DFX_UnableToOpenDevice); return -1; } if(arg) { - printf("vo_3dfx: Unknown subdevice: %s\n",arg); + mp_msg(MSGT_VO,MSGL_WARN, MSGTR_LIBVO_3DFX_UnknownSubdevice,arg); return ENOSYS; } return 0; diff --git a/libvo/vo_dxr3.c b/libvo/vo_dxr3.c index b91c38c9d1..9504690511 100644 --- a/libvo/vo_dxr3.c +++ b/libvo/vo_dxr3.c @@ -130,6 +130,8 @@ #include <math.h> #include "config.h" +#include "mp_msg.h" +#include "help_mp.h" #ifdef HAVE_MALLOC_H #include <malloc.h> #endif @@ -281,7 +283,7 @@ static int control(uint32_t request, void *data, ...) return VO_TRUE; case VOCTRL_SET_SPU_PALETTE: if (ioctl(fd_spu, EM8300_IOCTL_SPU_SETPALETTE, data) < 0) { - printf("VO: [dxr3] Unable to load new SPU palette!\n"); + mp_msg(MSGT_VO,MSGL_ERR, MSGTR_LIBVO_DXR3_UnableToLoadNewSPUPalette); return VO_ERROR; } return VO_TRUE; @@ -311,7 +313,7 @@ static int control(uint32_t request, void *data, ...) if (dxr3_prebuf) { ioval = EM8300_PLAYMODE_PLAY; if (ioctl(fd_control, EM8300_IOCTL_SET_PLAYMODE, &ioval) < 0) { - printf("VO: [dxr3] Unable to set playmode!\n"); + mp_msg(MSGT_VO,MSGL_WARN, MSGTR_LIBVO_DXR3_UnableToSetPlaymode); } } return VO_TRUE; @@ -319,7 +321,7 @@ static int control(uint32_t request, void *data, ...) if (dxr3_prebuf) { ioval = EM8300_PLAYMODE_PAUSED; if (ioctl(fd_control, EM8300_IOCTL_SET_PLAYMODE, &ioval) < 0) { - printf("VO: [dxr3] Unable to set playmode!\n"); + mp_msg(MSGT_VO,MSGL_WARN, MSGTR_LIBVO_DXR3_UnableToSetPlaymode); } } return VO_TRUE; @@ -425,7 +427,7 @@ static int config(uint32_t width, uint32_t height, uint32_t d_width, uint32_t d_ /* up in a lockup */ ioval = EM8300_SPUMODE_ON; if (ioctl(fd_control, EM8300_IOCTL_SET_SPUMODE, &ioval) < 0) { - printf("VO: [dxr3] Unable to set subpicture mode!\n"); + mp_msg(MSGT_VO,MSGL_WARN, MSGTR_LIBVO_DXR3_UnableToSetSubpictureMode); uninit(); return -1; } @@ -433,7 +435,7 @@ static int config(uint32_t width, uint32_t height, uint32_t d_width, uint32_t d_ /* Set the playmode to play (just in case another app has set it to something else) */ ioval = EM8300_PLAYMODE_PLAY; if (ioctl(fd_control, EM8300_IOCTL_SET_PLAYMODE, &ioval) < 0) { - printf("VO: [dxr3] Unable to set playmode!\n"); + mp_msg(MSGT_VO,MSGL_WARN, MSGTR_LIBVO_DXR3_UnableToSetPlaymode); } /* Start em8300 prebuffering and sync engine */ @@ -465,7 +467,7 @@ static int config(uint32_t width, uint32_t height, uint32_t d_width, uint32_t d_ monitor_aspect = (float) width / (float) height; if (ioctl(fd_control, EM8300_IOCTL_GET_VIDEOMODE, &old_vmode) < 0) { - printf("VO: [dxr3] Unable to get TV norm!\n"); + mp_msg(MSGT_VO,MSGL_WARN, MSGTR_LIBVO_DXR3_UnableToGetTVNorm); old_vmode = -1; } @@ -484,8 +486,8 @@ static int config(uint32_t width, uint32_t height, uint32_t d_width, uint32_t d_ ioval = EM8300_VIDEOMODE_PAL; } - printf("VO: [dxr3] Auto-selected TV norm by frame rate: "); - ioval == EM8300_VIDEOMODE_PAL60 ? printf("PAL-60") : printf("PAL"); + mp_msg(MSGT_VO,MSGL_INFO, MSGTR_LIBVO_DXR3_AutoSelectedTVNormByFrameRate); + ioval == EM8300_VIDEOMODE_PAL60 ? mp_msg(MSGT_VO,MSGL_INFO, "PAL-60") : mp_msg(MSGT_VO,MSGL_INFO, "PAL"); printf(".\n"); } else { if (vo_fps > 28) { @@ -494,14 +496,14 @@ static int config(uint32_t width, uint32_t height, uint32_t d_width, uint32_t d_ ioval = EM8300_VIDEOMODE_PAL; } - printf("VO: [dxr3] Auto-selected TV norm by frame rate: "); - ioval == EM8300_VIDEOMODE_NTSC ? printf("NTSC") : printf("PAL"); + mp_msg(MSGT_VO,MSGL_INFO, MSGTR_LIBVO_DXR3_AutoSelectedTVNormByFrameRate); + ioval == EM8300_VIDEOMODE_NTSC ? mp_msg(MSGT_VO,MSGL_INFO, "NTSC") : mp_msg(MSGT_VO,MSGL_INFO, "PAL"); printf(".\n"); } if (old_vmode != ioval) { if (ioctl(fd_control, EM8300_IOCTL_SET_VIDEOMODE, &ioval) < 0) { - printf("VO: [dxr3] Unable to set TV norm!\n"); + mp_msg(MSGT_VO,MSGL_WARN, MSGTR_LIBVO_DXR3_UnableToSetTVNorm); } } } @@ -512,10 +514,10 @@ static int config(uint32_t width, uint32_t height, uint32_t d_width, uint32_t d_ aspect_save_prescale(d_width, d_height); ioctl(fd_control, EM8300_IOCTL_GET_VIDEOMODE, &ioval); if (ioval == EM8300_VIDEOMODE_NTSC) { - printf("VO: [dxr3] Setting up for NTSC.\n"); + mp_msg(MSGT_VO,MSGL_INFO, MSGTR_LIBVO_DXR3_SettingUpForNTSC); aspect_save_screenres(352, 240); } else { - printf("VO: [dxr3] Setting up for PAL/SECAM.\n"); + mp_msg(MSGT_VO,MSGL_INFO, MSGTR_LIBVO_DXR3_SettingUpForPALSECAM); aspect_save_screenres(352, 288); } aspect(&s_width, &s_height, A_ZOOM); @@ -528,10 +530,10 @@ static int config(uint32_t width, uint32_t height, uint32_t d_width, uint32_t d_ tmp2 = abs(d_height - (int) (d_width / 2.35)); if (tmp1 < tmp2) { ioval = EM8300_ASPECTRATIO_4_3; - printf("VO: [dxr3] Setting aspect ratio to 4:3.\n"); + mp_msg(MSGT_VO,MSGL_INFO, MSGTR_LIBVO_DXR3_SettingAspectRatioTo43); } else { ioval = EM8300_ASPECTRATIO_16_9; - printf("VO: [dxr3] Setting aspect ratio to 16:9.\n"); + mp_msg(MSGT_VO,MSGL_INFO, MSGTR_LIBVO_DXR3_SettingAspectRatioTo169); } ioctl(fd_control, EM8300_IOCTL_SET_ASPECTRATIO, &ioval); @@ -550,20 +552,20 @@ static int config(uint32_t width, uint32_t height, uint32_t d_width, uint32_t d_ osdpicbuf = calloc( 1,s_width * s_height); if (osdpicbuf == NULL) { - printf("VO: [dxr3] Out of memory.\n"); + mp_msg(MSGT_VO,MSGL_ERR, MSGTR_LIBVO_DXR3_OutOfMemory); return -1; } spued = (encodedata *) malloc(sizeof(encodedata)); if (spued == NULL) { free( osdpicbuf ); - printf("VO: [dxr3] Out of memory.\n"); + mp_msg(MSGT_VO,MSGL_ERR, MSGTR_LIBVO_DXR3_OutOfMemory); return -1; } spubuf = (encodedata *) malloc(sizeof(encodedata)); if (spubuf == NULL) { free( osdpicbuf ); free( spued ); - printf("VO: [dxr3] Out of memory.\n"); + mp_msg(MSGT_VO,MSGL_ERR, MSGTR_LIBVO_DXR3_OutOfMemory); return -1; } osd_w = s_width; @@ -651,13 +653,13 @@ static int config(uint32_t width, uint32_t height, uint32_t d_width, uint32_t d_ ((key_color.blue >> (16 - blue_prec)) << blue_shift)); key_color.flags = DoRed | DoGreen | DoBlue; if (!XAllocColor(mDisplay, cmap, &key_color)) { - printf("VO: [dxr3] Unable to allocate keycolor!\n"); + mp_msg(MSGT_VO,MSGL_ERR, MSGTR_LIBVO_DXR3_UnableToAllocateKeycolor); return -1; } acq_color = ((key_color.red / 256) << 16) | ((key_color.green / 256) << 8) | key_color.blue; if (key_color.pixel != KEY_COLOR) { - printf("VO: [dxr3] Unable to allocate exact keycolor, using closest match (0x%lx).\n", key_color.pixel); + mp_msg(MSGT_VO,MSGL_WARN, MSGTR_LIBVO_DXR3_UnableToAllocateExactKeycolor, key_color.pixel); } /* Set keycolor and activate overlay */ @@ -814,7 +816,7 @@ static int draw_slice(uint8_t *srcimg[], int stride[], int w, int h, int x0, int static void uninit(void) { - printf("VO: [dxr3] Uninitializing.\n"); + mp_msg(MSGT_VO,MSGL_INFO, MSGTR_LIBVO_DXR3_Uninitializing); #ifdef HAVE_X11 if (dxr3_overlay) { overlay_set_mode(overlay_data, EM8300_OVERLAY_MODE_OFF); @@ -832,7 +834,7 @@ static void uninit(void) #endif if (old_vmode != -1) { if (ioctl(fd_control, EM8300_IOCTL_SET_VIDEOMODE, &old_vmode) < 0) { - printf("VO: [dxr3] Failed restoring TV norm!\n"); + mp_msg(MSGT_VO,MSGL_WARN, MSGTR_LIBVO_DXR3_FailedRestoringTVNorm); } } @@ -867,49 +869,49 @@ static int preinit(const char *arg) /* Parse commandline */ while (arg) { if (!strncmp("prebuf", arg, 6) && !dxr3_prebuf) { - printf("VO: [dxr3] Enabling prebuffering.\n"); + mp_msg(MSGT_VO,MSGL_INFO, MSGTR_LIBVO_DXR3_EnablingPrebuffering); dxr3_prebuf = 1; } else if (!strncmp("sync", arg, 4) && !dxr3_newsync) { - printf("VO: [dxr3] Using new sync engine.\n"); + mp_msg(MSGT_VO,MSGL_INFO, MSGTR_LIBVO_DXR3_UsingNewSyncEngine); dxr3_newsync = 1; } else if (!strncmp("overlay", arg, 7) && !dxr3_overlay) { #ifdef HAVE_X11 - printf("VO: [dxr3] Using overlay.\n"); + mp_msg(MSGT_VO,MSGL_INFO, MSGTR_LIBVO_DXR3_UsingOverlay); dxr3_overlay = 1; #else - printf("VO: [dxr3] Error: You need to compile mplayer with x11 libraries and headers installed to use overlay.\n"); + mp_msg(MSGT_VO,MSGL_WARN, MSGTR_LIBVO_DXR3_ErrorYouNeedToCompileMplayerWithX11); #endif } else if (!strncmp("norm=", arg, 5)) { arg += 5; // dxr3_norm is 0 (-> don't change norm) by default // but maybe someone changes this in the future - printf("VO: [dxr3] Will set TV norm to: "); + mp_msg(MSGT_VO,MSGL_INFO, MSGTR_LIBVO_DXR3_WillSetTVNormTo); if (*arg == '5') { dxr3_norm = 5; - printf("NTSC"); + mp_msg(MSGT_VO,MSGL_INFO, "NTSC"); } else if (*arg == '4') { dxr3_norm = 4; - printf("PAL-60"); + mp_msg(MSGT_VO,MSGL_INFO, "PAL-60"); } else if (*arg == '3') { dxr3_norm = 3; - printf("PAL"); + mp_msg(MSGT_VO,MSGL_INFO, "PAL"); } else if (*arg == '2') { dxr3_norm = 2; - printf("Auto-adjust to movie frame rate (PAL/PAL-60)"); + mp_msg(MSGT_VO,MSGL_INFO, MSGTR_LIBVO_DXR3_AutoAdjustToMovieFrameRatePALPAL60); } else if (*arg == '1') { dxr3_norm = 1; - printf("Auto-adjust to movie frame rate (PAL/NTSC)"); + mp_msg(MSGT_VO,MSGL_INFO, MSGTR_LIBVO_DXR3_AutoAdjustToMovieFrameRatePALNTSC); } else if (*arg == '0') { dxr3_norm = 0; - printf("Use current norm"); + mp_msg(MSGT_VO,MSGL_INFO, MSGTR_LIBVO_DXR3_UseCurrentNorm); } else { dxr3_norm = 0; - printf("Unknown norm supplied. Use current norm"); + mp_msg(MSGT_VO,MSGL_INFO, MSGTR_LIBVO_DXR3_UseUnknownNormSuppliedCurrentNorm); } - printf(".\n"); + mp_msg(MSGT_VO,MSGL_INFO, ".\n"); } else if (arg[0] == '0' || arg[0] == '1' || arg[0] == '2' || arg[0] == '3') { dxr3_device_num = arg[0]; } @@ -926,15 +928,15 @@ static int preinit(const char *arg) fd_control = open(devname, fdflags); if (fd_control < 1) { /* Fall back to old naming scheme */ - printf("VO: [dxr3] Error opening %s for writing, trying /dev/em8300 instead.\n", devname); + mp_msg(MSGT_VO,MSGL_WARN, MSGTR_LIBVO_DXR3_ErrorOpeningForWritingTrying, devname); sprintf(devname, "/dev/em8300"); fd_control = open(devname, fdflags); if (fd_control < 1) { - printf("VO: [dxr3] Error opening /dev/em8300 for writing as well!\nBailing.\n"); + mp_msg(MSGT_VO,MSGL_ERR, MSGTR_LIBVO_DXR3_ErrorOpeningForWritingAsWell); return -1; } } else { - printf("VO: [dxr3] Opened %s.\n", devname); + mp_msg(MSGT_VO,MSGL_INFO, MSGTR_LIBVO_DXR3_Opened, devname); } /* Open the video interface */ @@ -942,16 +944,16 @@ static int preinit(const char *arg) fd_video = open(devname, fdflags); if (fd_video < 0) { /* Fall back to old naming scheme */ - printf("VO: [dxr3] Error opening %s for writing, trying /dev/em8300_mv instead.\n", devname); + mp_msg(MSGT_VO,MSGL_WARN, MSGTR_LIBVO_DXR3_ErrorOpeningForWritingTryingMV, devname); sprintf(devname, "/dev/em8300_mv"); fd_video = open(devname, fdflags); if (fd_video < 0) { - printf("VO: [dxr3] Error opening /dev/em8300_mv for writing as well!\nBailing.\n"); + mp_msg(MSGT_VO,MSGL_ERR, MSGTR_LIBVO_DXR3_ErrorOpeningForWritingAsWellMV); uninit(); return -1; } } else { - printf("VO: [dxr3] Opened %s.\n", devname); + mp_msg(MSGT_VO,MSGL_INFO, MSGTR_LIBVO_DXR3_Opened, devname); } strcpy(fdv_name, devname); @@ -960,16 +962,16 @@ static int preinit(const char *arg) fd_spu = open(devname, fdflags); if (fd_spu < 0) { /* Fall back to old naming scheme */ - printf("VO: [dxr3] Error opening %s for writing, trying /dev/em8300_sp instead.\n", devname); + mp_msg(MSGT_VO,MSGL_WARN, MSGTR_LIBVO_DXR3_ErrorOpeningForWritingTryingSP, devname); sprintf(devname, "/dev/em8300_sp"); fd_spu = open(devname, fdflags); if (fd_spu < 0) { - printf("VO: [dxr3] Error opening /dev/em8300_sp for writing as well!\nBailing.\n"); + mp_msg(MSGT_VO,MSGL_ERR, MSGTR_LIBVO_DXR3_ErrorOpeningForWritingAsWellSP); uninit(); return -1; } } else { - printf("VO: [dxr3] Opened %s.\n", devname); + mp_msg(MSGT_VO,MSGL_INFO, MSGTR_LIBVO_DXR3_Opened, devname); } strcpy(fds_name, devname); @@ -986,7 +988,7 @@ static int preinit(const char *arg) dpy = XOpenDisplay(NULL); if (!dpy) { - printf("VO: [dxr3] Unable to open display during overlay hack setup!\n"); + mp_msg(MSGT_VO,MSGL_ERR, MSGTR_LIBVO_DXR3_UnableToOpenDisplayDuringHackSetup); return -1; } XGetWindowAttributes(dpy, RootWindow(dpy, DefaultScreen(dpy)), &attribs); @@ -1006,7 +1008,7 @@ static int preinit(const char *arg) if (!use_gui) { #endif if (!vo_init()) { - printf("VO: [dxr3] Unable to init x11!\n"); + mp_msg(MSGT_VO,MSGL_ERR, MSGTR_LIBVO_DXR3_UnableToInitX11); return -1; } #ifdef HAVE_NEW_GUI @@ -1045,7 +1047,7 @@ static int overlay_set_attribute(overlay_t *o, int attribute, int value) attr.value = value; if (ioctl(o->dev, EM8300_IOCTL_OVERLAY_SET_ATTRIBUTE, &attr)==-1) { - printf("VO: [dxr3] Failed setting overlay attribute.\n"); + mp_msg(MSGT_VO,MSGL_WARN, MSGTR_LIBVO_DXR3_FailedSettingOverlayAttribute); return -1; } @@ -1251,7 +1253,7 @@ static int overlay_set_screen(overlay_t *o, int xres, int yres, int depth) if (ioctl(o->dev, EM8300_IOCTL_OVERLAY_SETSCREEN, &scr)==-1) { - printf("VO: [dxr3] Failed setting overlay screen!\nExiting.\n"); + mp_msg(MSGT_VO,MSGL_WARN, MSGTR_LIBVO_DXR3_FailedSettingOverlayScreen); return -1; } return 0; @@ -1260,7 +1262,7 @@ static int overlay_set_screen(overlay_t *o, int xres, int yres, int depth) static int overlay_set_mode(overlay_t *o, int mode) { if (ioctl(o->dev, EM8300_IOCTL_OVERLAY_SETMODE, &mode)==-1) { - printf("VO: [dxr3] Failed enabling overlay!\nExiting.\n"); + mp_msg(MSGT_VO,MSGL_WARN, MSGTR_LIBVO_DXR3_FailedEnablingOverlay); return -1; } return 0; @@ -1276,7 +1278,7 @@ static int overlay_set_window(overlay_t *o, int xpos,int ypos,int width,int heig if (ioctl(o->dev, EM8300_IOCTL_OVERLAY_SETWINDOW, &win)==-1) { - printf("VO: [dxr3] Failed resizing overlay window!\n"); + mp_msg(MSGT_VO,MSGL_WARN, MSGTR_LIBVO_DXR3_FailedResizingOverlayWindow); return -1; } return 0; @@ -1291,7 +1293,7 @@ static int overlay_set_bcs(overlay_t *o, int brightness, int contrast, int satur if (ioctl(o->dev, EM8300_IOCTL_GETBCS, &bcs)==-1) { - printf("VO: [dxr3] Failed setting overlay bcs!\n"); + mp_msg(MSGT_VO,MSGL_WARN, MSGTR_LIBVO_DXR3_FailedSettingOverlayBcs); return -1; } return 0; @@ -1379,11 +1381,11 @@ static int overlay_autocalibrate(overlay_t *o, pattern_drawer_cb pd, void *arg) cal.cal_mode = EM8300_OVERLAY_CALMODE_YOFFSET; if (ioctl(o->dev, EM8300_IOCTL_OVERLAY_CALIBRATE, &cal)) { - printf("VO: [dxr3] Failed getting overlay Y-offset values!\nExiting.\n"); + mp_msg(MSGT_VO,MSGL_WARN, MSGTR_LIBVO_DXR3_FailedGettingOverlayYOffsetValues); return -1; } o->yoffset = cal.result; - printf("Yoffset: %d\n",cal.result); + mp_msg(MSGT_VO,MSGL_INFO, MSGTR_LIBVO_DXR3_YOffset,cal.result); /* Calibrate X-offset */ @@ -1392,11 +1394,11 @@ static int overlay_autocalibrate(overlay_t *o, pattern_drawer_cb pd, void *arg) cal.cal_mode = EM8300_OVERLAY_CALMODE_XOFFSET; if (ioctl(o->dev, EM8300_IOCTL_OVERLAY_CALIBRATE, &cal)) { - printf("VO: [dxr3] Failed getting overlay X-offset values!\nExiting.\n"); + mp_msg(MSGT_VO,MSGL_WARN, MSGTR_LIBVO_DXR3_FailedGettingOverlayXOffsetValues); return -1; } o->xoffset = cal.result; - printf("Xoffset: %d\n",cal.result); + mp_msg(MSGT_VO,MSGL_INFO, MSGTR_LIBVO_DXR3_XOffset,cal.result); /* Calibrate X scale correction */ @@ -1405,10 +1407,10 @@ static int overlay_autocalibrate(overlay_t *o, pattern_drawer_cb pd, void *arg) cal.cal_mode = EM8300_OVERLAY_CALMODE_XCORRECTION; if (ioctl(o->dev, EM8300_IOCTL_OVERLAY_CALIBRATE, &cal)) { - printf("VO: [dxr3] Failed getting overlay X-scale correction!\nExiting.\n"); + mp_msg(MSGT_VO,MSGL_WARN, MSGTR_LIBVO_DXR3_FailedGettingOverlayYScaleCorrection); return -1; } - printf("Xcorrection: %d\n",cal.result); + mp_msg(MSGT_VO,MSGL_INFO, MSGTR_LIBVO_DXR3_XCorrection,cal.result); o->xcorr = cal.result; win.xpos = 10; @@ -1416,7 +1418,7 @@ static int overlay_autocalibrate(overlay_t *o, pattern_drawer_cb pd, void *arg) win.width = o->xres-20; win.height = o->yres-20; if (ioctl(o->dev, EM8300_IOCTL_OVERLAY_SETWINDOW, &win)==-1) { - printf("VO: [dxr3] Failed resizing overlay window!\n"); + mp_msg(MSGT_VO,MSGL_ERR, MSGTR_LIBVO_DXR3_FailedResizingOverlayWindow); exit(1); } @@ -1479,7 +1481,7 @@ static int overlay_autocalibrate(overlay_t *o, pattern_drawer_cb pd, void *arg) static int overlay_signalmode(overlay_t *o, int mode) { if(ioctl(o->dev, EM8300_IOCTL_OVERLAY_SIGNALMODE, &mode) ==-1) { - printf("VO: [dxr3] Failed set signal mix!\n"); + mp_msg(MSGT_VO,MSGL_WARN, MSGTR_LIBVO_DXR3_FailedSetSignalMix); return -1; } return 0; diff --git a/libvo/vo_mga.c b/libvo/vo_mga.c index 72a47a1c40..dc7900d68c 100644 --- a/libvo/vo_mga.c +++ b/libvo/vo_mga.c @@ -7,6 +7,8 @@ #include <string.h> #include "config.h" +#include "mp_msg.h" +#include "help_mp.h" #include "video_out.h" #include "video_out_internal.h" @@ -67,7 +69,7 @@ static int config(uint32_t width, uint32_t height, uint32_t d_width, uint32_t d_ aspect(&d_width,&d_height,A_NOZOOM); vo_fs = VO |