From 8222cbcc9b712e786119c9c59317aafcc0a429d1 Mon Sep 17 00:00:00 2001 From: arpi Date: Tue, 4 Feb 2003 17:50:30 +0000 Subject: - append the 'palette' filter if the codec supports RGB8/BGR8 and no csp match even with the scale filter. - print the current filter chain, in verbose mode git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@9276 b3059339-0415-0410-9bf9-f77b7e298cf2 --- libmpcodecs/vd.c | 28 +++++++++++++++++++++++++--- 1 file changed, 25 insertions(+), 3 deletions(-) (limited to 'libmpcodecs/vd.c') diff --git a/libmpcodecs/vd.c b/libmpcodecs/vd.c index 61862a94f1..8ac8d81ac7 100644 --- a/libmpcodecs/vd.c +++ b/libmpcodecs/vd.c @@ -148,6 +148,7 @@ int mpcodecs_config_vo(sh_video_t *sh, int w, int h, unsigned int preferred_outf int screen_size_y=0;//SCREEN_SIZE_Y; // vo_functions_t* video_out=sh->video_out; vf_instance_t* vf=sh->vfilter,*sc=NULL; + int palette=0; if(!sh->disp_w || !sh->disp_h) mp_msg(MSGT_DECVIDEO,MSGL_WARN, MSGTR_CodecDidNotSet); @@ -172,11 +173,20 @@ int mpcodecs_config_vo(sh_video_t *sh, int w, int h, unsigned int preferred_outf // check if libvo and codec has common outfmt (no conversion): csp_again: + + if(verbose>0){ + vf_instance_t* f=vf; + mp_msg(MSGT_DECVIDEO,MSGL_V,"Trying filter chain:"); + for(f = vf ; f ; f = f->next) + mp_msg(MSGT_DECVIDEO,MSGL_V," %s",f->info->name); + mp_msg(MSGT_DECVIDEO,MSGL_V,"\n"); + } + j=-1; for(i=0;icodec->outfmt[i]; - if(out_fmt==(signed int)0xFFFFFFFF) continue; + if(out_fmt==(unsigned int)0xFFFFFFFF) continue; flags=vf->query_format(vf,out_fmt); mp_msg(MSGT_CPLAYER,MSGL_DBG2,"vo_debug: query(%s) returned 0x%X (i=%d) \n",vo_format_name(out_fmt),flags,i); if((flags&2) || (flags && j<0)){ @@ -187,15 +197,27 @@ csp_again: continue; } j=i; vo_flags=flags; if(flags&2) break; + } else + if(!palette && !(flags&3) && (out_fmt==IMGFMT_RGB8||out_fmt==IMGFMT_BGR8)){ + sh->outfmtidx=j; // pass index to the control() function this way + if(mpvdec->control(sh,VDCTRL_QUERY_FORMAT,&out_fmt)!=CONTROL_FALSE) + palette=1; } } if(j<0){ // TODO: no match - we should use conversion... - if(strcmp(vf->info->name,"scale")){ + if(strcmp(vf->info->name,"scale") && palette!=-1){ mp_msg(MSGT_DECVIDEO,MSGL_INFO,MSGTR_CouldNotFindColorspace); sc=vf=vf_open_filter(vf,"scale",NULL); goto csp_again; - } else { // sws failed, if the last filter (vf_vo) support MPEGPES try to append vf_lavc + } else + if(palette==1){ + mp_msg(MSGT_DECVIDEO,MSGL_V,"vd: Trying -vop palette...\n"); + palette=-1; + vf=vf_open_filter(vf,"palette",NULL); + goto csp_again; + } else + { // sws failed, if the last filter (vf_vo) support MPEGPES try to append vf_lavc vf_instance_t* vo, *vp = NULL, *ve; // Remove the scale filter if we added it ourself if(vf == sc) { -- cgit v1.2.3