summaryrefslogtreecommitdiff
path: root/plugins/streamdev/patches
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/streamdev/patches')
-rw-r--r--plugins/streamdev/patches/p1/streamdev-cvs221109-AddCallbackMsg.diff120
-rw-r--r--plugins/streamdev/patches/p1/streamdev-cvs221109-AddFemonV1.diff210
2 files changed, 330 insertions, 0 deletions
diff --git a/plugins/streamdev/patches/p1/streamdev-cvs221109-AddCallbackMsg.diff b/plugins/streamdev/patches/p1/streamdev-cvs221109-AddCallbackMsg.diff
new file mode 100644
index 0000000..7facc61
--- /dev/null
+++ b/plugins/streamdev/patches/p1/streamdev-cvs221109-AddCallbackMsg.diff
@@ -0,0 +1,120 @@
+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();
diff --git a/plugins/streamdev/patches/p1/streamdev-cvs221109-AddFemonV1.diff b/plugins/streamdev/patches/p1/streamdev-cvs221109-AddFemonV1.diff
new file mode 100644
index 0000000..39872e4
--- /dev/null
+++ b/plugins/streamdev/patches/p1/streamdev-cvs221109-AddFemonV1.diff
@@ -0,0 +1,210 @@
+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
++