summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--core/cfg-mplayer.h2
-rw-r--r--core/command.c6
-rw-r--r--core/defaultopts.c2
-rw-r--r--core/mplayer.c10
-rw-r--r--core/options.h75
-rw-r--r--video/out/aspect.c22
-rw-r--r--video/out/cocoa_common.m50
-rw-r--r--video/out/vo.c20
-rw-r--r--video/out/vo.h6
-rw-r--r--video/out/vo_caca.c4
-rw-r--r--video/out/vo_opengl.c4
-rw-r--r--video/out/vo_opengl_old.c2
-rw-r--r--video/out/vo_sdl.c32
-rw-r--r--video/out/vo_vdpau.c2
-rw-r--r--video/out/vo_x11.c10
-rw-r--r--video/out/vo_xv.c6
-rw-r--r--video/out/w32_common.c72
-rw-r--r--video/out/wayland_common.c24
-rw-r--r--video/out/x11_common.c154
19 files changed, 253 insertions, 250 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;
diff --git a/video/out/aspect.c b/video/out/aspect.c
index e7ca37a82d..cf2b0ca383 100644
--- a/video/out/aspect.c
+++ b/video/out/aspect.c
@@ -36,7 +36,7 @@ void aspect_save_videores(struct vo *vo, int w, int h, int d_w, int d_h)
void aspect_save_screenres(struct vo *vo, int scrw, int scrh)
{
mp_msg(MSGT_VO, MSGL_DBG2, "aspect_save_screenres %dx%d\n", scrw, scrh);
- struct MPOpts *opts = vo->opts;
+ struct mp_vo_opts *opts = vo->opts;
if (scrw <= 0 && scrh <= 0)
scrw = 1024;
if (scrh <= 0)
@@ -45,10 +45,10 @@ void aspect_save_screenres(struct vo *vo, int scrw, int scrh)
scrw = (scrh * 4 + 2) / 3;
vo->aspdat.scrw = scrw;
vo->aspdat.scrh = scrh;
- if (opts->vo.force_monitor_aspect)
- vo->monitor_par = opts->vo.force_monitor_aspect * scrh / scrw;
+ if (opts->force_monitor_aspect)
+ vo->monitor_par = opts->force_monitor_aspect * scrh / scrw;
else
- vo->monitor_par = 1.0 / opts->vo.monitor_pixel_aspect;
+ vo->monitor_par = 1.0 / opts->monitor_pixel_aspect;
}
/* aspect is called with the source resolution and the
@@ -88,7 +88,7 @@ static void get_max_dims(struct vo *vo, int *w, int *h, int zoom)
struct aspect_data *aspdat = &vo->aspdat;
*w = zoom ? aspdat->scrw : aspdat->prew;
*h = zoom ? aspdat->scrh : aspdat->preh;
- if (zoom && vo->opts->vo.WinID >= 0)
+ if (zoom && vo->opts->WinID >= 0)
zoom = A_WINZOOM;
if (zoom == A_WINZOOM) {
*w = vo->dwidth;
@@ -101,7 +101,7 @@ void aspect(struct vo *vo, int *srcw, int *srch, int zoom)
int fitw;
int fith;
get_max_dims(vo, &fitw, &fith, zoom);
- if (!zoom && vo->opts->vo.geometry.wh_valid) {
+ if (!zoom && vo->opts->geometry.wh_valid) {
mp_msg(MSGT_VO, MSGL_DBG2, "aspect(0) no aspect forced!\n");
return; // the user doesn't want to fix aspect
}
@@ -121,18 +121,18 @@ static void panscan_calc_internal(struct vo *vo, int zoom)
int vo_panscan_area;
int max_w, max_h;
get_max_dims(vo, &max_w, &max_h, zoom);
- struct MPOpts *opts = vo->opts;
+ struct mp_vo_opts *opts = vo->opts;
- if (opts->vo.panscanrange > 0) {
+ if (opts->panscanrange > 0) {
aspect(vo, &fwidth, &fheight, zoom);
vo_panscan_area = max_h - fheight;
if (!vo_panscan_area)
vo_panscan_area = max_w - fwidth;
- vo_panscan_area *= opts->vo.panscanrange;
+ vo_panscan_area *= opts->panscanrange;
} else
- vo_panscan_area = -opts->vo.panscanrange * max_h;
+ vo_panscan_area = -opts->panscanrange * max_h;
- vo->panscan_amount = opts->vo.fs || zoom == A_WINZOOM ? opts->vo.panscan : 0;
+ vo->panscan_amount = opts->fs || zoom == A_WINZOOM ? opts->panscan : 0;
vo->panscan_x = vo_panscan_area * vo->panscan_amount * vo->aspdat.asp;
vo->panscan_y = vo_panscan_area * vo->panscan_amount;
}
diff --git a/video/out/cocoa_common.m b/video/out/cocoa_common.m
index 6f7c374f6f..50b0d2889c 100644
--- a/video/out/cocoa_common.m
+++ b/video/out/cocoa_common.m
@@ -150,11 +150,11 @@ static struct vo_cocoa_state *vo_cocoa_init_state(struct vo *vo)
.windowed_frame = {{0,0},{0,0}},
.out_fs_resize = NO,
.display_cursor = 1,
- .vo_cursor_autohide_delay = vo->opts->vo.cursor_autohide_delay,
+ .vo_cursor_autohide_delay = vo->opts->cursor_autohide_delay,
.power_mgmt_assertion = kIOPMNullAssertionID,
.accumulated_scroll = 0,
};
- if (!vo->opts->vo.border) s->windowed_mask = NSBorderlessWindowMask;
+ if (!vo->opts->border) s->windowed_mask = NSBorderlessWindowMask;
return s;
}
@@ -278,26 +278,26 @@ static int get_screen_handle(int identifier, NSWindow *window, NSScreen **screen
static void update_screen_info(struct vo *vo)
{
struct vo_cocoa_state *s = vo->cocoa;
- struct MPOpts *opts = vo->opts;
+ struct mp_vo_opts *opts = vo->opts;
NSScreen *ws, *fss;
- get_screen_handle(opts->vo.screen_id, s->window, &ws);
+ get_screen_handle(opts->screen_id, s->window, &ws);
s->screen_frame = [ws frame];
- get_screen_handle(opts->vo.fsscreen_id, s->window, &fss);
+ get_screen_handle(opts->fsscreen_id, s->window, &fss);
s->fsscreen_frame = [fss frame];
}
void vo_cocoa_update_xinerama_info(struct vo *vo)
{
struct vo_cocoa_state *s = vo->cocoa;
- struct MPOpts *opts = vo->opts;
+ struct mp_vo_opts *opts = vo->opts;
update_screen_info(vo);
aspect_save_screenres(vo, s->screen_frame.size.width,
s->screen_frame.size.height);
- opts->vo.screenwidth = s->screen_frame.size.width;
- opts->vo.screenheight = s->screen_frame.size.height;
+ opts->screenwidth = s->screen_frame.size.width;
+ opts->screenheight = s->screen_frame.size.height;
vo->xinerama_x = s->screen_frame.origin.x;
vo->xinerama_y = s->screen_frame.origin.y;
}
@@ -338,9 +338,9 @@ static void vo_set_level(struct vo *vo, int ontop)
void vo_cocoa_ontop(struct vo *vo)
{
- struct MPOpts *opts = vo->opts;
- opts->vo.ontop = !opts->vo.ontop;
- vo_set_level(vo, opts->vo.ontop);
+ struct mp_vo_opts *opts = vo->opts;
+ opts->ontop = !opts->ontop;
+ vo_set_level(vo, opts->ontop);
}
static void update_state_sizes(struct vo_cocoa_state *s,
@@ -418,7 +418,7 @@ static void update_window(struct vo *vo)
if (s->current_video_size.width != s->previous_video_size.width ||
s->current_video_size.height != s->previous_video_size.height) {
- if (vo->opts->vo.fs) {
+ if (vo->opts->fs) {
// we will resize as soon as we get out of fullscreen
s->out_fs_resize = YES;
} else {
@@ -436,7 +436,7 @@ int vo_cocoa_config_window(struct vo *vo, uint32_t d_width,
int gl3profile)
{
struct vo_cocoa_state *s = vo->cocoa;
- struct MPOpts *opts = vo->opts;
+ struct mp_vo_opts *opts = vo->opts;
if (vo->config_count > 0) {
NSPoint origin = [s->window frame].origin;
@@ -463,7 +463,7 @@ int vo_cocoa_config_window(struct vo *vo, uint32_t d_width,
if (flags & VOFLAG_FULLSCREEN)
vo_cocoa_fullscreen(vo);
- vo_set_level(vo, opts->vo.ontop);
+ vo_set_level(vo, opts->ontop);
[s->window setContentSize:s->current_video_size];
[s->window setContentAspectRatio:s->current_video_size];
@@ -491,7 +491,7 @@ static void vo_cocoa_display_cursor(struct vo *vo, int requested_state)
{
struct vo_cocoa_state *s = vo->cocoa;
if (requested_state) {
- if (!vo->opts->vo.fs || s->vo_cursor_autohide_delay > -2) {
+ if (!vo->opts->fs || s->vo_cursor_autohide_delay > -2) {
s->display_cursor = requested_state;
CGDisplayShowCursor(kCGDirectMainDisplay);
}
@@ -510,7 +510,7 @@ int vo_cocoa_check_events(struct vo *vo)
int ms_time = (int) ([[NSProcessInfo processInfo] systemUptime] * 1000);
// automatically hide mouse cursor
- if (vo->opts->vo.fs && s->display_cursor &&
+ if (vo->opts->fs && s->display_cursor &&
(ms_time - s->cursor_timer >= s->vo_cursor_autohide_delay)) {
vo_cocoa_display_cursor(vo, 0);
s->cursor_timer = ms_time;
@@ -648,8 +648,8 @@ void create_menu()
- (void)fullscreen
{
struct vo_cocoa_state *s = _vo->cocoa;
- struct MPOpts *opts = _vo->opts;
- if (!opts->vo.fs) {
+ struct mp_vo_opts *opts = _vo->opts;
+ if (!opts->fs) {
update_screen_info(_vo);
if (current_screen_has_dock_or_menubar(_vo))
[NSApp setPresentationOptions:NSApplicationPresentationHideDock|
@@ -658,7 +658,7 @@ void create_menu()
[self setHasShadow:NO];
[self setStyleMask:s->fullscreen_mask];
[self setFrame:s->fsscreen_frame display:YES animate:NO];
- opts->vo.fs = true;
+ opts->fs = true;
vo_cocoa_display_cursor(_vo, 0);
[self setMovableByWindowBackground: NO];
} else {
@@ -672,7 +672,7 @@ void create_menu()
s->out_fs_resize = NO;
}
[self setContentAspectRatio:s->current_video_size];
- opts->vo.fs = false;
+ opts->fs = false;
vo_cocoa_display_cursor(_vo, 1);
[self setMovableByWindowBackground: YES];
}
@@ -697,7 +697,7 @@ void create_menu()
// this is only valid as a starting value. it will be rewritten in the
// -fullscreen method.
if (_vo) {
- return !_vo->opts->vo.fs;
+ return !_vo->opts->fs;
} else {
return NO;
}
@@ -735,7 +735,7 @@ void create_menu()
- (void)mouseMoved: (NSEvent *) theEvent
{
- if (_vo->opts->vo.fs)
+ if (_vo->opts->fs)
vo_cocoa_display_cursor(_vo, 1);
}
@@ -856,7 +856,7 @@ void create_menu()
- (void)applicationWillBecomeActive:(NSNotification *)aNotification
{
- if (_vo->opts->vo.fs && current_screen_has_dock_or_menubar(_vo)) {
+ if (_vo->opts->fs && current_screen_has_dock_or_menubar(_vo)) {
struct vo_cocoa_state *s = _vo->cocoa;
[self setLevel:s->window_level];
[NSApp setPresentationOptions:NSApplicationPresentationHideDock|
@@ -866,7 +866,7 @@ void create_menu()
- (void)applicationWillResignActive:(NSNotification *)aNotification
{
- if (_vo->opts->vo.fs) {
+ if (_vo->opts->fs) {
[self setLevel:NSNormalWindowLevel];
[NSApp setPresentationOptions:NSApplicationPresentationDefault];
}
@@ -893,7 +893,7 @@ void create_menu()
- (void)mulSize:(float)multiplier
{
- if (!_vo->opts->vo.fs) {
+ if (!_vo->opts->fs) {
NSSize size = {
.width = _vo->aspdat.prew * multiplier,
.height = _vo->aspdat.preh * multiplier
diff --git a/video/out/vo.c b/video/out/vo.c
index 50d2dd4193..9402bc9c82 100644
--- a/video/out/vo.c
+++ b/video/out/vo.c
@@ -293,7 +293,7 @@ static void replace_legacy_vo_name(bstr *name)
*name = new;
}
-struct vo *init_best_video_out(struct MPOpts *opts,
+struct vo *init_best_video_out(struct mp_vo_opts *opts,
struct mp_fifo *key_fifo,
struct input_ctx *input_ctx,
struct encode_lavc_context *encode_lavc_ctx)
@@ -386,21 +386,21 @@ static void apply_autofit(int *w, int *h, int scr_w, int scr_h,
// multi-monitor stuff, and possibly more.
static void determine_window_geometry(struct vo *vo, int d_w, int d_h)
{
- struct MPOpts *opts = vo->opts;
+ struct mp_vo_opts *opts = vo->opts;
- int scr_w = opts->vo.screenwidth;
- int scr_h = opts->vo.screenheight;
+ int scr_w = opts->screenwidth;
+ int scr_h = opts->screenheight;
// This is only for applying monitor pixel aspect
aspect(vo, &d_w, &d_h, A_NOZOOM);
- apply_autofit(&d_w, &d_h, scr_w, scr_h, &opts->vo.autofit, true);
- apply_autofit(&d_w, &d_h, scr_w, scr_h, &opts->vo.autofit_larger, false);
+ apply_autofit(&d_w, &d_h, scr_w, scr_h, &opts->autofit, true);
+ apply_autofit(&d_w, &d_h, scr_w, scr_h, &opts->autofit_larger, false);
- vo->dx = (int)(opts->vo.screenwidth - d_w) / 2;
- vo->dy = (int)(opts->vo.screenheight - d_h) / 2;
+ vo->dx = (int)(opts->screenwidth - d_w) / 2;
+ vo->dy = (int)(opts->screenheight - d_h) / 2;
m_geometry_apply(&vo->dx, &vo->dy, &d_w, &d_h, scr_w, scr_h,
- &opts->vo.geometry);
+ &opts->geometry);
vo->dx += vo->xinerama_x;
vo->dy += vo->xinerama_y;
@@ -562,7 +562,7 @@ const char *vo_get_window_title(struct vo *vo)
void vo_mouse_movement(struct vo *vo, int posx, int posy)
{
char cmd_str[40];
- if (!vo->opts->vo.enable_mouse_movements)
+ if (!vo->opts->enable_mouse_movements)
return;
snprintf(cmd_str, sizeof(cmd_str), "set_mouse_pos %i %i", posx, posy);
mp_input_queue_cmd(vo->input_ctx, mp_input_parse_cmd(bstr0(cmd_str), ""));
diff --git a/video/out/vo.h b/video/out/vo.h
index ce26269a91..5b05deb79b 100644
--- a/video/out/vo.h
+++ b/video/out/vo.h
@@ -244,7 +244,7 @@ struct vo {
const struct vo_driver *driver;
void *priv;
- struct MPOpts *opts;
+ struct mp_vo_opts *opts;
struct vo_x11_state *x11;
struct vo_w32_state *w32;
struct vo_cocoa_state *cocoa;
@@ -282,7 +282,7 @@ struct vo {
char *window_title;
};
-struct vo *init_best_video_out(struct MPOpts *opts,
+struct vo *init_best_video_out(struct mp_vo_opts *opts,
struct mp_fifo *key_fifo,
struct input_ctx *input_ctx,
struct encode_lavc_context *encode_lavc_ctx);
@@ -324,7 +324,7 @@ void vo_get_src_dst_rects(struct vo *vo, struct mp_rect *out_src,
static inline int aspect_scaling(struct vo *vo)
{
- return vo->opts->vo.keepaspect || vo->opts->vo.fs;
+ return vo->opts->keepaspect || vo->opts->fs;
}
#endif /* MPLAYER_VIDEO_OUT_H */
diff --git a/video/out/vo_caca.c b/video/out/vo_caca.c
index 885a6c6e9a..95f13781eb 100644
--- a/video/out/vo_caca.c
+++ b/video/out/vo_caca.c
@@ -175,12 +175,12 @@ static void check_events(struct vo *vo)
vo_mouse_movement(vo, cev.data.mouse.x, cev.data.mouse.y);
break;
case CACA_EVENT_MOUSE_PRESS:
- if (!vo->opts->vo.nomouse_input)
+ if (!vo->opts->nomouse_input)
mplayer_put_key(vo->key_fifo,
(MP_MOUSE_BTN0 + cev.data.mouse.button - 1) | MP_KEY_STATE_DOWN);
break;
case CACA_EVENT_MOUSE_RELEASE:
- if (!vo->opts->vo.nomouse_input)
+ if (!vo->opts->nomouse_input)
mplayer_put_key(vo->key_fifo,
MP_MOUSE_BTN0 + cev.data.mouse.button - 1);
break;
diff --git a/video/out/vo_opengl.c b/video/out/vo_opengl.c
index 6170852132..dbaede4461 100644
--- a/video/out/vo_opengl.c
+++ b/video/out/vo_opengl.c
@@ -1794,7 +1794,7 @@ static struct bstr load_file(struct gl_priv *p, void *talloc_ctx,
const char *filename)
{
struct bstr res = {0};
- stream_t *s = open_stream(filename, p->vo->opts, NULL);
+ stream_t *s = open_stream(filename, NULL, NULL);
if (s) {
res = stream_read_complete(s, talloc_ctx, 1000000000, 0);
free_stream(s);
@@ -2085,7 +2085,7 @@ static int preinit(struct vo *vo, const char *arg)
.colorspace = MP_CSP_DETAILS_DEFAULTS,
.use_npot = 1,
.use_pbo = hq,
- .swap_interval = vo->opts->vo.vsync,
+ .swap_interval = vo->opts->vsync,
.dither_depth = hq ? 0 : -1,
.fbo_format = hq ? GL_RGB16 : GL_RGB,
.use_scale_sep = 1,
diff --git a/video/out/vo_opengl_old.c b/video/out/vo_opengl_old.c
index d41a547847..7841d097d3 100644
--- a/video/out/vo_opengl_old.c
+++ b/video/out/vo_opengl_old.c
@@ -2113,7 +2113,7 @@ static int preinit(struct vo *vo, const char *arg)
.use_rectangle = -1,
.ati_hack = -1,
.force_pbo = -1,
- .swap_interval = vo->opts->vo.vsync,
+ .swap_interval = vo->opts->vsync,
.custom_prog = NULL,
.custom_tex = NULL,
.custom_tlin = 1,
diff --git a/video/out/vo_sdl.c b/video/out/vo_sdl.c
index b10a237b19..e59ef0472b 100644
--- a/video/out/vo_sdl.c
+++ b/video/out/vo_sdl.c
@@ -271,7 +271,7 @@ static bool try_create_renderer(struct vo *vo, int i, const char *driver,
if (!is_good_renderer(&ri, driver, vc->allow_sw, NULL))
return false;
- bool xy_valid = vo->opts->vo.geometry.xy_valid;
+ bool xy_valid = vo->opts->geometry.xy_valid;
// then actually try
vc->window = SDL_CreateWindow("MPV",
@@ -387,7 +387,7 @@ static void set_fullscreen(struct vo *vo, int fs)
// toggling fullscreen might recreate the window, so better guard for this
SDL_DisableScreenSaver();
- vo->opts->vo.fs = fs;
+ vo->opts->fs = fs;
force_resize(vo);
}
@@ -470,21 +470,21 @@ static void flip_page(struct vo *vo)
static void check_events(struct vo *vo)
{
struct priv *vc = vo->priv;
- struct MPOpts *opts = vo->opts;
+ struct mp_vo_opts *opts = vo->opts;
SDL_Event ev;
- if (opts->vo.cursor_autohide_delay >= 0) {
+ if (opts->cursor_autohide_delay >= 0) {
if (!vc->mouse_hidden &&
- (GetTimerMS() - vc->mouse_timer >= opts->vo.cursor_autohide_delay)) {
+ (GetTimerMS() - vc->mouse_timer >= opts->cursor_autohide_delay)) {
SDL_ShowCursor(0);
vc->mouse_hidden = 1;
}
- } else if (opts->vo.cursor_autohide_delay == -1) {
+ } else if (opts->cursor_autohide_delay == -1) {
if (vc->mouse_hidden) {
SDL_ShowCursor(1);
vc->mouse_hidden = 0;
}
- } else if (opts->vo.cursor_autohide_delay == -2) {
+ } else if (opts->cursor_autohide_delay == -2) {
if (!vc->mouse_hidden) {
SDL_ShowCursor(0);
vc->mouse_hidden = 1;
@@ -553,7 +553,7 @@ static void check_events(struct vo *vo)
break;
}
case SDL_MOUSEMOTION:
- if (opts->vo.cursor_autohide_delay >= 0) {
+ if (opts->cursor_autohide_delay >= 0) {
SDL_ShowCursor(1);
vc->mouse_hidden = 0;
vc->mouse_timer = GetTimerMS();
@@ -561,7 +561,7 @@ static void check_events(struct vo *vo)
vo_mouse_movement(vo, ev.motion.x, ev.motion.y);
break;
case SDL_MOUSEBUTTONDOWN:
- if (opts->vo.cursor_autohide_delay >= 0) {
+ if (opts->cursor_autohide_delay >= 0) {
SDL_ShowCursor(1);
vc->mouse_hidden = 0;
vc->mouse_timer = GetTimerMS();
@@ -570,7 +570,7 @@ static void check_events(struct vo *vo)
(MP_MOUSE_BTN0 + ev.button.button - 1) | MP_KEY_STATE_DOWN);
break;
case SDL_MOUSEBUTTONUP:
- if (opts->vo.cursor_autohide_delay >= 0) {
+ if (opts->cursor_autohide_delay >= 0) {
SDL_ShowCursor(1);
vc->mouse_hidden = 0;
vc->mouse_timer = GetTimerMS();
@@ -771,7 +771,7 @@ static int preinit(struct vo *vo, const char *arg)
SDL_HINT_DEFAULT);
// predefine MPV options (SDL env vars shall be overridden)
- if (vo->opts->vo.vsync)
+ if (vo->opts->vsync)
SDL_SetHintWithPriority(SDL_HINT_RENDER_VSYNC, "1",
SDL_HINT_OVERRIDE);
else
@@ -921,10 +921,10 @@ static void update_screeninfo(struct vo *vo)
mp_msg(MSGT_VO, MSGL_ERR, "[sdl] SDL_GetCurrentDisplayMode failed\n");
return;
}
- struct MPOpts *opts = vo->opts;
- opts->vo.screenwidth = mode.w;
- opts->vo.screenheight = mode.h;
- aspect_save_screenres(vo, opts->vo.screenwidth, opts->vo.screenheight);
+ struct mp_vo_opts *opts = vo->opts;
+ opts->screenwidth = mode.w;
+ opts->screenheight = mode.h;
+ aspect_save_screenres(vo, opts->screenwidth, opts->screenheight);
}
static struct mp_image *get_screenshot(struct vo *vo)
@@ -981,7 +981,7 @@ static int control(struct vo *vo, uint32_t request, void *data)
{
switch (request) {
case VOCTRL_FULLSCREEN:
- set_fullscreen(vo, !vo->opts->vo.fs);
+ set_fullscreen(vo, !vo->opts->fs);
return 1;
case VOCTRL_REDRAW_FRAME:
draw_image(vo, NULL);
diff --git a/video/out/vo_vdpau.c b/video/out/vo_vdpau.c
index 02163f70bf..459fe2ca8c 100644
--- a/video/out/vo_vdpau.c
+++ b/video/out/vo_vdpau.c
@@ -377,7 +377,7 @@ static void resize(struct vo *vo)
vc->src_rect_vid.y0 = vc->flip ? src_rect.y1 : src_rect.y0;
vc->src_rect_vid.y1 = vc->flip ? src_rect.y0 : src_rect.y1;
- int flip_offset_ms = vo->opts->vo.fs ?
+ int flip_offset_ms = vo->opts->fs ?
vc->flip_offset_fs :
vc->flip_offset_window;
diff --git a/video/out/vo_x11.c b/video/out/vo_x11.c
index 9e5f4dc64d..8d8c87f343 100644
--- a/video/out/vo_x11.c
+++ b/video/out/vo_x11.c
@@ -349,7 +349,7 @@ static int config(struct vo *vo, uint32_t width, uint32_t height,
}
if (!XMatchVisualInfo(vo->x11->display, vo->x11->screen, p->depth,
DirectColor, &p->vinfo)
- || (vo->opts->vo.WinID > 0
+ || (vo->opts->WinID > 0
&& p->vinfo.visualid != XVisualIDFromVisual(p->attribs.visual)))
{
XMatchVisualInfo(vo->x11->display, vo->x11->screen, p->depth, TrueColor,
@@ -366,7 +366,7 @@ static int config(struct vo *vo, uint32_t width, uint32_t height,
vo_x11_config_vo_window(vo, &p->vinfo, vo->dx, vo->dy, vo->dwidth,
vo->dheight, flags, "x11");
- if (vo->opts->vo.WinID > 0) {
+ if (vo->opts->WinID > 0) {
unsigned depth, dummy_uint;
int dummy_int;
Window dummy_win;
@@ -445,7 +445,7 @@ static void Display_Image(struct priv *p, XImage *myximage, uint8_t *ImageData)
p->old_vo_dheight != vo->dheight) && p->zoomFlag)
return;
- if (vo->opts->vo.WinID == 0) {
+ if (vo->opts->WinID == 0) {
x = vo->dx;
y = vo->dy;
}
@@ -539,7 +539,7 @@ static void flip_page(struct vo *vo)
static void draw_image(struct vo *vo, mp_image_t *mpi)
{
struct priv *p = vo->priv;
- struct MPOpts *opts = vo->opts;
+ struct mp_vo_opts *opts = vo->opts;
uint8_t *dst[MP_MAX_PLANES] = {NULL};
int dstStride[MP_MAX_PLANES] = {0};
@@ -555,7 +555,7 @@ static void draw_image(struct vo *vo, mp_image_t *mpi)
p->old_vo_dwidth = vo->dwidth;
p->old_vo_dheight = vo->dheight;
- if (opts->vo.fs)
+ if (opts->fs)
aspect(vo, &newW, &newH, A_ZOOM);
if (sws_flags == 0)
newW &= (~31); // not needed but, if the user wants the FAST_BILINEAR SCALER, then its needed
diff --git a/video/out/vo_xv.c b/video/out/vo_xv.c
index 46079aaf5f..8435b7da85 100644
--- a/video/out/vo_xv.c
+++ b/video/out/vo_xv.c
@@ -328,7 +328,7 @@ static int xv_init_colorkey(struct vo *vo)
/* check if colorkeying is needed */
xv_atom = xv_intern_atom_if_exists(vo, "XV_COLORKEY");
- if (xv_atom != None && !(vo->opts->vo.colorkey & 0xFF000000)) {
+ if (xv_atom != None && !(vo->opts->colorkey & 0xFF000000)) {
if (ctx->xv_ck_info.source == CK_SRC_CUR) {
int colorkey_ret;
@@ -342,14 +342,14 @@ static int xv_init_colorkey(struct vo *vo)
return 0; // error getting colorkey
}
} else {
- ctx->xv_colorkey = vo->opts->vo.colorkey;
+ ctx->xv_colorkey = vo->opts->colorkey;
/* check if we have to set the colorkey too */
if (ctx->xv_ck_info.source == CK_SRC_SET) {
xv_atom = XInternAtom(display, "XV_COLORKEY", False);
rez = XvSetPortAttribute(display, ctx->xv_port, xv_atom,
- vo->opts->vo.colorkey);
+ vo->opts->colorkey);
if (rez != Success) {
mp_msg(MSGT_VO, MSGL_FATAL, "[xv] Couldn't set colorkey!\n");
return 0; // error setting colorkey
diff --git a/video/out/w32_common.c b/video/out/w32_common.c
index 3c882de625..5cbe520220 100644
--- a/video/out/w32_common.c
+++ b/video/out/w32_common.c
@@ -150,7 +150,7 @@ static LRESULT CALLBACK WndProc(HWND hWnd, UINT message, WPARAM wParam,
break;
}
case WM_SIZING:
- if (vo_keepaspect && !vo->opts->vo.fs && vo->otps->vo.WinID < 0) {
+ if (vo_keepaspect && !vo->opts->fs && vo->otps->vo.WinID < 0) {
RECT *rc = (RECT*)lParam;
// get client area of the windows if it had the rect rc
// (subtracting the window borders)
@@ -215,11 +215,11 @@ static LRESULT CALLBACK WndProc(HWND hWnd, UINT message, WPARAM wParam,
break;
}
case WM_LBUTTONDOWN: