From 8df780cb50ec4bb615ac25987de52bb3b4126de9 Mon Sep 17 00:00:00 2001 From: wm4 Date: Thu, 16 May 2013 14:12:01 +0200 Subject: vo: remove vo.check_events callback Use VOCTRL_CHECK_EVENTS instead. Change the remaining VOs to use it. Only vo_sdl and vo_caca actually need this, and vo_null, vo_lavc, and vo_image had stubs only. --- video/out/vo.c | 2 -- video/out/vo.h | 6 ------ video/out/vo_caca.c | 6 +++++- video/out/vo_image.c | 5 ----- video/out/vo_lavc.c | 5 ----- video/out/vo_null.c | 5 ----- video/out/vo_sdl.c | 4 +++- 7 files changed, 8 insertions(+), 25 deletions(-) (limited to 'video') diff --git a/video/out/vo.c b/video/out/vo.c index 25b9375ad6..de73d35ecc 100644 --- a/video/out/vo.c +++ b/video/out/vo.c @@ -235,8 +235,6 @@ void vo_check_events(struct vo *vo) vo->registered_fd = -1; return; } - if (vo->driver->check_events) - vo->driver->check_events(vo); vo_control(vo, VOCTRL_CHECK_EVENTS, NULL); } diff --git a/video/out/vo.h b/video/out/vo.h index ae63867ca6..6e9e66c013 100644 --- a/video/out/vo.h +++ b/video/out/vo.h @@ -197,12 +197,6 @@ struct vo_driver { void (*flip_page)(struct vo *vo); void (*flip_page_timed)(struct vo *vo, unsigned int pts_us, int duration); - /* - * This func is called after every frames to handle keyboard and - * other events. It's called in PAUSE mode too! - */ - void (*check_events)(struct vo *vo); - /* * Closes driver. Should restore the original state of the system. */ diff --git a/video/out/vo_caca.c b/video/out/vo_caca.c index 95f13781eb..fcb0bc4322 100644 --- a/video/out/vo_caca.c +++ b/video/out/vo_caca.c @@ -282,6 +282,11 @@ static int query_format(struct vo *vo, uint32_t format) static int control(struct vo *vo, uint32_t request, void *data) { + switch (request) { + case VOCTRL_CHECK_EVENTS: + check_events(vo); + return VO_TRUE; + } return VO_NOTIMPL; } @@ -298,6 +303,5 @@ const struct vo_driver video_out_caca = { .control = control, .draw_image = draw_image, .flip_page = flip_page, - .check_events = check_events, .uninit = uninit, }; diff --git a/video/out/vo_image.c b/video/out/vo_image.c index a7c8c16da4..af9b0edd4c 100644 --- a/video/out/vo_image.c +++ b/video/out/vo_image.c @@ -90,10 +90,6 @@ static int config(struct vo *vo, uint32_t width, uint32_t height, return 0; } -static void check_events(struct vo *vo) -{ -} - static void draw_image(struct vo *vo, mp_image_t *mpi) { struct priv *p = vo->priv; @@ -206,6 +202,5 @@ const struct vo_driver video_out_image = .draw_image = draw_image, .draw_osd = draw_osd, .flip_page = flip_page, - .check_events = check_events, .uninit = uninit, }; diff --git a/video/out/vo_lavc.c b/video/out/vo_lavc.c index f9534b02e7..6d1eb5c6f8 100644 --- a/video/out/vo_lavc.c +++ b/video/out/vo_lavc.c @@ -464,10 +464,6 @@ static void flip_page_timed(struct vo *vo, unsigned int pts_us, int duration) { } -static void check_events(struct vo *vo) -{ -} - static void draw_osd(struct vo *vo, struct osd_state *osd) { struct priv *vc = vo->priv; @@ -524,7 +520,6 @@ const struct vo_driver video_out_lavc = { .config = config, .control = control, .uninit = uninit, - .check_events = check_events, .draw_image = draw_image, .draw_osd = draw_osd, .flip_page_timed = flip_page_timed, diff --git a/video/out/vo_null.c b/video/out/vo_null.c index 993fcb606c..685b9c3a84 100644 --- a/video/out/vo_null.c +++ b/video/out/vo_null.c @@ -56,10 +56,6 @@ static void uninit(struct vo *vo) { } -static void check_events(struct vo *vo) -{ -} - static int preinit(struct vo *vo, const char *arg) { if (arg) { @@ -87,6 +83,5 @@ const struct vo_driver video_out_null = { .control = control, .draw_image = draw_image, .flip_page = flip_page, - .check_events = check_events, .uninit = uninit, }; diff --git a/video/out/vo_sdl.c b/video/out/vo_sdl.c index 9f6cadacc3..3dfa09cec7 100644 --- a/video/out/vo_sdl.c +++ b/video/out/vo_sdl.c @@ -979,6 +979,9 @@ static int get_eq(struct vo *vo, const char *name, int *value) static int control(struct vo *vo, uint32_t request, void *data) { switch (request) { + case VOCTRL_CHECK_EVENTS: + check_events(vo); + return 1; case VOCTRL_FULLSCREEN: set_fullscreen(vo, !vo->opts->fs); return 1; @@ -1039,7 +1042,6 @@ const struct vo_driver video_out_sdl = { .control = control, .draw_image = draw_image, .uninit = uninit, - .check_events = check_events, .draw_osd = draw_osd, .flip_page = flip_page, }; -- cgit v1.2.3