summaryrefslogtreecommitdiffstats
path: root/video
diff options
context:
space:
mode:
authorAlexander Preisinger <alexander.preisinger@gmail.com>2013-03-04 22:41:27 +0100
committerAlexander Preisinger <alexander.preisinger@gmail.com>2013-03-04 23:32:47 +0100
commit1198c031e4233a0cff5aa7d24aab986163f6903a (patch)
treebff49197908452f3ad1363edcf4c527db9bf1fe0 /video
parent4949992264d78d6dd22c0f6c611850402fd6eb30 (diff)
downloadmpv-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 'video')
-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
14 files changed, 204 insertions, 204 deletions
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:
- if (!vo_nomouse_input && (vo->opts->vo.fs || (wParam & MK_CONTROL))) {
+ if (!vo_nomouse_input && (vo->opts->fs || (wParam & MK_CONTROL))) {
mplayer_put_key(vo->key_fifo, MP_MOUSE_BTN0 | mod_state(vo));
break;
}
- if (!vo->opts->vo.fs) {
+ if (!vo->opts->fs) {
ReleaseCapture();
SendMessage(hWnd, WM_NCLBUTTONDOWN, HTCAPTION, 0);
return 0;
@@ -281,7 +281,7 @@ int vo_w32_check_events(struct vo *vo)
TranslateMessage(&msg);
DispatchMessageW(&msg);
}
- if (vo->opts->vo.WinID >= 0) {
+ if (vo->opts->WinID >= 0) {
BOOL res;
RECT r;
POINT p;
@@ -295,7 +295,7 @@ int vo_w32_check_events(struct vo *vo)
if (p.x != w32->window_x || p.y != w32->window_y) {
w32->window_x = p.x; w32->window_y = p.y;
}
- res = GetClientRect(WIN_ID_TO_HWND(vo->opts->vo.WinID), &r);
+ res = GetClientRect(WIN_ID_TO_HWND(vo->opts->WinID), &r);
if (res && (r.right != vo->dwidth || r.bottom != vo->dheight))
MoveWindow(w32->window, 0, 0, r.right, r.bottom, FALSE);
if (!IsWindow(WIN_ID_TO_HWND(vo->otps->vo.WinID)))
@@ -313,8 +313,8 @@ static BOOL CALLBACK mon_enum(HMONITOR hmon, HDC hdc, LPRECT r, LPARAM p)
// this defaults to the last screen if specified number does not exist
vo->xinerama_x = r->left;
vo->xinerama_y = r->top;
- vo->opts->vo.screenwidth = r->right - r->left;
- vo->opts->vo.screenheight = r->bottom - r->top;
+ vo->opts->screenwidth = r->right - r->left;
+ vo->opts->screenheight = r->bottom - r->top;
if (w32->mon_cnt == w32->mon_id)
return FALSE;
w32->mon_cnt++;
@@ -338,17 +338,17 @@ static BOOL CALLBACK mon_enum(HMONITOR hmon, HDC hdc, LPRECT r, LPARAM p)
void w32_update_xinerama_info(struct vo *vo)
{
struct vo_w32_state *w32 = vo->w32;
- struct MPOpts *opts = vo->opts;
- int screen = opts->vo.fs ? opts->vo.fsscreen_id : opts->vo.screen_id;
+ struct mp_vo_opts *opts = vo->opts;
+ int screen = opts->fs ? opts->fsscreen_id : opts->screen_id;
vo->xinerama_x = vo->xinerama_y = 0;
- if (opts->vo.fs && screen == -2) {
+ if (opts->fs && screen == -2) {
int tmp;
vo->xinerama_x = GetSystemMetrics(SM_XVIRTUALSCREEN);
vo->xinerama_y = GetSystemMetrics(SM_YVIRTUALSCREEN);
tmp = GetSystemMetrics(SM_CXVIRTUALSCREEN);
- if (tmp) vo->opts->vo.screenwidth = tmp;
+ if (tmp) vo->opts->screenwidth = tmp;
tmp = GetSystemMetrics(SM_CYVIRTUALSCREEN);
- if (tmp) vo->opts->vo.screenheight = tmp;
+ if (tmp) vo->opts->screenheight = tmp;
} else if (screen == -1) {
MONITORINFO mi;
HMONITOR m = MonitorFromWindow(w32->window, MONITOR_DEFAULTTOPRIMARY);
@@ -356,15 +356,15 @@ void w32_update_xinerama_info(struct vo *vo)
GetMonitorInfoW(m, &mi);
vo->xinerama_x = mi.rcMonitor.left;
vo->xinerama_y = mi.rcMonitor.top;
- vo->opts->vo.screenwidth = mi.rcMonitor.right - mi.rcMonitor.left;
- vo->opts->vo.screenheight = mi.rcMonitor.bottom - mi.rcMonitor.top;
+ vo->opts->screenwidth = mi.rcMonitor.right - mi.rcMonitor.left;
+ vo->opts->screenheight = mi.rcMonitor.bottom - mi.rcMonitor.top;
} else if (screen >= 0) {
w32->mon_cnt = 0;
w32->mon_id = screen;
EnumDisplayMonitors(NULL, NULL, mon_enum, (LONG_PTR)vo);
}
- aspect_save_screenres(vo, vo->opts->vo.screenwidth,
- vo->opts->vo.screenheight);
+ aspect_save_screenres(vo, vo->opts->screenwidth,
+ vo->opts->screenheight);
}
static void updateScreenProperties(struct vo *vo)
@@ -380,8 +380,8 @@ static void updateScreenProperties(struct vo *vo)
return;
}
- vo->opts->vo.screenwidth = dm.dmPelsWidth;
- vo->opts->vo.screenheight = dm.dmPelsHeight;
+ vo->opts->screenwidth = dm.dmPelsWidth;
+ vo->opts->screenheight = dm.dmPelsHeight;
w32_update_xinerama_info(vo);
}
@@ -390,7 +390,7 @@ static DWORD update_style(struct vo *vo, DWORD style)
const DWORD NO_FRAME = WS_POPUP;
const DWORD FRAME = WS_OVERLAPPEDWINDOW | WS_SIZEBOX;
style &= ~(NO_FRAME | FRAME);
- style |= (vo_border && !vo->opts->vo.fs) ? FRAME : NO_FRAME;
+ style |= (vo_border && !vo->opts->fs) ? FRAME : NO_FRAME;
return style;
}
@@ -401,30 +401,30 @@ static int reinit_window_state(struct vo *vo)
HWND layer = HWND_NOTOPMOST;
RECT r;
- if (vo->opts->vo.WinID >= 0)
+ if (vo->opts->WinID >= 0)
return 1;
wchar_t *title = mp_from_utf8(NULL, vo_get_window_title(vo));
SetWindowTextW(w32->window, title);
talloc_free(title);
- bool toggle_fs = w32->current_fs != vo->opts->vo.fs;
- w32->current_fs = vo->opts->vo.fs;
+ bool toggle_fs = w32->current_fs != vo->opts->fs;
+ w32->current_fs = vo->opts->fs;
DWORD style = update_style(vo, GetWindowLong(w32->window, GWL_STYLE));
- if (vo->opts->vo.fs || vo->opts->vo.ontop)
+ if (vo->opts->fs || vo->opts->ontop)
layer = HWND_TOPMOST;
// xxx not sure if this can trigger any unwanted messages (WM_MOVE/WM_SIZE)
- if (vo->opts->vo.fs) {
+ if (vo->opts->fs) {
while (ShowCursor(0) >= 0) /**/ ;
} else {
while (ShowCursor(1) < 0) /**/ ;
}
updateScreenProperties(vo);
- if (vo->opts->vo.fs) {
+ if (vo->opts->fs) {
// Save window position and size when switching to fullscreen.
if (toggle_fs) {
w32->prev_width = vo->dwidth;
@@ -434,8 +434,8 @@ static int reinit_window_state(struct vo *vo)
mp_msg(MSGT_VO, MSGL_V, "[vo] save window bounds: %d:%d:%d:%d\n",
w32->prev_x, w32->prev_y, w32->prev_width, w32->prev_height);
}
- vo->dwidth = vo->opts->vo.screenwidth;
- vo->dheight = vo->opts->vo.screenheight;
+ vo->dwidth = vo->opts->screenwidth;
+ vo->dheight = vo->opts->screenheight;
w32->window_x = vo->xinerama_x;
w32->window_y = vo->xinerama_y;
} else {
@@ -519,7 +519,7 @@ int vo_w32_config(struct vo *vo, uint32_t width, uint32_t height,
w32->o_dheight = height;
// the desired size is ignored in wid mode, it always matches the window size.
- if (vo->opts->vo.WinID < 0) {
+ if (vo->opts->WinID < 0) {
if (w32->window_bounds_initialized) {
// restore vo_dwidth/vo_dheight, which are reset against our will
// in vo_config()
@@ -544,7 +544,7 @@ int vo_w32_config(struct vo *vo, uint32_t width, uint32_t height,
}
}
- vo->opts->vo.fs = flags & VOFLAG_FULLSCREEN;
+ vo->opts->fs = flags & VOFLAG_FULLSCREEN;
return reinit_window_state(vo);
}
@@ -594,15 +594,15 @@ int vo_w32_init(struct vo *vo)
return 0;
}
- if (vo->opts->vo.WinID >= 0) {
+ if (vo->opts->WinID >= 0) {
RECT r;