summaryrefslogtreecommitdiffstats
path: root/libmpcodecs/vd.c
diff options
context:
space:
mode:
authorarpi <arpi@b3059339-0415-0410-9bf9-f77b7e298cf2>2002-04-11 20:56:17 +0000
committerarpi <arpi@b3059339-0415-0410-9bf9-f77b7e298cf2>2002-04-11 20:56:17 +0000
commit39e3a780ce9ac86245ae3fd28515f1a2b5dfff8d (patch)
treead69d9167f0f962b19bcfc45a2994721a66cf2ad /libmpcodecs/vd.c
parenta2ac31892837e61cc2e441cd143ad4d6afdaed24 (diff)
downloadmpv-39e3a780ce9ac86245ae3fd28515f1a2b5dfff8d.tar.bz2
mpv-39e3a780ce9ac86245ae3fd28515f1a2b5dfff8d.tar.xz
capabilities support -> automatic insertion of scale, expand, pp
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@5566 b3059339-0415-0410-9bf9-f77b7e298cf2
Diffstat (limited to 'libmpcodecs/vd.c')
-rw-r--r--libmpcodecs/vd.c27
1 files changed, 23 insertions, 4 deletions
diff --git a/libmpcodecs/vd.c b/libmpcodecs/vd.c
index 03f8e1b053..0ac34486f0 100644
--- a/libmpcodecs/vd.c
+++ b/libmpcodecs/vd.c
@@ -112,6 +112,7 @@ int vo_flags=0;
int vd_use_slices=1;
extern vd_functions_t* mpvdec; // FIXME!
+extern int divx_quality;
int mpcodecs_config_vo(sh_video_t *sh, int w, int h, unsigned int preferred_outfmt){
int i,j;
@@ -120,6 +121,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;
+ unsigned int fmtlist[CODECS_MAX_OUTFMT+1];
#if 1
if(!(sh->disp_w && sh->disp_h))
@@ -137,28 +139,40 @@ int mpcodecs_config_vo(sh_video_t *sh, int w, int h, unsigned int preferred_outf
w,h,vo_format_name(preferred_outfmt));
if(!vf) return 1; // temp hack
+
+ if(get_video_quality_max(sh)<=0 && divx_quality){
+ // user wants postprocess but no pp filter yet:
+ sh->vfilter=vf=vf_open_filter(vf,"pp",NULL);
+ }
// check if libvo and codec has common outfmt (no conversion):
+csp_again:
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;
- vo_flags=vf->query_format(vf,out_fmt);
- mp_msg(MSGT_CPLAYER,MSGL_V,"vo_debug: query(%s) returned 0x%X (i=%d) \n",vo_format_name(out_fmt),vo_flags,i);
- if((vo_flags&2) || (vo_flags && j<0)){
+ flags=vf->query_format(vf,out_fmt);
+ mp_msg(MSGT_CPLAYER,MSGL_V,"vo_debug: query(%s) returned 0x%X (i=%d) \n",vo_format_name(out_fmt),flags,i);
+ if((flags&2) || (flags && j<0)){
// check (query) if codec really support this outfmt...
if(mpvdec->control(sh,VDCTRL_QUERY_FORMAT,&out_fmt)==CONTROL_FALSE)
continue;
- j=i; if(vo_flags&2) break;
+ j=i; vo_flags=flags; if(flags&2) break;
}
}
if(j<0){
// TODO: no match - we should use conversion...
+ if(strcmp(vf->info->name,"scale")){
+ vf=vf_open_filter(vf,"scale",NULL);
+ goto csp_again;
+ }
mp_msg(MSGT_CPLAYER,MSGL_FATAL,MSGTR_VOincompCodec);
return 0; // failed
}
out_fmt=sh->codec->outfmt[j];
sh->outfmtidx=j;
+ sh->vfilter=vf;
// autodetect flipping
if(flip==-1){
@@ -167,6 +181,11 @@ int mpcodecs_config_vo(sh_video_t *sh, int w, int h, unsigned int preferred_outf
if(!(sh->codec->outflags[j]&CODECS_FLAG_NOFLIP))
flip=1;
}
+ if(vo_flags&VFCAP_FLIPPED) flip^=1;
+ if(flip && !(vo_flags&VFCAP_FLIP)){
+ // we need to flip, but no flipping filter avail.
+ sh->vfilter=vf=vf_open_filter(vf,"flip",NULL);
+ }
// time to do aspect ratio corrections...