VDR plugin to handle XBMC clients.

The vdr-plugin-xvdr is able to handle serveral XBMC clients connecting
via the XVDR addon.

WWW: https://github.com/pipelka/vdr-plugin-xvdr
This commit is contained in:
Juergen Lock 2011-12-18 17:23:38 +00:00
parent 2bf3ba692f
commit 7c720b5681
Notes: svn2git 2021-03-31 03:12:20 +00:00
svn path=/head/; revision=287599
13 changed files with 177 additions and 0 deletions

View file

@ -352,6 +352,7 @@
SUBDIR += vdr-plugin-vnsiserver
SUBDIR += vdr-plugin-wirbelscan
SUBDIR += vdr-plugin-xineliboutput
SUBDIR += vdr-plugin-xvdr
SUBDIR += vdr-plugins
SUBDIR += vic
SUBDIR += vlc

View file

@ -0,0 +1,39 @@
# New ports collection makefile for: vdr-plugin-xvdr
# Date created: Sat Oct 8 17:45:22 CEST 2011
# Whom: Juergen Lock <nox@FreeBSD.org>
#
# $FreeBSD$
#
PORTNAME= vdr-plugin-xvdr
PORTVERSION= 0.9.5
CATEGORIES= multimedia
MASTER_SITES= LOCAL/nox/
DISTNAME= pipelka-${PORTNAME}-xvdr-${PORTVERSION}-0-g${GITHASH}
MAINTAINER= nox@FreeBSD.org
COMMENT= Video Disk Recorder - XVDR server plugin
GITHASH= e4cab47
PATCH_STRIP= -p1
HAVE_CONFIGURE= yes
PORTDOCS= COPYING README
MAKE_JOBS_SAFE= yes
WRKSRC= ${WRKDIR}/pipelka-${PORTNAME}-${GITHASH}
.include "${.CURDIR}/../vdr/Makefile.plugins"
post-patch: post-patch-plugin
post-install:
@${MKDIR} ${PREFIX}/etc/vdr/plugins/${PLUGIN}
@${INSTALL_DATA} ${WRKSRC}/${PLUGIN}/allowed_hosts.conf ${PREFIX}/etc/vdr/plugins/${PLUGIN}/allowed_hosts.conf.sample
@if [ ! -f ${PREFIX}/etc/vdr/plugins/${PLUGIN}/allowed_hosts.conf ]; then \
${INSTALL_DATA} -o ${VDR_USER} -g ${VDR_GROUP} ${WRKSRC}/${PLUGIN}/allowed_hosts.conf ${PREFIX}/etc/vdr/plugins/${PLUGIN}; \
fi
.if !defined(NOPORTDOCS)
${MKDIR} ${DOCSDIR}
(cd ${WRKSRC} && ${INSTALL_DATA} ${PORTDOCS} ${DOCSDIR})
.endif
.include <bsd.port.mk>

View file

@ -0,0 +1,2 @@
SHA256 (vdr/pipelka-vdr-plugin-xvdr-xvdr-0.9.5-0-ge4cab47.tar.gz) = 791de7fea6b8fd355a38041b5d660b5f09a3fe7221c4cdfa86624f8ad2d8d6f3
SIZE (vdr/pipelka-vdr-plugin-xvdr-xvdr-0.9.5-0-ge4cab47.tar.gz) = 62582

View file

@ -0,0 +1,9 @@
--- a/Makefile
+++ b/Makefile
@@ -114,5 +114,4 @@ clean:
@-rm -f $(OBJS) $(DEPFILE) *.so *.tgz core* *~
install:
- @install -d ../../man
- @install README ../../man/$(PLUGIN).man
+ ${INSTALL_PROGRAM} $(LIBDIR)/libvdr-$(PLUGIN).so.$(APIVERSION) $(PREFIX)/lib/vdr/libvdr-$(PLUGIN).so.$(APIVERSION)

View file

@ -0,0 +1,15 @@
--- a/src/live/livestreamer.c
+++ b/src/live/livestreamer.c
@@ -29,7 +29,12 @@
#include <map>
#include <vdr/remux.h>
#include <vdr/channels.h>
+#ifdef __FreeBSD__
+#include <sys/endian.h>
+#define __cpu_to_be64 htobe64
+#else
#include <asm/byteorder.h>
+#endif
#include "config/config.h"
#include "net/cxsocket.h"

View file

