From 526e969419891386dd699f472f06f61df821a431 Mon Sep 17 00:00:00 2001 From: wm4 Date: Thu, 16 May 2013 14:07:41 +0200 Subject: w32: use vo_w32_control() for all VOs --- video/out/vo_direct3d.c | 43 +++++++++++-------------------------------- video/out/w32_common.c | 8 ++++---- video/out/w32_common.h | 4 ---- 3 files changed, 15 insertions(+), 40 deletions(-) (limited to 'video') diff --git a/video/out/vo_direct3d.c b/video/out/vo_direct3d.c index 36c006e322..6540177ad0 100644 --- a/video/out/vo_direct3d.c +++ b/video/out/vo_direct3d.c @@ -1295,12 +1295,6 @@ static int control(struct vo *vo, uint32_t request, void *data) d3d_priv *priv = vo->priv; switch (request) { - case VOCTRL_FULLSCREEN: - vo_w32_fullscreen(vo); - resize_d3d(priv); - return VO_TRUE; - case VOCTRL_RESET: - return VO_NOTIMPL; case VOCTRL_REDRAW_FRAME: d3d_draw_frame(priv); return VO_TRUE; @@ -1331,15 +1325,6 @@ static int control(struct vo *vo, uint32_t request, void *data) return mp_csp_equalizer_get(&priv->video_eq, args->name, args->valueptr) >= 0 ? VO_TRUE : VO_NOTIMPL; } - case VOCTRL_ONTOP: - vo_w32_ontop(vo); - return VO_TRUE; - case VOCTRL_BORDER: - vo_w32_border(vo); - return VO_TRUE; - case VOCTRL_UPDATE_SCREENINFO: - w32_update_xinerama_info(vo); - return VO_TRUE; case VOCTRL_SET_PANSCAN: calc_fs_rect(priv); priv->vo->want_redraw = true; @@ -1355,7 +1340,17 @@ static int control(struct vo *vo, uint32_t request, void *data) return !!args->out_image; } } - return VO_NOTIMPL; + + int events = 0; + int r = vo_w32_control(vo, &events, request, data); + + if (events & VO_EVENT_RESIZE) + resize_d3d(priv); + + if (events & VO_EVENT_EXPOSE) + vo->want_redraw = true; + + return r; } /** @brief libvo Callback: Configre the Direct3D adapter. @@ -1444,20 +1439,6 @@ static void uninit(struct vo *vo) priv->d3d9_dll = NULL; } -/** @brief libvo Callback: Handles video window events. - */ -static void check_events(struct vo *vo) -{ - d3d_priv *priv = vo->priv; - - int flags = vo_w32_check_events(vo); - if (flags & VO_EVENT_RESIZE) - resize_d3d(priv); - - if (flags & VO_EVENT_EXPOSE) - vo->want_redraw = true; -} - // Lock buffers and fill out to point to them. // Must call d3d_unlock_video_objects() to unlock the buffers again. static bool get_video_buffer(d3d_priv *priv, struct mp_image *out) @@ -1827,7 +1808,6 @@ const struct vo_driver video_out_direct3d = { .draw_image = draw_image, .draw_osd = draw_osd, .flip_page = flip_page, - .check_events = check_events, .uninit = uninit, }; @@ -1845,6 +1825,5 @@ const struct vo_driver video_out_direct3d_shaders = { .draw_image = draw_image, .draw_osd = draw_osd, .flip_page = flip_page, - .check_events = check_events, .uninit = uninit, }; diff --git a/video/out/w32_common.c b/video/out/w32_common.c index 8ace0614cc..5903a26f94 100644 --- a/video/out/w32_common.c +++ b/video/out/w32_common.c @@ -336,7 +336,7 @@ static BOOL CALLBACK mon_enum(HMONITOR hmon, HDC hdc, LPRECT r, LPARAM p) * vo_screenwidth * vo_screenheight */ -void w32_update_xinerama_info(struct vo *vo) +static void w32_update_xinerama_info(struct vo *vo) { struct vo_w32_state *w32 = vo->w32; struct mp_vo_opts *opts = vo->opts; @@ -647,7 +647,7 @@ int vo_w32_init(struct vo *vo) * event in addition or not. */ -void vo_w32_fullscreen(struct vo *vo) +static void vo_w32_fullscreen(struct vo *vo) { vo->opts->fs = !vo->opts->fs; reinit_window_state(vo); @@ -658,7 +658,7 @@ void vo_w32_fullscreen(struct vo *vo) * * Should be called on VOCTRL_BORDER event. */ -void vo_w32_border(struct vo *vo) +static void vo_w32_border(struct vo *vo) { vo->opts->border = !vo->opts->border; reinit_window_state(vo); @@ -669,7 +669,7 @@ void vo_w32_border(struct vo *vo) * * Should be called on VOCTRL_ONTOP event. */ -void vo_w32_ontop(struct vo *vo) +static void vo_w32_ontop(struct vo *vo) { vo->opts->ontop = !vo->opts->ontop; reinit_window_state(vo); diff --git a/video/out/w32_common.h b/video/out/w32_common.h index 400a429019..1bbf27730f 100644 --- a/video/out/w32_common.h +++ b/video/out/w32_common.h @@ -53,12 +53,8 @@ struct vo; int vo_w32_init(struct vo *vo); void vo_w32_uninit(struct vo *vo); -void vo_w32_ontop(struct vo *vo); -void vo_w32_border(struct vo *vo); -void vo_w32_fullscreen(struct vo *vo); int vo_w32_control(struct vo *vo, int *events, int request, void *arg); int vo_w32_check_events(struct vo *vo); int vo_w32_config(struct vo *vo, uint32_t, uint32_t, uint32_t); -void w32_update_xinerama_info(struct vo *vo); #endif /* MPLAYER_W32_COMMON_H */ -- cgit v1.2.3