summaryrefslogtreecommitdiffstats
path: root/libmpcodecs/vd.c
diff options
context:
space:
mode:
authorarpi <arpi@b3059339-0415-0410-9bf9-f77b7e298cf2>2003-02-04 17:50:30 +0000
committerarpi <arpi@b3059339-0415-0410-9bf9-f77b7e298cf2>2003-02-04 17:50:30 +0000
commit8222cbcc9b712e786119c9c59317aafcc0a429d1 (patch)
tree07e661842aaa4da7f87663d982de2542a94df79f /libmpcodecs/vd.c
parentcdb7ff9cd033eb0558caa74ab3a3d6e34537343e (diff)
downloadmpv-8222cbcc9b712e786119c9c59317aafcc0a429d1.tar.bz2
mpv-8222cbcc9b712e786119c9c59317aafcc0a429d1.tar.xz
- 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
Diffstat (limited to 'libmpcodecs/vd.c')
-rw-r--r--libmpcodecs/vd.c28
1 files changed, 25 insertions, 3 deletions
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;i<CODECS_MAX_OUTFMT;i++){
int flags;
out_fmt=sh->codec->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) {