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.
This commit is contained in:
1 parent
526e969419
commit
8df780cb50
7 files changed
+8
-25
No files matched your search
@@ -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);
|
||||
}
|
||||
|
||||
|
||||
@@ -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.
|
||||
*/
|
||||
|
||||
+5
-1
@@ -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,
|
||||
};
|
||||
@@ -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,
|
||||
};
|
||||
@@ -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,
|
||||
|
||||
@@ -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,
|
||||
};
|
||||
+3
-1
@@ -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,
|
||||
};
|
||||
Reference in new issue
Block a user