From ed71606e65e697ea6bc9fc78caf2dd4089dc0aeb Mon Sep 17 00:00:00 2001 From: wm4 Date: Sat, 21 Dec 2013 19:33:45 +0100 Subject: input: rework how input sources are added Until now, there were two functions to add input sources (stuff like stdin input, slave mode, lirc, joystick). Unify them to a single function (mp_input_add_fd()), and make sure the associated callbacks always have a context parameter. Change the lirc and joystick code such that they take store their state in a context struct (probably worthless), and use the new mp_msg replacements (the point of this refactoring). Additionally, get rid of the ugly USE_FD0_CMD_SELECT etc. ifdeffery in the terminal handling code. --- input/lirc.h | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) (limited to 'input/lirc.h') diff --git a/input/lirc.h b/input/lirc.h index ac1937f91d..6ff894d387 100644 --- a/input/lirc.h +++ b/input/lirc.h @@ -19,12 +19,9 @@ #ifndef MPLAYER_LIRC_H #define MPLAYER_LIRC_H -int -mp_input_lirc_init(void); - -int -mp_input_lirc_read(int fd,char* dest, int s); - -int mp_input_lirc_close(int fd); +struct input_ctx; +struct mp_log; +int mp_input_lirc_init(struct input_ctx *ictx, struct mp_log *log, + char *lirc_configfile); #endif /* MPLAYER_LIRC_H */ -- cgit v1.2.3