From 1351b50ea5e12d0b316c0670a525f1a75be3100b Mon Sep 17 00:00:00 2001 From: Uoti Urpala Date: Thu, 24 Apr 2008 07:14:05 +0300 Subject: Move flip and softzoom to options struct --- cfg-common-opts.h | 8 ++++---- cfg-common.h | 2 -- defaultopts.c | 1 + libmpcodecs/vd.c | 16 +++++++--------- mplayer.h | 3 --- options.h | 2 ++ 6 files changed, 14 insertions(+), 18 deletions(-) diff --git a/cfg-common-opts.h b/cfg-common-opts.h index a8426656bb..05c06e6bbe 100644 --- a/cfg-common-opts.h +++ b/cfg-common-opts.h @@ -225,14 +225,14 @@ // scaling: {"sws", &sws_flags, CONF_TYPE_INT, 0, 0, 2, NULL}, {"ssf", scaler_filter_conf, CONF_TYPE_SUBCONFIG, 0, 0, 0, NULL}, - {"zoom", &softzoom, CONF_TYPE_FLAG, 0, 0, 1, NULL}, - {"nozoom", &softzoom, CONF_TYPE_FLAG, 0, 1, 0, NULL}, + OPT_FLAG_ON("zoom", softzoom, 0), + OPT_FLAG_OFF("nozoom", softzoom, 0), {"aspect", &movie_aspect, CONF_TYPE_FLOAT, CONF_RANGE, 0.2, 3.0, NULL}, {"noaspect", &movie_aspect, CONF_TYPE_FLAG, 0, 0, 0, NULL}, {"xy", &screen_size_xy, CONF_TYPE_FLOAT, CONF_RANGE, 0.001, 4096, NULL}, - {"flip", &flip, CONF_TYPE_FLAG, 0, -1, 1, NULL}, - {"noflip", &flip, CONF_TYPE_FLAG, 0, -1, 0, NULL}, + OPT_FLAG_CONSTANTS("flip", flip, 0, -1, 1), + OPT_FLAG_CONSTANTS("noflip", flip, 0, -1, 0), {"tsfastparse", "-tsfastparse is no longer a valid option.\n", CONF_TYPE_PRINT, CONF_NOCFG ,0,0, NULL }, {"tsprog", &ts_prog, CONF_TYPE_INT, CONF_RANGE, 0, 65534, NULL}, diff --git a/cfg-common.h b/cfg-common.h index ddac0acdac..e5225e2504 100644 --- a/cfg-common.h +++ b/cfg-common.h @@ -10,8 +10,6 @@ extern int mp_msg_module; // codec/filter opts: (defined at libmpcodecs/vd.c) extern float screen_size_xy; extern float movie_aspect; -extern int softzoom; -extern int flip; /* defined in codec-cfg.c */ extern char * codecs_file; diff --git a/defaultopts.c b/defaultopts.c index d55d9706d5..57425ac746 100644 --- a/defaultopts.c +++ b/defaultopts.c @@ -14,6 +14,7 @@ void set_default_mplayer_options(struct MPOpts *opts) .video_id = -1, .sub_id = -2, .playback_speed = 1., + .flip = -1, .lavc_param = (struct lavc_param){ .workaround_bugs = 1, // autodetect .error_resilience = 2, diff --git a/libmpcodecs/vd.c b/libmpcodecs/vd.c index c123423411..528b150c1a 100644 --- a/libmpcodecs/vd.c +++ b/libmpcodecs/vd.c @@ -111,8 +111,6 @@ vd_functions_t* mpcodecs_vd_drivers[] = { #include "libvo/video_out.h" // libvo opts: -int softzoom=0; -int flip=-1; int opt_screen_size_x=0; int opt_screen_size_y=0; float screen_size_xy=0; @@ -232,14 +230,14 @@ csp_again: sh->vfilter=vf; // autodetect flipping - if(flip==-1){ - flip=0; + if(opts->flip==-1){ + opts->flip=0; if(sh->codec->outflags[j]&CODECS_FLAG_FLIP) if(!(sh->codec->outflags[j]&CODECS_FLAG_NOFLIP)) - flip=1; + opts->flip=1; } - if(vo_flags&VFCAP_FLIPPED) flip^=1; - if(flip && !(vo_flags&VFCAP_FLIP)){ + if(vo_flags&VFCAP_FLIPPED) opts->flip^=1; + if(opts->flip && !(vo_flags&VFCAP_FLIP)){ // we need to flip, but no flipping filter avail. vf_add_before_vo(&vf, "flip", NULL); sh->vfilter = vf; @@ -292,8 +290,8 @@ csp_again: vocfg_flags = (opts->fullscreen ? VOFLAG_FULLSCREEN:0) | (opts->vidmode ? VOFLAG_MODESWITCHING:0) - | (softzoom ? VOFLAG_SWSCALE:0) - | (flip ? VOFLAG_FLIPPING:0); + | (opts->softzoom ? VOFLAG_SWSCALE:0) + | (opts->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", diff --git a/mplayer.h b/mplayer.h index adfcf60938..143ddbe6aa 100644 --- a/mplayer.h +++ b/mplayer.h @@ -36,9 +36,6 @@ extern char * filename; extern int stream_cache_size; extern int autosync; -// libmpcodecs: -extern int flip; - extern int frame_dropping; extern int auto_quality; diff --git a/options.h b/options.h index 55fbedb895..3369948080 100644 --- a/options.h +++ b/options.h @@ -18,6 +18,8 @@ typedef struct MPOpts { int video_id; int sub_id; float playback_speed; + int softzoom; + int flip; struct lavc_param { int workaround_bugs; int error_resilience; -- cgit v1.2.3