[Mplayerxp-cvslog] SF.net SVN: mplayerxp:[99] mplayerxp
Brought to you by:
olov
From: <nic...@us...> - 2010-01-13 15:42:54
|
Revision: 99 http://mplayerxp.svn.sourceforge.net/mplayerxp/?rev=99&view=rev Author: nickols_k Date: 2010-01-13 15:42:47 +0000 (Wed, 13 Jan 2010) Log Message: ----------- new way of subconfig handling Modified Paths: -------------- mplayerxp/cfgparser.c mplayerxp/cfgparser.h mplayerxp/input/input.c mplayerxp/libmpcodecs/vd_ffmpeg.c mplayerxp/libmpdemux/demux_audio.c mplayerxp/libmpdemux/demux_lavf.c mplayerxp/libmpdemux/demux_rawaudio.c mplayerxp/libmpdemux/demux_rawvideo.c mplayerxp/libmpdemux/demux_viv.c mplayerxp/libmpdemux/demuxer.c Modified: mplayerxp/cfgparser.c =================================================================== --- mplayerxp/cfgparser.c 2010-01-12 17:58:30 UTC (rev 98) +++ mplayerxp/cfgparser.c 2010-01-13 15:42:47 UTC (rev 99) @@ -311,92 +311,6 @@ } } - if(! IS_RUNNING(config)) { - if(strcasecmp(opt,"vcd") == 0) { - char* s; - if(!param) - return ERR_MISSING_PARAM; - s = (char*)malloc((strlen(param) + 6 + 1)*sizeof(char)); - sprintf(s,"vcd://%s",param); - entry = play_tree_new(); - play_tree_add_file(entry,s); - free(s); - } else if(strcasecmp(opt,"dvd") == 0) { - char* s; - if(!param) - return ERR_MISSING_PARAM; - s = (char*)malloc((strlen(param) + 6 + 1)*sizeof(char)); - sprintf(s,"dvd://%s",param); - entry = play_tree_new(); - play_tree_add_file(entry,s); - free(s); - } else if(strcasecmp(opt,"tv") == 0) { - char *s,*pr,*prs; - char *channel=NULL; - const char *ps,*pe; - char *as; - int on=0; - if(!param) - return ERR_MISSING_PARAM; - ps = param; - pe = strchr(param,':'); - pr = prs = (char*)malloc((strlen(param)+1)*sizeof(char)); - pr[0] = '\0'; - while(ps) { - if(!pe) - pe = ps + strlen(ps); - - as = strchr(ps,'='); - if(as && as[1] != '\0' && pe-as > 0) - as++; - else - as = NULL; - if( !as && pe-ps == 2 && strncasecmp("on",ps,2) == 0 ) - on = 1; - else if(as && as-ps == 8 && strncasecmp("channel",ps,6) == 0 && pe-as > 0) { - channel = (char*)realloc(channel,(pe-as+1)*sizeof(char)); - strncpy(channel,as,pe-as); - channel[pe-as] = '\0'; - } else if(pe-ps > 0) { - if(prs != pr) { - prs[0] = ':'; - prs++; - } - strncpy(prs,ps,pe-ps); - prs += pe-ps; - prs[0] = '\0'; - } - - if(pe[0] != '\0') { - ps = pe+1; - pe = strchr(ps,':'); - } else - ps = NULL; - } - - if(on) { - int l=5; - - if(channel) - l += strlen(channel); - s = (char*) malloc((l+1)*sizeof(char)); - if(channel) - sprintf(s,"tv://%s",channel); - else - sprintf(s,"tv://"); - entry = play_tree_new(); - play_tree_add_file(entry,s); - if(strlen(pr) > 0) - play_tree_set_param(entry,"tv",pr); - free(s); - } - free(pr); - if(channel) - free(channel); - - } - } - if(entry) { if(config->last_entry) play_tree_append_entry(config->last_entry,entry); @@ -410,8 +324,6 @@ return 0; } - - static int config_read_option(m_config_t *config,config_t** conf_list,const char *opt,const char *param) { int i=0,nconf = 0; @@ -434,6 +346,7 @@ for (i = 0; conf[i].name != NULL; i++) { int namelength; /* allow 'aa*' in config.name */ +// MSG_DBG3( "cmp_option: conf=%s opt='%s'\n",conf[i].name,opt); namelength=strlen(conf[i].name); if ( (conf[i].name[namelength-1]=='*') && !memcmp(opt, conf[i].name, namelength-1)) @@ -442,8 +355,7 @@ goto option_found; } } - if (config->parser_mode == CONFIG_FILE) - MSG_ERR( "invalid option: %s\n",opt); + MSG_ERR( "invalid option: %s\n",opt); ret = ERR_NOT_AN_OPTION; goto out; option_found : @@ -465,7 +377,7 @@ return ret; else ret = -1; - if(! IS_RUNNING(config) && ! IS_GLOBAL(config) && + if(! IS_RUNNING(config) && ! IS_GLOBAL(config) && ! (conf[i].flags & CONF_GLOBAL) && conf[i].type != CONF_TYPE_SUBCONFIG ) m_config_push(config); if( !(conf[i].flags & CONF_NOSAVE) && ! (conf[i].flags & CONF_GLOBAL) ) @@ -498,6 +410,7 @@ ret = 1; } else { /* parser_mode == COMMAND_LINE */ *((int *) conf[i].p) = conf[i].max; + MSG_DBG3("assigning %s=%i as flag value\n",conf[i].name,conf[i].max); ret = 0; } break; @@ -527,6 +440,7 @@ } *((int *) conf[i].p) = tmp_int; + MSG_DBG3("assigning %s=%i as int value\n",conf[i].name,tmp_int); ret = 1; break; case CONF_TYPE_FLOAT: @@ -560,6 +474,7 @@ } *((float *) conf[i].p) = tmp_float; + MSG_DBG3("assigning %s=%f as float value\n",conf[i].name,tmp_float); ret = 1; break; case CONF_TYPE_STRING: @@ -582,6 +497,7 @@ goto out; } *((char **) conf[i].p) = strdup(param); + MSG_DBG3("assigning %s=%s as string value\n",conf[i].name,param); ret = 1; break; case CONF_TYPE_FUNC_PARAM: @@ -694,7 +610,7 @@ else if(ret > 0) play_tree_set_param(dest,o,param); free(o); - m_config_pop(config); + m_config_pop(config); } return ret; err_missing_param: @@ -703,14 +619,49 @@ goto out; } +static const config_t* m_config_find_option(const config_t **list,const char *name); + int m_config_set_option(m_config_t *config,const char *opt,const char *param) { char *e; + const config_t **clist=config->opt_list; #ifdef MP_DEBUG assert(config != NULL); assert(config->opt_list != NULL); assert(opt != NULL); #endif MSG_DBG2( "Setting option %s=%s\n",opt,param); + clist = config->opt_list; +#if 1 + if(strchr(opt,'.')) { + int flg,ret; + const config_t *subconf=NULL; + config_t* olist[] = { NULL, NULL }; + MSG_DBG2("Parsing %s as subconfig\n",opt); + do { + if(!(e = strchr(opt,'.'))) break; + if((e-opt)>0) { + char* s = (char*)malloc((e-opt+1)*sizeof(char)); + strncpy(s,opt,e-opt); + s[e-opt] = '\0'; + MSG_DBG2("Treat %s as subconfig name\n",s); + subconf = m_config_find_option(clist?clist:olist,s); + clist=NULL; + free(s); + MSG_DBG2("returned %p as subconfig name\n",subconf); + if(!subconf) return ERR_NOT_AN_OPTION; + if(subconf->type!=CONF_TYPE_SUBCONFIG) return ERR_NOT_AN_OPTION; + olist[0] = subconf->p; + opt = e+1; + MSG_DBG2("switching next subconf=%s\n",subconf->name); + } + }while(1); + flg=config->flags; + config->flags|=CONFIG_GLOBAL; + ret=config_read_option(config,olist,opt,param); + config->flags=flg; + return ret; + } +#endif e = strchr(opt,':'); if(e && e[1] != '\0') { int ret; @@ -1004,21 +955,43 @@ if ((no_more_opts == 0) && (*opt == '-') && (*(opt+1) != 0)) /* option */ { /* remove leading '-' */ + char *assign,*item,*parm; opt++; - MSG_DBG3( "this_opt = option: %s\n", opt); - tmp = m_config_set_option(config, opt, argv[i + 1]); + MSG_DBG2( "this_option: %s\n", opt); + parm = argv[i+1]; + item=opt; + assign = strchr(opt,'='); + if(assign) { + item = malloc(assign-opt); + memcpy(item,opt,assign-opt); + item[assign-opt]='\0'; + parm = strdup(assign+1); + } + tmp = m_config_set_option(config, item, parm); + if(!tmp && assign) + MSG_ERR("Option '%s' doesn't require arguments\n",item); + if(assign) { + free(item); + free(parm); + } + if(!tmp && assign) goto err_out; switch (tmp) { case ERR_NOT_AN_OPTION: case ERR_MISSING_PARAM: case ERR_OUT_OF_RANGE: case ERR_FUNC_ERR: - MSG_ERR( "Error %d while parsing option: '%s'!\n", - tmp, opt); + MSG_ERR( "Error '%s' while parsing option: '%s'!\n" + ,tmp==ERR_NOT_AN_OPTION?"no-option": + tmp==ERR_MISSING_PARAM?"missing-param": + tmp==ERR_OUT_OF_RANGE?"out-of-range": + "func-error" + ,opt); goto err_out; default: i += tmp; + if(assign) i--; break; } } @@ -1084,12 +1057,25 @@ return 1; } +static const config_t* m_config_find_option(const config_t **list,const char *name) { + unsigned i,j; + const config_t *conf; + if(list) { + for(j = 0; list[j] != NULL ; j++) { + conf = list[j]; + for(i=0; conf[i].name != NULL; i++) { + if(strcasecmp(conf[i].name,name) == 0) + return &conf[i]; + } + } + } + return NULL; +} + config_t* m_config_get_option(m_config_t const*config,const char* arg) { - int i,j; char *e; - config_t *conf; - config_t **conf_list; - config_t* cl[] = { NULL, NULL }; + const config_t **conf_list; + const config_t* cl[] = { NULL, NULL }; #ifdef MP_DEBUG assert(config != NULL); @@ -1108,17 +1094,7 @@ free(s); } else conf_list = config->opt_list; - - if(conf_list) { - for(j = 0 ; conf_list[j] != NULL ; j++) { - conf = conf_list[j]; - for(i=0; conf[i].name != NULL; i++) { - if(strcasecmp(conf[i].name,arg) == 0) - return &conf[i]; - } - } - } - return NULL; + return m_config_find_option(conf_list,arg); } void* m_config_get_option_ptr(m_config_t const*config,const char* arg) { @@ -1302,76 +1278,100 @@ return 0; } -void m_config_show_options(const m_config_t *args) { - unsigned i,j; - const config_t *opts; - MSG_INFO("List of available command-line options:\n"); - j=0; - while((opts=args->opt_list[j])!=NULL) { - i=0; - while(opts[i].name) { - if(opts[i].type<=CONF_TYPE_PRINT) { - MSG_INFO(" -%-11s %s" +static void __m_config_show_options(unsigned ntabs,const char *pfx,const config_t *opts) { + unsigned i,n; + i=0; + while(opts[i].name) { + if(opts[i].type==CONF_TYPE_SUBCONFIG && opts[i].p) { + char *newpfx; + unsigned pfxlen; + for(n=0;n<ntabs;n++) MSG_INFO(" "); + MSG_INFO("%s:\n",opts[i].help); + pfxlen=strlen(opts[i].name)+1; + if(pfx) pfxlen+=strlen(pfx); + newpfx=malloc(pfxlen+1); + if(pfx) strcpy(newpfx,pfx); + else newpfx[0]='\0'; + strcat(newpfx,opts[i].name); + strcat(newpfx,"."); + __m_config_show_options(ntabs+2,newpfx,(const config_t *)opts[i].p); + free(newpfx); + } + else + if(opts[i].type<=CONF_TYPE_PRINT) { + for(n=0;n<ntabs;n++) MSG_INFO(" "); + if(pfx) MSG_INFO("-%-s",pfx); + else MSG_INFO("-"); + MSG_INFO("%-11s %s" ,opts[i].name ,(opts[i].type==CONF_TYPE_PRINT && strcmp(opts[i].help,"show help")!=0)?opts[i].p:opts[i].help); - if((opts[i].flags&CONF_NOCFG)==0) { - MSG_INFO(" {%s:", + if((opts[i].flags&CONF_NOCFG)==0) { + MSG_INFO(" {%s:", opts[i].type==CONF_TYPE_FLAG?"flg": opts[i].type==CONF_TYPE_INT?"int": opts[i].type==CONF_TYPE_FLOAT?"flt": opts[i].type==CONF_TYPE_STRING?"str":""); - switch(opts[i].type) { - case CONF_TYPE_FLAG: { - int defv = *((int*)(opts[i].p)); - MSG_INFO("<default=%i>",defv); + switch(opts[i].type) { + case CONF_TYPE_FLAG: { + int defv = *((int*)(opts[i].p)); + MSG_INFO("<default=%i>",defv); + } + break; + case CONF_TYPE_STRING: { + const char **defv = (const char**)(opts[i].p); + if(defv) MSG_INFO("'%s'",*defv); + } + break; + case CONF_TYPE_INT: { + int defv = *((int*)(opts[i].p)); + if((opts[i].flags&CONF_RANGE)==CONF_RANGE) { + MSG_INFO("[%i...%i]",(int)opts[i].min,(int)opts[i].max); } - break; - case CONF_TYPE_STRING: { - const char **defv = (char**)(opts[i].p); - if(defv) MSG_INFO("'%s'",*defv); + else + if((opts[i].flags&CONF_MIN)==CONF_MIN) { + MSG_INFO("<min=%i>",(int)opts[i].min); } - break; - case CONF_TYPE_INT: { - int defv = *((int*)(opts[i].p)); - if((opts[i].flags&CONF_RANGE)==CONF_RANGE) { - MSG_INFO("[%i...%i]",(int)opts[i].min,(int)opts[i].max); - } - else - if((opts[i].flags&CONF_MIN)==CONF_MIN) { - MSG_INFO("<min=%i>",(int)opts[i].min); - } - else - if((opts[i].flags&CONF_MAX)==CONF_MAX) { - MSG_INFO("<max=%i>",(int)opts[i].max); - } - MSG_INFO("<default=%i>",defv); + else + if((opts[i].flags&CONF_MAX)==CONF_MAX) { + MSG_INFO("<max=%i>",(int)opts[i].max); } - break; - case CONF_TYPE_FLOAT: { - float defv = *((float*)(opts[i].p)); - if((opts[i].flags&CONF_RANGE)==CONF_RANGE) { - MSG_INFO("[%f...%f]",(float)opts[i].min,(float)opts[i].max); - } - else - if((opts[i].flags&CONF_MIN)==CONF_MIN) { - MSG_INFO("<min=%f>",(float)opts[i].min); - } - else - if((opts[i].flags&CONF_MAX)==CONF_MAX) { - MSG_INFO("<float=%f>",(float)opts[i].max); - } - MSG_INFO("<default=%f>",defv); + MSG_INFO("<default=%i>",defv); + } + break; + case CONF_TYPE_FLOAT: { + float defv = *((float*)(opts[i].p)); + if((opts[i].flags&CONF_RANGE)==CONF_RANGE) { + MSG_INFO("[%f...%f]",(float)opts[i].min,(float)opts[i].max); } - break; - default: - break; + else + if((opts[i].flags&CONF_MIN)==CONF_MIN) { + MSG_INFO("<min=%f>",(float)opts[i].min); } - MSG_INFO("}"); + else + if((opts[i].flags&CONF_MAX)==CONF_MAX) { + MSG_INFO("<float=%f>",(float)opts[i].max); } + MSG_INFO("<default=%f>",defv); + } + break; + default: + break; + } + MSG_INFO("}"); + } MSG_INFO("\n"); - } - i++; } + i++; + }; +} + +void m_config_show_options(const m_config_t *args) { + unsigned j; + const config_t *opts; + j=0; + MSG_INFO("List of available command-line options:\n"); + while((opts=args->opt_list[j])!=NULL) { + __m_config_show_options(2,NULL,opts); j++; }; } Modified: mplayerxp/cfgparser.h =================================================================== --- mplayerxp/cfgparser.h 2010-01-12 17:58:30 UTC (rev 98) +++ mplayerxp/cfgparser.h 2010-01-13 15:42:47 UTC (rev 99) @@ -52,8 +52,6 @@ const char *help; }; - - struct m_config { const config_t** opt_list; config_save_t** config_stack; Modified: mplayerxp/input/input.c =================================================================== --- mplayerxp/input/input.c 2010-01-12 17:58:30 UTC (rev 98) +++ mplayerxp/input/input.c 2010-01-13 15:42:47 UTC (rev 99) @@ -408,18 +408,18 @@ // Our command line options static const config_t input_conf[] = { - { "conf", &config_file, CONF_TYPE_STRING, CONF_GLOBAL, 0, 0, NULL, "" }, - { "ar-delay", &ar_delay, CONF_TYPE_INT, CONF_GLOBAL, 0, 0, NULL, "" }, - { "ar-rate", &ar_rate, CONF_TYPE_INT, CONF_GLOBAL, 0, 0, NULL, "" }, - { "keylist", mp_input_print_key_list, CONF_TYPE_FUNC, CONF_GLOBAL, 0, 0, NULL, "" }, - { "cmdlist", mp_input_print_cmd_list, CONF_TYPE_FUNC, CONF_GLOBAL, 0, 0, NULL, "" }, - { "js-dev", &js_dev, CONF_TYPE_STRING, CONF_GLOBAL, 0, 0, NULL, "" }, - { "file", &in_file, CONF_TYPE_STRING, CONF_GLOBAL, 0, 0, NULL, "" }, + { "conf", &config_file, CONF_TYPE_STRING, CONF_GLOBAL, 0, 0, NULL, "specifies alternative input.conf" }, + { "ar-delay", &ar_delay, CONF_TYPE_INT, CONF_GLOBAL, 0, 0, NULL, "autorepeate a key delay in milliseconds (0 to disable)" }, + { "ar-rate", &ar_rate, CONF_TYPE_INT, CONF_GLOBAL, 0, 0, NULL, "number of key-presses per second generating on autorepeat" }, + { "keylist", mp_input_print_key_list, CONF_TYPE_FUNC, CONF_GLOBAL, 0, 0, NULL, "prints all keys that can be bound to commands" }, + { "cmdlist", mp_input_print_cmd_list, CONF_TYPE_FUNC, CONF_GLOBAL, 0, 0, NULL, "prints all commands that can be bound to keys" }, + { "js-dev", &js_dev, CONF_TYPE_STRING, CONF_GLOBAL, 0, 0, NULL, "specifies the joystick device" }, + { "file", &in_file, CONF_TYPE_STRING, CONF_GLOBAL, 0, 0, NULL, "specifes file with commands (useful for FIFO)" }, { NULL, NULL, 0, 0, 0, 0, NULL, NULL} }; static const config_t mp_input_opts[] = { - { "input", &input_conf, CONF_TYPE_SUBCONFIG, 0, 0, 0, NULL, ""}, + { "input", &input_conf, CONF_TYPE_SUBCONFIG, 0, 0, 0, NULL, "Input specific options"}, { "joystick", &use_joystick, CONF_TYPE_FLAG, CONF_GLOBAL, 0, 1, NULL, "enables using of joystick" }, { "nojoystick", &use_joystick, CONF_TYPE_FLAG, CONF_GLOBAL, 1, 0, NULL, "disables using of joystick" }, { "lirc", &use_lirc, CONF_TYPE_FLAG, CONF_GLOBAL, 0, 1, NULL, "enables using of lirc" }, Modified: mplayerxp/libmpcodecs/vd_ffmpeg.c =================================================================== --- mplayerxp/libmpcodecs/vd_ffmpeg.c 2010-01-12 17:58:30 UTC (rev 98) +++ mplayerxp/libmpcodecs/vd_ffmpeg.c 2010-01-13 15:42:47 UTC (rev 99) @@ -42,21 +42,26 @@ static int lavc_param_threads=-1; static char *lavc_avopt = NULL; +static const config_t ff_options[] = { + {"er", &lavc_param_error_resilience, CONF_TYPE_INT, CONF_RANGE, 0, 99, NULL,"specifies error resilience for ffmpeg decoders"}, + {"idct", &lavc_param_idct_algo, CONF_TYPE_INT, CONF_RANGE, 0, 99, NULL,"specifies idct algorithm for ffmpeg decoders"}, + {"ec", &lavc_param_error_concealment, CONF_TYPE_INT, CONF_RANGE, 0, 99, NULL,"specifies error concealment for ffmpeg decoders"}, + {"vstats", &lavc_param_vstats, CONF_TYPE_FLAG, 0, 0, 1, NULL,"specifies vstat for ffmpeg decoders"}, + {"debug", &lavc_param_debug, CONF_TYPE_INT, CONF_RANGE, 0, 9999999, NULL,"specifies debug level for ffmpeg decoders"}, + {"vismv", &lavc_param_vismv, CONF_TYPE_INT, CONF_RANGE, 0, 9999999, NULL,"specifies visualize motion vectors (MVs) for ffmpeg decoders"}, + {"st", &lavc_param_skip_top, CONF_TYPE_INT, CONF_RANGE, 0, 999, NULL,"specifies skipping top lines for ffmpeg decoders"}, + {"sb", &lavc_param_skip_bottom, CONF_TYPE_INT, CONF_RANGE, 0, 999, NULL,"specifies skipping bottom lines for ffmpeg decoders"}, + {"lowres", &lavc_param_lowres_str, CONF_TYPE_STRING, 0, 0, 0, NULL,"specifies decoding at 1= 1/2, 2=1/4, 3=1/8 resolutions for ffmpeg decoders"}, + {"skiploopfilter", &lavc_param_skip_loop_filter_str, CONF_TYPE_STRING, 0, 0, 0, NULL,"specifies skipping of loop filters for ffmpeg decoders"}, + {"skipidct", &lavc_param_skip_idct_str, CONF_TYPE_STRING, 0, 0, 0, NULL,"specifies skipping of IDCT filters for ffmpeg decoders"}, + {"skipframe", &lavc_param_skip_frame_str, CONF_TYPE_STRING, 0, 0, 0, NULL,"indicates frame skipping for ffmpeg decoders"}, + {"threads", &lavc_param_threads, CONF_TYPE_INT, CONF_RANGE, 1, 8, NULL,"specifies number of threads for ffmpeg decoders"}, + {"o", &lavc_avopt, CONF_TYPE_STRING, 0, 0, 0, NULL,"specifies additional option for ffmpeg decoders"}, + { NULL, NULL, 0, 0, 0, 0, NULL, NULL} +}; + static const config_t options[] = { - {"ffmpeg_er", &lavc_param_error_resilience, CONF_TYPE_INT, CONF_RANGE, 0, 99, NULL,"specifies error resilience for ffmpeg decoders"}, - {"ffmpeg_idct", &lavc_param_idct_algo, CONF_TYPE_INT, CONF_RANGE, 0, 99, NULL,"specifies idct algorithm for ffmpeg decoders"}, - {"ffmpeg_ec", &lavc_param_error_concealment, CONF_TYPE_INT, CONF_RANGE, 0, 99, NULL,"specifies error concealment for ffmpeg decoders"}, - {"ffmpeg_vstats", &lavc_param_vstats, CONF_TYPE_FLAG, 0, 0, 1, NULL,"specifies vstat for ffmpeg decoders"}, - {"ffmpeg_debug", &lavc_param_debug, CONF_TYPE_INT, CONF_RANGE, 0, 9999999, NULL,"specifies debug level for ffmpeg decoders"}, - {"ffmpeg_vismv", &lavc_param_vismv, CONF_TYPE_INT, CONF_RANGE, 0, 9999999, NULL,"specifies visualize motion vectors (MVs) for ffmpeg decoders"}, - {"ffmpeg_st", &lavc_param_skip_top, CONF_TYPE_INT, CONF_RANGE, 0, 999, NULL,"specifies skipping top lines for ffmpeg decoders"}, - {"ffmpeg_sb", &lavc_param_skip_bottom, CONF_TYPE_INT, CONF_RANGE, 0, 999, NULL,"specifies skipping bottom lines for ffmpeg decoders"}, - {"ffmpeg_lowres", &lavc_param_lowres_str, CONF_TYPE_STRING, 0, 0, 0, NULL,"specifies decoding at 1= 1/2, 2=1/4, 3=1/8 resolutions for ffmpeg decoders"}, - {"ffmpeg_skiploopfilter", &lavc_param_skip_loop_filter_str, CONF_TYPE_STRING, 0, 0, 0, NULL,"specifies skipping of loop filters for ffmpeg decoders"}, - {"ffmpeg_skipidct", &lavc_param_skip_idct_str, CONF_TYPE_STRING, 0, 0, 0, NULL,"specifies skipping of IDCT filters for ffmpeg decoders"}, - {"ffmpeg_skipframe", &lavc_param_skip_frame_str, CONF_TYPE_STRING, 0, 0, 0, NULL,"indicates frame skipping for ffmpeg decoders"}, - {"ffmpeg_threads", &lavc_param_threads, CONF_TYPE_INT, CONF_RANGE, 1, 8, NULL,"specifies number of threads for ffmpeg decoders"}, - {"ffmpeg_o", &lavc_avopt, CONF_TYPE_STRING, 0, 0, 0, NULL,"specifies additional option for ffmpeg decoders"}, + {"ffmpeg", &ff_options, CONF_TYPE_SUBCONFIG, 0, 0, 0, NULL, "FFMPEG specific options"}, { NULL, NULL, 0, 0, 0, 0, NULL, NULL} }; Modified: mplayerxp/libmpdemux/demux_audio.c =================================================================== --- mplayerxp/libmpdemux/demux_audio.c 2010-01-12 17:58:30 UTC (rev 98) +++ mplayerxp/libmpdemux/demux_audio.c 2010-01-13 15:42:47 UTC (rev 99) @@ -1766,9 +1766,14 @@ #include "../cfgparser.h" +static const config_t mp3_opts[] = { + { "hr-seek", &hr_mp3_seek, CONF_TYPE_FLAG, 0, 0, 1, NULL, "enables hight-resolution mp3 seeking" }, + { "nohr-seek", &hr_mp3_seek, CONF_TYPE_FLAG, 0, 1, 0, NULL, "disables hight-resolution mp3 seeking"}, + {NULL, NULL, 0, 0, 0, 0, NULL, NULL} +}; + static const config_t audio_opts[] = { - { "hr-mp3-seek", &hr_mp3_seek, CONF_TYPE_FLAG, 0, 0, 1, NULL, "enables hight-resolution mp3 seeking" }, - { "nohr-mp3-seek", &hr_mp3_seek, CONF_TYPE_FLAG, 0, 1, 0, NULL, "disables hight-resolution mp3 seeking"}, + { "mp3", &mp3_opts, CONF_TYPE_SUBCONFIG, 0, 0, 0, NULL, "MP3 related options" }, {NULL, NULL, 0, 0, 0, 0, NULL, NULL} }; Modified: mplayerxp/libmpdemux/demux_lavf.c =================================================================== --- mplayerxp/libmpdemux/demux_lavf.c 2010-01-12 17:58:30 UTC (rev 98) +++ mplayerxp/libmpdemux/demux_lavf.c 2010-01-13 15:42:47 UTC (rev 99) @@ -47,9 +47,14 @@ static char *opt_cryptokey; extern int ts_prog; +const config_t lavf_opts[] = { + {"format", &(opt_format), CONF_TYPE_STRING, 0, 0, 0, NULL, "forces format of lavf demuxer"}, + {"cryptokey", &(opt_cryptokey), CONF_TYPE_STRING, 0, 0, 0, NULL, "specifies cryptokey for lavf demuxer"}, + {NULL, NULL, 0, 0, 0, 0, NULL, NULL} +}; + const config_t lavfdopts_conf[] = { - {"lavf_format", &(opt_format), CONF_TYPE_STRING, 0, 0, 0, NULL, "forces format of lavf demuxer"}, - {"lavf_cryptokey", &(opt_cryptokey), CONF_TYPE_STRING, 0, 0, 0, NULL, "specifies cryptokey for lavf demuxer"}, + {"lavf", &lavf_opts, CONF_TYPE_SUBCONFIG, 0, 0, 0, NULL, "LAVF-demuxer related options"}, {NULL, NULL, 0, 0, 0, 0, NULL, NULL} }; Modified: mplayerxp/libmpdemux/demux_rawaudio.c =================================================================== --- mplayerxp/libmpdemux/demux_rawaudio.c 2010-01-12 17:58:30 UTC (rev 98) +++ mplayerxp/libmpdemux/demux_rawaudio.c 2010-01-13 15:42:47 UTC (rev 99) @@ -17,16 +17,16 @@ static int format = 0x1; // Raw PCM static const config_t demux_rawaudio_opts[] = { - { "on", &use_rawaudio, CONF_TYPE_FLAG, 0,0, 1, NULL }, - { "channels", &channels, CONF_TYPE_INT,CONF_RANGE,1,8, NULL }, - { "rate", &samplerate, CONF_TYPE_INT,CONF_RANGE,1000,8*48000, NULL }, - { "samplesize", &samplesize, CONF_TYPE_INT,CONF_RANGE,1,8, NULL }, - { "format", &format, CONF_TYPE_INT, CONF_MIN, 0 , 0, NULL }, + { "on", &use_rawaudio, CONF_TYPE_FLAG, 0,0, 1, NULL, "forces treating stream as raw-audio" }, + { "channels", &channels, CONF_TYPE_INT,CONF_RANGE,1,8, NULL, "specifies number of channels in raw-audio steram" }, + { "rate", &samplerate, CONF_TYPE_INT,CONF_RANGE,1000,8*48000, NULL, "specifies sample-rate of raw-audio steram" }, + { "samplesize", &samplesize, CONF_TYPE_INT,CONF_RANGE,1,8, NULL, "specifies sample-size of raw-audio steram" }, + { "format", &format, CONF_TYPE_INT, CONF_MIN, 0 , 0, NULL, "specifies compression-format of raw-audio stream" }, {NULL, NULL, 0, 0, 0, 0, NULL} }; static const config_t rawaudio_conf[] = { - { "rawaudio", &demux_rawaudio_opts, CONF_TYPE_SUBCONFIG, 0, 0, 0, NULL}, + { "rawaudio", &demux_rawaudio_opts, CONF_TYPE_SUBCONFIG, 0, 0, 0, NULL, "Raw-audio specific commands"}, { NULL,NULL, 0, 0, 0, 0, NULL} }; Modified: mplayerxp/libmpdemux/demux_rawvideo.c =================================================================== --- mplayerxp/libmpdemux/demux_rawvideo.c 2010-01-12 17:58:30 UTC (rev 98) +++ mplayerxp/libmpdemux/demux_rawvideo.c 2010-01-13 15:42:47 UTC (rev 99) @@ -23,34 +23,34 @@ static int imgsize=0; static const config_t demux_rawvideo_opts[] = { - { "on", &use_rawvideo, CONF_TYPE_FLAG, 0,0, 1, NULL }, + { "on", &use_rawvideo, CONF_TYPE_FLAG, 0,0, 1, NULL, "forces treating stream as raw-vidio" }, // size: - { "w", &width, CONF_TYPE_INT,CONF_RANGE,1,8192, NULL }, - { "h", &height, CONF_TYPE_INT,CONF_RANGE,1,8192, NULL }, - { "sqcif", &size_id, CONF_TYPE_FLAG,0,0,1, NULL }, - { "qcif", &size_id, CONF_TYPE_FLAG,0,0,2, NULL }, - { "cif", &size_id, CONF_TYPE_FLAG,0,0,3, NULL }, - { "4cif", &size_id, CONF_TYPE_FLAG,0,0,4, NULL }, - { "pal", &size_id, CONF_TYPE_FLAG,0,0,5, NULL }, - { "ntsc", &size_id, CONF_TYPE_FLAG,0,0,6, NULL }, - { "16cif", &size_id, CONF_TYPE_FLAG,0,0,7, NULL }, - { "sif", &size_id, CONF_TYPE_FLAG,0,0,8, NULL }, + { "w", &width, CONF_TYPE_INT,CONF_RANGE,1,8192, NULL, "specifies image width of raw-video stream" }, + { "h", &height, CONF_TYPE_INT,CONF_RANGE,1,8192, NULL, "specifies image height of raw-video stream" }, + { "sqcif", &size_id, CONF_TYPE_FLAG,0,0,1, NULL, "sets image size to SQCIF standard" }, + { "qcif", &size_id, CONF_TYPE_FLAG,0,0,2, NULL, "sets image size to QCIF standard" }, + { "cif", &size_id, CONF_TYPE_FLAG,0,0,3, NULL, "sets image size to CIF standard" }, + { "4cif", &size_id, CONF_TYPE_FLAG,0,0,4, NULL, "sets image size to 4CIF standard" }, + { "pal", &size_id, CONF_TYPE_FLAG,0,0,5, NULL, "sets image size to PAL standard" }, + { "ntsc", &size_id, CONF_TYPE_FLAG,0,0,6, NULL, "sets image size to NTSC standard" }, + { "16cif", &size_id, CONF_TYPE_FLAG,0,0,7, NULL, "sets image size to 16CIF standard" }, + { "sif", &size_id, CONF_TYPE_FLAG,0,0,8, NULL, "sets image size to SIF standard" }, // format: - { "format", &format, CONF_TYPE_INT, 0, 0 , 0, NULL }, - { "i420", &format, CONF_TYPE_FLAG, 0, 0 , IMGFMT_I420, NULL }, - { "yv12", &format, CONF_TYPE_FLAG, 0, 0 , IMGFMT_YV12, NULL }, - { "yuy2", &format, CONF_TYPE_FLAG, 0, 0 , IMGFMT_YUY2, NULL }, - { "uyvy", &format, CONF_TYPE_FLAG, 0, 0 , IMGFMT_UYVY, NULL }, - { "y8", &format, CONF_TYPE_FLAG, 0, 0 , IMGFMT_Y8, NULL }, + { "format", &format, CONF_TYPE_INT, 0, 0 , 0, NULL, "specifies colorspace (fourcc) in hex or string constant" }, + { "i420", &format, CONF_TYPE_FLAG, 0, 0 , IMGFMT_I420, NULL, "treats raw-video as I420 fourcc" }, + { "yv12", &format, CONF_TYPE_FLAG, 0, 0 , IMGFMT_YV12, NULL, "treats raw-video as YV12 fourcc" }, + { "yuy2", &format, CONF_TYPE_FLAG, 0, 0 , IMGFMT_YUY2, NULL, "treats raw-video as YUY2 fourcc" }, + { "uyvy", &format, CONF_TYPE_FLAG, 0, 0 , IMGFMT_UYVY, NULL, "treats raw-video as UYVY fourcc" }, + { "y8", &format, CONF_TYPE_FLAG, 0, 0 , IMGFMT_Y8, NULL, "treats raw-video as Y8 fourcc" }, // misc: - { "fps", &fps, CONF_TYPE_FLOAT,CONF_RANGE,0.001,1000, NULL }, - { "size", &imgsize, CONF_TYPE_INT, CONF_RANGE, 1 , 8192*8192*4, NULL }, + { "fps", &fps, CONF_TYPE_FLOAT,CONF_RANGE,0.001,1000, NULL, "specifies rate in frames per second of raw-video stream" }, + { "size", &imgsize, CONF_TYPE_INT, CONF_RANGE, 1 , 8192*8192*4, NULL, "specifies frame size in bytes" }, {NULL, NULL, 0, 0, 0, 0, NULL} }; static const config_t rawvideo_conf[] = { - { "rawvideo", &demux_rawvideo_opts, CONF_TYPE_SUBCONFIG, 0, 0, 0, NULL}, + { "rawvideo", &demux_rawvideo_opts, CONF_TYPE_SUBCONFIG, 0, 0, 0, NULL, "Raw-video specific options"}, { NULL,NULL, 0, 0, 0, 0, NULL} }; Modified: mplayerxp/libmpdemux/demux_viv.c =================================================================== --- mplayerxp/libmpdemux/demux_viv.c 2010-01-12 17:58:30 UTC (rev 98) +++ mplayerxp/libmpdemux/demux_viv.c 2010-01-13 15:42:47 UTC (rev 99) @@ -77,21 +77,21 @@ static config_t vivoopts_conf[]={ - {"version", &vivo_param_version, CONF_TYPE_INT, 0, 0, 0, NULL}, + {"version", &vivo_param_version, CONF_TYPE_INT, 0, 0, 0, NULL, "forces version of VIVO stream"}, /* audio options */ - {"acodec", &vivo_param_acodec, CONF_TYPE_STRING, 0, 0, 0, NULL}, - {"abitrate", &vivo_param_abitrate, CONF_TYPE_INT, 0, 0, 0, NULL}, - {"samplerate", &vivo_param_samplerate, CONF_TYPE_INT, 0, 0, 0, NULL}, - {"bytesperblock", &vivo_param_bytesperblock, CONF_TYPE_INT, 0, 0, 0, NULL}, + {"acodec", &vivo_param_acodec, CONF_TYPE_STRING, 0, 0, 0, NULL, "specifies audio-codec of VIVO stream"}, + {"abitrate", &vivo_param_abitrate, CONF_TYPE_INT, 0, 0, 0, NULL, "specifies audio bitrate of VIVO stream"}, + {"samplerate", &vivo_param_samplerate, CONF_TYPE_INT, 0, 0, 0, NULL, "specifies audio samplerate of VIVO stream"}, + {"bytesperblock", &vivo_param_bytesperblock, CONF_TYPE_INT, 0, 0, 0, NULL, "specifies number of bytes per audio-block in VIVO stream"}, /* video options */ - {"width", &vivo_param_width, CONF_TYPE_INT, 0, 0, 0, NULL}, - {"height", &vivo_param_height, CONF_TYPE_INT, 0, 0, 0, NULL}, - {"vformat", &vivo_param_vformat, CONF_TYPE_INT, 0, 0, 0, NULL}, + {"width", &vivo_param_width, CONF_TYPE_INT, 0, 0, 0, NULL, "specifies width of video in VIVO stream" }, + {"height", &vivo_param_height, CONF_TYPE_INT, 0, 0, 0, NULL, "specifies height of video in VIVO stream"}, + {"vformat", &vivo_param_vformat, CONF_TYPE_INT, 0, 0, 0, NULL, "specifies video-codec of VIVO stream"}, {NULL, NULL, 0, 0, 0, 0, NULL} }; static config_t vivo_conf[] = { - { "vivo", &vivoopts_conf, CONF_TYPE_SUBCONFIG, 0, 0, 0, NULL}, + { "vivo", &vivoopts_conf, CONF_TYPE_SUBCONFIG, 0, 0, 0, NULL, "Vivo specific options"}, { NULL,NULL, 0, 0, 0, 0, NULL} }; Modified: mplayerxp/libmpdemux/demuxer.c =================================================================== --- mplayerxp/libmpdemux/demuxer.c 2010-01-12 17:58:30 UTC (rev 98) +++ mplayerxp/libmpdemux/demuxer.c 2010-01-13 15:42:47 UTC (rev 99) @@ -745,15 +745,20 @@ /******************* Options stuff **********************/ -static const config_t demuxer_opts[] = { +static const config_t demux_opts[] = { { "audiofile", &audio_stream, CONF_TYPE_STRING, 0, 0, 0, NULL, "forces reading of audio-stream from other file" }, { "subfile", &sub_stream, CONF_TYPE_STRING, 0, 0, 0, NULL, "forces reading of subtitles from other file" }, - { "demuxer", &demuxer_type, CONF_TYPE_INT, CONF_RANGE, 1, DEMUXER_TYPE_MAX, NULL, "forces demxer by given number" }, - { "audio-demuxer", &audio_demuxer_type, CONF_TYPE_INT, CONF_RANGE, 1, DEMUXER_TYPE_MAX, NULL, "forces using of audio-demuxer" }, - { "sub-demuxer", &sub_demuxer_type, CONF_TYPE_INT, CONF_RANGE, 1, DEMUXER_TYPE_MAX, NULL, "forces using of subtitle-demuxer" }, + { "type", &demuxer_type, CONF_TYPE_INT, CONF_RANGE, 1, DEMUXER_TYPE_MAX, NULL, "forces demuxer by given number" }, + { "audio", &audio_demuxer_type, CONF_TYPE_INT, CONF_RANGE, 1, DEMUXER_TYPE_MAX, NULL, "forces using of audio-demuxer" }, + { "sub", &sub_demuxer_type, CONF_TYPE_INT, CONF_RANGE, 1, DEMUXER_TYPE_MAX, NULL, "forces using of subtitle-demuxer" }, { NULL, NULL, 0, 0, 0, 0, NULL, NULL} }; +static const config_t demuxer_opts[] = { + { "demuxer", &demux_opts, CONF_TYPE_SUBCONFIG, 0, 0, 0, NULL, "Demuxer related options" }, + { NULL, NULL, 0, 0, 0, 0, NULL, NULL} +}; + void demuxer_register_options(m_config_t* cfg) { m_config_register_options(cfg,demuxer_opts); } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |