# This is a shell archive. Save it in a file, remove anything before # this line, and then unpack it by entering "sh file". Note, it may # create directories; files and directories will be owned by you and # have default permissions. # # This archive contains: # # multimedia/vdr-plugin-remote/ # multimedia/vdr-plugin-remote/Makefile # multimedia/vdr-plugin-remote/distinfo # multimedia/vdr-plugin-remote/pkg-descr # multimedia/vdr-plugin-remote/pkg-plist # multimedia/vdr-plugin-remote/files/ # multimedia/vdr-plugin-remote/files/patch-Makefile # multimedia/vdr-plugin-remote/files/patch-uhid1 # echo c - multimedia/vdr-plugin-remote/ mkdir -p multimedia/vdr-plugin-remote/ > /dev/null 2>&1 echo x - multimedia/vdr-plugin-remote/Makefile sed 's/^X//' >multimedia/vdr-plugin-remote/Makefile << '63f327e590d43d959ed6797f66d03e82' X# New ports collection makefile for: vdr_plugin_remote X# Date created: Sun Aug 29 18:11:42 CEST 2010 X# Whom: Juergen Lock X# X# $FreeBSD: $ X# X XPORTNAME= vdr_plugin_remote XPORTVERSION= 0.4.0 XCATEGORIES= multimedia XMASTER_SITES= http://www.escape-edv.de/endriss/vdr/ XDISTNAME= ${PORTNAME:S/_plugin_/-/}-${DISTVERSIONPREFIX}${DISTVERSION}${DISTVERSIONSUFFIX} XEXTRACT_SUFX= .tgz X XMAINTAINER= multimedia@FreeBSD.org XCOMMENT= Video Disk Recorder - remote control plugin X XPATCH_STRIP= -p1 XHAVE_CONFIGURE= yes XPORTDOCS= COPYING README XMAKE_JOBS_SAFE= yes XWRKSRC= ${WRKDIR}/${PLUGIN}-${DISTVERSION} X X.include "${.CURDIR}/../vdrdevel/Makefile.plugins" X Xpost-patch: post-patch-plugin X X.if !defined(NOPORTDOCS) Xpost-install: X ${MKDIR} ${DOCSDIR} X (cd ${WRKSRC} && ${INSTALL_DATA} ${PORTDOCS} ${DOCSDIR}) X.endif X X.include 63f327e590d43d959ed6797f66d03e82 echo x - multimedia/vdr-plugin-remote/distinfo sed 's/^X//' >multimedia/vdr-plugin-remote/distinfo << '7b599d1b1fb99b22674517a09a45f7f1' XMD5 (vdr/vdr-remote-0.4.0.tgz) = 336fa829fc24100d47545094218141a6 XSHA256 (vdr/vdr-remote-0.4.0.tgz) = 402178a5ca34796621ec248fbc459c41d86e7ce7f226080b507aad3e054512bf XSIZE (vdr/vdr-remote-0.4.0.tgz) = 28397 7b599d1b1fb99b22674517a09a45f7f1 echo x - multimedia/vdr-plugin-remote/pkg-descr sed 's/^X//' >multimedia/vdr-plugin-remote/pkg-descr << '002b9d9457458c6e8ebea716e4a71902' Xhttp://www.linuxtv.org/vdrwiki/index.php/Remote-plugin X XThis plugin extends the remote control capabilities of vdr. XThe following remote control devices are supported: X X(a) linux input device driver ('/dev/input/eventX', X=0,1,2,...) X (currently not supported on FreeBSD) X X(b) keyboard (tty driver): /dev/console, /dev/ttyX X X(c) TCP connection (telnet) X X(d) LIRC X X(e) some(?) FreeBSD uhid(4) devices (experimental support added by this port) X To use, add something like this to vdr_flags: '-Premote -h /dev/uhid0', X (re)start vdr, then the osd should ask you to configure the X remote by pressing the buttons you want to assign. X X Note: If your remote is detected as a keyboard you'll have to X tell ukbd(4) to ignore it first by doing (as root) something like: X X usbconfig add_dev_quirk_vplh 0x1241 0xe000 0 0xffff UQ_KBD_IGNORE X X (and possibly unplug it for a moment, 0x1241 there is the vendor X id, 0xe000 the product id of the device, you can get yours by X doing X X usbconfig -u 1 -a 2 dump_device_desc X X and looking for idVendor and idProduct, -u 1 and -a 2 there X correspond to ugen1.2 listed by usbconfig w/o args.) X X You can check with: X X usbconfig show_ifdrv X X if the device is then listed as ugen...: uhid... you're good to go. X XWWW: http://escape-edv.de/endriss/vdr 002b9d9457458c6e8ebea716e4a71902 echo x - multimedia/vdr-plugin-remote/pkg-plist sed 's/^X//' >multimedia/vdr-plugin-remote/pkg-plist << '73ee7e50e683574c8a892b74a54b1db2' Xlib/vdr/libvdr-remote.so.1.7.15 73ee7e50e683574c8a892b74a54b1db2 echo c - multimedia/vdr-plugin-remote/files/ mkdir -p multimedia/vdr-plugin-remote/files/ > /dev/null 2>&1 echo x - multimedia/vdr-plugin-remote/files/patch-Makefile sed 's/^X//' >multimedia/vdr-plugin-remote/files/patch-Makefile << '7aee64c13bce45bbdf5799e8cf04c5c1' X--- a/Makefile X+++ b/Makefile X@@ -54,6 +54,12 @@ DEFINES += -D_GNU_SOURCE -DPLUGIN_NAME_I X DEFINES += -DREMOTE_FEATURE_LIRC X DEFINES += -DREMOTE_FEATURE_TCPIP X X+ifeq ($(OSTYPE),FreeBSD) X+DEFINES += -DREMOTE_FEATURE_UHID X+else X+DEFINES += -DREMOTE_FEATURE_DEVINPUT X+endif X+ X ### The object files (add further files here): X X OBJS = $(PLUGIN).o ttystatus.o X@@ -126,3 +132,6 @@ dist: clean X clean: X @-rm -f $(PODIR)/*.mo $(PODIR)/*.pot X @-rm -f *.o $(DEPFILE) *.so *.tgz core* *~ X+ X+install: X+ ${INSTALL_PROGRAM} $(LIBDIR)/libvdr-$(PLUGIN).so.$(APIVERSION) $(PREFIX)/lib/vdr/libvdr-$(PLUGIN).so.$(APIVERSION) 7aee64c13bce45bbdf5799e8cf04c5c1 echo x - multimedia/vdr-plugin-remote/files/patch-uhid1 sed 's/^X//' >multimedia/vdr-plugin-remote/files/patch-uhid1 << 'a4ef9a76b77d9599771fa0c127c731a5' X--- a/remote.c X+++ a/remote.c X@@ -15,7 +15,9 @@ X #include X #include X #include X+#ifdef REMOTE_FEATURE_DEVINPUT X #include X+#endif X #include "i18n.h" X #include "remote.h" X #ifdef REMOTE_FEATURE_TCPIP X@@ -25,6 +27,9 @@ X X X #define NUMREMOTES 10 // maximum number of remote control devices X+#ifdef REMOTE_FEATURE_UHID X+#define UHID_DEFAULT_READSIZE 8 // default size of uhid reads X+#endif X X #define AV7110_KEYMAP_DEVICE "/proc/av7110_ir" X #if 0 X@@ -183,6 +188,7 @@ void cRemoteGeneric::Action(void) X int identifyInputDevice(const int fh, char *name) X // --------------------------------------------------------------------------- X { X+#ifdef REMOTE_FEATURE_DEVINPUT X char description[256]; X X // check name of input device X@@ -196,11 +202,13 @@ int identifyInputDevice(const int fh, ch X X if (strstr(description, "DVB") || strstr(description, "dvb")) X return 2; X+#endif X X return 0; X } X X X+#ifdef REMOTE_FEATURE_DEVINPUT X // --------------------------------------------------------------------------- X bool cRemoteDevInput::loadKeymap(const char *devname, uint32_t options) X // --------------------------------------------------------------------------- X@@ -454,6 +462,68 @@ bool cRemoteDevInput::keyPressed(uint64_ X { X return (code & 0xFFFF00000000ULL); X } X+#endif // REMOTE_FEATURE_DEVINPUT X+ X+ X+/*****************************************************************************/ X+ X+ X+#ifdef REMOTE_FEATURE_UHID X+// --------------------------------------------------------------------------- X+cRemoteUhid::cRemoteUhid(const char *name, int f, char *d, int size) X+ :cRemoteGeneric(name, f, d) X+// --------------------------------------------------------------------------- X+{ X+ Start(); X+ X+ readsize = size; X+ repeatcode = 0; X+ fcntl(f, F_SETFL, O_NONBLOCK); X+} X+ X+ X+// --------------------------------------------------------------------------- X+bool cRemoteUhid::Initialize() X+// --------------------------------------------------------------------------- X+{ X+ return true; X+} X+ X+ X+// --------------------------------------------------------------------------- X+uint64_t cRemoteUhid::getKey(void) X+// --------------------------------------------------------------------------- X+{ X+ int n; X+ uint64_t code = 0; X+ X+ // XXX handle short reads properly on big-endian X+ n = read(fh, &code, readsize); X+ if (n <= 0) { X+ if (n < 0 && (errno == EAGAIN || errno == EINTR)) X+ code = repeatcode; X+ else { X+ code = INVALID_KEY; X+ repeatcode = 0; X+ } X+ } else { X+ repeatcode = code; X+#if 1 //def PRINTFDEBUGGING X+ printf("code %jx\n", code); X+#endif X+ } X+ X+ return code; X+} X+ X+ X+// --------------------------------------------------------------------------- X+bool cRemoteUhid::keyPressed(uint64_t code) X+// --------------------------------------------------------------------------- X+{ X+ return (code != 0LL); X+} X+#endif // REMOTE_FEATURE_UHID X X X /*****************************************************************************/ X@@ -557,6 +627,9 @@ private: X int devcnt; X char devtyp[NUMREMOTES]; X char *devnam[NUMREMOTES]; X+#ifdef REMOTE_FEATURE_UHID X+ int devsize[NUMREMOTES]; X+#endif X int fh[NUMREMOTES]; X public: X cPluginRemote(void); X@@ -604,6 +677,10 @@ const char *cPluginRemote::CommandLineHe X // --------------------------------------------------------------------------- X { X return " -i dev, --input=dev input device (/dev/input/... | autodetect)\n" X+#ifdef REMOTE_FEATURE_UHID X+ " -h dev, --uhid=dev uhid(4) device (/dev/uhidX)\n" X+ " -s size, --uhidsize=size uhid device read size\n" X+#endif X #ifdef REMOTE_FEATURE_LIRC X " -l dev, --lirc=dev lirc device (/dev/lircd)\n" X #endif X@@ -624,6 +701,10 @@ bool cPluginRemote::ProcessArgs(int argc X { X static struct option long_options[] = X { { "input", required_argument, NULL, 'i' }, X+#ifdef REMOTE_FEATURE_UHID X+ { "uhid", required_argument, NULL, 'h' }, X+ { "uhidsize", required_argument, NULL, 's' }, X+#endif X { "lirc", required_argument, NULL, 'l' }, X { "port", required_argument, NULL, 'p' }, X { "tty", required_argument, NULL, 't' }, X@@ -631,11 +712,20 @@ bool cPluginRemote::ProcessArgs(int argc X { NULL } }; X int c; X X+#ifndef REMOTE_FEATURE_UHID X while ((c = getopt_long(argc, argv, "i:l:p:t:T:", long_options, NULL)) != -1) X+#else X+ while ((c = getopt_long(argc, argv, "i:h:s:l:p:t:T:", long_options, NULL)) != -1) X+#endif X { X+#ifdef REMOTE_FEATURE_UHID X+ int size; X+#endif X+ X switch (c) X { X case 'i': X+ case 'h': X case 'l': X case 'p': X case 't': X@@ -647,8 +737,27 @@ bool cPluginRemote::ProcessArgs(int argc X } X devtyp[devcnt] = c; X devnam[devcnt] = optarg; X+#ifdef REMOTE_FEATURE_UHID X+ devsize[devcnt] = UHID_DEFAULT_READSIZE; X+#endif X devcnt++; X break; X+#ifdef REMOTE_FEATURE_UHID X+ case 's': X+ if (!devcnt || devcnt > NUMREMOTES) X+ { X+ esyslog("%s: uhidsize must come after uhid device", Name()); X+ return false; X+ } X+ size = atoi(optarg); X+ if (size <= 0 || size_t(size) > sizeof (int64_t)) X+ { X+ esyslog("%s: bad uhidsize %s", Name(), optarg); X+ return false; X+ } X+ devsize[devcnt] = size; X+ break; X+#endif X X default: X esyslog("%s: invalid argument", Name()); X@@ -671,6 +780,7 @@ bool cPluginRemote::Start(void) X RegisterI18n(remotePhrases); X #endif X X+#ifdef REMOTE_FEATURE_DEVINPUT X // no device specified by the user, set default X if (devcnt == 0) X { X@@ -719,6 +829,7 @@ bool cPluginRemote::Start(void) X if (devtyp[i] == 'i' && strcmp(devnam[i], "autodetect") == 0) X devnam[i] = "/dev/input/ir"; X } // for i X+#endif X X for (int i = 0; i < devcnt; i++) X { X@@ -769,9 +880,17 @@ bool cPluginRemote::Start(void) X X switch (devtyp[i]) X { X+#ifdef REMOTE_FEATURE_DEVINPUT X case 'i': X new cRemoteDevInput(nam,fh[i],devnam[i]); X break; X+#endif X+ X+#ifdef REMOTE_FEATURE_UHID X+ case 'h': X+ new cRemoteUhid(nam,fh[i],devnam[i],devsize[i]); X+ break; X+#endif X X #ifdef REMOTE_FEATURE_LIRC X case 'l': X--- a/remote.h X+++ a/remote.h X@@ -82,6 +82,24 @@ public: X X X X+#ifdef REMOTE_FEATURE_UHID X+/*****************************************************************************/ X+class cRemoteUhid : protected cRemoteGeneric X+/*****************************************************************************/ X+{ X+private: X+ uint64_t repeatcode; X+ int readsize; X+protected: X+ virtual uint64_t getKey(void); X+ virtual bool keyPressed(uint64_t code); X+public: X+ cRemoteUhid(const char *name, int f, char *d, int size); X+ virtual bool Initialize(void); X+}; X+#endif X+ X+ X #ifdef REMOTE_FEATURE_LIRCOLD X /*****************************************************************************/ X class cRemoteDevLirc : protected cRemoteGeneric a4ef9a76b77d9599771fa0c127c731a5 exit