summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authoralex <alex@b3059339-0415-0410-9bf9-f77b7e298cf2>2003-05-30 18:23:55 +0000
committeralex <alex@b3059339-0415-0410-9bf9-f77b7e298cf2>2003-05-30 18:23:55 +0000
commit019bae008cce2457ddb43a5fbc914e8a9214a2b3 (patch)
treee15d001f9b8a2b82ff6035befb1f678d8fe607a3
parent0093c1e72b24757d97093591c53321df6f54905b (diff)
downloadmpv-019bae008cce2457ddb43a5fbc914e8a9214a2b3.tar.bz2
mpv-019bae008cce2457ddb43a5fbc914e8a9214a2b3.tar.xz
lirccd support by Fredrik Tolf <fredrik@dolda2000.cjb.net>
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@10216 b3059339-0415-0410-9bf9-f77b7e298cf2
-rw-r--r--Makefile8
-rwxr-xr-xconfigure27
-rw-r--r--input/input.c16
3 files changed, 46 insertions, 5 deletions
diff --git a/Makefile b/Makefile
index e18b082c91..000e48d5aa 100644
--- a/Makefile
+++ b/Makefile
@@ -204,7 +204,7 @@ endif
$(PRG): $(MPLAYER_DEP)
./darwinfixlib.sh $(MPLAYER_DEP)
- $(CC) $(CFLAGS) -o $(PRG) $(OBJS_MPLAYER) libvo/libvo.a libao2/libao2.a $(MENU_LIBS) $(VIDIX_LIBS) $(GUI_LIBS) $(COMMON_LIBS) $(GTK_LIBS) $(VO_LIBS) $(AO_LIBS) $(EXTRA_LIB) $(LIRC_LIB) $(STATIC_LIB) $(ARCH_LIB) $(I18NLIBS) -lm
+ $(CC) $(CFLAGS) -o $(PRG) $(OBJS_MPLAYER) libvo/libvo.a libao2/libao2.a $(MENU_LIBS) $(VIDIX_LIBS) $(GUI_LIBS) $(COMMON_LIBS) $(GTK_LIBS) $(VO_LIBS) $(AO_LIBS) $(EXTRA_LIB) $(LIRC_LIB) $(LIRCC_LIB) $(STATIC_LIB) $(ARCH_LIB) $(I18NLIBS) -lm
mplayer.exe.spec.c: libmpcodecs/libmpcodecs.a
winebuild -fPIC -o mplayer.exe.spec.c -exe mplayer.exe -mcui \
@@ -212,11 +212,11 @@ mplayer.exe.spec.c: libmpcodecs/libmpcodecs.a
-L/usr/local/lib/wine -lkernel32
mplayer.exe.so: $(MPLAYER_DEP) mplayer.exe.spec.c
- $(CC) $(CFLAGS) -Wall -shared -Wl,-rpath,/usr/local/lib -Wl,-Bsymbolic -o mplayer.exe.so $(OBJS_MPLAYER) mplayer.exe.spec.c libvo/libvo.a libao2/libao2.a $(MENU_LIBS) $(VIDIX_LIBS) $(GUI_LIBS) $(COMMON_LIBS) $(GTK_LIBS) $(VO_LIBS) $(AO_LIBS) $(EXTRA_LIB) $(LIRC_LIB) $(STATIC_LIB) $(ARCH_LIB) -lwine -lm
+ $(CC) $(CFLAGS) -Wall -shared -Wl,-rpath,/usr/local/lib -Wl,-Bsymbolic -o mplayer.exe.so $(OBJS_MPLAYER) mplayer.exe.spec.c libvo/libvo.a libao2/libao2.a $(MENU_LIBS) $(VIDIX_LIBS) $(GUI_LIBS) $(COMMON_LIBS) $(GTK_LIBS) $(VO_LIBS) $(AO_LIBS) $(EXTRA_LIB) $(LIRC_LIB) $(LIRCC_LIB) $(STATIC_LIB) $(ARCH_LIB) -lwine -lm
mplayer_wine.so: $(MPLAYER_DEP)
./darwinfixlib.sh $(MPLAYER_DEP)
- $(CC) $(CFLAGS) -shared -Wl,-Bsymbolic -o mplayer_wine.so mplayer_wine.spec.c $(OBJS_MPLAYER) libvo/libvo.a libao2/libao2.a $(MENU_LIBS) $(VIDIX_LIBS) $(GUI_LIBS) $(COMMON_LIBS) $(GTK_LIBS) $(VO_LIBS) $(AO_LIBS) $(EXTRA_LIB) $(LIRC_LIB) $(STATIC_LIB) -lwine $(ARCH_LIB) -lm
+ $(CC) $(CFLAGS) -shared -Wl,-Bsymbolic -o mplayer_wine.so mplayer_wine.spec.c $(OBJS_MPLAYER) libvo/libvo.a libao2/libao2.a $(MENU_LIBS) $(VIDIX_LIBS) $(GUI_LIBS) $(COMMON_LIBS) $(GTK_LIBS) $(VO_LIBS) $(AO_LIBS) $(EXTRA_LIB) $(LIRC_LIB) $(LIRCC_LIB) $(STATIC_LIB) -lwine $(ARCH_LIB) -lm
$(PRG_FIBMAP): fibmap_mplayer.o
$(CC) -o $(PRG_FIBMAP) fibmap_mplayer.o
@@ -224,7 +224,7 @@ $(PRG_FIBMAP): fibmap_mplayer.o
ifeq ($(MENCODER),yes)
$(PRG_MENCODER): $(MENCODER_DEP)
./darwinfixlib.sh $(MENCODER_DEP) libmpcodecs/libmpencoders.a
- $(CC) $(CFLAGS) -o $(PRG_MENCODER) $(OBJS_MENCODER) libmpcodecs/libmpencoders.a $(ENCORE_LIB) $(COMMON_LIBS) $(EXTRA_LIB) $(MLIB_LIB) $(LIRC_LIB) $(ARCH_LIB) $(I18NLIBS) -lm
+ $(CC) $(CFLAGS) -o $(PRG_MENCODER) $(OBJS_MENCODER) libmpcodecs/libmpencoders.a $(ENCORE_LIB) $(COMMON_LIBS) $(EXTRA_LIB) $(MLIB_LIB) $(LIRC_LIB) $(LIRCC_LIB) $(ARCH_LIB) $(I18NLIBS) -lm
endif
codecs.conf.h: $(PRG_CFG)
diff --git a/configure b/configure
index 9f599fde97..bcd11b1a7c 100755
--- a/configure
+++ b/configure
@@ -147,6 +147,7 @@ Optional features:
--disable-iconv do not use iconv(3) function [autodetect]
--disable-setlocale disable setlocale using in mplayer [autodetect]
--enable-lirc enable LIRC (remote control) support [autodetect]
+ --enable-lircc enable LIRCCD (LIRC client daemon) input [autodetect]
--enable-joystick enable joystick support [disable]
--disable-tv disable TV Interface (tv/dvb grabbers) [enable]
--disable-tv-v4l disable Video4Linux TV Interface support [autodetect]
@@ -1064,6 +1065,7 @@ _xvid=auto
_divx4linux=auto
_opendivx=no
_lirc=auto
+_lircc=auto
_gui=no
_termcap=auto
_termios=auto
@@ -1249,6 +1251,8 @@ for ac_option do
--disable-libfame) _fame=no ;;
--enable-lirc) _lirc=yes ;;
--disable-lirc) _lirc=no ;;
+ --enable-lircc) _lircc=yes ;;
+ --disable-lircc) _lircc=no ;;
--enable-gui) _gui=yes ;;
--disable-gui) _gui=no ;;
--enable-termcap) _termcap=yes ;;
@@ -5195,6 +5199,22 @@ else
fi
echores "$_lirc"
+echocheck "lircc"
+if test "$_lircc" = auto ; then
+ _lircc=no
+ cat > $TMPC <<EOF
+#include <lirc/lircc.h>
+int main(void) { return 0; }
+EOF
+ cc_check -llircc && _lircc=yes
+fi
+if test "$_lircc" = yes ; then
+ _def_lircc='#define HAVE_LIRCC 1'
+ _ld_lircc='-llircc'
+else
+ _def_lircc='#undef HAVE_LIRCC'
+fi
+echores "$_lircc"
#############################################################################
echo "Creating config.mak"
@@ -5282,6 +5302,7 @@ SGIAUDIO_LIB = $_ld_sgiaudio
# input/demuxer/codecs
TERMCAP_LIB = $_ld_termcap
LIRC_LIB = $_ld_lirc
+LIRCC_LIB = $_ld_lircc
CSS_USE = $_css
CSS_LIB = $_ld_css
DVDKIT = $_dvdkit
@@ -5534,6 +5555,12 @@ $_def_glob
/* LIRC (remote control, see www.lirc.org) support: */
$_def_lirc
+/*
+ * LIRCCD (LIRC client daemon)
+ * See http://www.dolda2000.cjb.net/~fredrik/lirccd/
+ */
+$_def_lircc
+
/* DeCSS support using libcss */
$_def_css
diff --git a/input/input.c b/input/input.c
index 059205a461..2eec96d356 100644
--- a/input/input.c
+++ b/input/input.c
@@ -33,6 +33,10 @@
#include "lirc.h"
#endif
+#ifdef HAVE_LIRCC
+#include <lirc/lircc.h>
+#endif
+
/// This array defines all know commands.
/// The first field is an id used to recognize the command without too many strcmp
/// The second is abviously the command name
@@ -381,7 +385,7 @@ static short ar_state = -1;
static mp_cmd_t* ar_cmd = NULL;
static unsigned int ar_delay = 100, ar_rate = 8, last_ar = 0;
-static int use_joystick = 1, use_lirc = 1;
+static int use_joystick = 1, use_lirc = 1, use_lircc = 1;
static char* config_file = "input.conf";
static char* js_dev = NULL;
@@ -410,6 +414,8 @@ static config_t mp_input_opts[] = {
{ "joystick", &use_joystick, CONF_TYPE_FLAG, CONF_GLOBAL, 0, 1, NULL },
{ "nolirc", &use_lirc, CONF_TYPE_FLAG, CONF_GLOBAL, 1, 0, NULL },
{ "lirc", &use_lirc, CONF_TYPE_FLAG, CONF_GLOBAL, 0, 1, NULL },
+ { "nolircc", &use_lircc, CONF_TYPE_FLAG, CONF_GLOBAL, 1, 0, NULL },
+ { "lircc", &use_lircc, CONF_TYPE_FLAG, CONF_GLOBAL, 0, 1, NULL },
{ NULL, NULL, 0, 0, 0, 0, NULL}
};
@@ -1481,6 +1487,14 @@ mp_input_init(void) {
}
#endif
+#ifdef HAVE_LIRCC
+ if(use_lircc) {
+ int fd = lircc_init("mplayer", NULL);
+ if(fd >= 0)
+ mp_input_add_cmd_fd(fd,1,NULL,(mp_close_func_t)lircc_cleanup);
+ }
+#endif
+
if(in_file) {
struct stat st;
if(stat(in_file,&st))