Mercurial > mplayer.hg
changeset 7506:c1cb94198e05
-vc/-vfm accepts codec/driver _list_ now. empty list element for -vc means
*, ie search all codecs. codec name starting with - disables the codec.
author | arpi |
---|---|
date | Thu, 26 Sep 2002 01:31:18 +0000 |
parents | 3a2685099095 |
children | a2173bfdc133 |
files | cfg-common.h libmpcodecs/dec_video.c libmpcodecs/dec_video.h mencoder.c mplayer.c |
diffstat | 5 files changed, 44 insertions(+), 17 deletions(-) [+] |
line wrap: on
line diff
--- a/cfg-common.h Thu Sep 26 01:28:32 2002 +0000 +++ b/cfg-common.h Thu Sep 26 01:31:18 2002 +0000 @@ -107,9 +107,9 @@ // {"afm", &audio_family, CONF_TYPE_INT, CONF_MIN, 0, 22, NULL}, // keep ranges in sync // {"vfm", &video_family, CONF_TYPE_INT, CONF_MIN, 0, 29, NULL}, // with codec-cfg.c {"afm", &audio_fm, CONF_TYPE_STRING, 0, 0, 0, NULL}, - {"vfm", &video_fm, CONF_TYPE_STRING, 0, 0, 0, NULL}, + {"vfm", &video_fm_list, CONF_TYPE_STRING_LIST, 0, 0, 0, NULL}, {"ac", &audio_codec, CONF_TYPE_STRING, 0, 0, 0, NULL}, - {"vc", &video_codec, CONF_TYPE_STRING, 0, 0, 0, NULL}, + {"vc", &video_codec_list, CONF_TYPE_STRING_LIST, 0, 0, 0, NULL}, // postprocessing: {"divxq", "Option -divxq has been renamed to -pp (postprocessing), use -pp !\n",
--- a/libmpcodecs/dec_video.c Thu Sep 26 01:28:32 2002 +0000 +++ b/libmpcodecs/dec_video.c Thu Sep 26 01:31:18 2002 +0000 @@ -204,26 +204,41 @@ return 0; } -int init_best_video_codec(sh_video_t *sh_video,char* video_codec,char* video_fm){ +int init_best_video_codec(sh_video_t *sh_video,char** video_codec_list,char** video_fm_list){ +char* vc_l_default[2]={"",(char*)NULL}; +// hack: +if(!video_codec_list) video_codec_list=vc_l_default; // Go through the codec.conf and find the best codec... sh_video->inited=0; codecs_reset_selection(0); -if(video_codec){ - // forced codec by name: - mp_msg(MSGT_DECVIDEO,MSGL_INFO,MSGTR_ForcedVideoCodec,video_codec); - init_video(sh_video,video_codec,NULL,-1); -} else { +while(!sh_video->inited && *video_codec_list){ + char* video_codec=*(video_codec_list++); + if(video_codec[0]){ + if(video_codec[0]=='-'){ + // disable this codec: + select_codec(video_codec+1,0); + } else { + // forced codec by name: + mp_msg(MSGT_DECVIDEO,MSGL_INFO,MSGTR_ForcedVideoCodec,video_codec); + init_video(sh_video,video_codec,NULL,-1); + } + } else { int status; // try in stability order: UNTESTED, WORKING, BUGGY. never try CRASHING. - if(video_fm){ - // try first the preferred codec family: + if(video_fm_list){ + char** fmlist=video_fm_list; + // try first the preferred codec families: + while(!sh_video->inited && *fmlist){ + char* video_fm=*(fmlist++); mp_msg(MSGT_DECVIDEO,MSGL_INFO,MSGTR_TryForceVideoFmtStr,video_fm); for(status=CODECS_STATUS__MAX;status>=CODECS_STATUS__MIN;--status) if(init_video(sh_video,NULL,video_fm,status)) break; + } } if(!sh_video->inited) for(status=CODECS_STATUS__MAX;status>=CODECS_STATUS__MIN;--status) if(init_video(sh_video,NULL,NULL,status)) break; + } } if(!sh_video->inited){ @@ -232,8 +247,8 @@ return 0; // failed } -mp_msg(MSGT_DECVIDEO,MSGL_INFO,"%s video codec: [%s] vfm:%s (%s)\n", - video_codec?mp_gettext("Forcing"):mp_gettext("Detected"),sh_video->codec->name,sh_video->codec->drv,sh_video->codec->info); +mp_msg(MSGT_DECVIDEO,MSGL_INFO,"Selected video codec: [%s] vfm:%s (%s)\n", + sh_video->codec->name,sh_video->codec->drv,sh_video->codec->info); return 1; // success }
--- a/libmpcodecs/dec_video.h Thu Sep 26 01:28:32 2002 +0000 +++ b/libmpcodecs/dec_video.h Thu Sep 26 01:31:18 2002 +0000 @@ -4,7 +4,7 @@ extern void vfm_help(); -extern int init_best_video_codec(sh_video_t *sh_video,char* video_codec,char* video_fm); +extern int init_best_video_codec(sh_video_t *sh_video,char** video_codec_list,char** video_fm_list); //extern int init_video(sh_video_t *sh_video, int *pitches); extern int init_video(sh_video_t *sh_video,char* codecname,char* vfm,int status);
--- a/mencoder.c Thu Sep 26 01:28:32 2002 +0000 +++ b/mencoder.c Thu Sep 26 01:31:18 2002 +0000 @@ -94,8 +94,10 @@ static int has_audio=1; char *audio_codec=NULL; // override audio codec char *video_codec=NULL; // override video codec +char **video_codec_list=NULL; // override video codec char* audio_fm=NULL; // override audio codec family char* video_fm=NULL; // override video codec family +char** video_fm_list=NULL; // override video codec family int out_audio_codec=-1; int out_video_codec=-1; @@ -633,7 +635,7 @@ sh_video->vfilter=append_filters(sh_video->vfilter); mp_msg(MSGT_CPLAYER,MSGL_INFO,"==========================================================================\n"); - init_best_video_codec(sh_video,video_codec,video_fm); + init_best_video_codec(sh_video,video_codec_list,video_fm_list); mp_msg(MSGT_CPLAYER,MSGL_INFO,"==========================================================================\n"); if(!sh_video->inited) mencoder_exit(1,NULL);
--- a/mplayer.c Thu Sep 26 01:28:32 2002 +0000 +++ b/mplayer.c Thu Sep 26 01:31:18 2002 +0000 @@ -177,8 +177,10 @@ int has_video=1; char *audio_codec=NULL; // override audio codec char *video_codec=NULL; // override video codec +char **video_codec_list=NULL; // override video codec char *audio_fm=NULL; // override audio codec family char *video_fm=NULL; // override video codec family +char **video_fm_list=NULL; // override video codec family // streaming: int audio_id=-1; @@ -619,19 +621,27 @@ } } +#if 0 + if(video_codec_list){ + int i; + video_codec=video_codec_list[0]; + for(i=0;video_codec_list[i];i++) + printf("vc#%d: '%s'\n",i,video_codec_list[i]); + } +#endif if(audio_codec && strcmp(audio_codec,"help")==0){ mp_msg(MSGT_CPLAYER, MSGL_INFO, MSGTR_AvailableAudioCodecs); list_codecs(1); printf("\n"); exit(0); } - if(video_codec && strcmp(video_codec,"help")==0){ + if(video_codec_list && strcmp(video_codec_list[0],"help")==0){ mp_msg(MSGT_CPLAYER, MSGL_INFO, MSGTR_AvailableVideoCodecs); list_codecs(0); printf("\n"); exit(0); } - if(video_fm && strcmp(video_fm,"help")==0){ + if(video_fm_list && strcmp(video_fm_list[0],"help")==0){ vfm_help(); printf("\n"); exit(0); @@ -1234,7 +1244,7 @@ current_module="init_video_codec"; mp_msg(MSGT_CPLAYER,MSGL_INFO,"==========================================================================\n"); -init_best_video_codec(sh_video,video_codec,video_fm); +init_best_video_codec(sh_video,video_codec_list,video_fm_list); mp_msg(MSGT_CPLAYER,MSGL_INFO,"==========================================================================\n"); if(!sh_video->inited){