Mercurial > mplayer.hg
comparison libmpcodecs/vd.c @ 15212:05aa13cdf92f
replace VO and VF numeric flags with #defined identifiers
author | henry |
---|---|
date | Mon, 18 Apr 2005 15:52:38 +0000 |
parents | 5723c4b2a2ea |
children | 3fe3b2b3a6ce |
comparison
equal
deleted
inserted
replaced
15211:d42f22a1503b | 15212:05aa13cdf92f |
---|---|
146 int screen_size_x=0;//SCREEN_SIZE_X; | 146 int screen_size_x=0;//SCREEN_SIZE_X; |
147 int screen_size_y=0;//SCREEN_SIZE_Y; | 147 int screen_size_y=0;//SCREEN_SIZE_Y; |
148 // vo_functions_t* video_out=sh->video_out; | 148 // vo_functions_t* video_out=sh->video_out; |
149 vf_instance_t* vf=sh->vfilter,*sc=NULL; | 149 vf_instance_t* vf=sh->vfilter,*sc=NULL; |
150 int palette=0; | 150 int palette=0; |
151 int vocfg_flags=0; | |
151 | 152 |
152 if(!sh->disp_w || !sh->disp_h) | 153 if(!sh->disp_w || !sh->disp_h) |
153 mp_msg(MSGT_DECVIDEO,MSGL_WARN, MSGTR_CodecDidNotSet); | 154 mp_msg(MSGT_DECVIDEO,MSGL_WARN, MSGTR_CodecDidNotSet); |
154 /* XXX: HACK, if sh->disp_* aren't set, | 155 /* XXX: HACK, if sh->disp_* aren't set, |
155 * but we have w and h, set them :: atmos */ | 156 * but we have w and h, set them :: atmos */ |
186 int flags; | 187 int flags; |
187 out_fmt=sh->codec->outfmt[i]; | 188 out_fmt=sh->codec->outfmt[i]; |
188 if(out_fmt==(unsigned int)0xFFFFFFFF) continue; | 189 if(out_fmt==(unsigned int)0xFFFFFFFF) continue; |
189 flags=vf->query_format(vf,out_fmt); | 190 flags=vf->query_format(vf,out_fmt); |
190 mp_msg(MSGT_CPLAYER,MSGL_DBG2,"vo_debug: query(%s) returned 0x%X (i=%d) \n",vo_format_name(out_fmt),flags,i); | 191 mp_msg(MSGT_CPLAYER,MSGL_DBG2,"vo_debug: query(%s) returned 0x%X (i=%d) \n",vo_format_name(out_fmt),flags,i); |
191 if((flags&2) || (flags && j<0)){ | 192 if((flags&VFCAP_CSP_SUPPORTED_BY_HW) || (flags&VFCAP_CSP_SUPPORTED && j<0)){ |
192 // check (query) if codec really support this outfmt... | 193 // check (query) if codec really support this outfmt... |
193 sh->outfmtidx=j; // pass index to the control() function this way | 194 sh->outfmtidx=j; // pass index to the control() function this way |
194 if(mpvdec->control(sh,VDCTRL_QUERY_FORMAT,&out_fmt)==CONTROL_FALSE){ | 195 if(mpvdec->control(sh,VDCTRL_QUERY_FORMAT,&out_fmt)==CONTROL_FALSE){ |
195 mp_msg(MSGT_CPLAYER,MSGL_DBG2,"vo_debug: codec query_format(%s) returned FALSE\n",vo_format_name(out_fmt)); | 196 mp_msg(MSGT_CPLAYER,MSGL_DBG2,"vo_debug: codec query_format(%s) returned FALSE\n",vo_format_name(out_fmt)); |
196 continue; | 197 continue; |
197 } | 198 } |
198 j=i; vo_flags=flags; if(flags&2) break; | 199 j=i; vo_flags=flags; if(flags&VFCAP_CSP_SUPPORTED_BY_HW) break; |
199 } else | 200 } else |
200 if(!palette && !(flags&3) && (out_fmt==IMGFMT_RGB8||out_fmt==IMGFMT_BGR8)){ | 201 if(!palette && !(flags&(VFCAP_CSP_SUPPORTED_BY_HW|VFCAP_CSP_SUPPORTED)) && (out_fmt==IMGFMT_RGB8||out_fmt==IMGFMT_BGR8)){ |
201 sh->outfmtidx=j; // pass index to the control() function this way | 202 sh->outfmtidx=j; // pass index to the control() function this way |
202 if(mpvdec->control(sh,VDCTRL_QUERY_FORMAT,&out_fmt)!=CONTROL_FALSE) | 203 if(mpvdec->control(sh,VDCTRL_QUERY_FORMAT,&out_fmt)!=CONTROL_FALSE) |
203 palette=1; | 204 palette=1; |
204 } | 205 } |
205 } | 206 } |
298 } else { | 299 } else { |
299 mp_msg(MSGT_CPLAYER,MSGL_INFO,MSGTR_MovieAspectUndefined); | 300 mp_msg(MSGT_CPLAYER,MSGL_INFO,MSGTR_MovieAspectUndefined); |
300 } | 301 } |
301 } | 302 } |
302 | 303 |
304 vocfg_flags = (fullscreen ? VOFLAG_FULLSCREEN:0) | |
305 | (vidmode ? VOFLAG_MODESWITCHING:0) | |
306 | (softzoom ? VOFLAG_SWSCALE:0) | |
307 | (flip ? VOFLAG_FLIPPING:0); | |
308 | |
303 // Time to config libvo! | 309 // Time to config libvo! |
304 mp_msg(MSGT_CPLAYER,MSGL_V,"VO Config (%dx%d->%dx%d,flags=%d,'%s',0x%X)\n", | 310 mp_msg(MSGT_CPLAYER,MSGL_V,"VO Config (%dx%d->%dx%d,flags=%d,'%s',0x%X)\n", |
305 sh->disp_w,sh->disp_h, | 311 sh->disp_w,sh->disp_h, |
306 screen_size_x,screen_size_y, | 312 screen_size_x,screen_size_y, |
307 fullscreen|(vidmode<<1)|(softzoom<<2)|(flip<<3), | 313 vocfg_flags, |
308 "MPlayer",out_fmt); | 314 "MPlayer",out_fmt); |
309 | 315 |
310 vf->w = sh->disp_w; | 316 vf->w = sh->disp_w; |
311 vf->h = sh->disp_h; | 317 vf->h = sh->disp_h; |
312 if(vf_config_wrapper(vf,sh->disp_w,sh->disp_h, | 318 if(vf_config_wrapper(vf,sh->disp_w,sh->disp_h, |
313 screen_size_x,screen_size_y, | 319 screen_size_x,screen_size_y, |
314 fullscreen|(vidmode<<1)|(softzoom<<2)|(flip<<3), | 320 vocfg_flags, |
315 out_fmt)==0){ | 321 out_fmt)==0){ |
316 // "MPlayer",out_fmt)){ | 322 // "MPlayer",out_fmt)){ |
317 mp_msg(MSGT_CPLAYER,MSGL_WARN,MSGTR_CannotInitVO); | 323 mp_msg(MSGT_CPLAYER,MSGL_WARN,MSGTR_CannotInitVO); |
318 sh->vf_inited=-1; | 324 sh->vf_inited=-1; |
319 return 0; | 325 return 0; |