diff options
Diffstat (limited to 'libmpcodecs')
-rw-r--r-- | libmpcodecs/vd.c | 16 | ||||
-rw-r--r-- | libmpcodecs/vd_zrmjpeg.c | 3 | ||||
-rw-r--r-- | libmpcodecs/ve_divx4.c | 6 | ||||
-rw-r--r-- | libmpcodecs/ve_libdv.c | 4 | ||||
-rw-r--r-- | libmpcodecs/ve_nuv.c | 2 | ||||
-rw-r--r-- | libmpcodecs/ve_qtvideo.c | 2 | ||||
-rw-r--r-- | libmpcodecs/ve_vfw.c | 2 | ||||
-rw-r--r-- | libmpcodecs/vf_flip.c | 3 | ||||
-rw-r--r-- | libmpcodecs/vf_vo.c | 8 |
9 files changed, 27 insertions, 19 deletions
diff --git a/libmpcodecs/vd.c b/libmpcodecs/vd.c index 4b20ab4fee..42b0697f2a 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 // vo_functions_t* video_out=sh->video_out; vf_instance_t* vf=sh->vfilter,*sc=NULL; int palette=0; + int vocfg_flags=0; if(!sh->disp_w || !sh->disp_h) mp_msg(MSGT_DECVIDEO,MSGL_WARN, MSGTR_CodecDidNotSet); @@ -188,16 +189,16 @@ csp_again: 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)){ + if((flags&VFCAP_CSP_SUPPORTED_BY_HW) || (flags&VFCAP_CSP_SUPPORTED && j<0)){ // check (query) if codec really support this outfmt... sh->outfmtidx=j; // pass index to the control() function this way if(mpvdec->control(sh,VDCTRL_QUERY_FORMAT,&out_fmt)==CONTROL_FALSE){ mp_msg(MSGT_CPLAYER,MSGL_DBG2,"vo_debug: codec query_format(%s) returned FALSE\n",vo_format_name(out_fmt)); continue; } - j=i; vo_flags=flags; if(flags&2) break; + j=i; vo_flags=flags; if(flags&VFCAP_CSP_SUPPORTED_BY_HW) break; } else - if(!palette && !(flags&3) && (out_fmt==IMGFMT_RGB8||out_fmt==IMGFMT_BGR8)){ + if(!palette && !(flags&(VFCAP_CSP_SUPPORTED_BY_HW|VFCAP_CSP_SUPPORTED)) && (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; @@ -300,18 +301,23 @@ csp_again: } } + vocfg_flags = (fullscreen ? VOFLAG_FULLSCREEN:0) + | (vidmode ? VOFLAG_MODESWITCHING:0) + | (softzoom ? VOFLAG_SWSCALE:0) + | (flip ? VOFLAG_FLIPPING:0); + // Time to config libvo! mp_msg(MSGT_CPLAYER,MSGL_V,"VO Config (%dx%d->%dx%d,flags=%d,'%s',0x%X)\n", sh->disp_w,sh->disp_h, screen_size_x,screen_size_y, - fullscreen|(vidmode<<1)|(softzoom<<2)|(flip<<3), + vocfg_flags, "MPlayer",out_fmt); vf->w = sh->disp_w; vf->h = sh->disp_h; if(vf_config_wrapper(vf,sh->disp_w,sh->disp_h, screen_size_x,screen_size_y, - fullscreen|(vidmode<<1)|(softzoom<<2)|(flip<<3), + vocfg_flags, out_fmt)==0){ // "MPlayer",out_fmt)){ mp_msg(MSGT_CPLAYER,MSGL_WARN,MSGTR_CannotInitVO); diff --git a/libmpcodecs/vd_zrmjpeg.c b/libmpcodecs/vd_zrmjpeg.c index 39a97e1e4b..660b306b25 100644 --- a/libmpcodecs/vd_zrmjpeg.c +++ b/libmpcodecs/vd_zrmjpeg.c @@ -9,6 +9,7 @@ #include "config.h" #include "mp_msg.h" +#include "vfcap.h" /* some convenient #define's, is this portable enough? */ #define VERBOSE(...) mp_msg(MSGT_DECVIDEO, MSGL_V, "vd_zrmjpeg: " __VA_ARGS__) @@ -38,7 +39,7 @@ typedef struct { static int query_format(sh_video_t *sh, unsigned int format) { vd_zrmjpeg_ctx_t *ctx = sh->context; - if (format == ctx->preferred_csp) return CONTROL_TRUE; + if (format == ctx->preferred_csp) return VFCAP_CSP_SUPPORTED; return CONTROL_FALSE; } diff --git a/libmpcodecs/ve_divx4.c b/libmpcodecs/ve_divx4.c index 0e4a7e3c1d..29612ce0b4 100644 --- a/libmpcodecs/ve_divx4.c +++ b/libmpcodecs/ve_divx4.c @@ -376,13 +376,13 @@ static int query_format(struct vf_instance_s* vf, unsigned int fmt){ case IMGFMT_YV12: case IMGFMT_IYUV: case IMGFMT_I420: - return 3; // no conversion + return VFCAP_CSP_SUPPORTED | VFCAP_CSP_SUPPORTED_BY_HW; // no conversion case IMGFMT_YUY2: case IMGFMT_UYVY: - return 1; // conversion + return VFCAP_CSP_SUPPORTED; // conversion case IMGFMT_RGB24: case IMGFMT_BGR24: - return 1 | VFCAP_FLIPPED; // conversion+flipped + return VFCAP_CSP_SUPPORTED | VFCAP_FLIPPED; // conversion+flipped } return 0; } diff --git a/libmpcodecs/ve_libdv.c b/libmpcodecs/ve_libdv.c index 22d9e92b4b..3e910d0dcf 100644 --- a/libmpcodecs/ve_libdv.c +++ b/libmpcodecs/ve_libdv.c @@ -66,8 +66,8 @@ static int control(struct vf_instance_s* vf, int request, void* data){ } static int query_format(struct vf_instance_s* vf, unsigned int fmt){ - if(fmt==IMGFMT_YUY2) return 3; - if(fmt==IMGFMT_RGB24) return 1; + if(fmt==IMGFMT_YUY2) return VFCAP_CSP_SUPPORTED | VFCAP_CSP_SUPPORTED_BY_HW; + if(fmt==IMGFMT_RGB24) return VFCAP_CSP_SUPPORTED; return 0; } diff --git a/libmpcodecs/ve_nuv.c b/libmpcodecs/ve_nuv.c index bee798617d..1cff1bfb42 100644 --- a/libmpcodecs/ve_nuv.c +++ b/libmpcodecs/ve_nuv.c @@ -93,7 +93,7 @@ static int control(struct vf_instance_s* vf, int request, void* data){ } static int query_format(struct vf_instance_s* vf, unsigned int fmt){ - if(fmt==IMGFMT_I420) return 3; + if(fmt==IMGFMT_I420) return VFCAP_CSP_SUPPORTED | VFCAP_CSP_SUPPORTED_BY_HW; return 0; } diff --git a/libmpcodecs/ve_qtvideo.c b/libmpcodecs/ve_qtvideo.c index f871de2755..892a9d0235 100644 --- a/libmpcodecs/ve_qtvideo.c +++ b/libmpcodecs/ve_qtvideo.c @@ -166,7 +166,7 @@ static int control(struct vf_instance_s* vf, int request, void* data){ } static int query_format(struct vf_instance_s* vf, unsigned int fmt){ - if(fmt==IMGFMT_YUY2) return 3; + if(fmt==IMGFMT_YUY2) return VFCAP_CSP_SUPPORTED | VFCAP_CSP_SUPPORTED_BY_HW; return 0; } diff --git a/libmpcodecs/ve_vfw.c b/libmpcodecs/ve_vfw.c index 1d31302085..511aa42e2d 100644 --- a/libmpcodecs/ve_vfw.c +++ b/libmpcodecs/ve_vfw.c @@ -234,7 +234,7 @@ static int control(struct vf_instance_s* vf, int request, void* data){ } static int query_format(struct vf_instance_s* vf, unsigned int fmt){ - if(fmt==IMGFMT_BGR24) return 3 | VFCAP_FLIPPED; + if(fmt==IMGFMT_BGR24) return VFCAP_CSP_SUPPORTED | VFCAP_CSP_SUPPORTED_BY_HW | VFCAP_FLIPPED; return 0; } diff --git a/libmpcodecs/vf_flip.c b/libmpcodecs/vf_flip.c index aab23b01dd..bca671c686 100644 --- a/libmpcodecs/vf_flip.c +++ b/libmpcodecs/vf_flip.c @@ -8,13 +8,14 @@ #include "mp_image.h" #include "vf.h" +#include "../libvo/video_out.h" //===========================================================================// static int config(struct vf_instance_s* vf, int width, int height, int d_width, int d_height, unsigned int flags, unsigned int outfmt){ - flags&=~8; // remove the FLIP flag + flags&=~VOFLAG_FLIPPING; // remove the FLIP flag return vf_next_config(vf,width,height,d_width,d_height,flags,outfmt); } diff --git a/libmpcodecs/vf_vo.c b/libmpcodecs/vf_vo.c index 476de8af92..08e3d12064 100644 --- a/libmpcodecs/vf_vo.c +++ b/libmpcodecs/vf_vo.c @@ -32,10 +32,10 @@ static int config(struct vf_instance_s* vf, width, height, d_width, d_height, vo_format_name(outfmt), - (flags&1)?" [fs]":"", - (flags&2)?" [vm]":"", - (flags&4)?" [zoom]":"", - (flags&8)?" [flip]":""); + (flags&VOFLAG_FULLSCREEN)?" [fs]":"", + (flags&VOFLAG_MODESWITCHING)?" [vm]":"", + (flags&VOFLAG_SWSCALE)?" [zoom]":"", + (flags&VOFLAG_FLIPPING)?" [flip]":""); mp_msg(MSGT_CPLAYER,MSGL_V,"VO: Description: %s\n",info->name); mp_msg(MSGT_CPLAYER,MSGL_V,"VO: Author: %s\n", info->author); if(info->comment && strlen(info->comment) > 0) |