@ -0,0 +1,13 @@
--- a/src/net/cxsocket.c
--- b/src/net/cxsocket.c
@@ -48,6 +48,10 @@
#include "config/config.h"
#include "cxsocket.h"
+#ifndef MSG_MORE
+#define MSG_MORE 0
+#endif
+
cxSocket::~cxSocket()
{
close();

View file

@ -0,0 +1,12 @@
--- a/src/net/cxsocket.h
+++ b/src/net/cxsocket.h
@@ -29,6 +29,9 @@
#ifndef __CXSOCKET_H
#define __CXSOCKET_H
+#ifdef __FreeBSD__
+#include <netinet/in.h>
+#endif
#include <inttypes.h>
#include <sys/types.h>
#include <sys/socket.h>

View file

@ -0,0 +1,16 @@
--- a/src/net/requestpacket.c
+++ b/src/net/requestpacket.c
@@ -28,7 +28,13 @@
#include <stdint.h>
#include <string.h>
+#ifdef __FreeBSD__
+#include <sys/endian.h>
+#define __cpu_to_be64 htobe64
+#define __be64_to_cpu be64toh
+#else
#include <asm/byteorder.h>
+#endif
#include "xvdr/xvdrcommand.h"
#include "config/config.h"

View file

@ -0,0 +1,15 @@
--- a/src/net/responsepacket.c
+++ b/src/net/responsepacket.c
@@ -31,7 +31,12 @@
#include <arpa/inet.h>
#include <stdlib.h>
#include <string.h>
+#ifdef __FreeBSD__
+#include <sys/endian.h>
+#define __cpu_to_be64 htobe64
+#else
#include <asm/byteorder.h>
+#endif
#include <zlib.h>
#include "config/config.h"

View file

@ -0,0 +1,24 @@
--- a/src/recordings/recplayer.c
+++ b/src/recordings/recplayer.c
@@ -36,6 +36,10 @@
#include "config/config.h"
+#ifndef O_NOATIME
+#define O_NOATIME 0
+#endif
+
cRecPlayer::cRecPlayer(cRecording* rec)
{
m_file = -1;
@@ -220,8 +220,10 @@ int cRecPlayer::getBlock(unsigned char*
return 0;
}
+#ifndef __FreeBSD__
// Tell linux not to bother keeping the data in the FS cache
posix_fadvise(m_file, filePosition, bytes_read, POSIX_FADV_DONTNEED);
+#endif
// divide and conquer
if(bytes_read < amount) {

View file

@ -0,0 +1,21 @@
--- a/src/xvdr/xvdrserver.c
+++ b/src/xvdr/xvdrserver.c
@@ -156,6 +156,7 @@ void cXVDRServer::NewClientConnected(int
int val = 1;
setsockopt(fd, SOL_SOCKET, SO_KEEPALIVE, &val, sizeof(val));
+#ifndef __FreeBSD__
val = 30;
setsockopt(fd, SOL_TCP, TCP_KEEPIDLE, &val, sizeof(val));
@@ -167,6 +168,10 @@ void cXVDRServer::NewClientConnected(int
val = 1;
setsockopt(fd, SOL_TCP, TCP_NODELAY, &val, sizeof(val));
+#else
+ val = 1;
+ setsockopt(fd, IPPROTO_TCP, TCP_NODELAY, &val, sizeof(val));
+#endif
INFOLOG("Client with ID %d connected: %s", m_IdCnt, cxSocket::ip2txt(sin.sin_addr.s_addr, sin.sin_port, buf));
cXVDRClient *connection = new cXVDRClient(fd, m_IdCnt, cxSocket::ip2txt(sin.sin_addr.s_addr, sin.sin_port, buf));

View file

@ -0,0 +1,5 @@
VDR plugin to handle XBMC clients.
The vdr-plugin-xvdr is able to handle serveral XBMC clients connecting
via the XVDR addon.
WWW: https://github.com/pipelka/vdr-plugin-xvdr

View file

@ -0,0 +1,5 @@
lib/vdr/libvdr-xvdr.so.1.7.19
@unexec if cmp -s %D/etc/vdr/plugins/xvdr/allowed_hosts.conf.sample %D/etc/vdr/plugins/xvdr/allowed_hosts.conf; then rm -f %D/etc/vdr/plugins/xvdr/allowed_hosts.conf; fi
etc/vdr/plugins/xvdr/allowed_hosts.conf.sample
@exec if [ ! -f %D/etc/vdr/plugins/xvdr/allowed_hosts.conf ] ; then cp -p %D/%F %B/allowed_hosts.conf; fi
@dirrmtry etc/vdr/plugins/xvdr