Move flip and softzoom to options struct

This commit is contained in:
Uoti Urpala 2008-04-24 07:14:05 +03:00
parent 0dc3a72273
commit 1351b50ea5
6 changed files with 14 additions and 18 deletions

View File

@ -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},

View File

@ -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;

View File

@ -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,

View File

@ -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",

View File

@ -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;

View File

@ -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;