vdr-streamdev:

- remove vdr-streamdev, will be developed in openelec-vdr branch
This commit is contained in:
Stephan Raue 2010-03-12 18:22:55 +01:00
parent 9025c4ecc8
commit 688d8733ba
9 changed files with 0 additions and 488 deletions

View File

@ -1,14 +0,0 @@
#!/bin/sh
. config/options
#$SCRIPTS/build vdr
VDR_DIR=`basename $BUILD/vdr-1*`
cd $BUILD/$1*
make \
VDRDIR="../$VDR_DIR" \
LIBDIR="." \
LOCALEDIR="./locale"

View File

@ -1 +0,0 @@
PLUGIN=streamdev-client

View File

@ -1 +0,0 @@
PLUGIN="streamdev-server"

View File

@ -1,26 +0,0 @@
#!/bin/sh
. config/options
mkdir -p $INSTALL/usr/lib/vdr
cp $BUILD/$1*/lib$1*.so.* $INSTALL/usr/lib/vdr
for loc in $INCLUDED_LOCALES; do
LOCALE=`echo $loc|cut -f1 -d.`
if [ -d $BUILD/$1*/locale/$LOCALE ]; then
mkdir -p $INSTALL/usr/share/locale/$LOCALE
cp -a $BUILD/$1*/locale/$LOCALE/* $INSTALL/usr/share/locale/$LOCALE/
fi
done
PKG_DIR=`find $PACKAGES -type d -name $1`
mkdir -p $INSTALL/usr/config/vdr/plugins.d
cp $PKG_DIR/config/streamdev-server $INSTALL/usr/config/vdr/plugins.d/50_streamdev-server
cp $PKG_DIR/config/streamdev-client $INSTALL/usr/config/vdr/plugins.d/50_streamdev-client
mkdir -p $INSTALL/usr/config/vdr/plugins/streamdev
cp $PKG_BUILD/streamdev/streamdevhosts.conf $INSTALL/usr/config/vdr/plugins/streamdev
if [ "$SERVICES" = yes ]; then
echo '0.0.0.0/0' >> $INSTALL/usr/config/vdr/plugins/streamdev/streamdevhosts.conf
fi

View File

@ -1,48 +0,0 @@
diff -NaurwB streamdev/server/connectionVTP.c streamdev-patched/server/connectionVTP.c
--- streamdev/server/connectionVTP.c 2009-10-13 08:38:47.000000000 +0200
+++ streamdev-patched/server/connectionVTP.c 2010-01-17 19:08:39.000000000 +0100
@@ -40,6 +40,9 @@
#if defined(USE_PARENTALRATING) || defined(PARENTALRATINGCONTENTVERSNUM)
enum eStates { Channel, Event, Title, Subtitle, Description, Vps, Content,
EndEvent, EndChannel, EndEPG };
+#elif APIVERSNUM >= 10711
+ enum eStates { Channel, Event, Title, Subtitle, Description, Vps, Content, Rating,
+ EndEvent, EndChannel, EndEPG };
#else
enum eStates { Channel, Event, Title, Subtitle, Description, Vps,
EndEvent, EndChannel, EndEPG };
@@ -282,7 +285,7 @@
break;
case Vps:
-#if defined(USE_PARENTALRATING) || defined(PARENTALRATINGCONTENTVERSNUM)
+#if defined(USE_PARENTALRATING) || defined(PARENTALRATINGCONTENTVERSNUM) || APIVERSNUM >= 10711
m_State = Content;
#else
m_State = EndEvent;
@@ -308,6 +311,25 @@
} else
return Next(Last);
break;
+#elif APIVERSNUM >= 10711
+ case Content:
+ m_State = Rating;
+ if (!isempty(m_Event->ContentToString(m_Event->Contents()))) {
+ char *copy = strdup(m_Event->ContentToString(m_Event->Contents()));
+ cString cpy(copy, true);
+ strreplace(copy, '\n', '|');
+ return m_Client->Respond(-215, "G %i %i %s", m_Event->Contents() & 0xF0, m_Event->Contents() & 0x0F, copy);
+ } else
+ return Next(Last);
+ break;
+
+ case Rating:
+ m_State = EndEvent;
+ if (m_Event->ParentalRating())
+ return m_Client->Respond(-215, "R %d", m_Event->ParentalRating());
+ else
+ return Next(Last);
+ break;
#endif
case EndEvent:

View File

@ -1,66 +0,0 @@
diff -NaurwB streamdev/server/connectionVTP.c streamdev-patched/server/connectionVTP.c
--- streamdev/server/connectionVTP.c 2010-01-17 17:52:57.000000000 +0100
+++ streamdev-patched/server/connectionVTP.c 2010-01-17 17:51:56.000000000 +0100
@@ -1384,22 +1490,52 @@
{
INIT_WRAPPER();
if (*Option) {
- if (isnumber(Option)) {
- cTimer *timer = Timers.Get(strtol(Option, NULL, 10) - 1);
+ int number = 0;
+ bool force = false;
+ char buf[strlen(Option) + 1];
+ strcpy(buf, Option);
+ const char *delim = " \t";
+ char *strtok_next;
+ char *p = strtok_r(buf, delim, &strtok_next);
+
+ if (isnumber(p)) {
+ number = strtol(p, NULL, 10) - 1;
+ }
+ else if (strcasecmp(p, "FORCE") == 0) {
+ force = true;
+ }
+ if ((p = strtok_r(NULL, delim, &strtok_next)) != NULL) {
+ if (isnumber(p)) {
+ number = strtol(p, NULL, 10) - 1;
+ }
+ else if (strcasecmp(p, "FORCE") == 0) {
+ force = true;
+ }
+ else {
+ Reply(501, "Timer not found or wrong syntax");
+ }
+ }
+
+ cTimer *timer = Timers.Get(number);
if (timer) {
- if (!timer->Recording()) {
+ if (timer->Recording()) {
+ if (force) {
+ timer->Skip();
+ cRecordControls::Process(time(NULL));
+ }
+ else {
+ Reply(550, "Timer \"%i\" is recording", number);
+ EXIT_WRAPPER();
+ }
+ }
isyslog("deleting timer %s", *timer->ToDescr());
Timers.Del(timer);
Timers.SetModified();
- Reply(250, "Timer \"%s\" deleted", Option);
+ Reply(250, "Timer \"%i\" deleted", number);
} else
- Reply(550, "Timer \"%s\" is recording", Option);
+ Reply(501, "Timer \"%i\" not defined", number);
} else
- Reply(501, "Timer \"%s\" not defined", Option);
- } else
- Reply(501, "Error in timer number \"%s\"", Option);
- } else
- Reply(501, "Missing timer number");
+ Reply(501, "Missing timer option");
EXIT_WRAPPER();
}

View File

@ -1,120 +0,0 @@
diff -NaurwB streamdev-unpatched/common.h streamdev/common.h
--- streamdev-unpatched/common.h 2009-09-18 12:41:41.000000000 +0200
+++ streamdev/common.h 2009-11-23 04:54:04.000000000 +0100
@@ -57,6 +57,8 @@
si_Count
};
+#define MAX_RESPONSE_SIZE 1024
+
extern const char *VERSION;
class cMenuEditIpItem: public cMenuEditItem {
diff -NaurwB streamdev-unpatched/server/connectionVTP.c streamdev/server/connectionVTP.c
--- streamdev-unpatched/server/connectionVTP.c 2009-10-13 08:38:47.000000000 +0200
+++ streamdev/server/connectionVTP.c 2009-11-23 14:23:33.000000000 +0100
@@ -1714,3 +1714,69 @@
Code < 0 ? -Code : Code,
Code < 0 ? '-' : ' ', *str);
}
+
+void cConnectionVTP::TimerChange(const cTimer *Timer, eTimerChange Change)
+{
+ if (m_DataSocket) {
+ char buf[MAX_RESPONSE_SIZE];
+ if (Change == tcMod) {
+ snprintf(buf, MAX_RESPONSE_SIZE, "MODT %s\0", Timer ? *Timer->ToText(true) : "-");
+ }
+ if (Change == tcAdd) {
+ snprintf(buf, MAX_RESPONSE_SIZE, "ADDT %s\0", Timer ? *Timer->ToText(true) : "-");
+ }
+ if (Change == tcDel) {
+ snprintf(buf, MAX_RESPONSE_SIZE, "DELT %s\0", Timer ? *Timer->ToText(true) : "-");
+ }
+
+ m_DataSocket->SysWrite(buf, strlen(buf));
+ }
+}
+
+#ifdef USE_STATUS_EXTENSION
+void cConnectionVTP::OsdStatusMessage(eMessageType type, const char *Message)
+#else
+void cConnectionVTP::OsdStatusMessage(const char *Message)
+#endif
+{
+ if (m_DataSocket && Message) {
+ char buf[MAX_RESPONSE_SIZE];
+
+ /* Ignore this messages */
+ if (strcasecmp(Message, trVDR("Channel not available!")) == 0) return;
+ else if (strcasecmp(Message, trVDR("Delete timer?")) == 0) return;
+ else if (strcasecmp(Message, trVDR("Delete recording?")) == 0) return;
+ else if (strcasecmp(Message, trVDR("Press any key to cancel shutdown")) == 0) return;
+ else if (strcasecmp(Message, trVDR("Press any key to cancel restart")) == 0) return;
+ else if (strcasecmp(Message, trVDR("Editing - shut down anyway?")) == 0) return;
+ else if (strcasecmp(Message, trVDR("Recording - shut down anyway?")) == 0) return;
+ else if (strcasecmp(Message, trVDR("shut down anyway?")) == 0) return;
+ else if (strcasecmp(Message, trVDR("Recording - restart anyway?")) == 0) return;
+ else if (strcasecmp(Message, trVDR("Editing - restart anyway?")) == 0) return;
+ else if (strcasecmp(Message, trVDR("Delete channel?")) == 0) return;
+ else if (strcasecmp(Message, trVDR("Timer still recording - really delete?")) == 0) return;
+ else if (strcasecmp(Message, trVDR("Delete marks information?")) == 0) return;
+ else if (strcasecmp(Message, trVDR("Delete resume information?")) == 0) return;
+ else if (strcasecmp(Message, trVDR("CAM is in use - really reset?")) == 0) return;
+ else if (strcasecmp(Message, trVDR("Really restart?")) == 0) return;
+ else if (strcasecmp(Message, trVDR("Stop recording?")) == 0) return;
+ else if (strcasecmp(Message, trVDR("Cancel editing?")) == 0) return;
+ else if (strcasecmp(Message, trVDR("Cutter already running - Add to cutting queue?")) == 0) return;
+ else if (strcasecmp(Message, trVDR("No index-file found. Creating may take minutes. Create one?")) == 0) return;
+
+#ifdef USE_STATUS_EXTENSION
+ if (type == mtStatus)
+ snprintf(buf, MAX_RESPONSE_SIZE, "SMSG %s\0", Message);
+ else if (type == mtInfo)
+ snprintf(buf, MAX_RESPONSE_SIZE, "IMSG %s\0", Message);
+ else if (type == mtWarning)
+ snprintf(buf, MAX_RESPONSE_SIZE, "WMSG %s\0", Message);
+ else if (type == mtError)
+ snprintf(buf, MAX_RESPONSE_SIZE, "EMSG %s\0", Message);
+ else
+#endif
+ snprintf(buf, MAX_RESPONSE_SIZE, "IMSG %s\0", Message);
+
+ m_DataSocket->SysWrite(buf, strlen(buf));
+ }
+}
diff -NaurwB streamdev-unpatched/server/connectionVTP.h streamdev/server/connectionVTP.h
--- streamdev-unpatched/server/connectionVTP.h 2009-07-01 12:46:16.000000000 +0200
+++ streamdev/server/connectionVTP.h 2009-11-23 14:23:33.000000000 +0100
@@ -1,6 +1,7 @@
#ifndef VDR_STREAMDEV_SERVERS_CONNECTIONVTP_H
#define VDR_STREAMDEV_SERVERS_CONNECTIONVTP_H
+#include <vdr/status.h>
#include "server/connection.h"
#include "server/recplayer.h"
@@ -12,7 +13,8 @@
class cLSTTHandler;
class cLSTRHandler;
-class cConnectionVTP: public cServerConnection {
+class cConnectionVTP: public cServerConnection
+ , public cStatus {
friend class cLSTEHandler;
#if !defined __GNUC__ || __GNUC__ >= 3
using cServerConnection::Respond;
@@ -41,6 +43,13 @@
template<class cHandler>
bool CmdLSTX(cHandler *&Handler, char *Option);
+ virtual void TimerChange(const cTimer *Timer, eTimerChange Change);
+#ifdef USE_STATUS_EXTENSION
+ virtual void OsdStatusMessage(eMessageType type, const char *Message);
+#else
+ virtual void OsdStatusMessage(const char *Message);
+#endif
+
public:
cConnectionVTP(void);
virtual ~cConnectionVTP();

View File

@ -1,210 +0,0 @@
diff -NaurwB streamdev-unpatched/server/connectionVTP.c streamdev/server/connectionVTP.c
--- streamdev-unpatched/server/connectionVTP.c 2009-10-13 08:38:47.000000000 +0200
+++ streamdev/server/connectionVTP.c 2009-11-22 20:04:07.000000000 +0100
@@ -7,6 +7,8 @@
#include "server/suspend.h"
#include "setup.h"
+#include "../services/femonservice.h"
+
#include <vdr/tools.h>
#include <vdr/videodir.h>
#include <vdr/menu.h>
@@ -710,6 +712,102 @@
return false;
}
+
+// --- cLSTQHandler -----------------------------------------------------------
+
+class cLSTQHandler
+{
+private:
+ enum eStates { Device, Status, Signal, SNR, BER, UNC, Video,
+ Audio, Dolby, EndQuality };
+ cConnectionVTP *m_Client;
+ FemonService_v1_0 m_femon;
+ int m_Errno;
+ int m_Channel;
+ cString m_Error;
+ eStates m_State;
+public:
+ cLSTQHandler(cConnectionVTP *Client, const char *Option);
+ ~cLSTQHandler();
+ bool Next(bool &Last);
+};
+
+cLSTQHandler::cLSTQHandler(cConnectionVTP *Client, const char *Option):
+ m_Client(Client),
+ m_Errno(0),
+ m_State(Device),
+ m_Channel(-1)
+{
+// if (*Option) {
+// if (isnumber(Option)) {
+// m_Channel = atoi(Option);
+// }
+// }
+
+ cPlugin *p;
+ p = cPluginManager::CallFirstService("FemonService-v1.0", &m_femon);
+ if (!p) {
+ m_Errno = 550;
+ m_Error = cString::sprintf("No support for Signal Quality found");
+ }
+}
+
+cLSTQHandler::~cLSTQHandler()
+{
+}
+
+bool cLSTQHandler::Next(bool &Last)
+{
+ if (*m_Error != NULL) {
+ Last = true;
+ cString str(m_Error);
+ m_Error = NULL;
+ return m_Client->Respond(m_Errno, "%s", *str);
+ }
+
+ Last = false;
+ switch (m_State) {
+ case Device:
+ m_State = Status;
+ if (*m_femon.fe_name != NULL)
+ return m_Client->Respond(-215, "Device : %s", *m_femon.fe_name);
+ else
+ return m_Client->Respond(-215, "Device : ");
+ case Status:
+ m_State = Signal;
+ if (*m_femon.fe_status != NULL)
+ return m_Client->Respond(-215, "Status : %s", *m_femon.fe_status);
+ else
+ return m_Client->Respond(-215, "Status : ");
+ case Signal:
+ m_State = SNR;
+ return m_Client->Respond(-215, "Signal : %04X (%2d%%)", m_femon.fe_signal, m_femon.fe_signal / 655);
+ case SNR:
+ m_State = BER;
+ return m_Client->Respond(-215, "SNR : %04X (%2d%%)", m_femon.fe_snr, m_femon.fe_snr / 655);
+ case BER:
+ m_State = UNC;
+ return m_Client->Respond(-215, "BER : %08X", m_femon.fe_ber);
+ case UNC:
+ m_State = Video;
+ return m_Client->Respond(-215, "UNC : %08X", m_femon.fe_unc);
+ case Video:
+ m_State = Audio;
+ return m_Client->Respond(-215, "Video : %.2f Mbit/s", m_femon.video_bitrate);
+ case Audio:
+ m_State = Dolby;
+ return m_Client->Respond(-215, "Audio : %.0f kbit/s", m_femon.audio_bitrate);
+ case Dolby:
+ m_State = EndQuality;
+ return m_Client->Respond(-215, "Dolby : %.0f kbit/s", m_femon.dolby_bitrate);
+ case EndQuality:
+ Last = true;
+ return m_Client->Respond(215, "End of quality information");
+ }
+ return false;
+}
+
+
// --- cConnectionVTP ---------------------------------------------------------
cConnectionVTP::cConnectionVTP(void):
@@ -727,7 +825,8 @@
m_LSTEHandler(NULL),
m_LSTCHandler(NULL),
m_LSTTHandler(NULL),
- m_LSTRHandler(NULL)
+ m_LSTRHandler(NULL),
+ m_LSTQHandler(NULL)
{
}
@@ -745,6 +844,7 @@
delete m_LSTCHandler;
delete m_LSTEHandler;
delete m_LSTRHandler;
+ delete m_LSTQHandler;
delete m_RecPlayer;
}
@@ -801,6 +901,7 @@
else if (strcasecmp(Cmd, "LSTR") == 0) return CmdLSTR(param);
else if (strcasecmp(Cmd, "LSTT") == 0) return CmdLSTT(param);
else if (strcasecmp(Cmd, "LSTC") == 0) return CmdLSTC(param);
+ else if (strcasecmp(Cmd, "LSTQ") == 0) return CmdLSTQ(param);
if (param == NULL) {
esyslog("ERROR: streamdev: this seriously shouldn't happen at %s:%d",
@@ -1268,6 +1369,11 @@
return CmdLSTX(m_LSTRHandler, Option);
}
+bool cConnectionVTP::CmdLSTQ(char *Option)
+{
+ return CmdLSTX(m_LSTQHandler, Option);
+}
+
// Functions adopted from SVDRP
#define INIT_WRAPPER() bool _res
#define Reply(c,m...) _res = Respond(c,m)
diff -NaurwB streamdev-unpatched/server/connectionVTP.h streamdev/server/connectionVTP.h
--- streamdev-unpatched/server/connectionVTP.h 2009-07-01 12:46:16.000000000 +0200
+++ streamdev/server/connectionVTP.h 2009-11-22 16:08:51.000000000 +0100
@@ -11,6 +11,7 @@
class cLSTCHandler;
class cLSTTHandler;
class cLSTRHandler;
+class cLSTQHandler;
class cConnectionVTP: public cServerConnection {
friend class cLSTEHandler;
@@ -36,6 +37,7 @@
cLSTCHandler *m_LSTCHandler;
cLSTTHandler *m_LSTTHandler;
cLSTRHandler *m_LSTRHandler;
+ cLSTQHandler *m_LSTQHandler;
protected:
template<class cHandler>
@@ -72,6 +74,7 @@
bool CmdLSTC(char *Opts);
bool CmdLSTT(char *Opts);
bool CmdLSTR(char *Opts);
+ bool CmdLSTQ(char *Opts);
// Commands adopted from SVDRP
bool CmdSTAT(const char *Option);
diff -NaurwB streamdev-unpatched/services/femonservice.h streamdev/services/femonservice.h
--- streamdev-unpatched/services/femonservice.h 1970-01-01 01:00:00.000000000 +0100
+++ streamdev/services/femonservice.h 2009-10-01 03:20:00.000000000 +0200
@@ -0,0 +1,26 @@
+/*
+ * Frontend Status Monitor plugin for the Video Disk Recorder
+ *
+ * See the README file for copyright information and how to reach the author.
+ *
+ */
+
+#ifndef __FEMONSERVICE_H
+#define __FEMONSERVICE_H
+
+#include <linux/dvb/frontend.h>
+
+struct FemonService_v1_0 {
+ cString fe_name;
+ cString fe_status;
+ uint16_t fe_snr;
+ uint16_t fe_signal;
+ uint32_t fe_ber;
+ uint32_t fe_unc;
+ double video_bitrate;
+ double audio_bitrate;
+ double dolby_bitrate;
+ };
+
+#endif //__FEMONSERVICE_H
+

View File

@ -1,2 +0,0 @@
http://poc.ginf.hu/vdr-streamdev-20100124.tar.bz2