diff options
author | Alexander Preisinger <alexander.preisinger@gmail.com> | 2013-03-04 22:41:27 +0100 |
---|---|---|
committer | Alexander Preisinger <alexander.preisinger@gmail.com> | 2013-03-04 23:32:47 +0100 |
commit | 1198c031e4233a0cff5aa7d24aab986163f6903a (patch) | |
tree | bff49197908452f3ad1363edcf4c527db9bf1fe0 /core | |
parent | 4949992264d78d6dd22c0f6c611850402fd6eb30 (diff) | |
download | mpv-1198c031e4233a0cff5aa7d24aab986163f6903a.tar.bz2 mpv-1198c031e4233a0cff5aa7d24aab986163f6903a.tar.xz |
vo: Separate vo options from MPOpts
Separate the video output options from the big MPOpts structure and also only
pass the new mp_vo_opts structure to the vo backend.
Move video_driver_list into mp_vo_opts
Diffstat (limited to 'core')
-rw-r--r-- | core/cfg-mplayer.h | 2 | ||||
-rw-r--r-- | core/command.c | 6 | ||||
-rw-r--r-- | core/defaultopts.c | 2 | ||||
-rw-r--r-- | core/mplayer.c | 10 | ||||
-rw-r--r-- | core/options.h | 75 |
5 files changed, 49 insertions, 46 deletions
diff --git a/core/cfg-mplayer.h b/core/cfg-mplayer.h index 6a3d75ce21..af01a999d1 100644 --- a/core/cfg-mplayer.h +++ b/core/cfg-mplayer.h @@ -527,7 +527,7 @@ const m_option_t mplayer_opts[]={ /* name, pointer, type, flags, min, max */ //---------------------- libao/libvo options ------------------------ - OPT_STRINGLIST("vo", video_driver_list, 0), + OPT_STRINGLIST("vo", vo.video_driver_list, 0), OPT_STRINGLIST("ao", audio_driver_list, 0), OPT_FLAG("fixed-vo", fixed_vo, CONF_GLOBAL), OPT_FLAG("ontop", vo.ontop, 0), diff --git a/core/command.c b/core/command.c index 271db5b117..3553a192ad 100644 --- a/core/command.c +++ b/core/command.c @@ -850,16 +850,16 @@ static int mp_property_fullscreen(m_option_t *prop, void *arg, MPContext *mpctx) { - struct MPOpts *opts = mpctx->video_out->opts; + struct mp_vo_opts *opts = mpctx->video_out->opts; if (!mpctx->video_out) return M_PROPERTY_UNAVAILABLE; if (action == M_PROPERTY_SET) { - if (opts->vo.fs == !!*(int *) arg) + if (opts->fs == !!*(int *) arg) return M_PROPERTY_OK; if (mpctx->video_out->config_ok) vo_control(mpctx->video_out, VOCTRL_FULLSCREEN, 0); - mpctx->opts.fullscreen = opts->vo.fs; + mpctx->opts.fullscreen = opts->fs; return M_PROPERTY_OK; } return mp_property_generic_option(prop, action, arg, mpctx); diff --git a/core/defaultopts.c b/core/defaultopts.c index b551f05da1..859e50d855 100644 --- a/core/defaultopts.c +++ b/core/defaultopts.c @@ -9,7 +9,6 @@ void set_default_mplayer_options(struct MPOpts *opts) { *opts = (const struct MPOpts){ .audio_driver_list = NULL, - .video_driver_list = NULL, .audio_decoders = "-spdif:*", // never select spdif by default .video_decoders = NULL, .fixed_vo = 1, @@ -19,6 +18,7 @@ void set_default_mplayer_options(struct MPOpts *opts) .mixer_init_mute = -1, .ao_buffersize = -1, .vo = { + .video_driver_list = NULL, .cursor_autohide_delay = 1000, .monitor_pixel_aspect = 1.0, .panscanrange = 1.0, diff --git a/core/mplayer.c b/core/mplayer.c index d217f98932..041b7da67b 100644 --- a/core/mplayer.c +++ b/core/mplayer.c @@ -2359,7 +2359,7 @@ int reinit_video_chain(struct MPContext *mpctx) //================== Init VIDEO (codec & libvo) ========================== if (!opts->fixed_vo || !(mpctx->initialized_flags & INITIALIZED_VO)) { mpctx->video_out - = init_best_video_out(opts, mpctx->key_fifo, mpctx->input, + = init_best_video_out(&opts->vo, mpctx->key_fifo, mpctx->input, mpctx->encode_lavc_ctx); if (!mpctx->video_out) { mp_tmsg(MSGT_CPLAYER, MSGL_FATAL, "Error opening/initializing " @@ -3850,9 +3850,9 @@ static void play_current_file(struct MPContext *mpctx) load_per_extension_config(mpctx->mconfig, mpctx->filename); load_per_file_config(mpctx->mconfig, mpctx->filename); - if (opts->video_driver_list) + if (opts->vo.video_driver_list) load_per_output_config(mpctx->mconfig, PROFILE_CFG_VO, - opts->video_driver_list[0]); + opts->vo.video_driver_list[0]); if (opts->audio_driver_list) load_per_output_config(mpctx->mconfig, PROFILE_CFG_AO, opts->audio_driver_list[0]); @@ -4242,8 +4242,8 @@ static bool handle_help_options(struct MPContext *mpctx) { struct MPOpts *opts = &mpctx->opts; int opt_exit = 0; - if (opts->video_driver_list && - strcmp(opts->video_driver_list[0], "help") == 0) { + if (opts->vo.video_driver_list && + strcmp(opts->vo.video_driver_list[0], "help") == 0) { list_video_out(); opt_exit = 1; } diff --git a/core/options.h b/core/options.h index 9f54598361..3d4c05bcc1 100644 --- a/core/options.h +++ b/core/options.h @@ -4,8 +4,45 @@ #include <stdbool.h> #include "core/m_option.h" -typedef struct MPOpts { +typedef struct mp_vo_opts { char **video_driver_list; + + int screenwidth; + int screenheight; + int ontop; + bool fs; + int vsync; + int screen_id; + int fsscreen_id; + int stop_screensaver; + char *winname; + char** fstype_list; + + float panscan; + float panscanrange; + + struct m_geometry geometry; + struct m_geometry autofit; + struct m_geometry autofit_larger; + + int fsmode; + int keepaspect; + int border; + + int colorkey; + + int nomouse_input; + int enable_mouse_movements; + int cursor_autohide_delay; + + int64_t WinID; + + float force_monitor_aspect; + float monitor_pixel_aspect; + int force_window_position; +} mp_vo_opts; + +typedef struct MPOpts { char **audio_driver_list; int fixed_vo; char *mixer_device; @@ -17,41 +54,7 @@ typedef struct MPOpts { int gapless_audio; int ao_buffersize; - struct output_conf { - int screenwidth; - int screenheight; - int ontop; - bool fs; - int vsync; - int screen_id; - int fsscreen_id; - int stop_screensaver; - char *winname; - char** fstype_list; - - float panscan; - float panscanrange; - - struct m_geometry geometry; - struct m_geometry autofit; - struct m_geometry autofit_larger; - - int fsmode; - int keepaspect; - int border; - - int colorkey; - - int nomouse_input; - int enable_mouse_movements; - int cursor_autohide_delay; - - int64_t WinID; - - float force_monitor_aspect; - float monitor_pixel_aspect; - int force_window_position; - } vo; + mp_vo_opts vo; char *wintitle; int force_rgba_osd; |