[Mplayerxp-cvslog] SF.net SVN: mplayerxp:[584] mplayerxp
Brought to you by:
olov
From: <nic...@us...> - 2012-12-20 15:46:59
|
Revision: 584 http://mplayerxp.svn.sourceforge.net/mplayerxp/?rev=584&view=rev Author: nickols_k Date: 2012-12-20 15:46:50 +0000 (Thu, 20 Dec 2012) Log Message: ----------- fixes+improvements+converting MSG_* info mpxp_* Modified Paths: -------------- mplayerxp/dump.cpp mplayerxp/input2/input.cpp mplayerxp/input2/joystick.cpp mplayerxp/input2/lirc.cpp mplayerxp/libao3/audio_out.cpp mplayerxp/libao3/audio_out.h mplayerxp/libvo2/video_out.cpp mplayerxp/libvo2/video_out.h mplayerxp/mplayerxp.cpp mplayerxp/mpxp_msg.cpp mplayerxp/mpxp_msg.h mplayerxp/nls/mpxp_help-en.h mplayerxp/nls/mpxp_help-ru.h mplayerxp/postproc/vf_vo2.cpp Modified: mplayerxp/dump.cpp =================================================================== --- mplayerxp/dump.cpp 2012-12-20 15:07:43 UTC (rev 583) +++ mplayerxp/dump.cpp 2012-12-20 15:46:50 UTC (rev 584) @@ -67,7 +67,7 @@ if(len>0) fwrite(buf,len,1,f); } fclose(f); - MSG_INFO(MSGTR_CoreDumped); /* nice joke ;) */ + mpxp_info<<MSGTR_StreamDumped<<std::endl; exit_player(MSGTR_Exit_eof); } @@ -274,7 +274,7 @@ delete demuxer->priv; demuxer->priv=NULL; } - MSG_INFO(MSGTR_CoreDumped); + mpxp_info<<MSGTR_StreamDumped<<std::endl; } Modified: mplayerxp/input2/input.cpp =================================================================== --- mplayerxp/input2/input.cpp 2012-12-20 15:07:43 UTC (rev 583) +++ mplayerxp/input2/input.cpp 2012-12-20 15:46:50 UTC (rev 584) @@ -1,6 +1,8 @@ #include "mpxp_config.h" #include "osdep/mplib.h" using namespace mpxp; +#include <iomanip> + #include <stdlib.h> #include <string.h> #include <stdio.h> @@ -466,7 +468,7 @@ static MPXP_Rc mp_input_add_cmd_fd(libinput_t& priv,any_t* opaque, int sel, mp_cmd_func_t read_func, mp_close_func_t close_func) { if(priv.num_cmd_fd == MP_MAX_CMD_FD) { - MSG_ERR("Too much command fd, unable to register fd\n"); + mpxp_err<<"Too much command fd, unable to register fd"<<std::endl; return MPXP_False; } @@ -507,7 +509,7 @@ static MPXP_Rc mp_input_add_key_fd(libinput_t& priv,any_t* opaque, int sel, mp_key_func_t read_func, mp_close_func_t close_func) { if(priv.num_key_fd == MP_MAX_KEY_FD) { - MSG_ERR("Too much key fd, unable to register fd\n"); + mpxp_err<<"Too much key fd, unable to register fd"<<std::endl; return MPXP_False; } @@ -564,7 +566,7 @@ errno = 0; cmd->args[i].v.i = atoi(ptr); if(errno != 0) { - MSG_ERR("Command %s : argument %d isn't an integer\n",cmd_def->name,i+1); + mpxp_err<<"Command: "<<cmd_def->name<<" argument "<<i+1<<" isn't an integer"<<std::endl; ptr = NULL; } break; @@ -579,7 +581,7 @@ setlocale(LC_NUMERIC, ""); #endif if(errno != 0) { - MSG_ERR("Command %s : argument %d isn't a float\n",cmd_def->name,i+1); + mpxp_err<<"Command: "<<cmd_def->name<<" argument "<<i+1<<" isn't a float"<<std::endl; ptr = NULL; } break; @@ -599,7 +601,7 @@ ptr2 = e + 1; } if(term != ' ' && (!e || e[0] == '\0')) { - MSG_ERR("Command %s : argument %d is unterminated\n",cmd_def->name,i+1); + mpxp_err<<"Command: "<<cmd_def->name<<" argument "<<i+1<<" is unterminated"<<std::endl; ptr = NULL; break; } else if(!e) e = ptr+strlen(ptr); @@ -614,13 +616,13 @@ } } break; case -1: ptr = NULL; - default: MSG_ERR("Unknown argument %d\n",i); + default: mpxp_err<<"Unknown argument "<<i<<std::endl; } } cmd->nargs = i; if(cmd_def->nargs > cmd->nargs) { - MSG_ERR("Got command '%s' but\n",str); - MSG_ERR("command %s require at least %d arguments, we found only %d so far\n",cmd_def->name,cmd_def->nargs,cmd->nargs); + mpxp_err<<"Got command '"<<str<<"' but"<<std::endl; + mpxp_err<<"command "<<cmd_def->name<<" require at least "<<cmd_def->nargs<<" arguments, we found only "<<cmd->nargs<<" so far"<<std::endl; mp_cmd_free(cmd); delete str; return NULL; @@ -674,7 +676,7 @@ switch(r) { case MP_INPUT_ERROR: case MP_INPUT_DEAD: - MSG_ERR("Error while reading cmd fd: %s\n",strerror(errno)); + mpxp_err<<"Error while reading cmd fd: "<<strerror(errno)<<std::endl; case MP_INPUT_NOTHING: return r; } // EOF ? @@ -696,7 +698,7 @@ if(!end) { // If buffer is full we must drop all until the next \n if(mp_fd->size - mp_fd->pos <= 1) { - MSG_ERR("Cmd buffer is full: dropping content\n"); + mpxp_err<<"Cmd buffer is full: dropping content"<<std::endl; mp_fd->pos = 0; mp_fd->flags |= MP_FD_DROP; } @@ -776,22 +778,22 @@ if(priv.cmd_binds) cmd = mp_input_find_bind_for_key(priv.cmd_binds,n,keys); if(cmd == NULL) cmd = mp_input_find_bind_for_key(def_cmd_binds,n,keys); if(cmd == NULL) { - MSG_WARN("No bind found for key %s",mp_input_get_key_name(priv,keys[0])); + mpxp_warn<<"No bind found for key: "<<mp_input_get_key_name(priv,keys[0]); if(n > 1) { int s; - for(s=1; s < n; s++) MSG_WARN("-%s",mp_input_get_key_name(priv,keys[s])); + for(s=1; s < n; s++) mpxp_warn<<std::left<<mp_input_get_key_name(priv,keys[s]); } - MSG_WARN(" \n"); + mpxp_warn<<std::endl; return NULL; } ret = mp_input_parse_cmd(cmd); if(!ret) { - MSG_ERR("Invalid command for binded key %s",mp_input_get_key_name(priv,priv.key_down[0])); + mpxp_err<<"Invalid command for binded key: "<<mp_input_get_key_name(priv,priv.key_down[0]); if(priv.num_key_down > 1) { unsigned int s; - for(s=1; s < priv.num_key_down; s++) MSG_ERR("-%s",mp_input_get_key_name(priv,priv.key_down[s])); + for(s=1; s < priv.num_key_down; s++) mpxp_err<<std::left<<mp_input_get_key_name(priv,priv.key_down[s]); } - MSG_ERR(" : %s \n",cmd); + mpxp_err<<" : "<<cmd<<std::endl; } return ret; } @@ -820,9 +822,9 @@ code = ((mp_key_func_t)priv.key_fds[i].read.key_func)(priv.key_fds[i].opaque); if(code >= 0) return code; - if(code == MP_INPUT_ERROR) MSG_ERR("Error on key input fd\n"); + if(code == MP_INPUT_ERROR) mpxp_err<<"Error on key input fd"<<std::endl; else if(code == MP_INPUT_DEAD) { - MSG_ERR("Dead key input on fd\n"); + mpxp_err<<"Dead key input on fd"<<std::endl; mp_input_rm_key_fd(priv,priv.key_fds[i].opaque); } } @@ -847,7 +849,7 @@ // key pushed if(code & MP_KEY_DOWN) { if(priv.num_key_down > MP_MAX_KEY_DOWN) { - MSG_ERR("Too much key down at the same time\n"); + mpxp_err<<"Too much key down at the same time"<<std::endl; continue; } code &= ~MP_KEY_DOWN; @@ -871,7 +873,7 @@ } if(j == priv.num_key_down) { // key was not in the down keys : add it if(priv.num_key_down > MP_MAX_KEY_DOWN) { - MSG_ERR("Too much key down at the same time\n"); + mpxp_err<<"Too much key down at the same time"<<std::endl; continue; } priv.key_down[priv.num_key_down] = code; @@ -937,7 +939,7 @@ char* cmd; r = mp_input_read_cmd(&priv.cmd_fds[i],&cmd); if(r < 0) { - if(r == MP_INPUT_ERROR) MSG_ERR("Error on cmd fd\n"); + if(r == MP_INPUT_ERROR) mpxp_err<<"Error on cmd fd"<<std::endl; else if(r == MP_INPUT_DEAD) priv.cmd_fds[i].flags |= MP_FD_DEAD; continue; } @@ -1136,11 +1138,11 @@ fd = open(file,O_RDONLY); if(fd < 0) { - MSG_ERR("Can't open input config file %s : %s\n",file,strerror(errno)); + mpxp_err<<"Can't open input config file "<<file<<" : "<<strerror(errno)<<std::endl; return 0; } - MSG_V("Parsing input config file %s\n",file); + mpxp_v<<"Parsing input config file "<<file<<std::endl; while(1) { if(! eof && bs < BS_MAX-1) { @@ -1148,7 +1150,7 @@ r = read(fd,buffer+bs,BS_MAX-1-bs); if(r < 0) { if(errno == EINTR) continue; - MSG_ERR("Error while reading input config file %s : %s\n",file,strerror(errno)); + mpxp_err<<"Error while reading input config file "<<file<<" : "<<strerror(errno)<<std::endl; mp_input_free_binds(binds); close(fd); return 0; @@ -1161,7 +1163,7 @@ } // Empty buffer : return if(bs <= 1) { - MSG_INFO("Input config file %s parsed : %d binds\n",file,n_binds); + mpxp_info<<"Input config file "<<file<<" parsed : "<<n_binds<<" binds"<<std::endl; if(binds) priv.cmd_binds = binds; close(fd); return 1; @@ -1196,8 +1198,8 @@ for(end = iter; end[0] != '\0' && strchr(SPACE_CHAR,end[0]) == NULL ; end++)/*NOTHING */; if(end[0] == '\0') { // Key name don't fit in the buffer if(buffer == iter) { - if(eof && (buffer-iter) == bs) MSG_ERR("Unfinished binding %s\n",iter); - else MSG_ERR("Buffer is too small for this key name : %s\n",iter); + if(eof && (buffer-iter) == bs) mpxp_err<<"Unfinished binding "<<iter<<std::endl; + else mpxp_err<<"Buffer is too small for this key name : "<<iter<<std::endl; mp_input_free_binds(binds); return 0; } @@ -1209,7 +1211,7 @@ strncpy(name,iter,end-iter); name[end-iter] = '\0'; if(! mp_input_get_input_from_name(name,keys)) { - MSG_ERR("Unknown key '%s'\n",name); + mpxp_err<<"Unknown key '"<<name<<"'"<<std::endl; mp_input_free_binds(binds); close(fd); return 0; @@ -1222,9 +1224,9 @@ // Found new line if(iter[0] == '\n' || iter[0] == '\r') { int i; - MSG_ERR("No command found for key %s" ,mp_input_get_key_name(priv,keys[0])); - for(i = 1; keys[i] != 0 ; i++) MSG_ERR("-%s",mp_input_get_key_name(priv,keys[i])); - MSG_ERR("\n"); + mpxp_err<<"No command found for key "<<mp_input_get_key_name(priv,keys[0]); + for(i = 1; keys[i] != 0 ; i++) mpxp_err<<std::left<<mp_input_get_key_name(priv,keys[i]); + mpxp_err<<std::endl; keys[0] = 0; if(iter > buffer) { memmove(buffer,iter,bs- (iter-buffer)); @@ -1235,7 +1237,7 @@ for(end = iter ; end[0] != '\n' && end[0] != '\r' && end[0] != '\0' ; end++)/* NOTHING */; if(end[0] == '\0' && ! (eof && ((end+1) - buffer) == bs)) { if(iter == buffer) { - MSG_ERR("Buffer is too small for command %s\n",buffer); + mpxp_err<<"Buffer is too small for command "<<buffer<<std::endl; mp_input_free_binds(binds); close(fd); return 0; @@ -1258,7 +1260,7 @@ continue; } } - MSG_ERR("What are we doing here ?\n"); + mpxp_err<<"What are we doing here ?"<<std::endl; close(fd); return 0; } @@ -1272,13 +1274,13 @@ if(! mp_input_parse_config(priv,file)) { // Try global conf dir file = CONFDIR "/input.conf"; - if(! mp_input_parse_config(priv,file)) MSG_WARN("Falling back on default (hardcoded) input config\n"); + if(! mp_input_parse_config(priv,file)) mpxp_warn<<"Falling back on default (hardcoded) input config"<<std::endl; } #ifdef HAVE_JOYSTICK if(libinput_conf.use_joystick) { any_t* joystick_fd; joystick_fd = mp_input_joystick_open(libinput_conf.js_dev); - if(!joystick_fd) MSG_ERR("Can't init input joystick with using: %s\n",libinput_conf.js_dev); + if(!joystick_fd) mpxp_err<<"Can't init input joystick with using: "<<libinput_conf.js_dev<<std::endl; else mp_input_add_key_fd(priv,joystick_fd,1,mp_input_joystick_read,(mp_close_func_t)mp_input_joystick_close); } #endif @@ -1298,11 +1300,11 @@ #endif if(libinput_conf.in_file) { struct stat st; - if(stat(libinput_conf.in_file,&st)) MSG_ERR("Can't stat %s: %s\n",libinput_conf.in_file,strerror(errno)); + if(stat(libinput_conf.in_file,&st)) mpxp_err<<"Can't stat: "<<libinput_conf.in_file<<" : "<<strerror(errno)<<std::endl; else { priv.in_file_fd = open(libinput_conf.in_file,(S_ISFIFO(st.st_mode)?O_RDWR:O_RDONLY)|O_NONBLOCK); if(priv.in_file_fd >= 0) mp_input_add_cmd_fd(priv,&priv,1,NULL,(mp_close_func_t)close); - else MSG_ERR("Can't open %s: %s\n",libinput_conf.in_file,strerror(errno)); + else mpxp_err<<"Can't open: "<<libinput_conf.in_file<<" : "<<strerror(errno)<<std::endl; } } priv.in_file_fd = 0; @@ -1354,8 +1356,8 @@ void mp_input_print_keys(libinput_t& handle) { unsigned i; UNUSED(handle); - MSG_INFO("List of available KEYS:\n"); - for(i= 0; key_names[i].name != NULL ; i++) MSG_INFO("%s\n",key_names[i].name); + mpxp_info<<"List of available KEYS:"<<std::endl; + for(i= 0; key_names[i].name != NULL ; i++) mpxp_info<<key_names[i].name<<std::endl; } static int mp_input_print_key_list(libinput_t& handle) { @@ -1365,12 +1367,12 @@ void mp_input_print_binds(libinput_t& handle) { unsigned i,j; - MSG_INFO("List of available key bindings:\n"); + mpxp_info<<"List of available key bindings:"<<std::endl; for(i=0; def_cmd_binds[i].cmd != NULL ; i++) { for(j=0;def_cmd_binds[i].input[j] != 0;j++) { - MSG_INFO(" %-20s",mp_input_get_key_name(handle,def_cmd_binds[i].input[j])); + mpxp_info<<std::left<<" "<<mp_input_get_key_name(handle,def_cmd_binds[i].input[j]); } - MSG_INFO(" %s\n",def_cmd_binds[i].cmd); + mpxp_info<<" "<<def_cmd_binds[i].cmd<<std::endl; } } @@ -1380,9 +1382,9 @@ const char* type; UNUSED(handle); - MSG_INFO("List of available input commands:\n"); + mpxp_info<<"List of available input commands:"<<std::endl; for(i = 0; (cmd = &mp_cmds[i])->name != NULL ; i++) { - MSG_INFO(" %-20.20s",cmd->name); + mpxp_info<<std::left<<" "<<cmd->name; for(j= 0 ; j < MP_CMD_MAX_ARGS && cmd->args[j].type != -1 ; j++) { switch(cmd->args[j].type) { case MP_CMD_ARG_INT: @@ -1397,10 +1399,10 @@ default: type = "??"; } - if(j+1 > cmd->nargs) MSG_INFO(" [%s]",type); - else MSG_INFO(" %s",type); + if(j+1 > cmd->nargs) mpxp_info<<" ["<<type<<"]"; + else mpxp_info<<" "<<type; } - MSG_INFO("\n"); + mpxp_info<<std::endl; } } Modified: mplayerxp/input2/joystick.cpp =================================================================== --- mplayerxp/input2/joystick.cpp 2012-12-20 15:07:43 UTC (rev 583) +++ mplayerxp/input2/joystick.cpp 2012-12-20 15:46:50 UTC (rev 584) @@ -41,10 +41,10 @@ struct js_event ev; priv_t* priv=new(zeromem) priv_t; - MSG_INFO("Opening joystick device %s\n",dev ? dev : JS_DEV); + mpxp_info<<"Opening joystick device:"<<(dev?dev:JS_DEV)<<std::endl; if((priv->fd=open(dev?dev:JS_DEV,O_RDONLY|O_NONBLOCK))<0) { - MSG_ERR("Can't open joystick device %s : %s\n",dev ? dev : JS_DEV,strerror(errno)); + mpxp_err<<"Can't open joystick device: "<<(dev?dev:JS_DEV)<<" : "<<strerror(errno)<<std::endl; delete priv; return NULL; } @@ -59,7 +59,7 @@ inited = 1; break; } - MSG_ERR("Error while reading joystick device : %s\n",strerror(errno)); + mpxp_err<<"Error while reading joystick device: "<<strerror(errno)<<std::endl; close(priv->fd); delete priv; return NULL; @@ -67,7 +67,7 @@ l += r; } if((unsigned int)l < sizeof(struct js_event)) { - if(l > 0) MSG_ERR("Joystick : we loose %d bytes of data\n",l); + if(l > 0) mpxp_err<<"Joystick: we loose "<<l<<"bytes of data"<<std::endl; break; } ev.type &= ~JS_EVENT_INIT; @@ -93,20 +93,20 @@ if(r <= 0) { if(errno == EINTR) continue; else if(errno == EAGAIN) return MP_INPUT_NOTHING; - if(r < 0) MSG_ERR("Joystick error while reading joystick device : %s\n",strerror(errno)); - else MSG_ERR("Joystick error while reading joystick device : EOF\n"); + if(r < 0) mpxp_err<<"Joystick error while reading joystick device: "<<strerror(errno)<<std::endl; + else mpxp_err<<"Joystick error while reading joystick device: EOF"<<std::endl; return MP_INPUT_DEAD; } l += r; } if((unsigned int)l < sizeof(struct js_event)) { - if(l > 0) MSG_ERR("Joystick : we loose %d bytes of data\n",l); + if(l > 0) mpxp_err<<"Joystick: we loose "<<l<<"bytes of data"<<std::endl; return MP_INPUT_NOTHING; } if(ev.type & JS_EVENT_INIT) { - MSG_WARN("Joystick : warning init event, we have lost sync with driver\n"); + mpxp_warn<<"Joystick: warning init event, we have lost sync with driver"<<std::endl; ev.type &= ~JS_EVENT_INIT; if(ev.type == JS_EVENT_BUTTON) { int s = (priv.btns >> ev.number) & 1; @@ -141,7 +141,7 @@ } else return MP_INPUT_NOTHING; } else { - MSG_ERR("Joystick warning unknow event type %d\n",ev.type); + mpxp_err<<"Joystick warning unknow event type "<<ev.type<<std::endl; return MP_INPUT_ERROR; } return MP_INPUT_NOTHING; Modified: mplayerxp/input2/lirc.cpp =================================================================== --- mplayerxp/input2/lirc.cpp 2012-12-20 15:07:43 UTC (rev 583) +++ mplayerxp/input2/lirc.cpp 2012-12-20 15:46:50 UTC (rev 584) @@ -29,16 +29,16 @@ any_t* mp_input_lirc_open(void) { priv_t* priv=new(zeromem) priv_t; - MSG_INFO(MSGTR_SettingUpLIRC); + mpxp_info<<MSGTR_SettingUpLIRC<<std::endl; if((priv->lirc_sock=lirc_init(const_cast<char*>("mplayer"),1))==-1){ - MSG_ERR(MSGTR_LIRCopenfailed MSGTR_LIRCdisabled); + mpxp_err<<MSGTR_LIRCopenfailed<<std::endl<<MSGTR_LIRCdisabled<<std::endl; delete priv; return NULL; } if(lirc_readconfig( lirc_configfile,&lirc_config,NULL )!=0 ){ - MSG_ERR(MSGTR_LIRCcfgerr MSGTR_LIRCdisabled, - lirc_configfile == NULL ? "~/.lircrc" : lirc_configfile); + mpxp_err<<MSGTR_LIRCcfgerr<<": "<<(lirc_configfile==NULL?"~/.lircrc":lirc_configfile)<<std::endl; + mpxp_err<<MSGTR_LIRCdisabled<<std::endl; lirc_deinit(); delete priv; return NULL; @@ -72,14 +72,14 @@ while((r = select(1,&fds,NULL,NULL,&tv)) <= 0) { if(r < 0) { if(errno == EINTR) continue; - MSG_ERR("Select error : %s\n",strerror(errno)); + mpxp_err<<"Select error:"<<strerror(errno)<<std::endl; return MP_INPUT_ERROR; } else return MP_INPUT_NOTHING; } // There's something to read if(lirc_nextcode(&code) != 0) { - MSG_ERR("Lirc error :(\n"); + mpxp_err<<"Lirc error :("<<std::endl; return MP_INPUT_DEAD; } Modified: mplayerxp/libao3/audio_out.cpp =================================================================== --- mplayerxp/libao3/audio_out.cpp 2012-12-20 15:07:43 UTC (rev 583) +++ mplayerxp/libao3/audio_out.cpp 2012-12-20 15:46:50 UTC (rev 584) @@ -194,15 +194,15 @@ delete &priv; } -void Audio_Output::print_help() const { +void Audio_Output::print_help() { unsigned i; - MSG_INFO("Available audio output drivers:\n"); + mpxp_info<<"Available audio output drivers:"<<std::endl; i=0; while (audio_out_drivers[i]) { const ao_info_t *info = audio_out_drivers[i++]; - MSG_INFO("\t%s\t%s\n", info->short_name, info->name); + mpxp_info<<"\t"<<info->short_name<<"\t"<<info->name<<std::endl; } - MSG_INFO("\n"); + mpxp_info<<std::endl; } MPXP_Rc Audio_Output::_register(const char *driver_name,unsigned flags) const { Modified: mplayerxp/libao3/audio_out.h =================================================================== --- mplayerxp/libao3/audio_out.h 2012-12-20 15:07:43 UTC (rev 583) +++ mplayerxp/libao3/audio_out.h 2012-12-20 15:46:50 UTC (rev 584) @@ -33,7 +33,7 @@ Audio_Output(const char* subdevice); virtual ~Audio_Output(); - virtual void print_help() const; + static void print_help(); virtual MPXP_Rc _register(const char *driver_name,unsigned flags) const; virtual const ao_info_t* get_info() const; virtual MPXP_Rc configure(unsigned rate,unsigned channels,unsigned format) const; Modified: mplayerxp/libvo2/video_out.cpp =================================================================== --- mplayerxp/libvo2/video_out.cpp 2012-12-20 15:07:43 UTC (rev 583) +++ mplayerxp/libvo2/video_out.cpp 2012-12-20 15:46:50 UTC (rev 584) @@ -147,8 +147,7 @@ delete &priv; } -void Video_Output::print_help() const -{ +void Video_Output::print_help() { unsigned i; MSG_INFO("Available video output drivers:\n"); i=0; Modified: mplayerxp/libvo2/video_out.h =================================================================== --- mplayerxp/libvo2/video_out.h 2012-12-20 15:07:43 UTC (rev 583) +++ mplayerxp/libvo2/video_out.h 2012-12-20 15:46:50 UTC (rev 584) @@ -168,7 +168,7 @@ void FLIP_REVERT() { flags^=VOFLAG_FLIPPING; } virtual MPXP_Rc init(const std::string& driver_name) const; - virtual void print_help() const; + static void print_help(); virtual const vo_info_t* get_info() const; virtual MPXP_Rc configure(vf_stream_t* parent,uint32_t width, uint32_t height, uint32_t d_width, Modified: mplayerxp/mplayerxp.cpp =================================================================== --- mplayerxp/mplayerxp.cpp 2012-12-20 15:07:43 UTC (rev 583) +++ mplayerxp/mplayerxp.cpp 2012-12-20 15:46:50 UTC (rev 584) @@ -606,8 +606,8 @@ m_config_show_options(*mpxp_context().mconfig); mp_input_print_binds(MPXPSys.libinput()); Stream::print_drivers(); - mpxp_context().video().output->print_help(); - mpxp_context().audio().output->print_help(); + Video_Output::print_help(); + Audio_Output::print_help(); vf_help(); af_help(); vfm_help(); Modified: mplayerxp/mpxp_msg.cpp =================================================================== --- mplayerxp/mpxp_msg.cpp 2012-12-20 15:07:43 UTC (rev 583) +++ mplayerxp/mpxp_msg.cpp 2012-12-20 15:46:50 UTC (rev 584) @@ -47,7 +47,7 @@ } void mpxp_streambuf::put_chars(char const* begin, char const* end) const { - if(!(parent._type&mp_conf.msg_filter)) { parent.setstate(std::ios_base::badbit); return; } + parent.test_conditions(); if(::isatty(::fileno(::stderr))) ::fwrite(data.c_str(),data.length(),1,::stderr); ::fwrite(begin,end-begin,1,::stderr); } @@ -88,6 +88,10 @@ return std::min(_idx,unsigned(sizeof(msg_prefix)/sizeof(msg_prefix[0]))); } +void mpxp_ostream::test_conditions() { + if(!(_type&mp_conf.msg_filter)) setstate(std::ios_base::badbit); +} + /* TODO: replace this block with std::string */ static const char blue[]="\033[0;34;40m"; static const char green[]="\033[0;32;40m"; @@ -125,17 +129,33 @@ mpxp_ostream_status::mpxp_ostream_status(mpxp_msgt_e type):mpxp_ostream(light_blue,type){} mpxp_ostream_status::~mpxp_ostream_status() {} -mpxp_ostream_v::mpxp_ostream_v(mpxp_msgt_e type):mpxp_ostream(cyan,type){ if(mp_conf.verbose<1) setstate(ios_base::badbit); /* do not display */ } +mpxp_ostream_v::mpxp_ostream_v(mpxp_msgt_e type):mpxp_ostream(cyan,type){} mpxp_ostream_v::~mpxp_ostream_v() {} +void mpxp_ostream_v::test_conditions() { + if(mp_conf.verbose<1) setstate(ios_base::badbit); /* do not display */ + mpxp_ostream::test_conditions(); +} -mpxp_ostream_dbg2::mpxp_ostream_dbg2(mpxp_msgt_e type):mpxp_ostream(gray,type){ if(mp_conf.verbose<2) setstate(ios_base::badbit); /* do not display */ } +mpxp_ostream_dbg2::mpxp_ostream_dbg2(mpxp_msgt_e type):mpxp_ostream(gray,type){} mpxp_ostream_dbg2::~mpxp_ostream_dbg2() {} +void mpxp_ostream_dbg2::test_conditions() { + if(mp_conf.verbose<2) setstate(ios_base::badbit); /* do not display */ + mpxp_ostream::test_conditions(); +} -mpxp_ostream_dbg3::mpxp_ostream_dbg3(mpxp_msgt_e type):mpxp_ostream(gray,type){ if(mp_conf.verbose<3) setstate(ios_base::badbit); /* do not display */ } +mpxp_ostream_dbg3::mpxp_ostream_dbg3(mpxp_msgt_e type):mpxp_ostream(gray,type){} mpxp_ostream_dbg3::~mpxp_ostream_dbg3() {} +void mpxp_ostream_dbg3::test_conditions() { + if(mp_conf.verbose<3) setstate(ios_base::badbit); /* do not display */ + mpxp_ostream::test_conditions(); +} -mpxp_ostream_dbg4::mpxp_ostream_dbg4(mpxp_msgt_e type):mpxp_ostream(gray,type){ if(mp_conf.verbose<4) setstate(ios_base::badbit); /* do not display */ } +mpxp_ostream_dbg4::mpxp_ostream_dbg4(mpxp_msgt_e type):mpxp_ostream(gray,type){} mpxp_ostream_dbg4::~mpxp_ostream_dbg4() {} +void mpxp_ostream_dbg4::test_conditions() { + if(mp_conf.verbose<4) setstate(ios_base::badbit); /* do not display */ + mpxp_ostream::test_conditions(); +} /* old stuff: */ Modified: mplayerxp/mpxp_msg.h =================================================================== --- mplayerxp/mpxp_msg.h 2012-12-20 15:07:43 UTC (rev 583) +++ mplayerxp/mpxp_msg.h 2012-12-20 15:46:50 UTC (rev 584) @@ -86,7 +86,8 @@ virtual ~mpxp_ostream(); protected: mpxp_msgt_e _type; - friend class mpxp_streambuf; + friend class mpxp_streambuf; + virtual void test_conditions(); private: unsigned compute_idx(mpxp_msgt_e type) const; unsigned idx; @@ -140,24 +141,32 @@ public: mpxp_ostream_v(mpxp_msgt_e type); virtual ~mpxp_ostream_v(); + protected: + virtual void test_conditions(); }; class mpxp_ostream_dbg2 : public mpxp_ostream { public: mpxp_ostream_dbg2(mpxp_msgt_e type); virtual ~mpxp_ostream_dbg2(); + protected: + virtual void test_conditions(); }; class mpxp_ostream_dbg3 : public mpxp_ostream { public: mpxp_ostream_dbg3(mpxp_msgt_e type); virtual ~mpxp_ostream_dbg3(); + protected: + virtual void test_conditions(); }; class mpxp_ostream_dbg4 : public mpxp_ostream { public: mpxp_ostream_dbg4(mpxp_msgt_e type); virtual ~mpxp_ostream_dbg4(); + protected: + virtual void test_conditions(); }; void mpxp_print_init(int verbose); Modified: mplayerxp/nls/mpxp_help-en.h =================================================================== --- mplayerxp/nls/mpxp_help-en.h 2012-12-20 15:07:43 UTC (rev 583) +++ mplayerxp/nls/mpxp_help-en.h 2012-12-20 15:46:50 UTC (rev 584) @@ -135,8 +135,8 @@ #ifndef MSGTR_CantOpenDumpfile #define MSGTR_CantOpenDumpfile "Can't open dump file!!!\n" #endif -#ifndef MSGTR_CoreDumped -#define MSGTR_CoreDumped "core dumped :)\n" +#ifndef MSGTR_StreamDumped +#define MSGTR_StreamDumped "stream dumped :)\n" #endif #ifndef MSGTR_FPSnotspecified #define MSGTR_FPSnotspecified "FPS not specified (or invalid) in the header! Use the -fps option!\n" @@ -451,19 +451,19 @@ // LIRC: #ifndef MSGTR_SettingUpLIRC -#define MSGTR_SettingUpLIRC "Setting up lirc support...\n" +#define MSGTR_SettingUpLIRC "Setting up lirc support..." #endif #ifndef MSGTR_LIRCdisabled -#define MSGTR_LIRCdisabled "You won't be able to use your remote control\n" +#define MSGTR_LIRCdisabled "You won't be able to use your remote control" #endif #ifndef MSGTR_LIRCopenfailed -#define MSGTR_LIRCopenfailed "Failed opening lirc support!\n" +#define MSGTR_LIRCopenfailed "Failed opening lirc support!" #endif #ifndef MSGTR_LIRCsocketerr -#define MSGTR_LIRCsocketerr "Something's wrong with the lirc socket: %s\n" +#define MSGTR_LIRCsocketerr "Something's wrong with the lirc socket" #endif #ifndef MSGTR_LIRCcfgerr -#define MSGTR_LIRCcfgerr "Failed to read LIRC config file %s !\n" +#define MSGTR_LIRCcfgerr "Failed to read LIRC config file" #endif #endif /*__MPXP_EN_HELP_INCLUDED*/ Modified: mplayerxp/nls/mpxp_help-ru.h =================================================================== --- mplayerxp/nls/mpxp_help-ru.h 2012-12-20 15:07:43 UTC (rev 583) +++ mplayerxp/nls/mpxp_help-ru.h 2012-12-20 15:46:50 UTC (rev 584) @@ -88,7 +88,7 @@ #define MSGTR_DVDauthOk "Авторизация DVD выглядит OK.\n" #define MSGTR_DumpSelectedSteramMissing "dump: FATAL: выбранный поток потерян!\n" #define MSGTR_CantOpenDumpfile "Не могу открыть файл дампа!!!\n" -#define MSGTR_CoreDumped "core dumped :)\n" +#define MSGTR_StreamDumped "stream dumped :)" #define MSGTR_FPSnotspecified "Кадр/сек не указаны (или недопустимые) в заголовке! Используйте -fps опцию!\n" #define MSGTR_NoVideoStream "Видео поток не найден... это невоспроизводимо пока\n" #define MSGTR_TryForceAudioFmt "Попытка форсировать семейство аудио кодеков" @@ -206,8 +206,8 @@ #define MSGTR_UnknownAudio "Неизвестный/потерянный аудио формат, отказ от звука\n" // LIRC: -#define MSGTR_SettingUpLIRC "Установка поддержки lirc...\n" -#define MSGTR_LIRCdisabled "Вы не сможете использовать Ваше удалённое управление\n" -#define MSGTR_LIRCopenfailed "Неудачное открытие поддержки lirc!\n" -#define MSGTR_LIRCsocketerr "Что-то неправильно с сокетом lirc: %s\n" -#define MSGTR_LIRCcfgerr "Неудачное чтение файла конфигурации LIRC %s !\n" +#define MSGTR_SettingUpLIRC "Установка поддержки lirc..." +#define MSGTR_LIRCdisabled "Вы не сможете использовать Ваше удалённое управление" +#define MSGTR_LIRCopenfailed "Неудачное открытие поддержки lirc!" +#define MSGTR_LIRCsocketerr "Что-то неправильно с сокетом lirc" +#define MSGTR_LIRCcfgerr "Неудачное чтение файла конфигурации LIRC" Modified: mplayerxp/postproc/vf_vo2.cpp =================================================================== --- mplayerxp/postproc/vf_vo2.cpp 2012-12-20 15:07:43 UTC (rev 583) +++ mplayerxp/postproc/vf_vo2.cpp 2012-12-20 15:46:50 UTC (rev 584) @@ -27,18 +27,19 @@ static void __FASTCALL__ print_conf(vf_instance_t* vf) { const vo_info_t *info = mpxp_context().video().output->get_info(); - MSG_INFO("VO-CONF: [%s] %dx%d => %dx%d %s %s%s%s%s\n",info->short_name, - vf->priv->sw, vf->priv->sh, - vf->priv->dw, vf->priv->dh, - vo_format_name(vf->priv->ofmt), - (vf->priv->sflg&1)?" [fs]":"", - (vf->priv->sflg&2)?" [vm]":"", - (vf->priv->sflg&4)?" [zoom]":"", - (vf->priv->sflg&8)?" [flip]":""); - MSG_V("VO: Description: %s\n",info->name); - MSG_V("VO: Author: %s\n", info->author); + mpxp_info<<"VO-CONF: ["<<info->short_name<<"] " + <<vf->priv->sw<<"x"<<vf->priv->sh + <<" => "<<vf->priv->dw<<"x"<<vf->priv->dh + <<" "<<vo_format_name(vf->priv->ofmt) + <<" " + <<((vf->priv->sflg&1)?" [fs]":"") + <<((vf->priv->sflg&2)?" [vm]":"") + <<((vf->priv->sflg&4)?" [zoom]":"") + <<((vf->priv->sflg&8)?" [flip]":"")<<std::endl; + mpxp_v<<"VO: Description: "<<info->name<<std::endl; + mpxp_v<<"VO: Author: "<<info->author<<std::endl; if(info->comment && strlen(info->comment) > 0) - MSG_V("VO: Comment: %s\n", info->comment); + mpxp_v<<"VO: Comment: "<<info->comment<<std::endl; } static int __FASTCALL__ vf_config(vf_instance_t* vf, @@ -47,7 +48,7 @@ if ((width <= 0) || (height <= 0) || (d_width <= 0) || (d_height <= 0)) { - MSG_ERR("VO: invalid dimensions!\n"); + mpxp_err<<"VO: invalid dimensions!"<<std::endl; return 0; } @@ -63,6 +64,8 @@ // save vo's stride capability for the wanted colorspace: vf->default_caps=query_format(vf,outfmt,d_width,d_height);// & VFCAP_ACCEPT_STRIDE; + mpxp_dbg2<<"vf_vo2->config("<<width<<","<<height<<","<<d_width<<","<<d_height + <<","<<flags<<","<<vo_format_name(outfmt)<<")"<<std::endl; if(MPXP_Ok!=mpxp_context().video().output->configure(vf->parent,width,height,d_width,d_height,flags,"MPlayerXP",outfmt)) return 0; vf->priv->is_planar=vo_describe_fourcc(outfmt,&vf->priv->vd); @@ -76,7 +79,7 @@ static MPXP_Rc __FASTCALL__ control_vf(vf_instance_t* vf, int request,any_t* data) { UNUSED(vf); - MSG_DBG2("vf_control: %u\n",request); + mpxp_dbg2<<"vf_control: "<<request<<std::endl; switch(request){ case VFCTRL_SET_EQUALIZER: { vf_equalizer_t *eq=reinterpret_cast<vf_equalizer_t*>(data); @@ -97,7 +100,7 @@ dri_surface_cap_t dcaps; int rflags; uint32_t flags=mpxp_context().video().output->query_format(&fmt,w,h); - MSG_DBG2("[vf_vo2] %i=query_format(%s)\n",flags,vo_format_name(fmt)); + mpxp_dbg2<<"[vf_vo2] "<<flags<<"=query_format("<<vo_format_name(fmt)<<")"<<std::endl; rflags=0; UNUSED(vf); if(flags) { @@ -121,15 +124,15 @@ if(retval==MPXP_Ok) { mpi->flags |= MP_IMGFLAG_FINAL|MP_IMGFLAG_DIRECT; if(finalize) mpi->flags |= MP_IMGFLAG_FINALIZED; - MSG_DBG2("vf_vo_get_image was called successfully\n"); - } - MSG_DBG2("vf_vo_get_image was called failed\n"); + mpxp_dbg2<<"vf_vo_get_image was called successfully"<<std::endl; + } else mpxp_dbg2<<"vf_vo_get_image was called failed"<<std::endl; } static int __FASTCALL__ put_slice(vf_instance_t* vf, mp_image_t *mpi){ if(!vo_config_count) return 0; // vo not configured? if(!(mpi->flags & MP_IMGFLAG_FINAL) || (vf_first(vf)==vf && !(mpi->flags & MP_IMGFLAG_RENDERED))) { - MSG_DBG2("vf_vo_put_slice was called(%u): %u %u %u %u\n",mpi->xp_idx,mpi->x,mpi->y,mpi->w,mpi->h); + mpxp_dbg2<<"vf_vo_put_slice was called(" + <<mpi->xp_idx<<"): "<<mpi->x<<" "<<mpi->y<<" "<<mpi->w<<" "<<mpi->h<<std::endl; mpxp_context().video().output->draw_slice(mpi); } return 1; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |