1
mirror of https://github.com/mpv-player/mpv synced 2024-12-28 06:03:45 +01:00

Move vf_settings to options struct

This commit is contained in:
Uoti Urpala 2008-04-25 13:58:12 +03:00
parent e08c8d6378
commit 0885f4e5b5
8 changed files with 13 additions and 10 deletions

View File

@ -203,7 +203,7 @@
{"af-adv", audio_filter_conf, CONF_TYPE_SUBCONFIG, 0, 0, 0, NULL},
{"vop", "-vop has been removed, use -vf instead.\n", CONF_TYPE_PRINT, CONF_NOCFG ,0,0, NULL},
{"vf*", &vf_settings, CONF_TYPE_OBJ_SETTINGS_LIST, 0, 0, 0, &vf_obj_list},
OPT_SETTINGSLIST("vf*", vf_settings, 0, &vf_obj_list),
// select audio/video codec (by name) or codec family (by number):
// {"afm", &audio_family, CONF_TYPE_INT, CONF_MIN, 0, 22, NULL}, // keep ranges in sync
// {"vfm", &video_family, CONF_TYPE_INT, CONF_MIN, 0, 29, NULL}, // with codec-cfg.c

View File

@ -223,7 +223,6 @@ extern int mf_w;
extern int mf_h;
extern double mf_fps;
extern char * mf_type;
extern m_obj_settings_t* vf_settings;
extern m_obj_list_t vf_obj_list;
const m_option_t mfopts_conf[]={

View File

@ -195,7 +195,6 @@ static const vf_info_t* const filter_list[]={
};
// For the vf option
m_obj_settings_t* vf_settings = NULL;
const m_obj_list_t vf_obj_list = {
(void**)filter_list,
M_ST_OFF(vf_info_t,name),
@ -692,7 +691,9 @@ void vf_next_draw_slice(struct vf_instance* vf,unsigned char** src, int * stride
//============================================================================
vf_instance_t* append_filters(vf_instance_t* last){
vf_instance_t *append_filters(vf_instance_t* last,
struct m_obj_settings *vf_settings)
{
struct MPOpts *opts = last->opts;
vf_instance_t* vf;
int i;

View File

@ -118,7 +118,8 @@ int vf_next_query_format(struct vf_instance* vf, unsigned int fmt);
int vf_next_put_image(struct vf_instance* vf,mp_image_t *mpi, double pts);
void vf_next_draw_slice (struct vf_instance* vf, unsigned char** src, int* stride, int w,int h, int x, int y);
vf_instance_t* append_filters(vf_instance_t* last);
struct m_obj_settings;
vf_instance_t* append_filters(vf_instance_t* last, struct m_obj_settings *vf_settings);
void vf_uninit_filter(vf_instance_t* vf);
void vf_uninit_filter_chain(vf_instance_t* vf);

View File

@ -505,5 +505,6 @@ m_option_free(const m_option_t* opt,void* dst) {
#define OPT_INTRANGE(optname, varname, flags, min, max) {optname, NULL, &m_option_type_int, (flags)|CONF_RANGE, min, max, NULL, 1, offsetof(struct MPOpts, varname)}
#define OPT_FLOATRANGE(optname, varname, flags, min, max) {optname, NULL, &m_option_type_float, (flags)|CONF_RANGE, min, max, NULL, 1, offsetof(struct MPOpts, varname)}
#define OPT_STRING(optname, varname, flags) {optname, NULL, &m_option_type_string, flags, 0, 0, NULL, 1, offsetof(struct MPOpts, varname)}
#define OPT_SETTINGSLIST(optname, varname, flags, objlist) {optname, NULL, &m_option_type_obj_settings_list, flags, 0, 0, objlist, 1, offsetof(struct MPOpts, varname)}
#endif /* MPLAYER_M_OPTION_H */

View File

@ -893,7 +893,7 @@ default: {
char* vf_args[] = { "osd", "1", NULL };
sh_video->vfilter=vf_open_filter(&opts, sh_video->vfilter,"expand",vf_args);
}
sh_video->vfilter=append_filters(sh_video->vfilter);
sh_video->vfilter=append_filters(sh_video->vfilter, opts.vf_settings);
mp_msg(MSGT_CPLAYER,MSGL_INFO,"==========================================================================\n");
init_best_video_codec(sh_video,video_codec_list,video_fm_list);

View File

@ -2170,9 +2170,9 @@ int reinit_video_chain(struct MPContext *mpctx)
if(ass_enabled) {
int i;
int insert = 1;
if (vf_settings)
for (i = 0; vf_settings[i].name; ++i)
if (strcmp(vf_settings[i].name, "ass") == 0) {
if (opts->vf_settings)
for (i = 0; opts->vf_settings[i].name; ++i)
if (strcmp(opts->vf_settings[i].name, "ass") == 0) {
insert = 0;
break;
}
@ -2189,7 +2189,7 @@ int reinit_video_chain(struct MPContext *mpctx)
}
#endif
sh_video->vfilter=(void*)append_filters(sh_video->vfilter);
sh_video->vfilter=(void*)append_filters(sh_video->vfilter, opts->vf_settings);
#ifdef USE_ASS
if (ass_enabled)

View File

@ -28,6 +28,7 @@ typedef struct MPOpts {
int video_id;
int sub_id;
float playback_speed;
struct m_obj_settings *vf_settings;
int softzoom;
float movie_aspect;
float screen_size_xy;