[SCM] vdr-plugin-vnsiserver/master: Imported Upstream version 1.3.1
tiber-guest at users.alioth.debian.org
tiber-guest at users.alioth.debian.org
Tue Sep 22 08:09:14 UTC 2015
The following commit has been merged in the master branch:
commit 4fb705869076adf0bafc04af51e4e30b7138612d
Author: Tobias Grimm <etobi at debian.org>
Date: Tue Sep 22 10:04:30 2015 +0200
Imported Upstream version 1.3.1
diff --git a/.gitignore b/.gitignore
index 13412ee..d6cbfea 100644
--- a/.gitignore
+++ b/.gitignore
@@ -4,3 +4,9 @@
*~
po/*.pot
po/*.mo
+.kdev4/
+
+# Don't add patch files
+*.diff
+*.patch
+*.orig
diff --git a/HISTORY b/HISTORY
index 674db0b..1df333c 100644
--- a/HISTORY
+++ b/HISTORY
@@ -1,6 +1,18 @@
VDR Plugin 'vnsiserver' Revision History
----------------------------------------
+2015-09-18: Version 1.3.0
+
+- add support for undelete recordings
+- add support for rds data if present on dvb radio and send to addon if supported there
+- Update support for wirbelscan plugin
+- Rework Licence files to use KODI
+- Improved README
+- Fix possible seq fault in void cRecPlayer::reScan()
+- fix picons for western
+- make avoid EPG scan while streaming default
+- see github history for other fixes
+
2015-01-25: Version 1.2.1
- add cmd line switch for setting tcp port
diff --git a/Makefile b/Makefile
index d7e69bb..8f1cb05 100644
--- a/Makefile
+++ b/Makefile
@@ -86,7 +86,7 @@ endif
### The object files (add further files here):
-OBJS = vnsi.o bitstream.o vnsiclient.o config.o cxsocket.o parser.o parser_AAC.o \
+OBJS = vnsi.o bitstream.o vnsiclient.o channelscancontrol.o config.o cxsocket.o parser.o parser_AAC.o \
parser_AC3.o parser_DTS.o parser_h264.o parser_MPEGAudio.o parser_MPEGVideo.o \
parser_Subtitle.o parser_Teletext.o streamer.o recplayer.o requestpacket.o responsepacket.o \
vnsiserver.o hash.o recordingscache.o setup.o vnsiosd.o demuxer.o videobuffer.o \
diff --git a/README b/README
index f4f5adc..d8155a9 100644
--- a/README
+++ b/README
@@ -5,8 +5,8 @@
This is a "plugin" for the Video Disk Recorder (VDR).
-VDR plugin to handle XBMC clients.
-The vdr-plugin-vnsiserver is able to handle serveral XBMC clients connecting
+VDR plugin to handle KODI clients.
+The vdr-plugin-vnsiserver is able to handle serveral KODI clients connecting
via the VNSI addon.
This program is free software; you can redistribute it and/or modify
@@ -27,9 +27,21 @@ Get VDR sources.
$ cd <path to vdr>/PLUGINS/src
$ git clone https://github.com/FernetMenta/vdr-plugin-vnsiserver
$ ln -s vdr-plugin-vnsiserver vnsiserver
-
- -----------------------------------------------------------------------------
+
+On newer VDR Versions (2.2.0) plugin can be build and installed alone, use:
+
+ $ git clone https://github.com/FernetMenta/vdr-plugin-vnsiserver
+ $ cd vdr-plugin-vnsiserver
+ $ make
+ $ sudo make install
+
+If you want to fix install dir you can use this, where the end define the VDR
+library folder:
+
+ $ sudo make install LIBDIR=/usr/lib/vdr
+
+-----------------------------------------------------------------------------
3. Help and Suppport
-----------------------------------------------------------------------------
-http://forum.xbmc.org/forumdisplay.php?fid=169
+http://forum.kodi.tv/forumdisplay.php?fid=169
diff --git a/bitstream.c b/bitstream.c
index 3e44ff9..d0c06f3 100644
--- a/bitstream.c
+++ b/bitstream.c
@@ -1,9 +1,10 @@
/*
- * vdr-plugin-vnsi - XBMC server plugin for VDR
+ * vdr-plugin-vnsi - KODI server plugin for VDR
*
* Copyright (C) 2010 Alwin Esch (Team XBMC)
+ * Copyright (C) 2015 Team KODI
*
- * http://www.xbmc.org
+ * http://kodi.tv
*
* This Program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -16,7 +17,7 @@
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
- * along with XBMC; see the file COPYING. If not, see
+ * along with KODI; see the file COPYING. If not, see
* <http://www.gnu.org/licenses/>.
*
*/
diff --git a/bitstream.h b/bitstream.h
index 626142f..4d236b5 100644
--- a/bitstream.h
+++ b/bitstream.h
@@ -1,9 +1,10 @@
/*
- * vdr-plugin-vnsi - XBMC server plugin for VDR
+ * vdr-plugin-vnsi - KODI server plugin for VDR
*
* Copyright (C) 2010 Alwin Esch (Team XBMC)
+ * Copyright (C) 2015 Team KODI
*
- * http://www.xbmc.org
+ * http://kodi.tv
*
* This Program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -16,7 +17,7 @@
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
- * along with XBMC; see the file COPYING. If not, see
+ * along with KODI; see the file COPYING. If not, see
* <http://www.gnu.org/licenses/>.
*
*/
diff --git a/channelfilter.c b/channelfilter.c
index d8a61ca..a497a40 100644
--- a/channelfilter.c
+++ b/channelfilter.c
@@ -1,6 +1,10 @@
/*
+ * vdr-plugin-vnsi - KODI server plugin for VDR
+ *
* Copyright (C) 2005-2013 Team XBMC
- * http://xbmc.org
+ * Copyright (C) 2015 Team KODI
+ *
+ * http://kodi.tv
*
* This Program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -13,7 +17,7 @@
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
- * along with XBMC; see the file COPYING. If not, see
+ * along with KODI; see the file COPYING. If not, see
* <http://www.gnu.org/licenses/>.
*
*/
@@ -56,7 +60,7 @@ bool cVNSIChannelFilter::IsRadio(const cChannel* channel)
if (channel->Vpid() == 0 && channel->Apid(0) == 0)
isRadio = false;
// channels without VPID are radio channels (channels with VPID 1 are encrypted radio channels)
- else if (channel->Vpid() == 0 || channel->Vpid() == 1)
+ else if (channel->Vpid() == 0 || channel->Vpid() == 1 || channel->Rid() == 1)
isRadio = true;
return isRadio;
diff --git a/channelfilter.h b/channelfilter.h
index dc49728..58dc659 100644
--- a/channelfilter.h
+++ b/channelfilter.h
@@ -1,6 +1,10 @@
/*
+ * vdr-plugin-vnsi - KODI server plugin for VDR
+ *
* Copyright (C) 2005-2013 Team XBMC
- * http://xbmc.org
+ * Copyright (C) 2015 Team KODI
+ *
+ * http://kodi.tv
*
* This Program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -13,7 +17,7 @@
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
- * along with XBMC; see the file COPYING. If not, see
+ * along with KODI; see the file COPYING. If not, see
* <http://www.gnu.org/licenses/>.
*
*/
diff --git a/channelscancontrol.c b/channelscancontrol.c
new file mode 100644
index 0000000..eac2eef
--- /dev/null
+++ b/channelscancontrol.c
@@ -0,0 +1,309 @@
+/*
+ * vdr-plugin-vnsi - KODI server plugin for VDR
+ *
+ * Copyright (C) 2010,2015 Alwin Esch (Team KODI)
+ * Copyright (C) 2010, 2011 Alexander Pipelka
+ *
+ * http://kodi.tv
+ *
+ * This Program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2, or (at your option)
+ * any later version.
+ *
+ * This Program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with KODI; see the file COPYING. If not, see
+ * <http://www.gnu.org/licenses/>.
+ *
+ */
+
+#include <vdr/menu.h>
+#include <vdr/status.h>
+
+#include "channelscancontrol.h"
+#include "vnsiclient.h"
+
+using namespace WIRBELSCAN_SERVICE;
+
+/*!
+ * versions definitions
+ */
+#define MIN_CMDVERSION 1 // command api 0001
+#define MIN_STATUSVERSION 1 // query status
+#define MIN_SETUPVERSION 1 // get/put setup, GetSetup#XXXX/SetSetup#XXXX
+#define MIN_COUNTRYVERSION 1 // get list of country IDs and Names
+#define MIN_SATVERSION 1 // get list of sat IDs and Names
+#define MIN_USERVERSION 1 // scan user defined transponder
+
+#define SCAN_TV ( 1 << 0 )
+#define SCAN_RADIO ( 1 << 1 )
+#define SCAN_FTA ( 1 << 2 )
+#define SCAN_SCRAMBLED ( 1 << 3 )
+#define SCAN_HD ( 1 << 4 )
+
+/*!
+ * macro definitions
+ */
+#define SETSCAN 0
+#define SCANNING 1
+#define SCANDONE 2
+#define CHECKVERSION(a,b,c) p=strchr((char *) m_scanInformation->a,'#') + 1; sscanf(p,"%d ",&version); if (version < b) c = true;
+#define CHECKLIMITS(a,v,_min,_max,_def) a=v; if ((a<_min) || (a>_max)) a=_def;
+#define freeAndNull(p) if(p) { free(p); p=NULL; }
+#define deleteAndNull(p) if(p) { delete(p); p=NULL; }
+
+CScanControl::CScanControl(cVNSIClient *client)
+ : m_client(client),
+ m_isChecked(false),
+ m_isNotSupported(true),
+ m_channelScanPlugin(NULL),
+ m_singleScan(0),
+ m_cbuf(NULL),
+ m_sbuf(NULL),
+ m_scanInformation(NULL)
+{
+}
+
+CScanControl::~CScanControl()
+{
+ if (m_scanInformation)
+ delete m_scanInformation;
+ freeAndNull(m_cbuf);
+ freeAndNull(m_sbuf);
+}
+
+bool CScanControl::IsSupported()
+{
+ if (!m_isChecked)
+ LoadScanner();
+
+ return !m_isNotSupported;
+}
+
+bool CScanControl::LoadScanner()
+{
+ /*!
+ * Plugin present?
+ */
+ m_channelScanPlugin = cPluginManager::GetPlugin("wirbelscan");
+ if (m_channelScanPlugin == NULL)
+ return false;
+
+ /*!
+ * This plugin version compatibel to wirbelscan?
+ */
+ char *p;
+ m_scanInformation = new cWirbelscanInfo;
+ if (asprintf(&p, "%s%s", SPlugin, SInfo) < 0 ||
+ !m_channelScanPlugin->Service("wirbelscan_GetVersion", m_scanInformation))
+ {
+ m_client->OsdStatusMessage(*cString::sprintf("%s", tr("Your scanner version doesnt support services - Please upgrade.")));
+ free(p);
+ return false;
+ }
+ free(p);
+
+ int version = 0;
+ m_isNotSupported = false;
+ CHECKVERSION(CommandVersion,MIN_CMDVERSION, m_isNotSupported);
+ CHECKVERSION(StatusVersion, MIN_STATUSVERSION, m_isNotSupported);
+ CHECKVERSION(SetupVersion, MIN_SETUPVERSION, m_isNotSupported);
+ CHECKVERSION(CountryVersion,MIN_COUNTRYVERSION, m_isNotSupported);
+ CHECKVERSION(SatVersion, MIN_SATVERSION, m_isNotSupported);
+ CHECKVERSION(UserVersion, MIN_USERVERSION, m_isNotSupported);
+ if (m_isNotSupported)
+ {
+ m_client->OsdStatusMessage(*cString::sprintf("%s", tr("Your scanner version is to old - Please upgrade." )));
+ return false;
+ }
+
+ /*!
+ * Check which receivers are present
+ */
+ int cardnr = 0;
+ cDevice *device;
+ memset(&m_receiverSystems, 0, sizeof(m_receiverSystems));
+ while ((device = cDevice::GetDevice(cardnr++)))
+ {
+ if (device->ProvidesSource(cSource::stTerr))
+ m_receiverSystems[RECEIVER_SYSTEM_DVB_T] = true;
+ if (device->ProvidesSource(cSource::stCable))
+ m_receiverSystems[RECEIVER_SYSTEM_DVB_C] = true;
+ if (device->ProvidesSource(cSource::stSat))
+ m_receiverSystems[RECEIVER_SYSTEM_DVB_S] = true;
+ if (device->ProvidesSource(cSource::stAtsc))
+ m_receiverSystems[RECEIVER_SYSTEM_ATSC] = true;
+ }
+
+ if (cPluginManager::GetPlugin("pvrinput"))
+ {
+ m_receiverSystems[RECEIVER_SYSTEM_ANALOG_TV] = true;
+ m_receiverSystems[RECEIVER_SYSTEM_ANALOG_RADIO] = true;
+ }
+
+ m_countryBuffer.size = 0;
+ m_countryBuffer.count = 0;
+ m_countryBuffer.buffer = NULL;
+ if (asprintf(&p, "%sGet%s", SPlugin, SCountry) < 0)
+ return false;
+ m_channelScanPlugin->Service(p, &m_countryBuffer); // query buffer size.
+ m_cbuf = (SListItem*) malloc(m_countryBuffer.size * sizeof(SListItem)); // now, allocate memory.
+ m_countryBuffer.buffer = m_cbuf; // assign buffer
+ m_channelScanPlugin->Service(p, &m_countryBuffer); // fill buffer with values.
+ free(p);
+
+ m_satBuffer.size = 0;
+ m_satBuffer.count = 0;
+ m_satBuffer.buffer = NULL;
+ if (asprintf(&p, "%sGet%s", SPlugin, SSat) < 0)
+ return false;
+ m_channelScanPlugin->Service(p, &m_satBuffer); // query buffer size.
+ m_sbuf = (SListItem*) malloc(m_satBuffer.size * sizeof(SListItem)); // now, allocate memory.
+ m_satBuffer.buffer = m_sbuf; // assign buffer
+ m_channelScanPlugin->Service(p, &m_satBuffer); // fill buffer with values.
+ free(p);
+
+ if (asprintf(&p, "%sGet%s", SPlugin, SSetup) < 0)
+ return false;
+ m_channelScanPlugin->Service(p, &m_setup);
+ free(p);
+
+ return true;
+}
+
+bool CScanControl::StartScan(sScanServiceData &data)
+{
+ if (m_isNotSupported)
+ return false;
+
+ m_finishReported = false;
+
+ CHECKLIMITS(m_setup.SatId , data.SatIndex , 0 , 0xFFFF, 0);
+ CHECKLIMITS(m_setup.CountryId , data.CountryIndex , 0 , 0xFFFF, 0);
+ CHECKLIMITS(m_setup.DVB_Type , data.type , 0 , 5 , 0);
+ CHECKLIMITS(m_setup.DVBT_Inversion , data.DVBT_Inversion , 0 , 1 , 0);
+ CHECKLIMITS(m_setup.DVBC_Inversion , data.DVBC_Inversion , 0 , 1 , 0);
+ CHECKLIMITS(m_setup.DVBC_Symbolrate , data.DVBC_Symbolrate , 0 , 16 , 0);
+ CHECKLIMITS(m_setup.DVBC_QAM , data.DVBC_QAM , 0 , 4 , 0);
+ CHECKLIMITS(m_setup.ATSC_type , data.ATSC_Type , 0 , 1 , 0);
+
+ m_setup.scanflags = data.scan_tv ? SCAN_TV : 0;
+ m_setup.scanflags |= data.scan_radio ? SCAN_RADIO : 0;
+ m_setup.scanflags |= data.scan_scrambled ? SCAN_SCRAMBLED : 0;
+ m_setup.scanflags |= data.scan_fta ? SCAN_FTA : 0;
+ m_setup.scanflags |= data.scan_hd ? SCAN_HD : 0;
+
+ m_lastChannelCount = Channels.Count();
+
+ char *s;
+ if (asprintf(&s, "%sSet%s", SPlugin, SSetup) < 0)
+ return false;
+ m_channelScanPlugin->Service(s, &m_setup);
+ free(s);
+
+ PutCommand(CmdStartScan);
+ Start();// start polling thread
+ return true;
+}
+
+bool CScanControl::StopScan()
+{
+ if (m_isNotSupported)
+ return false;
+
+ PutCommand(CmdStopScan);
+ cCondWait::SleepMs(500);
+ Cancel(2);
+ if (!m_finishReported)
+ {
+ if (m_scanStatus.status != StatusStopped)
+ {
+ m_scanStatus.status = StatusStopped;
+ m_client->processSCAN_SetStatus(m_scanStatus.status);
+ INFOLOG("Stopping scan plugin not reported back and stop maybe not complete confirmed");
+ }
+ m_client->processSCAN_IsFinished();
+ }
+
+ return true;
+}
+
+bool CScanControl::GetCountries(scannerEntryList &list)
+{
+ for (uint32_t i = 0; i < m_countryBuffer.count; i++)
+ {
+ scannerEntry entry;
+ entry.index = m_countryBuffer.buffer[i].id;
+ entry.name = m_countryBuffer.buffer[i].short_name;
+ entry.longName = m_countryBuffer.buffer[i].full_name;
+ list.push_back(entry);
+ }
+
+ return !list.empty();
+}
+
+bool CScanControl::GetSatellites(scannerEntryList &list)
+{
+ for (uint32_t i = 0; i < m_satBuffer.count; i++)
+ {
+ scannerEntry entry;
+ entry.index = m_satBuffer.buffer[i].id;
+ entry.name = m_satBuffer.buffer[i].short_name;
+ entry.longName = m_satBuffer.buffer[i].full_name;
+ list.push_back(entry);
+ }
+
+ return !list.empty();
+}
+
+void CScanControl::PutCommand(WIRBELSCAN_SERVICE::s_cmd command)
+{
+ cWirbelscanCmd cmd;
+ char * request;
+ if (asprintf(&request, "%s%s", SPlugin, SCommand) < 0)
+ return;
+
+ cmd.cmd = command;
+ m_channelScanPlugin->Service(request, &cmd);
+ free(request);
+}
+
+void CScanControl::Action(void)
+{
+ while (Running())
+ {
+ cCondWait::SleepMs(1000);
+
+ char * s;
+ if (asprintf(&s, "%sGet%s", SPlugin, SStatus) < 0)
+ return;
+ m_channelScanPlugin->Service(s, &m_scanStatus);
+ free(s);
+
+ m_client->processSCAN_SetStatus(m_scanStatus.status);
+ m_client->processSCAN_SetPercentage(m_scanStatus.progress);
+ m_client->processSCAN_SetSignalStrength(m_scanStatus.strength, false);
+ m_client->processSCAN_SetDeviceInfo(m_scanStatus.curr_device);
+ m_client->processSCAN_SetTransponder(m_scanStatus.transponder);
+
+ for (int i = 0; i < Channels.Count()-m_lastChannelCount; i++)
+ {
+ cChannel *channel = Channels.GetByNumber(Channels.Count()-i);
+ m_client->processSCAN_NewChannel(channel->Name(), channel->Vpid() == 0, channel->Ca() > 0, channel->Vtype() > 2);
+ }
+ m_lastChannelCount = Channels.Count();
+
+ if (m_scanStatus.status == StatusStopped)
+ {
+ m_client->processSCAN_IsFinished();
+ m_finishReported = true;
+ break;
+ }
+ }
+ Cancel(0);
+}
diff --git a/channelscancontrol.h b/channelscancontrol.h
new file mode 100644
index 0000000..4bb0819
--- /dev/null
+++ b/channelscancontrol.h
@@ -0,0 +1,126 @@
+/*
+ * vdr-plugin-vnsi - KODI server plugin for VDR
+ *
+ * Copyright (C) 2010,2015 Alwin Esch (Team KODI)
+ * Copyright (C) 2010, 2011 Alexander Pipelka
+ *
+ * http://kodi.tv
+ *
+ * This Program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2, or (at your option)
+ * any later version.
+ *
+ * This Program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with KODI; see the file COPYING. If not, see
+ * <http://www.gnu.org/licenses/>.
+ *
+ */
+
+#ifndef __CHANNELSCAN_CONTROL__
+#define __CHANNELSCAN_CONTROL__
+
+#include <vector>
+#include <vdr/plugin.h>
+#include "wirbelscan_services.h"
+
+#define RECEIVER_SYSTEM_DVB_T 0
+#define RECEIVER_SYSTEM_DVB_C 1
+#define RECEIVER_SYSTEM_DVB_S 2
+#define RECEIVER_SYSTEM_ATSC 3
+#define RECEIVER_SYSTEM_ANALOG_TV 4
+#define RECEIVER_SYSTEM_ANALOG_RADIO 5
+
+typedef enum scantype
+{
+ DVB_TERR = 0,
+ DVB_CABLE = 1,
+ DVB_SAT = 2,
+ PVRINPUT = 3,
+ PVRINPUT_FM = 4,
+ DVB_ATSC = 5,
+} scantype_t;
+
+struct sScanServiceData
+{
+ int type;
+
+ bool scan_tv;
+ bool scan_radio;
+ bool scan_fta;
+ bool scan_scrambled;
+ bool scan_hd;
+
+ int CountryIndex;
+
+ int DVBC_Inversion;
+ int DVBC_Symbolrate;
+ int DVBC_QAM;
+
+ int DVBT_Inversion;
+
+ int SatIndex;
+
+ int ATSC_Type;
+};
+
+struct scannerEntry
+{
+ int index;
+ const char *name;
+ const char *longName;
+};
+
+typedef std::vector<scannerEntry> scannerEntryList;
+
+class cVNSIClient;
+
+class CScanControl : public cThread
+{
+public:
+ CScanControl(cVNSIClient *client);
+ ~CScanControl();
+
+ bool IsSupported();
+ bool StartScan(sScanServiceData &data);
+ bool StopScan();
+ bool GetCountries(scannerEntryList &list);
+ bool GetSatellites(scannerEntryList &list);
+
+ bool SupportsDVB_T() { return m_receiverSystems[RECEIVER_SYSTEM_DVB_T]; }
+ bool SupportsDVB_C() { return m_receiverSystems[RECEIVER_SYSTEM_DVB_C]; }
+ bool SupportsDVB_S() { return m_receiverSystems[RECEIVER_SYSTEM_DVB_S]; }
+ bool SupportsAnalogTV() { return m_receiverSystems[RECEIVER_SYSTEM_ANALOG_TV]; }
+ bool SupportsAnalogRadio() { return m_receiverSystems[RECEIVER_SYSTEM_ANALOG_RADIO]; }
+ bool SupportsATSC() { return m_receiverSystems[RECEIVER_SYSTEM_ATSC]; }
+
+ virtual void Action();
+
+private:
+ bool LoadScanner();
+ void PutCommand(WIRBELSCAN_SERVICE::s_cmd command);
+
+ cVNSIClient *m_client;
+ bool m_isChecked;
+ bool m_isNotSupported;
+ bool m_isNotTpSupported;
+ bool m_receiverSystems[6];
+ cPlugin *m_channelScanPlugin;
+ bool m_singleScan;
+ bool m_finishReported;
+ WIRBELSCAN_SERVICE::SListItem *m_cbuf;
+ WIRBELSCAN_SERVICE::SListItem *m_sbuf;
+ WIRBELSCAN_SERVICE::cPreAllocBuffer m_countryBuffer;
+ WIRBELSCAN_SERVICE::cPreAllocBuffer m_satBuffer;
+ WIRBELSCAN_SERVICE::cWirbelscanInfo *m_scanInformation;
+ WIRBELSCAN_SERVICE::cWirbelscanStatus m_scanStatus;
+ WIRBELSCAN_SERVICE::cWirbelscanScanSetup m_setup;
+ int m_lastChannelCount;
+};
+
+#endif // __CHANNELSCAN_CONTROL__
diff --git a/config.c b/config.c
index 5ce3549..29a1909 100644
--- a/config.c
+++ b/config.c
@@ -1,10 +1,11 @@
/*
- * vdr-plugin-vnsi - XBMC server plugin for VDR
+ * vdr-plugin-vnsi - KODI server plugin for VDR
*
* Copyright (C) 2010 Alwin Esch (Team XBMC)
* Copyright (C) 2010, 2011 Alexander Pipelka
+ * Copyright (C) 2015 Team KODI
*
- * http://www.xbmc.org
+ * http://kodi.tv
*
* This Program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -17,7 +18,7 @@
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
- * along with XBMC; see the file COPYING. If not, see
+ * along with KODI; see the file COPYING. If not, see
* <http://www.gnu.org/licenses/>.
*
*/
@@ -36,6 +37,7 @@ cVNSIServerConfig::cVNSIServerConfig()
ConfigDirectory = NULL;
stream_timeout = 10;
device = false;
+ pDevice = NULL;
testStreamActive = false;
}
diff --git a/config.h b/config.h
index 50feb2e..933bf96 100644
--- a/config.h
+++ b/config.h
@@ -1,10 +1,11 @@
/*
- * vdr-plugin-vnsi - XBMC server plugin for VDR
+ * vdr-plugin-vnsi - KODI server plugin for VDR
*
* Copyright (C) 2010 Alwin Esch (Team XBMC)
* Copyright (C) 2010, 2011 Alexander Pipelka
+ * Copyright (C) 2015 Team KODI
*
- * http://www.xbmc.org
+ * http://kodi.tv
*
* This Program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -17,7 +18,7 @@
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
- * along with XBMC; see the file COPYING. If not, see
+ * along with KODI; see the file COPYING. If not, see
* <http://www.gnu.org/licenses/>.
*
*/
@@ -79,6 +80,7 @@ public:
uint16_t listen_port; // Port of remote server
uint16_t stream_timeout; // timeout in seconds for stream data
bool device; // true if vnsi should act as dummy device
+ void *pDevice; // pointer to cDvbVnsiDevice
cString testStreamFile; // TS file to simulate channel
bool testStreamActive; // true if test mode is enabled
};
diff --git a/cxsocket.c b/cxsocket.c
index 68fbaa9..e50bfab 100644
--- a/cxsocket.c
+++ b/cxsocket.c
@@ -1,11 +1,12 @@
/*
- * vdr-plugin-vnsi - XBMC server plugin for VDR
+ * vdr-plugin-vnsi - KODI server plugin for VDR
*
* Copyright (C) 2003-2006 Petri Hintukainen
* Copyright (C) 2010 Alwin Esch (Team XBMC)
* Copyright (C) 2011 Alexander Pipelka
+ * Copyright (C) 2015 Team KODI
*
- * http://www.xbmc.org
+ * http://kodi.tv
*
* This Program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -18,7 +19,7 @@
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
- * along with XBMC; see the file COPYING. If not, see
+ * along with KODI; see the file COPYING. If not, see
* <http://www.gnu.org/licenses/>.
*
*/
diff --git a/cxsocket.h b/cxsocket.h
index 3d9e64f..d144411 100644
--- a/cxsocket.h
+++ b/cxsocket.h
@@ -1,11 +1,12 @@
/*
- * vdr-plugin-vnsi - XBMC server plugin for VDR
+ * vdr-plugin-vnsi - KODI server plugin for VDR
*
* Copyright (C) 2003-2006 Petri Hintukainen
* Copyright (C) 2010 Alwin Esch (Team XBMC)
* Copyright (C) 2011 Alexander Pipelka
+ * Copyright (C) 2015 Team KODI
*
- * http://www.xbmc.org
+ * http://kodi.tv
*
* This Program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -18,7 +19,7 @@
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
- * along with XBMC; see the file COPYING. If not, see
+ * along with KODI; see the file COPYING. If not, see
* <http://www.gnu.org/licenses/>.
*
*/
diff --git a/demuxer.c b/demuxer.c
index 02b2976..94859ec 100644
--- a/demuxer.c
+++ b/demuxer.c
@@ -1,6 +1,10 @@
/*
+ * vdr-plugin-vnsi - KODI server plugin for VDR
+ *
* Copyright (C) 2005-2012 Team XBMC
- * http://www.xbmc.org
+ * Copyright (C) 2015 Team KODI
+ *
+ * http://kodi.tv
*
* This Program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -13,7 +17,7 @@
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
- * along with XBMC; see the file COPYING. If not, see
+ * along with KODI; see the file COPYING. If not, see
* <http://www.gnu.org/licenses/>.
*
*/
@@ -27,7 +31,8 @@
#include <vdr/channels.h>
#include <libsi/si.h>
-cVNSIDemuxer::cVNSIDemuxer()
+cVNSIDemuxer::cVNSIDemuxer(bool bAllowRDS)
+ : m_bAllowRDS(bAllowRDS)
{
m_OldPmtVersion = -1;
}
@@ -50,8 +55,6 @@ void cVNSIDemuxer::Open(const cChannel &channel, cVideoBuffer *videoBuffer)
else
m_WaitIFrame = false;
- m_FirstFramePTS = 0;
-
m_PtsWrap.m_Wrap = false;
m_PtsWrap.m_NoOfWraps = 0;
m_PtsWrap.m_ConfirmCount = 0;
@@ -73,7 +76,7 @@ void cVNSIDemuxer::Close()
m_StreamInfos.clear();
}
-int cVNSIDemuxer::Read(sStreamPacket *packet)
+int cVNSIDemuxer::Read(sStreamPacket *packet, sStreamPacket *packet_side_data)
{
uint8_t *buf;
int len;
@@ -132,18 +135,10 @@ int cVNSIDemuxer::Read(sStreamPacket *packet)
}
else if (stream = FindStream(ts_pid))
{
- int error = stream->ProcessTSPacket(buf, packet, m_WaitIFrame);
+ int error = stream->ProcessTSPacket(buf, packet, packet_side_data, m_WaitIFrame);
if (error == 0)
{
- if (m_WaitIFrame)
- {
- if (packet->pts != DVD_NOPTS_VALUE)
- m_FirstFramePTS = packet->pts;
- m_WaitIFrame = false;
- }
-
- if (packet->pts < m_FirstFramePTS)
- return 0;
+ m_WaitIFrame = false;
packet->serial = m_MuxPacketSerial;
if (m_SetRefTime)
@@ -434,7 +429,7 @@ bool cVNSIDemuxer::EnsureParsers()
}
else if (it->type == stMPEG2AUDIO)
{
- stream = new cTSStream(stMPEG2AUDIO, it->pID, &m_PtsWrap);
+ stream = new cTSStream(stMPEG2AUDIO, it->pID, &m_PtsWrap, it->handleRDS);
stream->SetLanguage(it->language);
}
else if (it->type == stAACADTS)
@@ -484,6 +479,7 @@ bool cVNSIDemuxer::EnsureParsers()
void cVNSIDemuxer::SetChannelStreams(const cChannel *channel)
{
sStreamInfo newStream;
+ bool containsVideo = false;
int index = 0;
if (channel->Vpid())
{
@@ -496,6 +492,7 @@ void cVNSIDemuxer::SetChannelStreams(const cChannel *channel)
newStream.type = stMPEG2VIDEO;
AddStreamInfo(newStream);
+ containsVideo = true;
}
const int *DPids = channel->Dpids();
@@ -530,6 +527,7 @@ void cVNSIDemuxer::SetChannelStreams(const cChannel *channel)
else if (channel->Atype(index) == 0x11)
newStream.type = stAACLATM;
#endif
+ newStream.handleRDS = m_bAllowRDS && newStream.type == stMPEG2AUDIO && !containsVideo ? true : false; // Relevant for RDS, if present only on mpeg 2 audio, use only if RDS is allowed
newStream.SetLanguage(channel->Alang(index));
AddStreamInfo(newStream);
}
diff --git a/demuxer.h b/demuxer.h
index cf71983..fe83f02 100644
--- a/demuxer.h
+++ b/demuxer.h
@@ -1,6 +1,10 @@
/*
+ * vdr-plugin-vnsi - KODI server plugin for VDR
+ *
* Copyright (C) 2005-2012 Team XBMC
- * http://www.xbmc.org
+ * Copyright (C) 2015 Team KODI
+ *
+ * http://kodi.tv
*
* This Program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -13,7 +17,7 @@
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
- * along with XBMC; see the file COPYING. If not, see
+ * along with KODI; see the file COPYING. If not, see
* <http://www.gnu.org/licenses/>.
*
*/
@@ -38,6 +42,7 @@ struct sStreamInfo
int subtitlingType;
int compositionPageId;
int ancillaryPageId;
+ bool handleRDS;
void SetLanguage(const char* lang)
{
language[0] = lang[0];
@@ -50,9 +55,9 @@ struct sStreamInfo
class cVNSIDemuxer
{
public:
- cVNSIDemuxer();
+ cVNSIDemuxer(bool bAllowRDS);
virtual ~cVNSIDemuxer();
- int Read(sStreamPacket *packet);
+ int Read(sStreamPacket *packet, sStreamPacket *packet_side_data);
cTSStream *GetFirstStream();
cTSStream *GetNextStream();
void Open(const cChannel &channel, cVideoBuffer *videoBuffer);
@@ -78,7 +83,6 @@ protected:
cPatPmtParser m_PatPmtParser;
int m_OldPmtVersion;
bool m_WaitIFrame;
- int64_t m_FirstFramePTS;
cVideoBuffer *m_VideoBuffer;
cMutex m_Mutex;
uint32_t m_MuxPacketSerial;
@@ -86,4 +90,5 @@ protected:
uint16_t m_Error;
bool m_SetRefTime;
time_t m_refTime, m_endTime, m_wrapTime;
+ bool m_bAllowRDS;
};
diff --git a/hash.c b/hash.c
index 6afa505..f4dee4e 100644
--- a/hash.c
+++ b/hash.c
@@ -1,8 +1,11 @@
/*
- * vdr-plugin-vnsi - XBMC server plugin for VDR
+ * vdr-plugin-vnsi - KODI server plugin for VDR
*
* Copyright (C) 1986 Gary S. Brown (CRC32 code)
* Copyright (C) 2011 Alexander Pipelka
+ * Copyright (C) 2015 Team KODI
+ *
+ * http://kodi.tv
*
* This Program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -15,7 +18,7 @@
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
- * along with XBMC; see the file COPYING. If not, see
+ * along with KODI; see the file COPYING. If not, see
* <http://www.gnu.org/licenses/>.
*
*/
diff --git a/hash.h b/hash.h
index 0aef425..05e5fff 100644
--- a/hash.h
+++ b/hash.h
@@ -1,8 +1,11 @@
/*
- * vdr-plugin-vnsi - XBMC server plugin for VDR
+ * vdr-plugin-vnsi - KODI server plugin for VDR
*
* Copyright (C) 1986 Gary S. Brown (CRC32 code)
* Copyright (C) 2011 Alexander Pipelka
+ * Copyright (C) 2015 Team KODI
+ *
+ * http://kodi.tv
*
* This Program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -15,7 +18,7 @@
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
- * along with XBMC; see the file COPYING. If not, see
+ * along with KODI; see the file COPYING. If not, see
* <http://www.gnu.org/licenses/>.
*
*/
diff --git a/parser.c b/parser.c
index c4a2b3c..ab8dadf 100644
--- a/parser.c
+++ b/parser.c
@@ -1,6 +1,10 @@
/*
+ * vdr-plugin-vnsi - KODI server plugin for VDR
+ *
* Copyright (C) 2005-2012 Team XBMC
- * http://www.xbmc.org
+ * Copyright (C) 2015 Team KODI
+ *
+ * http://kodi.tv
*
* This Program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -13,7 +17,7 @@
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
- * along with XBMC; see the file COPYING. If not, see
+ * along with KODI; see the file COPYING. If not, see
* <http://www.gnu.org/licenses/>.
*
*/
@@ -434,7 +438,9 @@ inline bool cParser::IsValidStartCode(uint8_t *buf, int size)
// --- cTSStream ----------------------------------------------------
-cTSStream::cTSStream(eStreamType type, int pid, sPtsWrap *ptsWrap)
+uint32_t cTSStream::m_UniqueSideDataIDs = 0;
+
+cTSStream::cTSStream(eStreamType type, int pid, sPtsWrap *ptsWrap, bool handleSideData)
: m_streamType(type)
, m_pID(pid)
{
@@ -465,7 +471,7 @@ cTSStream::cTSStream(eStreamType type, int pid, sPtsWrap *ptsWrap)
}
else if (m_streamType == stMPEG2AUDIO)
{
- m_pesParser = new cParserMPEG2Audio(m_pID, this, ptsWrap, true);
+ m_pesParser = new cParserMPEG2Audio(m_pID, this, ptsWrap, true, handleSideData);
m_streamContent = scAUDIO;
}
else if (m_streamType == stAACADTS)
@@ -519,17 +525,19 @@ cTSStream::~cTSStream()
}
}
-int cTSStream::ProcessTSPacket(uint8_t *data, sStreamPacket *pkt, bool iframe)
+int cTSStream::ProcessTSPacket(uint8_t *data, sStreamPacket *pkt, sStreamPacket *pkt_side_data, bool iframe)
{
+ int ret = 1;
+
if (!data)
- return 1;
+ return ret;
if (!m_pesParser)
- return 1;
+ return ret;
int payloadSize = m_pesParser->ParsePacketHeader(data);
if (payloadSize == 0)
- return 1;
+ return ret;
else if (payloadSize < 0)
{
return -m_pesParser->GetError();
@@ -540,25 +548,41 @@ int cTSStream::ProcessTSPacket(uint8_t *data, sStreamPacket *pkt, bool iframe)
return -m_pesParser->GetError();
}
- m_pesParser->Parse(pkt);
+ m_pesParser->Parse(pkt, pkt_side_data);
if (iframe && !m_pesParser->IsVideo())
- return 1;
+ return ret;
if (pkt->data)
{
int64_t dts = pkt->dts;
int64_t pts = pkt->pts;
- // Rescale for XBMC
+ // Rescale for KODI
if (pkt->dts != DVD_NOPTS_VALUE)
pkt->dts = Rescale(dts, DVD_TIME_BASE, 90000);
if (pkt->pts != DVD_NOPTS_VALUE)
pkt->pts = Rescale(pts, DVD_TIME_BASE, 90000);
pkt->duration = Rescale(pkt->duration, DVD_TIME_BASE, 90000);
- return 0;
+
+ ret = 0;
}
- return 1;
+ if (pkt_side_data && pkt_side_data->data)
+ {
+ int64_t dts = pkt_side_data->dts;
+ int64_t pts = pkt_side_data->pts;
+
+ // Rescale for KODI
+ if (pkt_side_data->dts != DVD_NOPTS_VALUE)
+ pkt_side_data->dts = Rescale(dts, DVD_TIME_BASE, 90000);
+ if (pkt_side_data->pts != DVD_NOPTS_VALUE)
+ pkt_side_data->pts = Rescale(pts, DVD_TIME_BASE, 90000);
+ pkt_side_data->duration = Rescale(pkt_side_data->duration, DVD_TIME_BASE, 90000);
+
+ ret = 0;
+ }
+
+ return ret;
}
bool cTSStream::ReadTime(uint8_t *data, int64_t *dts)
@@ -632,7 +656,7 @@ int64_t cTSStream::Rescale(int64_t a, int64_t b, int64_t c)
{
a1+= a1 + ((a0>>i)&1);
t1+=t1;
- if (c <= a1)
+ if (c <= (int64_t)a1)
{
a1 -= c;
t1++;
@@ -642,6 +666,19 @@ int64_t cTSStream::Rescale(int64_t a, int64_t b, int64_t c)
}
}
+uint32_t cTSStream::AddSideDataType(eStreamContent content)
+{
+ m_UniqueSideDataIDs++;
+ if (m_UniqueSideDataIDs == 0)
+ m_UniqueSideDataIDs++;
+
+ uint32_t sidePid = m_UniqueSideDataIDs << 16;
+
+ m_SideDataTypes.push_back(std::make_pair(sidePid, content));
+
+ return sidePid;
+}
+
void cTSStream::SetLanguage(const char *language)
{
m_language[0] = language[0];
diff --git a/parser.h b/parser.h
index e446fb7..f15bd2e 100644
--- a/parser.h
+++ b/parser.h
@@ -1,6 +1,10 @@
/*
+ * vdr-plugin-vnsi - KODI server plugin for VDR
+ *
* Copyright (C) 2005-2012 Team XBMC
- * http://www.xbmc.org
+ * Copyright (C) 2015 Team KODI
+ *
+ * http://kodi.tv
*
* This Program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -13,7 +17,7 @@
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
- * along with XBMC; see the file COPYING. If not, see
+ * along with KODI; see the file COPYING. If not, see
* <http://www.gnu.org/licenses/>.
*
*/
@@ -23,6 +27,7 @@
#include <vdr/device.h>
#include <queue>
+#include <vector>
#define DVD_TIME_BASE 1000000
#define DVD_NOPTS_VALUE (-1LL<<52) // should be possible to represent in both double and __int64
@@ -84,7 +89,8 @@ enum eStreamContent
scAUDIO,
scSUBTITLE,
scTELETEXT,
- scPROGRAMM
+ scPROGRAMM,
+ scRDS
};
enum eStreamType
@@ -144,7 +150,7 @@ public:
virtual ~cParser();
bool AddPESPacket(uint8_t *data, int size);
- virtual void Parse(sStreamPacket *pkt) = 0;
+ virtual void Parse(sStreamPacket *pkt, sStreamPacket *pkt_side_data) = 0;
// void ClearFrame() {m_PesBufferPtr = 0;}
int ParsePacketHeader(uint8_t *data);
int ParsePESHeader(uint8_t *buf, size_t len);
@@ -210,15 +216,18 @@ private:
int m_BitsPerSample;
int m_BlockAlign;
+ std::vector< std::pair<uint32_t, eStreamContent> > m_SideDataTypes;
+ static uint32_t m_UniqueSideDataIDs;
+
unsigned char m_subtitlingType;
uint16_t m_compositionPageId;
uint16_t m_ancillaryPageId;
public:
- cTSStream(eStreamType type, int pid, sPtsWrap *ptsWrap);
+ cTSStream(eStreamType type, int pid, sPtsWrap *ptsWrap, bool handleSideData = false);
virtual ~cTSStream();
- int ProcessTSPacket(uint8_t *data, sStreamPacket *pkt, bool iframe);
+ int ProcessTSPacket(uint8_t *data, sStreamPacket *pkt, sStreamPacket *pkt_side_data, bool iframe);
bool ReadTime(uint8_t *data, int64_t *dts);
void ResetParser();
@@ -229,6 +238,9 @@ public:
void SetType(eStreamType type) { m_streamType = type; }
const int GetPID() const { return m_pID; }
+ uint32_t AddSideDataType(eStreamContent content);
+ const std::vector< std::pair<uint32_t, eStreamContent> > *GetSideDataTypes() const { return &m_SideDataTypes; }
+
/* Video Stream Information */
bool SetVideoInformation(int FpsScale, int FpsRate, int Height, int Width, float Aspect);
void GetVideoInformation(uint32_t &FpsScale, uint32_t &FpsRate, uint32_t &Height, uint32_t &Width, double &Aspect);
diff --git a/parser_AAC.c b/parser_AAC.c
index aae8404..5dab502 100644
--- a/parser_AAC.c
+++ b/parser_AAC.c
@@ -1,6 +1,10 @@
/*
+ * vdr-plugin-vnsi - KODI server plugin for VDR
+ *
* Copyright (C) 2005-2012 Team XBMC
- * http://www.xbmc.org
+ * Copyright (C) 2015 Team KODI
+ *
+ * http://kodi.tv
*
* This Program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -13,7 +17,7 @@
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
- * along with XBMC; see the file COPYING. If not, see
+ * along with KODI; see the file COPYING. If not, see
* <http://www.gnu.org/licenses/>.
*
*/
@@ -58,7 +62,7 @@ cParserAAC::~cParserAAC()
}
-void cParserAAC::Parse(sStreamPacket *pkt)
+void cParserAAC::Parse(sStreamPacket *pkt, sStreamPacket *pkt_side_data)
{
int p = m_PesParserPtr;
int l;
diff --git a/parser_AAC.h b/parser_AAC.h
index f63a724..d898626 100644
--- a/parser_AAC.h
+++ b/parser_AAC.h
@@ -1,6 +1,10 @@
/*
+ * vdr-plugin-vnsi - KODI server plugin for VDR
+ *
* Copyright (C) 2005-2012 Team XBMC
- * http://www.xbmc.org
+ * Copyright (C) 2015 Team KODI
+ *
+ * http://kodi.tv
*
* This Program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -13,7 +17,7 @@
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
- * along with XBMC; see the file COPYING. If not, see
+ * along with KODI; see the file COPYING. If not, see
* <http://www.gnu.org/licenses/>.
*
*/
@@ -51,7 +55,7 @@ private:
public:
cParserAAC(int pID, cTSStream *stream, sPtsWrap *ptsWrap, bool observePtsWraps);
virtual ~cParserAAC();
- virtual void Parse(sStreamPacket *pkt);
+ virtual void Parse(sStreamPacket *pkt, sStreamPacket *pkt_side_data);
virtual void Reset();
};
diff --git a/parser_AC3.c b/parser_AC3.c
index a1645a2..f401953 100644
--- a/parser_AC3.c
+++ b/parser_AC3.c
@@ -1,6 +1,10 @@
/*
+ * vdr-plugin-vnsi - KODI server plugin for VDR
+ *
* Copyright (C) 2005-2012 Team XBMC
- * http://www.xbmc.org
+ * Copyright (C) 2015 Team KODI
+ *
+ * http://kodi.tv
*
* This Program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -13,7 +17,7 @@
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
- * along with XBMC; see the file COPYING. If not, see
+ * along with KODI; see the file COPYING. If not, see
* <http://www.gnu.org/licenses/>.
*
*/
@@ -121,7 +125,7 @@ cParserAC3::~cParserAC3()
{
}
-void cParserAC3::Parse(sStreamPacket *pkt)
+void cParserAC3::Parse(sStreamPacket *pkt, sStreamPacket *pkt_side_data)
{
int p = m_PesParserPtr;
int l;
diff --git a/parser_AC3.h b/parser_AC3.h
index b789423..a70d177 100644
--- a/parser_AC3.h
+++ b/parser_AC3.h
@@ -1,6 +1,10 @@
/*
+ * vdr-plugin-vnsi - KODI server plugin for VDR
+ *
* Copyright (C) 2005-2012 Team XBMC
- * http://www.xbmc.org
+ * Copyright (C) 2015 Team KODI
+ *
+ * http://kodi.tv
*
* This Program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -13,7 +17,7 @@
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
- * along with XBMC; see the file COPYING. If not, see
+ * along with KODI; see the file COPYING. If not, see
* <http://www.gnu.org/licenses/>.
*
*/
@@ -42,7 +46,7 @@ public:
cParserAC3(int pID, cTSStream *stream, sPtsWrap *ptsWrap, bool observePtsWraps);
virtual ~cParserAC3();
- virtual void Parse(sStreamPacket *pkt);
+ virtual void Parse(sStreamPacket *pkt, sStreamPacket *pkt_side_data);
virtual void Reset();
};
diff --git a/parser_DTS.c b/parser_DTS.c
index 2ad2385..f464892 100644
--- a/parser_DTS.c
+++ b/parser_DTS.c
@@ -1,6 +1,10 @@
/*
+ * vdr-plugin-vnsi - KODI server plugin for VDR
+ *
* Copyright (C) 2005-2012 Team XBMC
- * http://www.xbmc.org
+ * Copyright (C) 2015 Team KODI
+ *
+ * http://kodi.tv
*
* This Program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -13,7 +17,7 @@
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
- * along with XBMC; see the file COPYING. If not, see
+ * along with KODI; see the file COPYING. If not, see
* <http://www.gnu.org/licenses/>.
*
*/
@@ -34,7 +38,7 @@ cParserDTS::~cParserDTS()
{
}
-void cParserDTS::Parse(sStreamPacket *pkt)
+void cParserDTS::Parse(sStreamPacket *pkt, sStreamPacket *pkt_side_data)
{
}
diff --git a/parser_DTS.h b/parser_DTS.h
index c28b4ba..11bd91e 100644
--- a/parser_DTS.h
+++ b/parser_DTS.h
@@ -1,6 +1,10 @@
/*
+ * vdr-plugin-vnsi - KODI server plugin for VDR
+ *
* Copyright (C) 2005-2012 Team XBMC
- * http://www.xbmc.org
+ * Copyright (C) 2015 Team KODI
+ *
+ * http://kodi.tv
*
* This Program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -13,7 +17,7 @@
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
- * along with XBMC; see the file COPYING. If not, see
+ * along with KODI; see the file COPYING. If not, see
* <http://www.gnu.org/licenses/>.
*
*/
@@ -33,7 +37,7 @@ public:
cParserDTS(int pID, cTSStream *stream, sPtsWrap *ptsWrap, bool observePtsWraps);
virtual ~cParserDTS();
- virtual void Parse(sStreamPacket *pkt);
+ virtual void Parse(sStreamPacket *pkt, sStreamPacket *pkt_side_data);
};
diff --git a/parser_MPEGAudio.c b/parser_MPEGAudio.c
index 2c62030..fbbb0d0 100644
--- a/parser_MPEGAudio.c
+++ b/parser_MPEGAudio.c
@@ -1,6 +1,10 @@
/*
+ * vdr-plugin-vnsi - KODI server plugin for VDR
+ *
* Copyright (C) 2005-2012 Team XBMC
- * http://www.xbmc.org
+ * Copyright (C) 2015 Team KODI
+ *
+ * http://kodi.tv
*
* This Program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -13,7 +17,7 @@
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
- * along with XBMC; see the file COPYING. If not, see
+ * along with KODI; see the file COPYING. If not, see
* <http://www.gnu.org/licenses/>.
*
*/
@@ -25,6 +29,8 @@
#include "parser_MPEGAudio.h"
#include "bitstream.h"
+#define MAX_RDS_BUFFER_SIZE 100000
+
const uint16_t FrequencyTable[3] = { 44100, 48000, 32000 };
const uint16_t BitrateTable[2][3][15] =
{
@@ -40,7 +46,7 @@ const uint16_t BitrateTable[2][3][15] =
}
};
-cParserMPEG2Audio::cParserMPEG2Audio(int pID, cTSStream *stream, sPtsWrap *ptsWrap, bool observePtsWraps)
+cParserMPEG2Audio::cParserMPEG2Audio(int pID, cTSStream *stream, sPtsWrap *ptsWrap, bool observePtsWraps, bool enableRDS)
: cParser(pID, stream, ptsWrap, observePtsWraps)
{
m_PTS = 0;
@@ -50,13 +56,23 @@ cParserMPEG2Audio::cParserMPEG2Audio(int pID, cTSStream *stream, sPtsWrap *ptsWr
m_Channels = 0;
m_BitRate = 0;
m_PesBufferInitialSize = 2048;
+ m_RDSEnabled = enableRDS;
+ m_RDSBufferInitialSize = 384;
+ m_RDSBuffer = NULL;
+ m_RDSBufferSize = 0;
+ m_RDSExtPID = 0;
}
cParserMPEG2Audio::~cParserMPEG2Audio()
{
+ if (m_RDSBuffer)
+ {
+ delete m_RDSBuffer;
+ m_RDSBuffer = NULL;
+ }
}
-void cParserMPEG2Audio::Parse(sStreamPacket *pkt)
+void cParserMPEG2Audio::Parse(sStreamPacket *pkt, sStreamPacket *pkt_side_data)
{
int p = m_PesParserPtr;
int l;
@@ -82,9 +98,74 @@ void cParserMPEG2Audio::Parse(sStreamPacket *pkt)
m_PesNextFramePtr = p + m_FrameSize;
m_PesParserPtr = 0;
m_FoundFrame = false;
+
+ if (m_RDSEnabled)
+ {
+ /*
+ * Reading of RDS Universal Encoder Communication Protocol
+ * If present it starts on end of a mpeg audio stream and goes
+ * backwards.
+ * See ETSI TS 101 154 - C.4.2.18 for details.
+ */
+ int rdsl = m_PesBuffer[p+m_FrameSize-2]; // RDS DataFieldLength
+ if (m_PesBuffer[p+m_FrameSize-1] == 0xfd && rdsl > 0) // RDS DataSync = 0xfd @ end
+ {
+ if (m_RDSBuffer == NULL)
+ {
+ m_RDSBufferSize = m_RDSBufferInitialSize;
+ m_RDSBuffer = (uint8_t*)malloc(m_RDSBufferSize);
+
+ if (m_RDSBuffer == NULL)
+ {
+ ERRORLOG("PVR Parser MPEG2-Audio - %s - malloc failed for RDS data", __FUNCTION__);
+ m_RDSEnabled = false;
+ return;
+ }
+
+ m_RDSExtPID = m_Stream->AddSideDataType(scRDS);
+ if (!m_RDSExtPID)
+ {
+ ERRORLOG("PVR Parser MPEG2-Audio - %s - failed to add RDS data stream", __FUNCTION__);
+ m_RDSEnabled = false;
+ return;
+ }
+ }
+
+ if (rdsl >= m_RDSBufferSize)
+ {
+ if (rdsl >= MAX_RDS_BUFFER_SIZE)
+ {
+ ERRORLOG("PVR Parser MPEG2-Audio - %s - max buffer size (%i kB) for RDS data reached, pid: %d", __FUNCTION__, MAX_RDS_BUFFER_SIZE/1024, m_pID);
+ m_RDSEnabled = false;
+ return;
+ }
+ m_RDSBufferSize += m_RDSBufferInitialSize / 10;
+ m_RDSBuffer = (uint8_t*)realloc(m_RDSBuffer, m_RDSBufferSize);
+ if (m_RDSBuffer == NULL)
+ {
+ ERRORLOG("PVR Parser MPEG2-Audio - %s - realloc for RDS data failed", __FUNCTION__);
+ m_RDSEnabled = false;
+ return;
+ }
+ }
+
+ int pes_buffer_ptr = 0;
+ for (int i = m_FrameSize-3; i > m_FrameSize-3-rdsl; i--) // <-- data reverse, from end to start
+ m_RDSBuffer[pes_buffer_ptr++] = m_PesBuffer[p+i];
+
+ pkt_side_data->id = m_RDSExtPID;
+ pkt_side_data->data = m_RDSBuffer;
+ pkt_side_data->size = pes_buffer_ptr;
+ pkt_side_data->duration = 0;
+ pkt_side_data->dts = m_curDTS;
+ pkt_side_data->pts = m_curPTS;
+ pkt_side_data->streamChange = false;
+ }
+ }
}
}
+
int cParserMPEG2Audio::FindHeaders(uint8_t *buf, int buf_size)
{
if (m_FoundFrame)
diff --git a/parser_MPEGAudio.h b/parser_MPEGAudio.h
index 32a3989..e2f25b1 100644
--- a/parser_MPEGAudio.h
+++ b/parser_MPEGAudio.h
@@ -1,6 +1,10 @@
/*
+ * vdr-plugin-vnsi - KODI server plugin for VDR
+ *
* Copyright (C) 2005-2012 Team XBMC
- * http://www.xbmc.org
+ * Copyright (C) 2015 Team KODI
+ *
+ * http://kodi.tv
*
* This Program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -13,7 +17,7 @@
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
- * along with XBMC; see the file COPYING. If not, see
+ * along with KODI; see the file COPYING. If not, see
* <http://www.gnu.org/licenses/>.
*
*/
@@ -36,13 +40,20 @@ private:
int64_t m_PTS;
int64_t m_DTS;
+ bool m_RDSEnabled;
+ uint32_t m_RDSExtPID;
+ uint8_t *m_RDSBuffer;
+ int m_RDSBufferSize;
+ int m_RDSBufferPtr;
+ size_t m_RDSBufferInitialSize;
+
int FindHeaders(uint8_t *buf, int buf_size);
public:
- cParserMPEG2Audio(int pID, cTSStream *stream, sPtsWrap *ptsWrap, bool observePtsWraps);
+ cParserMPEG2Audio(int pID, cTSStream *stream, sPtsWrap *ptsWrap, bool observePtsWraps, bool enableRDS);
virtual ~cParserMPEG2Audio();
- virtual void Parse(sStreamPacket *pkt);
+ virtual void Parse(sStreamPacket *pkt, sStreamPacket *pkt_side_data);
};
diff --git a/parser_MPEGVideo.c b/parser_MPEGVideo.c
index 2e9cb93..663d09d 100644
--- a/parser_MPEGVideo.c
+++ b/parser_MPEGVideo.c
@@ -1,6 +1,10 @@
/*
+ * vdr-plugin-vnsi - KODI server plugin for VDR
+ *
* Copyright (C) 2005-2012 Team XBMC
- * http://www.xbmc.org
+ * Copyright (C) 2015 Team KODI
+ *
+ * http://kodi.tv
*
* This Program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -13,7 +17,7 @@
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
- * along with XBMC; see the file COPYING. If not, see
+ * along with KODI; see the file COPYING. If not, see
* <http://www.gnu.org/licenses/>.
*
*/
@@ -67,7 +71,7 @@ cParserMPEG2Video::~cParserMPEG2Video()
{
}
-void cParserMPEG2Video::Parse(sStreamPacket *pkt)
+void cParserMPEG2Video::Parse(sStreamPacket *pkt, sStreamPacket *pkt_side_data)
{
if (m_PesBufferPtr < 4)
return;
diff --git a/parser_MPEGVideo.h b/parser_MPEGVideo.h
index c5d2d9e..3a28a3d 100644
--- a/parser_MPEGVideo.h
+++ b/parser_MPEGVideo.h
@@ -1,6 +1,10 @@
/*
+ * vdr-plugin-vnsi - KODI server plugin for VDR
+ *
* Copyright (C) 2005-2012 Team XBMC
- * http://www.xbmc.org
+ * Copyright (C) 2015 Team KODI
+ *
+ * http://kodi.tv
*
* This Program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -13,7 +17,7 @@
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
- * along with XBMC; see the file COPYING. If not, see
+ * along with KODI; see the file COPYING. If not, see
* <http://www.gnu.org/licenses/>.
*
*/
@@ -56,7 +60,7 @@ public:
cParserMPEG2Video(int pID, cTSStream *stream, sPtsWrap *ptsWrap, bool observePtsWraps);
virtual ~cParserMPEG2Video();
- virtual void Parse(sStreamPacket *pkt);
+ virtual void Parse(sStreamPacket *pkt, sStreamPacket *pkt_side_data);
virtual void Reset();
};
diff --git a/parser_Subtitle.c b/parser_Subtitle.c
index 6408fbd..bd8e19f 100644
--- a/parser_Subtitle.c
+++ b/parser_Subtitle.c
@@ -1,6 +1,10 @@
/*
+ * vdr-plugin-vnsi - KODI server plugin for VDR
+ *
* Copyright (C) 2005-2012 Team XBMC
- * http://www.xbmc.org
+ * Copyright (C) 2015 Team KODI
+ *
+ * http://kodi.tv
*
* This Program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -13,7 +17,7 @@
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
- * along with XBMC; see the file COPYING. If not, see
+ * along with KODI; see the file COPYING. If not, see
* <http://www.gnu.org/licenses/>.
*
*/
@@ -35,7 +39,7 @@ cParserSubtitle::~cParserSubtitle()
}
-void cParserSubtitle::Parse(sStreamPacket *pkt)
+void cParserSubtitle::Parse(sStreamPacket *pkt, sStreamPacket *pkt_side_data)
{
int l = m_PesBufferPtr;
diff --git a/parser_Subtitle.h b/parser_Subtitle.h
index 296ac7c..fa949ef 100644
--- a/parser_Subtitle.h
+++ b/parser_Subtitle.h
@@ -1,6 +1,10 @@
/*
+ * vdr-plugin-vnsi - KODI server plugin for VDR
+ *
* Copyright (C) 2005-2012 Team XBMC
- * http://www.xbmc.org
+ * Copyright (C) 2015 Team KODI
+ *
+ * http://kodi.tv
*
* This Program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -13,7 +17,7 @@
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
- * along with XBMC; see the file COPYING. If not, see
+ * along with KODI; see the file COPYING. If not, see
* <http://www.gnu.org/licenses/>.
*
*/
@@ -31,7 +35,7 @@ public:
cParserSubtitle(int pID, cTSStream *stream, sPtsWrap *ptsWrap, bool observePtsWraps);
virtual ~cParserSubtitle();
- virtual void Parse(sStreamPacket *pkt);
+ virtual void Parse(sStreamPacket *pkt, sStreamPacket *pkt_side_data);
};
diff --git a/parser_Teletext.c b/parser_Teletext.c
index b2ecaee..a5c65a6 100644
--- a/parser_Teletext.c
+++ b/parser_Teletext.c
@@ -1,6 +1,10 @@
/*
+ * vdr-plugin-vnsi - KODI server plugin for VDR
+ *
* Copyright (C) 2005-2012 Team XBMC
- * http://www.xbmc.org
+ * Copyright (C) 2015 Team KODI
+ *
+ * http://kodi.tv
*
* This Program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -13,7 +17,7 @@
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
- * along with XBMC; see the file COPYING. If not, see
+ * along with KODI; see the file COPYING. If not, see
* <http://www.gnu.org/licenses/>.
*
*/
@@ -33,7 +37,7 @@ cParserTeletext::~cParserTeletext()
{
}
-void cParserTeletext::Parse(sStreamPacket *pkt)
+void cParserTeletext::Parse(sStreamPacket *pkt, sStreamPacket *pkt_side_data)
{
int l = m_PesBufferPtr;
if (l < 1)
diff --git a/parser_Teletext.h b/parser_Teletext.h
index 831e7f5..a26306e 100644
--- a/parser_Teletext.h
+++ b/parser_Teletext.h
@@ -1,6 +1,10 @@
/*
+ * vdr-plugin-vnsi - KODI server plugin for VDR
+ *
* Copyright (C) 2005-2012 Team XBMC
- * http://www.xbmc.org
+ * Copyright (C) 2015 Team KODI
+ *
+ * http://kodi.tv
*
* This Program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -13,7 +17,7 @@
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
- * along with XBMC; see the file COPYING. If not, see
+ * along with KODI; see the file COPYING. If not, see
* <http://www.gnu.org/licenses/>.
*
*/
@@ -35,7 +39,7 @@ public:
cParserTeletext(int pID, cTSStream *stream, sPtsWrap *ptsWrap, bool observePtsWraps);
virtual ~cParserTeletext();
- virtual void Parse(sStreamPacket *pkt);
+ virtual void Parse(sStreamPacket *pkt, sStreamPacket *pkt_side_data);
};
#endif // VNSI_DEMUXER_TELETEXT_H
diff --git a/parser_h264.c b/parser_h264.c
index 4e073c8..c7f8dde 100644
--- a/parser_h264.c
+++ b/parser_h264.c
@@ -1,6 +1,10 @@
/*
+ * vdr-plugin-vnsi - KODI server plugin for VDR
+ *
* Copyright (C) 2005-2012 Team XBMC
- * http://www.xbmc.org
+ * Copyright (C) 2015 Team KODI
+ *
+ * http://kodi.tv
*
* This Program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -13,7 +17,7 @@
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
- * along with XBMC; see the file COPYING. If not, see
+ * along with KODI; see the file COPYING. If not, see
* <http://www.gnu.org/licenses/>.
*
*/
@@ -68,7 +72,7 @@ cParserH264::~cParserH264()
{
}
-void cParserH264::Parse(sStreamPacket *pkt)
+void cParserH264::Parse(sStreamPacket *pkt, sStreamPacket *pkt_side_data)
{
if (m_PesBufferPtr < 4)
return;
@@ -101,7 +105,7 @@ void cParserH264::Parse(sStreamPacket *pkt)
DEBUGLOG("H.264 SPS: DAR %.2f", DAR);
int duration;
- if (m_curDTS != DVD_NOPTS_VALUE && m_prevDTS != DVD_NOPTS_VALUE)
+ if (m_curDTS != DVD_NOPTS_VALUE && m_prevDTS != DVD_NOPTS_VALUE && m_curDTS > m_prevDTS)
duration = m_curDTS - m_prevDTS;
else
duration = m_Stream->Rescale(20000, 90000, DVD_TIME_BASE);
diff --git a/parser_h264.h b/parser_h264.h
index 609ce0a..3167ba9 100644
--- a/parser_h264.h
+++ b/parser_h264.h
@@ -1,6 +1,10 @@
/*
+ * vdr-plugin-vnsi - KODI server plugin for VDR
+ *
* Copyright (C) 2005-2012 Team XBMC
- * http://www.xbmc.org
+ * Copyright (C) 2015 Team KODI
+ *
+ * http://kodi.tv
*
* This Program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -13,7 +17,7 @@
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
- * along with XBMC; see the file COPYING. If not, see
+ * along with KODI; see the file COPYING. If not, see
* <http://www.gnu.org/licenses/>.
*
*/
@@ -108,7 +112,7 @@ public:
cParserH264(int pID, cTSStream *stream, sPtsWrap *ptsWrap, bool observePtsWraps);
virtual ~cParserH264();
- virtual void Parse(sStreamPacket *pkt);
+ virtual void Parse(sStreamPacket *pkt, sStreamPacket *pkt_side_data);
virtual void Reset();
};
diff --git a/patches/vdr-wirbelscan-0.0.5-pre11e-AddServiceInterface.diff b/patches/vdr-wirbelscan-0.0.5-pre11e-AddServiceInterface.diff
deleted file mode 100644
index 769f25e..0000000
--- a/patches/vdr-wirbelscan-0.0.5-pre11e-AddServiceInterface.diff
+++ /dev/null
@@ -1,426 +0,0 @@
-diff -NaurwB wirbelscan-0.0.5-pre11e/common.h wirbelscan-patched/common.h
---- wirbelscan-0.0.5-pre11e/common.h 2010-03-17 11:32:34.000000000 +0100
-+++ wirbelscan-patched/common.h 2010-04-19 00:55:36.000000000 +0200
-@@ -11,16 +11,7 @@
-
- #include <linux/types.h>
- #include <sys/ioctl.h>
--
--typedef enum scantype {
-- DVB_TERR = 0,
-- DVB_CABLE = 1,
-- DVB_SAT = 2,
-- PVRINPUT = 3,
-- PVRINPUT_FM = 4,
-- DVB_ATSC = 5,
--} scantype_t;
--
-+#include "wirbelscanservice.h"
-
-
- /* generic functions */
-diff -NaurwB wirbelscan-0.0.5-pre11e/dvb_wrapper.c wirbelscan-patched/dvb_wrapper.c
---- wirbelscan-0.0.5-pre11e/dvb_wrapper.c 2010-03-18 11:06:33.000000000 +0100
-+++ wirbelscan-patched/dvb_wrapper.c 2010-04-23 03:59:28.000000000 +0200
-@@ -1,5 +1,4 @@
-
--#include <linux/dvb/frontend.h> //either API version 3.2 or 5.0
- #include <linux/dvb/version.h>
- #include <vdr/dvbdevice.h>
- #include <vdr/channels.h>
-diff -NaurwB wirbelscan-0.0.5-pre11e/menusetup.c wirbelscan-patched/menusetup.c
---- wirbelscan-0.0.5-pre11e/menusetup.c 2010-03-17 13:10:15.000000000 +0100
-+++ wirbelscan-patched/menusetup.c 2010-04-23 03:59:41.000000000 +0200
-@@ -7,7 +7,6 @@
- */
-
-
--#include <linux/dvb/frontend.h>
- #include <vdr/menuitems.h>
- #include <vdr/device.h>
- #include <vdr/config.h>
-@@ -39,6 +38,7 @@
- cOsdItem * ChanNew = NULL;
- cOsdItem * ChanAll = NULL;
- cOsdItem * ScanType = NULL;
-+sRemoteMenuScanning * RemoteMenuScanning = NULL;
-
- #define LOGLEN 8
- cOsdItem * LogMsg[LOGLEN];
-diff -NaurwB wirbelscan-0.0.5-pre11e/menusetup.h wirbelscan-patched/menusetup.h
---- wirbelscan-0.0.5-pre11e/menusetup.h 2010-03-17 11:32:34.000000000 +0100
-+++ wirbelscan-patched/menusetup.h 2010-04-23 02:04:08.000000000 +0200
-@@ -49,6 +49,16 @@
- bool DoScan (int DVB_Type);
- void DoStop (void);
-
-+struct sRemoteMenuScanning {
-+ void (*SetPercentage)(int percent);
-+ void (*SetSignalStrength)(int strenght, bool locked);
-+ void (*SetDeviceInfo)(const char *Info);
-+ void (*SetTransponder)(const char *Info);
-+ void (*NewChannel)(const char *Name, bool isRadio, bool isEncrypted, bool isHD);
-+ void (*IsFinished)();
-+ void (*SetStatus)(int status);
-+};
-+
- class cWirbelscan {
- private:
- public:
-@@ -91,5 +101,6 @@
- void AddLogMsg(const char * Msg);
- };
- extern cMenuScanning * MenuScanning;
-+extern sRemoteMenuScanning * RemoteMenuScanning;
-
- #endif
-diff -NaurwB wirbelscan-0.0.5-pre11e/scanfilter.c wirbelscan-patched/scanfilter.c
---- wirbelscan-0.0.5-pre11e/scanfilter.c 2010-03-17 11:32:34.000000000 +0100
-+++ wirbelscan-patched/scanfilter.c 2010-04-23 01:55:30.000000000 +0200
-@@ -1000,6 +1000,8 @@
- dlog(4, " SDT: old %s", *PrintChannel(channel));
- channel->SetName(pn, ps, pp);
- dlog(2, " Upd: %s", *PrintChannel(channel));
-+ if (RemoteMenuScanning)
-+ RemoteMenuScanning->NewChannel(channel->Name(), (channel->Vpid() == 0 && (channel->Apid(0) != 0 || channel->Dpid(0) != 0)), channel->Ca() != 0, sd->getServiceType() == 0x19);
- }
- }
- else {
-@@ -1009,6 +1011,8 @@
- transponder->CopyTransponderData(Channel());
- dlog(3, " SDT: Add: %s", *PrintTransponder(transponder));
- NewTransponders.Add(transponder);
-+ if (RemoteMenuScanning)
-+ RemoteMenuScanning->NewChannel(channel->Name(), (channel->Vpid() == 0 && (channel->Apid(0) != 0 || channel->Dpid(0) != 0)), channel->Ca() != 0, sd->getServiceType() == 0x19);
- }
- dlog(2, " SDT: Add %s", *PrintChannel(channel));
- }
-diff -NaurwB wirbelscan-0.0.5-pre11e/scanner.c wirbelscan-patched/scanner.c
---- wirbelscan-0.0.5-pre11e/scanner.c 2010-03-18 10:52:52.000000000 +0100
-+++ wirbelscan-patched/scanner.c 2010-04-23 04:04:27.000000000 +0200
-@@ -289,6 +289,8 @@
- }
-
- dlog(1, "%s", *PrintChannel(channel));
-+ if (RemoteMenuScanning)
-+ RemoteMenuScanning->NewChannel(channel->Name(), false, false, false);
- Channels.IncBeingEdited();
- Channels.Add(channel);
- Channels.DecBeingEdited();
-@@ -358,6 +360,7 @@
- if ((dev = GetPreferredDevice(aChannel)) == NULL) {
- dlog(0, "No device available - exiting!");
- if (MenuScanning) MenuScanning->SetStatus((status = 2));
-+ if (RemoteMenuScanning) RemoteMenuScanning->SetStatus((status = 2));
- DeleteAndNull(aChannel);
- return;
- }
-@@ -366,6 +369,7 @@
- GetTerrCapabilities(dev->CardIndex(), &crAuto, &modAuto, &invAuto, &bwAuto, &hAuto, &tmAuto, &gAuto);
- dlog(1, "frontend %s supports", *GetFeName(dev->CardIndex()));
- if (MenuScanning) MenuScanning->SetDeviceInfo(cString::sprintf("%s", *GetFeName(dev->CardIndex())));
-+ if (RemoteMenuScanning) RemoteMenuScanning->SetDeviceInfo(*cString::sprintf("%s", *GetFeName(dev->CardIndex())));
-
- if (invAuto) {
- dlog(1, "INVERSION_AUTO");
-@@ -439,6 +443,7 @@
- if ((dev = GetPreferredDevice(aChannel)) == NULL) {
- dlog(0, "No device available - exiting!");
- if (MenuScanning) MenuScanning->SetStatus((status = 2));
-+ if (RemoteMenuScanning) RemoteMenuScanning->SetStatus((status = 2));
- DeleteAndNull(aChannel);
- return;
- }
-@@ -447,6 +452,7 @@
- GetCableCapabilities(dev->CardIndex(), &crAuto, &modAuto, &invAuto);
- dlog(1, "frontend %s supports", *GetFeName(dev->CardIndex()));
- if (MenuScanning) MenuScanning->SetDeviceInfo(cString::sprintf("%s", *GetFeName(dev->CardIndex())));
-+ if (RemoteMenuScanning) RemoteMenuScanning->SetDeviceInfo(*cString::sprintf("%s", *GetFeName(dev->CardIndex())));
- if (invAuto) {
- dlog(1, "INVERSION_AUTO");
- caps_inversion = INVERSION_AUTO;
-@@ -526,6 +532,7 @@
- #endif
- dlog(0, "No DVB-S2 device available - trying fallback to DVB-S");
- if (MenuScanning) MenuScanning->SetStatus(3);
-+ if (RemoteMenuScanning) RemoteMenuScanning->SetStatus(3);
- // SetSatTransponderDataFromVDR(aChannel, cSource::FromString(sat_list[this_channellist].source_id), 11112, eHorizontal, 27500, eCoderate56, eSatModulationQpsk, eDvbs, eRolloff35);
- SetSatTransponderDataFromDVB(aChannel,
- cSource::FromString(sat_list[this_channellist].source_id),
-@@ -536,6 +543,7 @@
- if ((dev = GetPreferredDevice(aChannel)) == NULL) {
- dlog(0, "No device available - exiting!");
- if (MenuScanning) MenuScanning->SetStatus((status = 2));
-+ if (RemoteMenuScanning) RemoteMenuScanning->SetStatus((status = 2));
- DeleteAndNull(aChannel);
- return;
- }
-@@ -545,6 +553,7 @@
- GetSatCapabilities(dev->CardIndex(), &crAuto, &modAuto, &roAuto, &s2Support);
- dlog(1, "frontend %s supports", *GetFeName(dev->CardIndex()));
- if (MenuScanning) MenuScanning->SetDeviceInfo(cString::sprintf("%s", *GetFeName(dev->CardIndex())));
-+ if (RemoteMenuScanning) RemoteMenuScanning->SetDeviceInfo(*cString::sprintf("%s", *GetFeName(dev->CardIndex())));
- caps_inversion = INVERSION_AUTO;
- if (crAuto) {
- dlog(1, "FEC_AUTO");
-@@ -578,6 +587,7 @@
- if ((dev = GetPreferredDevice(aChannel)) == NULL) {
- dlog(0, "No device available - exiting!");
- if (MenuScanning) MenuScanning->SetStatus((status = 2));
-+ if (RemoteMenuScanning) RemoteMenuScanning->SetStatus((status = 2));
- DeleteAndNull(aChannel);
- return;
- }
-@@ -586,6 +596,7 @@
- GetAtscCapabilities(dev->CardIndex(), &crAuto, &modAuto, &invAuto, &vsbSupport, &qamSupport);
- dlog(1, "frontend %s supports", *GetFeName(dev->CardIndex()));
- if (MenuScanning) MenuScanning->SetDeviceInfo(cString::sprintf("%s", *GetFeName(dev->CardIndex())));
-+ if (RemoteMenuScanning) RemoteMenuScanning->SetDeviceInfo(*cString::sprintf("%s", *GetFeName(dev->CardIndex())));
- if (invAuto) {
- dlog(1, "INVERSION_AUTO\n");
- caps_inversion = INVERSION_AUTO;
-@@ -660,6 +671,7 @@
- #endif
- dlog(0, "No device available - exiting! (pvrinput not running?)");
- if (MenuScanning) MenuScanning->SetStatus((status = 2));
-+ if (RemoteMenuScanning) RemoteMenuScanning->SetStatus((status = 2));
- DeleteAndNull(aChannel);
- return;
- }
-@@ -707,6 +719,8 @@
- }
- if (MenuScanning)
- MenuScanning->SetDeviceInfo(cString::sprintf("%s", vcap.card));
-+ if (RemoteMenuScanning)
-+ RemoteMenuScanning->SetDeviceInfo(*cString::sprintf("%s", vcap.card));
- dev->DetachAllReceivers();
- break;
- }
-@@ -716,6 +730,7 @@
- } // end switch type
-
- if (MenuScanning) MenuScanning->SetStatus(1);
-+ if (RemoteMenuScanning) RemoteMenuScanning->SetStatus(1);
-
- //count channels.
-
-@@ -933,6 +948,11 @@
- type, (lastChannel - thisChannel));
- MenuScanning->SetTransponder(aChannel);
- }
-+ if (RemoteMenuScanning)
-+ {
-+ RemoteMenuScanning->SetPercentage((int) (thisChannel * 100) / lastChannel);
-+ RemoteMenuScanning->SetTransponder(*PrintTransponder(aChannel));
-+ }
- dev->SwitchChannel(aChannel, false);
- SwReceiver = new cSwReceiver::cSwReceiver(aChannel);
- dev->AttachReceiver(SwReceiver);
-@@ -952,6 +972,7 @@
- lock = false;
-
- if (MenuScanning) MenuScanning->SetStr(GetFrontendStrength(dev->CardIndex()), lock);
-+ if (RemoteMenuScanning) RemoteMenuScanning->SetSignalStrength(GetFrontendStrength(dev->CardIndex()), lock);
- if (! lock) {
- continue;
- }
-@@ -971,6 +992,8 @@
- cChannel * newChannel = new cChannel;
- if (MenuScanning)
- MenuScanning->SetStr(s, true);
-+ if (RemoteMenuScanning)
-+ RemoteMenuScanning->SetSignalStrength(s, true);
-
- newChannel->Parse(*aChannel->ToText());
- newChannel->SetName(*channelname, *shortname, (const char *) "analog");
-@@ -988,6 +1011,8 @@
- else {
- if (MenuScanning)
- MenuScanning->SetStr(0, false);
-+ if (RemoteMenuScanning)
-+ RemoteMenuScanning->SetSignalStrength(0, false);
- }
- break;
- }
-@@ -1108,6 +1133,13 @@
-
- stop:
- if (MenuScanning) MenuScanning->SetStatus((status = 0));
-+ if (RemoteMenuScanning)
-+ {
-+ RemoteMenuScanning->SetStatus((status = 0));
-+ RemoteMenuScanning->IsFinished();
-+ delete RemoteMenuScanning;
-+ RemoteMenuScanning = NULL;
-+ }
- dlog(3, "leaving scanner");
- Cancel(0);
- }
-diff -NaurwB wirbelscan-0.0.5-pre11e/statemachine.c wirbelscan-patched/statemachine.c
---- wirbelscan-0.0.5-pre11e/statemachine.c 2010-03-17 11:32:34.000000000 +0100
-+++ wirbelscan-patched/statemachine.c 2010-04-22 17:07:02.000000000 +0200
-@@ -129,6 +129,11 @@
- MenuScanning->SetTransponder(Transponder);
- MenuScanning->SetProgress(-1, DVB_TERR, -1);
- }
-+ if (RemoteMenuScanning)
-+ {
-+ RemoteMenuScanning->SetPercentage(-1);
-+ RemoteMenuScanning->SetTransponder(*PrintTransponder(Transponder));
-+ }
-
- ScannedTransponder = new cChannel(* Transponder);
- ScannedTransponders.Add(ScannedTransponder);
-@@ -143,6 +148,8 @@
- }
- if (MenuScanning)
- MenuScanning->SetStr(GetFrontendStrength(dev->CardIndex()), dev->HasLock(1));
-+ if (RemoteMenuScanning)
-+ RemoteMenuScanning->SetSignalStrength(GetFrontendStrength(dev->CardIndex()), dev->HasLock(1));
- break;
-
- case eNextTransponder:
-diff -NaurwB wirbelscan-0.0.5-pre11e/wirbelscan.c wirbelscan-patched/wirbelscan.c
---- wirbelscan-0.0.5-pre11e/wirbelscan.c 2010-03-17 11:32:34.000000000 +0100
-+++ wirbelscan-patched/wirbelscan.c 2010-04-23 03:17:50.000000000 +0200
-@@ -9,6 +9,8 @@
- #include <vdr/plugin.h>
- #include <vdr/i18n.h>
- #include "menusetup.h"
-+#include "countries.h"
-+#include "satellites.h"
- #if VDRVERSNUM < 10507
- #include "i18n.h"
- #endif
-@@ -141,7 +143,69 @@
-
- bool cPluginWirbelscan::Service(const char *Id, void *Data)
- {
-- // Handle custom service requests from other plugins
-+ if (strcmp(Id,"WirbelScanService-DoScan-v1.0") == 0)
-+ {
-+ if (Data)
-+ {
-+ WirbelScanService_DoScan_v1_0 *svc = (WirbelScanService_DoScan_v1_0*)Data;
-+
-+ Wirbelscan.scanflags = svc->scan_tv ? SCAN_TV : 0;
-+ Wirbelscan.scanflags |= svc->scan_radio ? SCAN_RADIO : 0;
-+ Wirbelscan.scanflags |= svc->scan_scrambled ? SCAN_SCRAMBLED : 0;
-+ Wirbelscan.scanflags |= svc->scan_fta ? SCAN_FTA : 0;
-+ Wirbelscan.scanflags |= svc->scan_hd ? SCAN_HD : 0;
-+ Wirbelscan.CountryIndex = svc->CountryIndex;
-+ Wirbelscan.DVBC_Inversion = svc->DVBC_Inversion;
-+ Wirbelscan.DVBC_Symbolrate = svc->DVBC_Symbolrate;
-+ Wirbelscan.DVBC_QAM = svc->DVBC_QAM;
-+ Wirbelscan.DVBT_Inversion = svc->DVBT_Inversion;
-+ Wirbelscan.SatIndex = svc->SatIndex;
-+ Wirbelscan.ATSC_type = svc->ATSC_Type;
-+
-+ RemoteMenuScanning = new sRemoteMenuScanning;
-+ RemoteMenuScanning->SetPercentage = svc->SetPercentage;
-+ RemoteMenuScanning->SetSignalStrength = svc->SetSignalStrength;
-+ RemoteMenuScanning->SetDeviceInfo = svc->SetDeviceInfo;
-+ RemoteMenuScanning->SetTransponder = svc->SetTransponder;
-+ RemoteMenuScanning->NewChannel = svc->NewChannel;
-+ RemoteMenuScanning->IsFinished = svc->IsFinished;
-+ RemoteMenuScanning->SetStatus = svc->SetStatus;
-+
-+ return DoScan(svc->type);
-+ }
-+ }
-+ else if (strcmp(Id,"WirbelScanService-StopScan-v1.0") == 0)
-+ {
-+ DoStop();
-+ return true;
-+ }
-+ else if (strcmp(Id,"WirbelScanService-GetCountries-v1.0") == 0)
-+ {
-+ if (Data)
-+ {
-+ WirbelScanService_GetCountries_v1_0 SetCountry = (WirbelScanService_GetCountries_v1_0) Data;
-+ for (int i=0; i < COUNTRY::country_count(); i++)
-+ {
-+ SetCountry(COUNTRY::country_list[i].id, COUNTRY::country_list[i].short_name, COUNTRY::country_list[i].full_name);
-+ }
-+ return true;
-+ }
-+ }
-+ else if (strcmp(Id,"WirbelScanService-GetSatellites-v1.0") == 0)
-+ {
-+ if (Data)
-+ {
-+ WirbelScanService_GetSatellites_v1_0 SetSatellite = (WirbelScanService_GetSatellites_v1_0) Data;
-+ for (int i=0; i < sat_count(); i++)
-+ {
-+ SetSatellite(sat_list[i].id, sat_list[i].short_name, sat_list[i].full_name);
-+ }
-+ return true;
-+ }
-+
-+ return true;
-+ }
-+
- return false;
- }
-
-diff -NaurwB wirbelscan-0.0.5-pre11e/wirbelscanservice.h wirbelscan-patched/wirbelscanservice.h
---- wirbelscan-0.0.5-pre11e/wirbelscanservice.h 1970-01-01 01:00:00.000000000 +0100
-+++ wirbelscan-patched/wirbelscanservice.h 2010-04-23 02:03:56.000000000 +0200
-@@ -0,0 +1,57 @@
-+/*
-+ * wirbelscan.c: A plugin for the Video Disk Recorder
-+ *
-+ * See the README file for copyright information and how to reach the author.
-+ *
-+ * $Id$
-+ */
-+
-+#ifndef __WIRBELSCAN_SERVICE_H
-+#define __WIRBELSCAN_SERVICE_H
-+
-+typedef enum scantype
-+{
-+ DVB_TERR = 0,
-+ DVB_CABLE = 1,
-+ DVB_SAT = 2,
-+ PVRINPUT = 3,
-+ PVRINPUT_FM = 4,
-+ DVB_ATSC = 5,
-+} scantype_t;
-+
-+typedef void (*WirbelScanService_GetCountries_v1_0)(int index, const char *isoName, const char *longName);
-+typedef void (*WirbelScanService_GetSatellites_v1_0)(int index, const char *shortName, const char *longName);
-+
-+struct WirbelScanService_DoScan_v1_0
-+{
-+ scantype_t type;
-+
-+ bool scan_tv;
-+ bool scan_radio;
-+ bool scan_fta;
-+ bool scan_scrambled;
-+ bool scan_hd;
-+
-+ int CountryIndex;
-+
-+ int DVBC_Inversion;
-+ int DVBC_Symbolrate;
-+ int DVBC_QAM;
-+
-+ int DVBT_Inversion;
-+
-+ int SatIndex;
-+
-+ int ATSC_Type;
-+
-+ void (*SetPercentage)(int percent);
-+ void (*SetSignalStrength)(int strenght, bool locked);
-+ void (*SetDeviceInfo)(const char *Info);
-+ void (*SetTransponder)(const char *Info);
-+ void (*NewChannel)(const char *Name, bool isRadio, bool isEncrypted, bool isHD);
-+ void (*IsFinished)();
-+ void (*SetStatus)(int status);
-+};
-+
-+#endif //__WIRBELSCAN_SERVICE_H
-+
diff --git a/po/de_DE.po b/po/de_DE.po
new file mode 100644
index 0000000..0edfa03
--- /dev/null
+++ b/po/de_DE.po
@@ -0,0 +1,67 @@
+# VDR VNSI plugin language source file.
+# Copyright (C) 2015 Alwin Esch
+# This file is distributed under the same license as the VDR package.
+#
+msgid ""
+msgstr ""
+"Project-Id-Version: VNSI-Server 1.0.0\n"
+"Report-Msgid-Bugs-To: <see README>\n"
+"POT-Creation-Date: 2015-04-04 14:32+0200\n"
+"PO-Revision-Date: 2015-01-23 21:46+0100\n"
+"Last-Translator: Alwin Esch\n"
+"Language-Team: German\n"
+"Language: de\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=ISO-8859-15\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+msgid "Your scanner version doesnt support services - Please upgrade."
+msgstr ""
+
+msgid "Your scanner version is to old - Please upgrade."
+msgstr ""
+
+msgid "PMT Timeout (0-10)"
+msgstr "PMT Auszeit (0-10)"
+
+msgid "Off"
+msgstr "Aus"
+
+msgid "RAM"
+msgstr "RAM"
+
+msgid "File"
+msgstr "Datei"
+
+msgid "Time Shift Mode"
+msgstr "Time Shift Modus"
+
+msgid "TS Buffersize (RAM) (1-80) x 100MB"
+msgstr "TS Puffergröße (RAM) (1-80) x 100MB"
+
+msgid "TS Buffersize (File) (1-10) x 1GB"
+msgstr "TS Puffergröße (Datei) (1-10) x 1GB"
+
+msgid "TS Buffer Directory"
+msgstr "TS-Puffer-Verzeichnis"
+
+msgid "Play Recording instead of live"
+msgstr "Wiedergeben als Aufzeichnung statt Live"
+
+msgid "Avoid EPG scan while streaming"
+msgstr "Keine EPG suche während der Wiedergabe durchführen"
+
+msgid "Recording with the same name exists"
+msgstr "Aufnahme mit der selben größe existiert"
+
+msgid "Error while read last filenumber"
+msgstr "Fehler beim lesen der letzen Dateinummer"
+
+msgid "Error while accessing vdrfile"
+msgstr "Fehler beim zugriff auf VDR-Datei"
+
+msgid "Error while accessing indexfile"
+msgstr "Fehler beim Zugriff der Indexdatei"
+
+msgid "Deleted recording vanished"
+msgstr "Gelöschte Aufnahme verschwunden"
diff --git a/po/lt_LT.po b/po/lt_LT.po
new file mode 100644
index 0000000..a3c985d
--- /dev/null
+++ b/po/lt_LT.po
@@ -0,0 +1,67 @@
+# VDR VNSI plugin language source file.
+# Copyright (C) 2015 Alwin Esch
+# This file is distributed under the same license as the VDR package.
+#
+msgid ""
+msgstr ""
+"Project-Id-Version: VNSI-Server 1.0.0\n"
+"Report-Msgid-Bugs-To: <see README>\n"
+"POT-Creation-Date: 2015-04-04 14:32+0200\n"
+"PO-Revision-Date: 2015-02-11 22:30+0200\n"
+"Last-Translator: Valdemaras Pipiras\n"
+"Language-Team: Lithuanian\n"
+"Language: lt\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=utf-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+msgid "Your scanner version doesnt support services - Please upgrade."
+msgstr ""
+
+msgid "Your scanner version is to old - Please upgrade."
+msgstr ""
+
+msgid "PMT Timeout (0-10)"
+msgstr "PMT (0-10)"
+
+msgid "Off"
+msgstr "Išjungta"
+
+msgid "RAM"
+msgstr "RAM"
+
+msgid "File"
+msgstr "Failas"
+
+msgid "Time Shift Mode"
+msgstr "Atidėto žiūrėjimo (TS) būsena"
+
+msgid "TS Buffersize (RAM) (1-80) x 100MB"
+msgstr "TS buferio dydis (RAM) (1-80) x 100MB"
+
+msgid "TS Buffersize (File) (1-10) x 1GB"
+msgstr "TS buferio dydis (Failas) (1-10) x 1GB"
+
+msgid "TS Buffer Directory"
+msgstr "TS katalogas buferiavimui"
+
+msgid "Play Recording instead of live"
+msgstr "Groti įrašą vietoj gyvos transliacijos"
+
+msgid "Avoid EPG scan while streaming"
+msgstr "Vengti EPG skanavimo kol vyksta transliacija"
+
+msgid "Recording with the same name exists"
+msgstr "Jau yra įrašų tokiu pat pavadinimu"
+
+msgid "Error while read last filenumber"
+msgstr "Klaida nuskaitant paskutinių failų skaičių"
+
+msgid "Error while accessing vdrfile"
+msgstr "Klaida bandant atidaryti VDR failą"
+
+msgid "Error while accessing indexfile"
+msgstr "Klaida bandant atidaryti index failą"
+
+msgid "Deleted recording vanished"
+msgstr "Ištrintas įrašas galutinai išvalytas"
diff --git a/recordingscache.c b/recordingscache.c
index bef0c64..b2892d8 100644
--- a/recordingscache.c
+++ b/recordingscache.c
@@ -1,7 +1,10 @@
/*
- * vdr-plugin-vnsi - XBMC server plugin for VDR
+ * vdr-plugin-vnsi - KODI server plugin for VDR
*
* Copyright (C) 2011 Alexander Pipelka
+ * Copyright (C) 2015 Team KODI
+ *
+ * http://kodi.tv
*
* This Program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -14,13 +17,14 @@
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
- * along with XBMC; see the file COPYING. If not, see
+ * along with KODI; see the file COPYING. If not, see
* <http://www.gnu.org/licenses/>.
*
*/
#include "config.h"
#include "recordingscache.h"
+#include "vnsiclient.h"
#include "hash.h"
cRecordingsCache::cRecordingsCache() {
@@ -34,7 +38,7 @@ cRecordingsCache& cRecordingsCache::GetInstance() {
return singleton;
}
-uint32_t cRecordingsCache::Register(cRecording* recording) {
+uint32_t cRecordingsCache::Register(cRecording* recording, bool deleted) {
cString filename = recording->FileName();
uint32_t uid = CreateStringHash(filename);
@@ -42,7 +46,8 @@ uint32_t cRecordingsCache::Register(cRecording* recording) {
if(m_recordings.find(uid) == m_recordings.end())
{
DEBUGLOG("%s - uid: %08x '%s'", __FUNCTION__, uid, (const char*)filename);
- m_recordings[uid] = filename;
+ m_recordings[uid].filename = filename;
+ m_recordings[uid].isDeleted = deleted;
}
m_mutex.Unlock();
@@ -58,10 +63,15 @@ cRecording* cRecordingsCache::Lookup(uint32_t uid) {
}
m_mutex.Lock();
- cString filename = m_recordings[uid];
+ cString filename = m_recordings[uid].filename;
DEBUGLOG("%s - filename: %s", __FUNCTION__, (const char*)filename);
- cRecording* r = Recordings.GetByName(filename);
+ cRecording* r;
+ if (!m_recordings[uid].isDeleted)
+ r = Recordings.GetByName(filename);
+ else
+ r = DeletedRecordings.GetByName(filename);
+
DEBUGLOG("%s - recording %s", __FUNCTION__, (r == NULL) ? "not found !" : "found");
m_mutex.Unlock();
diff --git a/recordingscache.h b/recordingscache.h
index a19146f..7fb9180 100644
--- a/recordingscache.h
+++ b/recordingscache.h
@@ -1,7 +1,10 @@
/*
- * vdr-plugin-vnsi - XBMC server plugin for VDR
+ * vdr-plugin-vnsi - KODI server plugin for VDR
*
* Copyright (C) 2011 Alexander Pipelka
+ * Copyright (C) 2015 Team KODI
+ *
+ * http://kodi.tv
*
* This Program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -14,7 +17,7 @@
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
- * along with XBMC; see the file COPYING. If not, see
+ * along with KODI; see the file COPYING. If not, see
* <http://www.gnu.org/licenses/>.
*
*/
@@ -40,13 +43,17 @@ public:
static cRecordingsCache& GetInstance();
- uint32_t Register(cRecording* recording);
+ uint32_t Register(cRecording* recording, bool deleted = false);
cRecording* Lookup(uint32_t uid);
private:
-
- std::map<uint32_t, cString> m_recordings;
+ struct RecordingsInfo
+ {
+ cString filename;
+ bool isDeleted;
+ };
+ std::map<uint32_t, RecordingsInfo> m_recordings;
cMutex m_mutex;
};
diff --git a/recplayer.c b/recplayer.c
index 99d3997..870d388 100644
--- a/recplayer.c
+++ b/recplayer.c
@@ -1,11 +1,12 @@
/*
- * vdr-plugin-vnsi - XBMC server plugin for VDR
+ * vdr-plugin-vnsi - KODI server plugin for VDR
*
* Copyright (C) 2004-2005 Chris Tallon
* Copyright (C) 2010 Alwin Esch (Team XBMC)
* Copyright (C) 2010, 2011 Alexander Pipelka
+ * Copyright (C) 2015 Team KODI
*
- * http://www.xbmc.org
+ * http://kodi.tv
*
* This Program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -18,7 +19,7 @@
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
- * along with XBMC; see the file COPYING. If not, see
+ * along with KODI; see the file COPYING. If not, see
* <http://www.gnu.org/licenses/>.
*
*/
@@ -115,7 +116,7 @@ void cRecPlayer::reScan()
cSegment* segment;
if (m_segments.Size() < i+1)
{
- cSegment* segment = new cSegment();
+ segment = new cSegment();
m_segments.Append(segment);
segment->start = m_totalLength;
}
diff --git a/recplayer.h b/recplayer.h
index f7a4af5..3d7b520 100644
--- a/recplayer.h
+++ b/recplayer.h
@@ -1,11 +1,12 @@
/*
- * vdr-plugin-vnsi - XBMC server plugin for VDR
+ * vdr-plugin-vnsi - KODI server plugin for VDR
*
* Copyright (C) 2004-2005 Chris Tallon
* Copyright (C) 2010 Alwin Esch (Team XBMC)
* Copyright (C) 2010, 2011 Alexander Pipelka
+ * Copyright (C) 2015 Team KODI
*
- * http://www.xbmc.org
+ * http://kodi.tv
*
* This Program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -18,7 +19,7 @@
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
- * along with XBMC; see the file COPYING. If not, see
+ * along with KODI; see the file COPYING. If not, see
* <http://www.gnu.org/licenses/>.
*
*/
diff --git a/requestpacket.c b/requestpacket.c
index 77a6cf2..4ab2b30 100644
--- a/requestpacket.c
+++ b/requestpacket.c
@@ -1,11 +1,12 @@
/*
- * vdr-plugin-vnsi - XBMC server plugin for VDR
+ * vdr-plugin-vnsi - KODI server plugin for VDR
*
* Copyright (C) 2007 Chris Tallon
* Copyright (C) 2010 Alwin Esch (Team XBMC)
* Copyright (C) 2010, 2011 Alexander Pipelka
+ * Copyright (C) 2015 Team KODI
*
- * http://www.xbmc.org
+ * http://kodi.tv
*
* This Program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -18,7 +19,7 @@
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
- * along with XBMC; see the file COPYING. If not, see
+ * along with KODI; see the file COPYING. If not, see
* <http://www.gnu.org/licenses/>.
*
*/
diff --git a/requestpacket.h b/requestpacket.h
index 24328a0..368f971 100644
--- a/requestpacket.h
+++ b/requestpacket.h
@@ -1,11 +1,12 @@
/*
- * vdr-plugin-vnsi - XBMC server plugin for VDR
+ * vdr-plugin-vnsi - KODI server plugin for VDR
*
* Copyright (C) 2007 Chris Tallon
* Copyright (C) 2010 Alwin Esch (Team XBMC)
* Copyright (C) 2010, 2011 Alexander Pipelka
+ * Copyright (C) 2015 Team KODI
*
- * http://www.xbmc.org
+ * http://kodi.tv
*
* This Program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -18,7 +19,7 @@
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
- * along with XBMC; see the file COPYING. If not, see
+ * along with KODI; see the file COPYING. If not, see
* <http://www.gnu.org/licenses/>.
*
*/
diff --git a/responsepacket.c b/responsepacket.c
index 439dfa7..92ad9ae 100644
--- a/responsepacket.c
+++ b/responsepacket.c
@@ -1,11 +1,12 @@
/*
- * vdr-plugin-vnsi - XBMC server plugin for VDR
+ * vdr-plugin-vnsi - KODI server plugin for VDR
*
* Copyright (C) 2007 Chris Tallon
* Copyright (C) 2010 Alwin Esch (Team XBMC)
* Copyright (C) 2010, 2011 Alexander Pipelka
+ * Copyright (C) 2015 Team KODI
*
- * http://www.xbmc.org
+ * http://kodi.tv
*
* This Program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -18,7 +19,7 @@
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
- * along with XBMC; see the file COPYING. If not, see
+ * along with KODI; see the file COPYING. If not, see
* <http://www.gnu.org/licenses/>.
*
*/
diff --git a/responsepacket.h b/responsepacket.h
index 0f5c457..256a70a 100644
--- a/responsepacket.h
+++ b/responsepacket.h
@@ -1,11 +1,12 @@
/*
- * vdr-plugin-vnsi - XBMC server plugin for VDR
+ * vdr-plugin-vnsi - KODI server plugin for VDR
*
* Copyright (C) 2007 Chris Tallon
* Copyright (C) 2010 Alwin Esch (Team XBMC)
* Copyright (C) 2010, 2011 Alexander Pipelka
+ * Copyright (C) 2015 Team KODI
*
- * http://www.xbmc.org
+ * http://kodi.tv
*
* This Program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -18,7 +19,7 @@
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
- * along with XBMC; see the file COPYING. If not, see
+ * along with KODI; see the file COPYING. If not, see
* <http://www.gnu.org/licenses/>.
*
*/
diff --git a/setup.c b/setup.c
index 0e6249f..acc0aa3 100644
--- a/setup.c
+++ b/setup.c
@@ -1,6 +1,10 @@
/*
+ * vdr-plugin-vnsi - KODI server plugin for VDR
+ *
* Copyright (C) 2005-2012 Team XBMC
- * http://www.xbmc.org
+ * Copyright (C) 2015 Team KODI
+ *
+ * http://kodi.tv
*
* This Program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -13,7 +17,7 @@
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
- * along with XBMC; see the file COPYING. If not, see
+ * along with KODI; see the file COPYING. If not, see
* <http://www.gnu.org/licenses/>.
*
*/
@@ -21,13 +25,13 @@
#include "setup.h"
#include "vnsicommand.h"
-int PmtTimeout = 5;
+int PmtTimeout = 0;
int TimeshiftMode = 0;
int TimeshiftBufferSize = 5;
int TimeshiftBufferFileSize = 6;
char TimeshiftBufferDir[PATH_MAX] = "\0";
int PlayRecording = 0;
-int AvoidEPGScan = 0;
+int AvoidEPGScan = 1;
cMenuSetupVNSI::cMenuSetupVNSI(void)
{
diff --git a/setup.h b/setup.h
index cf116cf..cd4f0dc 100644
--- a/setup.h
+++ b/setup.h
@@ -1,22 +1,26 @@
/*
-* Copyright (C) 2005-2012 Team XBMC
-* http://www.xbmc.org
-*
-* This Program is free software; you can redistribute it and/or modify
-* it under the terms of the GNU General Public License as published by
-* the Free Software Foundation; either version 2, or (at your option)
-* any later version.
-*
-* This Program is distributed in the hope that it will be useful,
-* but WITHOUT ANY WARRANTY; without even the implied warranty of
-* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-* GNU General Public License for more details.
-*
-* You should have received a copy of the GNU General Public License
-* along with XBMC; see the file COPYING. If not, see
-* <http://www.gnu.org/licenses/>.
-*
-*/
+ * vdr-plugin-vnsi - KODI server plugin for VDR
+ *
+ * Copyright (C) 2005-2012 Team XBMC
+ * Copyright (C) 2015 Team KODI
+ *
+ * http://kodi.tv
+ *
+ * This Program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2, or (at your option)
+ * any later version.
+ *
+ * This Program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with KODI; see the file COPYING. If not, see
+ * <http://www.gnu.org/licenses/>.
+ *
+ */
#ifndef VNSI_SETUP_H
#define VNSI_SETUP_H
diff --git a/status.c b/status.c
index b94d877..b8f41e1 100644
--- a/status.c
+++ b/status.c
@@ -1,6 +1,10 @@
/*
+ * vdr-plugin-vnsi - KODI server plugin for VDR
+ *
* Copyright (C) 2005-2014 Team XBMC
- * http://www.xbmc.org
+ * Copyright (C) 2015 Team KODI
+ *
+ * http://kodi.tv
*
* This Program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -13,7 +17,7 @@
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
- * along with XBMC; see the file COPYING. If not, see
+ * along with KODI; see the file COPYING. If not, see
* <http://www.gnu.org/licenses/>.
*
*/
@@ -104,53 +108,61 @@ void cVNSIStatus::Action(void)
}
}
- // trigger clients to reload the modified channel list
- if(m_clients.size() > 0 && chanTimer.TimedOut())
+ /*!
+ * Don't to updates during running channel scan, KODI's PVR manager becomes
+ * restarted of finished scan.
+ */
+ if (!cVNSIClient::InhibidDataUpdates())
{
- int modified = Channels.Modified();
- if (modified)
+ // trigger clients to reload the modified channel list
+ if(m_clients.size() > 0 && chanTimer.TimedOut())
{
- Channels.SetModified((modified == CHANNELSMOD_USER) ? true : false);
- INFOLOG("Requesting clients to reload channel list");
- for (ClientList::iterator i = m_clients.begin(); i != m_clients.end(); i++)
- (*i)->ChannelsChange();
+ int modified = Channels.Modified();
+ if (modified)
+ {
+ Channels.SetModified((modified == CHANNELSMOD_USER) ? true : false);
+ INFOLOG("Requesting clients to reload channel list");
+ for (ClientList::iterator i = m_clients.begin(); i != m_clients.end(); i++)
+ (*i)->ChannelsChange();
+ }
+ chanTimer.Set(5000);
}
- chanTimer.Set(5000);
- }
- // reset inactivity timeout as long as there are clients connected
- if(m_clients.size() > 0) {
- ShutdownHandler.SetUserInactiveTimeout();
- }
+ // reset inactivity timeout as long as there are clients connected
+ if(m_clients.size() > 0)
+ {
+ ShutdownHandler.SetUserInactiveTimeout();
+ }
- // update recordings
- if(Recordings.StateChanged(recState))
- {
- INFOLOG("Recordings state changed (%i)", recState);
- INFOLOG("Requesting clients to reload recordings list");
- for (ClientList::iterator i = m_clients.begin(); i != m_clients.end(); i++)
- (*i)->RecordingsChange();
- }
+ // update recordings
+ if(Recordings.StateChanged(recState))
+ {
+ INFOLOG("Recordings state changed (%i)", recState);
+ INFOLOG("Requesting clients to reload recordings list");
+ for (ClientList::iterator i = m_clients.begin(); i != m_clients.end(); i++)
+ (*i)->RecordingsChange();
+ }
- // update timers
- if(Timers.Modified(timerState))
- {
- INFOLOG("Timers state changed (%i)", timerState);
- INFOLOG("Requesting clients to reload timers");
- for (ClientList::iterator i = m_clients.begin(); i != m_clients.end(); i++)
+ // update timers
+ if(Timers.Modified(timerState))
{
- (*i)->TimerChange();
+ INFOLOG("Timers state changed (%i)", timerState);
+ INFOLOG("Requesting clients to reload timers");
+ for (ClientList::iterator i = m_clients.begin(); i != m_clients.end(); i++)
+ {
+ (*i)->TimerChange();
+ }
}
- }
- // update epg
- if((cSchedules::Modified() > epgUpdate + 10) || time(NULL) > epgUpdate + 300)
- {
- for (ClientList::iterator i = m_clients.begin(); i != m_clients.end(); i++)
+ // update epg
+ if((cSchedules::Modified() > epgUpdate + 10) || time(NULL) > epgUpdate + 300)
{
- (*i)->EpgChange();
+ for (ClientList::iterator i = m_clients.begin(); i != m_clients.end(); i++)
+ {
+ (*i)->EpgChange();
+ }
+ epgUpdate = time(NULL);
}
- epgUpdate = time(NULL);
}
m_mutex.Unlock();
diff --git a/status.h b/status.h
index 96e1726..94015a2 100644
--- a/status.h
+++ b/status.h
@@ -1,6 +1,10 @@
/*
+ * vdr-plugin-vnsi - KODI server plugin for VDR
+ *
* Copyright (C) 2005-2014 Team XBMC
- * http://www.xbmc.org
+ * Copyright (C) 2015 Team KODI
+ *
+ * http://kodi.tv
*
* This Program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -13,7 +17,7 @@
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
- * along with XBMC; see the file COPYING. If not, see
+ * along with KODI; see the file COPYING. If not, see
* <http://www.gnu.org/licenses/>.
*
*/
diff --git a/streamer.c b/streamer.c
index 6f5fa2f..782bfb6 100644
--- a/streamer.c
+++ b/streamer.c
@@ -1,10 +1,11 @@
/*
- * vdr-plugin-vnsi - XBMC server plugin for VDR
+ * vdr-plugin-vnsi - KODI server plugin for VDR
*
* Copyright (C) 2010 Alwin Esch (Team XBMC)
* Copyright (C) 2010, 2011 Alexander Pipelka
+ * Copyright (C) 2015 Team KODI
*
- * http://www.xbmc.org
+ * http://kodi.tv
*
* This Program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -17,7 +18,7 @@
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
- * along with XBMC; see the file COPYING. If not, see
+ * along with KODI; see the file COPYING. If not, see
* <http://www.gnu.org/licenses/>.
*
*/
@@ -40,10 +41,11 @@
// --- cLiveStreamer -------------------------------------------------
-cLiveStreamer::cLiveStreamer(int clientID, uint8_t timeshift, uint32_t timeout)
+cLiveStreamer::cLiveStreamer(int clientID, bool bAllowRDS, uint8_t timeshift, uint32_t timeout)
: cThread("cLiveStreamer stream processor")
, m_ClientID(clientID)
, m_scanTimeout(timeout)
+ , m_Demuxer(bAllowRDS)
, m_VideoInput(m_Event, m_Mutex, m_IsRetune)
{
m_Channel = NULL;
@@ -167,38 +169,58 @@ void cLiveStreamer::Close(void)
void cLiveStreamer::Action(void)
{
int ret;
- sStreamPacket pkt;
- memset(&pkt, 0, sizeof(sStreamPacket));
- bool requestStreamChange = false;
+ sStreamPacket pkt_data;
+ sStreamPacket pkt_side_data; // Additional data
+ memset(&pkt_data, 0, sizeof(sStreamPacket));
+ memset(&pkt_side_data, 0, sizeof(sStreamPacket));
+ bool requestStreamChangeData = false;
+ bool requestStreamChangeSideData = false;
cTimeMs last_info(1000);
cTimeMs bufferStatsTimer(1000);
while (Running())
{
- ret = m_Demuxer.Read(&pkt);
+ if (m_IsRetune)
+ ret = -1;
+ else
+ ret = m_Demuxer.Read(&pkt_data, &pkt_side_data);
if (ret > 0)
{
- if (pkt.pmtChange)
+ if (pkt_data.pmtChange)
{
- requestStreamChange = true;
+ requestStreamChangeData = true;
+ requestStreamChangeSideData = true;
}
- if (pkt.data)
+
+ // Process normal data if present
+ if (pkt_data.data)
{
- if (pkt.streamChange || requestStreamChange)
+ if (pkt_data.streamChange || requestStreamChangeData)
sendStreamChange();
- requestStreamChange = false;
- if (pkt.reftime)
+ requestStreamChangeData = false;
+ if (pkt_data.reftime)
{
- sendRefTime(&pkt);
- pkt.reftime = 0;
+ sendRefTime(&pkt_data);
+ pkt_data.reftime = 0;
}
- sendStreamPacket(&pkt);
+ sendStreamPacket(&pkt_data);
+ }
+
+ // If some additional data is present inside the stream, it is written there (currently RDS inside MPEG2-Audio)
+ if (pkt_side_data.data)
+ {
+ if (pkt_side_data.streamChange || requestStreamChangeSideData)
+ sendStreamChange();
+ requestStreamChangeSideData = false;
+
+ sendStreamPacket(&pkt_side_data);
+ pkt_side_data.data = NULL;
}
// send signal info every 10 sec.
- if(last_info.Elapsed() >= 10*1000)
+ if(last_info.TimedOut())
{
- last_info.Set(0);
+ last_info.Set(10000);
sendSignalInfo();
// prevent EPG scan (activity timeout is 60s)
@@ -220,15 +242,27 @@ void cLiveStreamer::Action(void)
{
// no data
{
- cMutexLock lock(&m_Mutex);
- if (m_IsRetune)
+ bool retune = false;
+ {
+ cMutexLock lock(&m_Mutex);
+ retune = m_IsRetune;
+ if (!retune)
+ m_Event.TimedWait(m_Mutex, 10);
+ }
+ if (retune)
{
m_VideoInput.Close();
- m_VideoInput.Open(m_Channel, m_Priority, m_VideoBuffer);
- m_IsRetune = false;
+ if (m_VideoInput.Open(m_Channel, m_Priority, m_VideoBuffer))
+ {
+ cMutexLock lock(&m_Mutex);
+ m_IsRetune = false;
+ }
+ else
+ {
+ cMutexLock lock(&m_Mutex);
+ m_Event.TimedWait(m_Mutex, 100);
+ }
}
- else
- m_Event.TimedWait(m_Mutex, 10);
}
if(m_last_tick.Elapsed() >= (uint64_t)(m_scanTimeout*1000))
{
@@ -340,6 +374,17 @@ void cLiveStreamer::sendStreamChange()
resp->add_U32(BlockAlign);
resp->add_U32(BitRate);
resp->add_U32(BitsPerSample);
+
+ for (unsigned int i = 0; i < stream->GetSideDataTypes()->size(); i++)
+ {
+ resp->add_U32(stream->GetSideDataTypes()->at(i).first);
+ if (stream->GetSideDataTypes()->at(i).second == scRDS)
+ {
+ resp->add_String("RDS");
+ resp->add_String(stream->GetLanguage());
+ resp->add_U32(stream->GetPID());
+ }
+ }
}
else if (stream->Type() == stMPEG2VIDEO)
{
diff --git a/streamer.h b/streamer.h
index e7cbfaf..078e144 100644
--- a/streamer.h
+++ b/streamer.h
@@ -1,10 +1,11 @@
/*
- * vdr-plugin-vnsi - XBMC server plugin for VDR
+ * vdr-plugin-vnsi - KODI server plugin for VDR
*
* Copyright (C) 2010 Alwin Esch (Team XBMC)
* Copyright (C) 2010, 2011 Alexander Pipelka
+ * Copyright (C) 2015 Team KODI
*
- * http://www.xbmc.org
+ * http://kodi.tv
*
* This Program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -17,7 +18,7 @@
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
- * along with XBMC; see the file COPYING. If not, see
+ * along with KODI; see the file COPYING. If not, see
* <http://www.gnu.org/licenses/>.
*
*/
@@ -90,7 +91,7 @@ protected:
void Close();
public:
- cLiveStreamer(int clientID, uint8_t timeshift, uint32_t timeout = 0);
+ cLiveStreamer(int clientID, bool bAllowRDS, uint8_t timeshift, uint32_t timeout = 0);
virtual ~cLiveStreamer();
void Activate(bool On);
diff --git a/videobuffer.c b/videobuffer.c
index 94292bb..131c252 100644
--- a/videobuffer.c
+++ b/videobuffer.c
@@ -1,6 +1,10 @@
/*
+ * vdr-plugin-vnsi - KODI server plugin for VDR
+ *
* Copyright (C) 2005-2012 Team XBMC
- * http://www.xbmc.org
+ * Copyright (C) 2015 Team KODI
+ *
+ * http://kodi.tv
*
* This Program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -13,7 +17,7 @@
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
- * along with XBMC; see the file COPYING. If not, see
+ * along with KODI; see the file COPYING. If not, see
* <http://www.gnu.org/licenses/>.
*
*/
diff --git a/videobuffer.h b/videobuffer.h
index c61bd3c..2df8f57 100644
--- a/videobuffer.h
+++ b/videobuffer.h
@@ -1,6 +1,10 @@
/*
+ * vdr-plugin-vnsi - KODI server plugin for VDR
+ *
* Copyright (C) 2005-2012 Team XBMC
- * http://www.xbmc.org
+ * Copyright (C) 2015 Team KODI
+ *
+ * http://kodi.tv
*
* This Program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -13,7 +17,7 @@
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
- * along with XBMC; see the file COPYING. If not, see
+ * along with KODI; see the file COPYING. If not, see
* <http://www.gnu.org/licenses/>.
*
*/
diff --git a/videoinput.c b/videoinput.c
index d7e45eb..98378b1 100644
--- a/videoinput.c
+++ b/videoinput.c
@@ -1,6 +1,10 @@
/*
+ * vdr-plugin-vnsi - KODI server plugin for VDR
+ *
* Copyright (C) 2005-2012 Team XBMC
- * http://www.xbmc.org
+ * Copyright (C) 2015 Team KODI
+ *
+ * http://kodi.tv
*
* This Program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -13,7 +17,7 @@
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
- * along with XBMC; see the file COPYING. If not, see
+ * along with KODI; see the file COPYING. If not, see
* <http://www.gnu.org/licenses/>.
*
*
@@ -28,6 +32,8 @@
#include <vdr/channels.h>
#include <vdr/device.h>
#include <vdr/receiver.h>
+#include <vdr/ci.h>
+#include <vdr/config.h>
#include <libsi/section.h>
#include <libsi/descriptor.h>
@@ -416,17 +422,21 @@ bool cVideoInput::Open(const cChannel *channel, int priority, cVideoBuffer *vide
if (m_Device != NULL)
{
- DEBUGLOG("Successfully found following device: %p (%d) for receiving", m_Device, m_Device ? m_Device->CardIndex() + 1 : 0);
+ INFOLOG("Successfully found following device: %p (%d) for receiving", m_Device, m_Device ? m_Device->CardIndex() + 1 : 0);
if (m_Device->SwitchChannel(m_Channel, false))
{
DEBUGLOG("Creating new live Receiver");
+ //m_Device->SetCurrentChannel(m_Channel);
m_SeenPmt = false;
m_PatFilter = new cLivePatFilter(this, m_Channel);
m_Receiver0 = new cLiveReceiver(this, m_Channel, m_Priority);
m_Receiver = new cLiveReceiver(this, m_Channel, m_Priority);
m_Device->AttachReceiver(m_Receiver0);
m_Device->AttachFilter(m_PatFilter);
+ cCamSlot *cs = m_Device->CamSlot();
+ if (m_Priority <= MINPRIORITY && cs)
+ cs->StartDecrypting();
m_VideoBuffer->AttachInput(true);
Start();
return true;
@@ -489,6 +499,15 @@ void cVideoInput::Close()
DEBUGLOG("Deleting Live Filter");
DELETENULL(m_PatFilter);
}
+
+ //m_Device->SetCurrentChannel(NULL);
+ cCamSlot *cs = m_Device->CamSlot();
+ if (m_Priority <= MINPRIORITY && cs)
+ {
+ cs->StartDecrypting();
+ if (!cs->IsDecrypting())
+ cs->Assign(NULL);
+ }
}
m_Channel = NULL;
m_Device = NULL;
@@ -523,6 +542,9 @@ void cVideoInput::PmtChange(int pidChange)
m_Receiver->SetPids(&m_Receiver->m_PmtChannel);
m_Receiver->AddPid(m_Receiver->m_PmtChannel.Tpid());
m_Device->AttachReceiver(m_Receiver);
+ cCamSlot *cs = m_Device->CamSlot();
+ if (m_Priority <= MINPRIORITY && cs)
+ cs->StartDecrypting();
m_SeenPmt = true;
}
}
diff --git a/videoinput.h b/videoinput.h
index f8e175d..d1ebb51 100644
--- a/videoinput.h
+++ b/videoinput.h
@@ -1,6 +1,10 @@
/*
+ * vdr-plugin-vnsi - KODI server plugin for VDR
+ *
* Copyright (C) 2005-2012 Team XBMC
- * http://www.xbmc.org
+ * Copyright (C) 2015 Team KODI
+ *
+ * http://kodi.tv
*
* This Program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -13,7 +17,7 @@
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
- * along with XBMC; see the file COPYING. If not, see
+ * along with KODI; see the file COPYING. If not, see
* <http://www.gnu.org/licenses/>.
*
*/
diff --git a/vnsi.c b/vnsi.c
index 18c8616..5078eb6 100644
--- a/vnsi.c
+++ b/vnsi.c
@@ -1,10 +1,11 @@
/*
- * vdr-plugin-vnsi - XBMC server plugin for VDR
+ * vdr-plugin-vnsi - KODI server plugin for VDR
*
* Copyright (C) 2010 Alwin Esch (Team XBMC)
* Copyright (C) 2010, 2011 Alexander Pipelka
+ * Copyright (C) 2015 Team KODI
*
- * http://www.xbmc.org
+ * http://kodi.tv
*
* This Program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -17,7 +18,7 @@
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
- * along with XBMC; see the file COPYING. If not, see
+ * along with KODI; see the file COPYING. If not, see
* <http://www.gnu.org/licenses/>.
*
*/
@@ -207,7 +208,8 @@ bool cDvbVsniDeviceProbe::Probe(int Adapter, int Frontend)
cDvbVnsiDevice::cDvbVnsiDevice(int Adapter, int Frontend) :cDvbDevice(Adapter, Frontend)
{
-
+ VNSIServerConfig.pDevice = this;
+ m_hasDecoder = false;
}
cDvbVnsiDevice::~cDvbVnsiDevice()
@@ -217,7 +219,8 @@ cDvbVnsiDevice::~cDvbVnsiDevice()
bool cDvbVnsiDevice::HasDecoder(void) const
{
- return true;
+ cMutexLock lock((cMutex*)&m_mutex);
+ return m_hasDecoder;
}
int cDvbVnsiDevice::PlayVideo(const uchar *Data, int Length)
@@ -230,4 +233,10 @@ int cDvbVnsiDevice::PlayAudio(const uchar *Data, int Length, uchar Id)
return Length;
}
+void cDvbVnsiDevice::ActivateDecoder(bool active)
+{
+ cMutexLock lock(&m_mutex);
+ m_hasDecoder = active;
+}
+
VDRPLUGINCREATOR(cPluginVNSIServer); // Don't touch this!
diff --git a/vnsi.h b/vnsi.h
index 167024c..957700e 100644
--- a/vnsi.h
+++ b/vnsi.h
@@ -1,10 +1,11 @@
/*
- * vdr-plugin-vnsi - XBMC server plugin for VDR
+ * vdr-plugin-vnsi - KODI server plugin for VDR
*
* Copyright (C) 2010 Alwin Esch (Team XBMC)
* Copyright (C) 2010, 2011 Alexander Pipelka
+ * Copyright (C) 2015 Team KODI
*
- * http://www.xbmc.org
+ * http://kodi.tv
*
* This Program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -17,16 +18,17 @@
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
- * along with XBMC; see the file COPYING. If not, see
+ * along with KODI; see the file COPYING. If not, see
* <http://www.gnu.org/licenses/>.
*
*/
#include <getopt.h>
#include <vdr/plugin.h>
+#include <vdr/thread.h>
#include "vnsiserver.h"
-static const char *VERSION = "1.2.1";
+static const char *VERSION = "1.3.1";
static const char *DESCRIPTION = "VDR-Network-Streaming-Interface (VNSI) Server";
extern int PmtTimeout;
@@ -84,4 +86,8 @@ public:
virtual bool HasDecoder(void) const;
int PlayVideo(const uchar *Data, int Length);
int PlayAudio(const uchar *Data, int Length, uchar Id);
+ void ActivateDecoder(bool active);
+protected:
+ bool m_hasDecoder;
+ cMutex m_mutex;
};
diff --git a/vnsiclient.c b/vnsiclient.c
index d0d4195..56d3e9a 100644
--- a/vnsiclient.c
+++ b/vnsiclient.c
@@ -1,10 +1,11 @@
/*
- * vdr-plugin-vnsi - XBMC server plugin for VDR
+ * vdr-plugin-vnsi - KODI server plugin for VDR
*
* Copyright (C) 2010 Alwin Esch (Team XBMC)
* Copyright (C) 2010, 2011 Alexander Pipelka
+ * Copyright (C) 2015 Team KODI
*
- * http://www.xbmc.org
+ * http://kodi.tv
*
* This Program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -17,7 +18,7 @@
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
- * along with XBMC; see the file COPYING. If not, see
+ * along with KODI; see the file COPYING. If not, see
* <http://www.gnu.org/licenses/>.
*
*/
@@ -47,26 +48,25 @@
#include "responsepacket.h"
#include "hash.h"
#include "channelfilter.h"
-#include "wirbelscanservice.h" /// copied from modified wirbelscan plugin
- /// must be hold up to date with wirbelscan
-
+#include "channelscancontrol.h"
cMutex cVNSIClient::m_timerLock;
+bool cVNSIClient::m_inhibidDataUpdates = false;
cVNSIClient::cVNSIClient(int fd, unsigned int id, const char *ClientAdr)
+ : m_Id(id),
+ m_loggedIn(false),
+ m_StatusInterfaceEnabled(false),
+ m_Streamer(NULL),
+ m_isStreaming(false),
+ m_bSupportRDS(false),
+ m_ClientAddress(ClientAdr),
+ m_RecPlayer(NULL),
+ m_req(NULL),
+ m_resp(NULL),
+ m_Osd(NULL),
+ m_ChannelScanControl(this)
{
- m_Id = id;
- m_Streamer = NULL;
- m_isStreaming = false;
- m_ClientAddress = ClientAdr;
- m_StatusInterfaceEnabled = false;
- m_RecPlayer = NULL;
- m_req = NULL;
- m_resp = NULL;
- m_processSCAN_Response = NULL;
- m_processSCAN_Socket = NULL;
- m_Osd = NULL;
-
m_socket.SetHandle(fd);
Start();
@@ -76,6 +76,7 @@ cVNSIClient::~cVNSIClient()
{
DEBUGLOG("%s", __FUNCTION__);
StopChannelStreaming();
+ m_ChannelScanControl.StopScan();
m_socket.close(); // force closing connection
Cancel(10);
DEBUGLOG("done");
@@ -154,6 +155,7 @@ void cVNSIClient::Action(void)
/* If thread is ended due to closed connection delete a
possible running stream here */
StopChannelStreaming();
+ m_ChannelScanControl.StopScan();
// Shutdown OSD
if (m_Osd)
@@ -165,7 +167,7 @@ void cVNSIClient::Action(void)
bool cVNSIClient::StartChannelStreaming(const cChannel *channel, int32_t priority, uint8_t timeshift, uint32_t timeout)
{
- m_Streamer = new cLiveStreamer(m_Id, timeshift, timeout);
+ m_Streamer = new cLiveStreamer(m_Id, m_bSupportRDS, timeshift, timeout);
m_isStreaming = m_Streamer->StreamChannel(channel, priority, &m_socket, m_resp);
return m_isStreaming;
}
@@ -561,6 +563,7 @@ bool cVNSIClient::processRequest(cRequestPacket* req)
result = processRECORDINGS_GetEdl();
break;
+
/** OPCODE 120 - 139: VNSI network functions for epg access and manipulating */
case VNSI_EPG_GETFORCHANNEL:
result = processEPG_GetForChannel();
@@ -588,6 +591,10 @@ bool cVNSIClient::processRequest(cRequestPacket* req)
result = processSCAN_Stop();
break;
+ case VNSI_SCAN_SUPPORTED_TYPES:
+ result = processSCAN_GetSupportedTypes();
+ break;
+
/** OPCODE 160 - 179: VNSI network functions for OSD */
case VNSI_OSD_CONNECT:
result = processOSD_Connect();
@@ -600,6 +607,32 @@ bool cVNSIClient::processRequest(cRequestPacket* req)
case VNSI_OSD_HITKEY:
result = processOSD_Hitkey();
break;
+
+
+ /** OPCODE 180 - 189: VNSI network functions for deleted recording access */
+ case VNSI_RECORDINGS_DELETED_ACCESS_SUPPORTED:
+ result = processRECORDINGS_DELETED_Supported();
+ break;
+
+ case VNSI_RECORDINGS_DELETED_GETCOUNT:
+ result = processRECORDINGS_DELETED_GetCount();
+ break;
+
+ case VNSI_RECORDINGS_DELETED_GETLIST:
+ result = processRECORDINGS_DELETED_GetList();
+ break;
+
+ case VNSI_RECORDINGS_DELETED_DELETE:
+ result = processRECORDINGS_DELETED_Delete();
+ break;
+
+ case VNSI_RECORDINGS_DELETED_UNDELETE:
+ result = processRECORDINGS_DELETED_Undelete();
+ break;
+
+ case VNSI_RECORDINGS_DELETED_DELETE_ALL:
+ result = processRECORDINGS_DELETED_DeleteAll();
+ break;
}
delete m_resp;
@@ -641,6 +674,16 @@ bool cVNSIClient::process_Login() /* OPCODE 1 */
else
SetLoggedIn(true);
+ if (m_protocolVersion < VNSI_RDS_PROTOCOLVERSION)
+ {
+ INFOLOG("RDS not supported on client '%s' and stream type disabled", clientName);
+ m_bSupportRDS = false;
+ }
+ else
+ {
+ m_bSupportRDS = true;
+ }
+
m_socket.write(m_resp->getPtr(), m_resp->getLen());
delete[] clientName;
@@ -1618,12 +1661,13 @@ bool cVNSIClient::processTIMER_Update() /* OPCODE 85 */
bool cVNSIClient::processRECORDINGS_GetDiskSpace() /* OPCODE 100 */
{
int FreeMB;
+ int UsedMB;
#if VDRVERSNUM >= 20102
- int Percent = cVideoDirectory::VideoDiskSpace(&FreeMB);
+ int Percent = cVideoDirectory::VideoDiskSpace(&FreeMB, &UsedMB);
#else
- int Percent = VideoDiskSpace(&FreeMB);
+ int Percent = VideoDiskSpace(&FreeMB, &UsedMB);
#endif
- int Total = (FreeMB / (100 - Percent)) * 100;
+ int Total = FreeMB + UsedMB;
m_resp->add_U32(Total);
m_resp->add_U32(FreeMB);
@@ -1636,7 +1680,6 @@ bool cVNSIClient::processRECORDINGS_GetDiskSpace() /* OPCODE 100 */
bool cVNSIClient::processRECORDINGS_GetCount() /* OPCODE 101 */
{
- Recordings.Load();
m_resp->add_U32(Recordings.Count());
m_resp->finalise();
@@ -1748,7 +1791,7 @@ bool cVNSIClient::processRECORDINGS_GetList() /* OPCODE 102 */
m_resp->add_String((isempty(directory)) ? "" : m_toUTF8.Convert(directory));
// filename / uid of recording
- uint32_t uid = cRecordingsCache::GetInstance().Register(recording);
+ uint32_t uid = cRecordingsCache::GetInstance().Register(recording, false);
m_resp->add_U32(uid);
free(fullname);
@@ -2015,19 +2058,37 @@ bool cVNSIClient::processEPG_GetForChannel() /* OPCODE 120 */
}
-/** OPCODE 140 - 169: VNSI network functions for channel scanning */
+/*!
+ * OPCODE 140 - 169:
+ * VNSI network functions for channel scanning
+ */
bool cVNSIClient::processSCAN_ScanSupported() /* OPCODE 140 */
{
- /** Note: Using "WirbelScanService-StopScan-v1.0" to detect
- a present service interface in wirbelscan plugin,
- it returns true if supported */
- cPlugin *p = cPluginManager::GetPlugin("wirbelscan");
- if (p && p->Service("WirbelScanService-StopScan-v1.0", NULL))
- m_resp->add_U32(VNSI_RET_OK);
- else
- m_resp->add_U32(VNSI_RET_NOTSUPPORTED);
+ uint32_t retValue = VNSI_RET_NOTSUPPORTED;
+ if (!m_inhibidDataUpdates && m_ChannelScanControl.IsSupported())
+ retValue = VNSI_RET_OK;
+
+ m_resp->add_U32(retValue);
+ m_resp->finalise();
+ m_socket.write(m_resp->getPtr(), m_resp->getLen());
+ return true;
+}
+
+bool cVNSIClient::processSCAN_GetSupportedTypes()
+{
+ uint32_t retValue = 0;
+ if (m_ChannelScanControl.IsSupported())
+ {
+ retValue |= m_ChannelScanControl.SupportsDVB_T() ? VNSI_SCAN_SUPPORT_DVB_T : 0;
+ retValue |= m_ChannelScanControl.SupportsDVB_C() ? VNSI_SCAN_SUPPORT_DVB_C : 0;
+ retValue |= m_ChannelScanControl.SupportsDVB_S() ? VNSI_SCAN_SUPPORT_DVB_S : 0;
+ retValue |= m_ChannelScanControl.SupportsAnalogTV() ? VNSI_SCAN_SUPPORT_ANALOG_TV : 0;
+ retValue |= m_ChannelScanControl.SupportsAnalogRadio() ? VNSI_SCAN_SUPPORT_ANALOG_RADIO : 0;
+ retValue |= m_ChannelScanControl.SupportsATSC() ? VNSI_SCAN_SUPPORT_ATSC : 0;
+ }
+ m_resp->add_U32(retValue);
m_resp->finalise();
m_socket.write(m_resp->getPtr(), m_resp->getLen());
return true;
@@ -2035,24 +2096,20 @@ bool cVNSIClient::processSCAN_ScanSupported() /* OPCODE 140 */
bool cVNSIClient::processSCAN_GetCountries() /* OPCODE 141 */
{
- if (!m_processSCAN_Response)
+ scannerEntryList list;
+ if (m_ChannelScanControl.GetCountries(list))
{
- m_processSCAN_Response = m_resp;
- cPlugin *p = cPluginManager::GetPlugin("wirbelscan");
- if (p)
- {
- m_resp->add_U32(VNSI_RET_OK);
- p->Service("WirbelScanService-GetCountries-v1.0", (void*) processSCAN_AddCountry);
- }
- else
+ m_resp->add_U32(VNSI_RET_OK);
+ for (scannerEntryList::const_iterator it = list.begin(); it != list.end(); ++it)
{
- m_resp->add_U32(VNSI_RET_NOTSUPPORTED);
+ m_resp->add_U32(it->index);
+ m_resp->add_String(it->name);
+ m_resp->add_String(it->longName);
}
- m_processSCAN_Response = NULL;
}
else
{
- m_resp->add_U32(VNSI_RET_DATALOCKED);
+ m_resp->add_U32(VNSI_RET_NOTSUPPORTED);
}
m_resp->finalise();
@@ -2062,24 +2119,20 @@ bool cVNSIClient::processSCAN_GetCountries() /* OPCODE 141 */
bool cVNSIClient::processSCAN_GetSatellites() /* OPCODE 142 */
{
- if (!m_processSCAN_Response)
+ scannerEntryList list;
+ if (m_ChannelScanControl.GetSatellites(list))
{
- m_processSCAN_Response = m_resp;
- cPlugin *p = cPluginManager::GetPlugin("wirbelscan");
- if (p)
- {
- m_resp->add_U32(VNSI_RET_OK);
- p->Service("WirbelScanService-GetSatellites-v1.0", (void*) processSCAN_AddSatellite);
- }
- else
+ m_resp->add_U32(VNSI_RET_OK);
+ for (scannerEntryList::const_iterator it = list.begin(); it != list.end(); ++it)
{
- m_resp->add_U32(VNSI_RET_NOTSUPPORTED);
+ m_resp->add_U32(it->index);
+ m_resp->add_String(it->name);
+ m_resp->add_String(it->longName);
}
- m_processSCAN_Response = NULL;
}
else
{
- m_resp->add_U32(VNSI_RET_DATALOCKED);
+ m_resp->add_U32(VNSI_RET_NOTSUPPORTED);
}
m_resp->finalise();
@@ -2089,8 +2142,8 @@ bool cVNSIClient::processSCAN_GetSatellites() /* OPCODE 142 */
bool cVNSIClient::processSCAN_Start() /* OPCODE 143 */
{
- WirbelScanService_DoScan_v1_0 svc;
- svc.type = (scantype_t)m_req->extract_U32();
+ sScanServiceData svc;
+ svc.type = (int)m_req->extract_U32();
svc.scan_tv = (bool)m_req->extract_U8();
svc.scan_radio = (bool)m_req->extract_U8();
svc.scan_fta = (bool)m_req->extract_U8();
@@ -2103,27 +2156,19 @@ bool cVNSIClient::processSCAN_Start() /* OPCODE 143 */
svc.DVBT_Inversion = (int)m_req->extract_U32();
svc.SatIndex = (int)m_req->extract_U32();
svc.ATSC_Type = (int)m_req->extract_U32();
- svc.SetPercentage = processSCAN_SetPercentage;
- svc.SetSignalStrength = processSCAN_SetSignalStrength;
- svc.SetDeviceInfo = processSCAN_SetDeviceInfo;
- svc.SetTransponder = processSCAN_SetTransponder;
- svc.NewChannel = processSCAN_NewChannel;
- svc.IsFinished = processSCAN_IsFinished;
- svc.SetStatus = processSCAN_SetStatus;
- m_processSCAN_Socket = &m_socket;
-
- cPlugin *p = cPluginManager::GetPlugin("wirbelscan");
- if (p)
- {
- if (p->Service("WirbelScanService-DoScan-v1.0", (void*) &svc))
+
+ if (!m_inhibidDataUpdates && m_ChannelScanControl.IsSupported())
+ {
+ if (m_ChannelScanControl.StartScan(svc))
+ {
m_resp->add_U32(VNSI_RET_OK);
+ m_inhibidDataUpdates = true;
+ }
else
m_resp->add_U32(VNSI_RET_ERROR);
}
else
- {
m_resp->add_U32(VNSI_RET_NOTSUPPORTED);
- }
m_resp->finalise();
m_socket.write(m_resp->getPtr(), m_resp->getLen());
@@ -2132,38 +2177,23 @@ bool cVNSIClient::processSCAN_Start() /* OPCODE 143 */
bool cVNSIClient::processSCAN_Stop() /* OPCODE 144 */
{
- cPlugin *p = cPluginManager::GetPlugin("wirbelscan");
- if (p)
+ m_inhibidDataUpdates = false;
+
+ if (m_ChannelScanControl.IsSupported())
{
- p->Service("WirbelScanService-StopScan-v1.0", NULL);
- m_resp->add_U32(VNSI_RET_OK);
+ if (m_ChannelScanControl.StopScan())
+ m_resp->add_U32(VNSI_RET_OK);
+ else
+ m_resp->add_U32(VNSI_RET_ERROR);
}
else
- {
m_resp->add_U32(VNSI_RET_NOTSUPPORTED);
- }
+
m_resp->finalise();
m_socket.write(m_resp->getPtr(), m_resp->getLen());
return true;
}
-cResponsePacket *cVNSIClient::m_processSCAN_Response = NULL;
-cxSocket *cVNSIClient::m_processSCAN_Socket = NULL;
-
-void cVNSIClient::processSCAN_AddCountry(int index, const char *isoName, const char *longName)
-{
- m_processSCAN_Response->add_U32(index);
- m_processSCAN_Response->add_String(isoName);
- m_processSCAN_Response->add_String(longName);
-}
-
-void cVNSIClient::processSCAN_AddSatellite(int index, const char *shortName, const char *longName)
-{
- m_processSCAN_Response->add_U32(index);
- m_processSCAN_Response->add_String(shortName);
- m_processSCAN_Response->add_String(longName);
-}
-
void cVNSIClient::processSCAN_SetPercentage(int percent)
{
cResponsePacket *resp = new cResponsePacket();
@@ -2174,7 +2204,7 @@ void cVNSIClient::processSCAN_SetPercentage(int percent)
}
resp->add_U32(percent);
resp->finalise();
- m_processSCAN_Socket->write(resp->getPtr(), resp->getLen());
+ m_socket.write(resp->getPtr(), resp->getLen());
delete resp;
}
@@ -2186,12 +2216,10 @@ void cVNSIClient::processSCAN_SetSignalStrength(int strength, bool locked)
delete resp;
return;
}
- strength *= 100;
- strength /= 0xFFFF;
resp->add_U32(strength);
resp->add_U32(locked);
resp->finalise();
- m_processSCAN_Socket->write(resp->getPtr(), resp->getLen());
+ m_socket.write(resp->getPtr(), resp->getLen());
delete resp;
}
@@ -2205,7 +2233,7 @@ void cVNSIClient::processSCAN_SetDeviceInfo(const char *Info)
}
resp->add_String(Info);
resp->finalise();
- m_processSCAN_Socket->write(resp->getPtr(), resp->getLen());
+ m_socket.write(resp->getPtr(), resp->getLen());
delete resp;
}
@@ -2219,7 +2247,7 @@ void cVNSIClient::processSCAN_SetTransponder(const char *Info)
}
resp->add_String(Info);
resp->finalise();
- m_processSCAN_Socket->write(resp->getPtr(), resp->getLen());
+ m_socket.write(resp->getPtr(), resp->getLen());
delete resp;
}
@@ -2236,7 +2264,7 @@ void cVNSIClient::processSCAN_NewChannel(const char *Name, bool isRadio, bool is
resp->add_U32(isHD);
resp->add_String(Name);
resp->finalise();
- m_processSCAN_Socket->write(resp->getPtr(), resp->getLen());
+ m_socket.write(resp->getPtr(), resp->getLen());
delete resp;
}
@@ -2249,8 +2277,7 @@ void cVNSIClient::processSCAN_IsFinished()
return;
}
resp->finalise();
- m_processSCAN_Socket->write(resp->getPtr(), resp->getLen());
- m_processSCAN_Socket = NULL;
+ m_socket.write(resp->getPtr(), resp->getLen());
delete resp;
}
@@ -2264,7 +2291,7 @@ void cVNSIClient::processSCAN_SetStatus(int status)
}
resp->add_U32(status);
resp->finalise();
- m_processSCAN_Socket->write(resp->getPtr(), resp->getLen());
+ m_socket.write(resp->getPtr(), resp->getLen());
delete resp;
}
@@ -2278,8 +2305,6 @@ bool cVNSIClient::processOSD_Connect() /* OPCODE 160 */
m_resp->add_U32(osdHeight);
m_resp->finalise();
m_socket.write(m_resp->getPtr(), m_resp->getLen());
-
- m_Osd = new cVnsiOsdProvider(&m_socket);
return true;
}
@@ -2303,26 +2328,357 @@ bool cVNSIClient::processOSD_Hitkey() /* OPCODE 162 */
return true;
}
-// this method is taken from XVDR
+/** OPCODE 180 - 189: VNSI network functions for deleted recording access */
+
+bool cVNSIClient::processRECORDINGS_DELETED_Supported() /* OPCODE 180 */
+{
+ m_resp->add_U32(VNSI_RET_OK);
+ m_resp->finalise();
+ m_socket.write(m_resp->getPtr(), m_resp->getLen());
+ return true;
+}
+
+bool cVNSIClient::processRECORDINGS_DELETED_GetCount() /* OPCODE 181 */
+{
+ DeletedRecordings.Load();
+ m_resp->add_U32(DeletedRecordings.Count());
+ m_resp->finalise();
+ m_socket.write(m_resp->getPtr(), m_resp->getLen());
+ return true;
+}
+
+bool cVNSIClient::processRECORDINGS_DELETED_GetList() /* OPCODE 182 */
+{
+ cMutexLock lock(&m_timerLock);
+ cThreadLock RecordingsLock(&Recordings);
+
+ for (cRecording *recording = DeletedRecordings.First(); recording; recording = DeletedRecordings.Next(recording))
+ {
+#if APIVERSNUM >= 10705
+ const cEvent *event = recording->Info()->GetEvent();
+#else
+ const cEvent *event = NULL;
+#endif
+
+ time_t recordingStart = 0;
+ int recordingDuration = 0;
+ if (event)
+ {
+ recordingStart = event->StartTime();
+ recordingDuration = event->Duration();
+ }
+ else
+ {
+ cRecordControl *rc = cRecordControls::GetRecordControl(recording->FileName());
+ if (rc)
+ {
+ recordingStart = rc->Timer()->StartTime();
+ recordingDuration = rc->Timer()->StopTime() - recordingStart;
+ }
+ else
+ {
+#if APIVERSNUM >= 10727
+ recordingStart = recording->Start();
+#else
+ recordingStart = recording->start;
+#endif
+ }
+ }
+ DEBUGLOG("GRI: RC: recordingStart=%lu recordingDuration=%i", recordingStart, recordingDuration);
+
+ // recording_time
+ m_resp->add_U32(recordingStart);
+
+ // duration
+ m_resp->add_U32(recordingDuration);
+
+ // priority
+#if APIVERSNUM >= 10727
+ m_resp->add_U32(recording->Priority());
+#else
+ m_resp->add_U32(recording->priority);
+#endif
+
+ // lifetime
+#if APIVERSNUM >= 10727
+ m_resp->add_U32(recording->Lifetime());
+#else
+ m_resp->add_U32(recording->lifetime);
+#endif
+
+ // channel_name
+ m_resp->add_String(recording->Info()->ChannelName() ? m_toUTF8.Convert(recording->Info()->ChannelName()) : "");
+
+ char* fullname = strdup(recording->Name());
+ char* recname = strrchr(fullname, FOLDERDELIMCHAR);
+ char* directory = NULL;
+
+ if(recname == NULL) {
+ recname = fullname;
+ }
+ else {
+ *recname = 0;
+ recname++;
+ directory = fullname;
+ }
+
+ // title
+ m_resp->add_String(m_toUTF8.Convert(recname));
+
+ // subtitle
+ if (!isempty(recording->Info()->ShortText()))
+ m_resp->add_String(m_toUTF8.Convert(recording->Info()->ShortText()));
+ else
+ m_resp->add_String("");
+
+ // description
+ if (!isempty(recording->Info()->Description()))
+ m_resp->add_String(m_toUTF8.Convert(recording->Info()->Description()));
+ else
+ m_resp->add_String("");
+
+ // directory
+ if(directory != NULL) {
+ char* p = directory;
+ while(*p != 0) {
+ if(*p == FOLDERDELIMCHAR) *p = '/';
+ if(*p == '_') *p = ' ';
+ p++;
+ }
+ while(*directory == '/') directory++;
+ }
+
+ m_resp->add_String((isempty(directory)) ? "" : m_toUTF8.Convert(directory));
+
+ // filename / uid of recording
+ uint32_t uid = cRecordingsCache::GetInstance().Register(recording, false);
+ m_resp->add_U32(uid);
+
+ free(fullname);
+ }
+
+ m_resp->finalise();
+ m_socket.write(m_resp->getPtr(), m_resp->getLen());
+ return true;
+}
+
+bool cVNSIClient::processRECORDINGS_DELETED_Delete() /* OPCODE 183 */
+{
+ cString recName;
+ cRecording* recording = NULL;
+
+#if VDRVERSNUM >= 20102
+ cLockFile LockFile(cVideoDirectory::Name());
+#else
+ cLockFile LockFile(VideoDirectory);
+#endif
+ if (LockFile.Lock())
+ {
+ uint32_t uid = m_req->extract_U32();
+
+ cThreadLock DeletedRecordingsLock(&DeletedRecordings);
+
+ for (recording = DeletedRecordings.First(); recording; recording = DeletedRecordings.Next(recording))
+ {
+ if (uid == CreateStringHash(recording->FileName()))
+ {
+#if VDRVERSNUM >= 20102
+ if (!cVideoDirectory::RemoveVideoFile(recording->FileName()))
+#else
+ if (!RemoveVideoFile(recording->FileName()))
+#endif
+ {
+ ERRORLOG("Error while remove deleted recording (%s)", recording->FileName());
+ m_resp->add_U32(VNSI_RET_ERROR);
+ }
+ else
+ {
+ DeletedRecordings.Del(recording);
+ DeletedRecordings.Update();
+ INFOLOG("Recording \"%s\" permanent deleted", recording->FileName());
+ m_resp->add_U32(VNSI_RET_OK);
+ }
+ break;
+ }
+ }
+ }
+
+ m_resp->finalise();
+ m_socket.write(m_resp->getPtr(), m_resp->getLen());
+
+ return true;
+}
+
+bool cVNSIClient::Undelete(cRecording* recording)
+{
+ DEBUGLOG("undelete recording: %s", recording->Name());
+
+ char *NewName = strdup(recording->FileName());
+ char *ext = strrchr(NewName, '.');
+ if (ext && strcmp(ext, ".del") == 0)
+ {
+ strncpy(ext, ".rec", strlen(ext));
+ if (!access(NewName, F_OK))
+ {
+ ERRORLOG("Recording with the same name exists (%s)", NewName);
+ OsdStatusMessage(*cString::sprintf("%s (%s)", tr("Recording with the same name exists"), NewName));
+ }
+ else
+ {
+ if (access(recording->FileName(), F_OK) == 0)
+ {
+#if VDRVERSNUM >= 20102
+ if (!cVideoDirectory::RenameVideoFile(recording->FileName(), NewName))
+#else
+ if (!RenameVideoFile(recording->FileName(), NewName))
+#endif
+ {
+ ERRORLOG("Error while rename deleted recording (%s) to (%s)", recording->FileName(), NewName);
+ }
+
+ cIndexFile *index = new cIndexFile(NewName, false, recording->IsPesRecording());
+ int LastFrame = index->Last() - 1;
+ if (LastFrame > 0)
+ {
+ uint16_t FileNumber = 0;
+ off_t FileOffset = 0;
+ index->Get(LastFrame, &FileNumber, &FileOffset);
+ delete index;
+ if (FileNumber == 0)
+ {
+ ERRORLOG("while read last filenumber (%s)", NewName);
+ OsdStatusMessage(*cString::sprintf("%s (%s)", tr("Error while read last filenumber"), NewName));
+ }
+ else
+ {
+ for (int i = 1; i <= FileNumber; i++)
+ {
+ cString temp = cString::sprintf(recording->IsPesRecording() ? "%s/%03d.vdr" : "%s/%05d.ts", (const char *)NewName, i);
+ if (access(*temp, R_OK) != 0)
+ {
+ i = FileNumber;
+ OsdStatusMessage(*cString::sprintf("%s %03d (%s)", tr("Error while accessing vdrfile"), i, NewName));
+ }
+ }
+ }
+ }
+ else
+ {
+ delete index;
+ ERRORLOG("accessing indexfile (%s)", NewName);
+ OsdStatusMessage(*cString::sprintf("%s (%s)", tr("Error while accessing indexfile"), NewName));
+ }
+
+ DeletedRecordings.Del(recording);
+ Recordings.Update();
+ DeletedRecordings.Update();
+ }
+ else
+ {
+ ERRORLOG("deleted recording '%s' vanished", recording->FileName());
+ OsdStatusMessage(*cString::sprintf("%s \"%s\"", tr("Deleted recording vanished"), recording->FileName()));
+ }
+ }
+ }
+ free(NewName);
+ return true;
+}
+
+bool cVNSIClient::processRECORDINGS_DELETED_Undelete() /* OPCODE 184 */
+{
+ int ret = VNSI_RET_DATAUNKNOWN;
+
+#if VDRVERSNUM >= 20102
+ cLockFile LockFile(cVideoDirectory::Name());
+#else
+ cLockFile LockFile(VideoDirectory);
+#endif
+ if (LockFile.Lock())
+ {
+ uint32_t uid = m_req->extract_U32();
+
+ cThreadLock DeletedRecordingsLock(&DeletedRecordings);
+
+ for (cRecording* recording = DeletedRecordings.First(); recording; recording = DeletedRecordings.Next(recording))
+ {
+ if (uid == CreateStringHash(recording->FileName()))
+ {
+ if (Undelete(recording))
+ {
+ INFOLOG("Recording \"%s\" undeleted", recording->FileName());
+ ret = VNSI_RET_OK;
+ }
+ else
+ ret = VNSI_RET_ERROR;
+ break;
+ }
+ }
+ }
+
+ m_resp->add_U32(ret);
+ m_resp->finalise();
+ m_socket.write(m_resp->getPtr(), m_resp->getLen());
+ return true;
+}
+
+bool cVNSIClient::processRECORDINGS_DELETED_DeleteAll() /* OPCODE 185 */
+{
+ int ret = VNSI_RET_OK;
+
+#if VDRVERSNUM >= 20102
+ cLockFile LockFile(cVideoDirectory::Name());
+#else
+ cLockFile LockFile(VideoDirectory);
+#endif
+
+ if (LockFile.Lock())
+ {
+ cThreadLock DeletedRecordingsLock(&DeletedRecordings);
+
+ for (cRecording *recording = DeletedRecordings.First(); recording; )
+ {
+ cRecording *next = DeletedRecordings.Next(recording);
+#if VDRVERSNUM >= 20102
+ if (!cVideoDirectory::RemoveVideoFile(recording->FileName()))
+#else
+ if (!RemoveVideoFile(recording->FileName()))
+#endif
+ {
+ ERRORLOG("Error while remove deleted recording (%s)", recording->FileName());
+ ret = VNSI_RET_ERROR;
+ break;
+ }
+ else
+ INFOLOG("Recording \"%s\" permanent deleted", recording->FileName());
+ recording = next;
+ }
+ DeletedRecordings.Clear();
+ DeletedRecordings.Update();
+ }
+
+ m_resp->add_U32(ret);
+ m_resp->finalise();
+ m_socket.write(m_resp->getPtr(), m_resp->getLen());
+
+ return true;
+}
+
+// part of this method is taken from XVDR
cString cVNSIClient::CreatePiconRef(cChannel* channel)
{
int hash = 0;
if(cSource::IsSat(channel->Source()))
{
- hash = channel->Source() & cSource::st_Pos;
+ int16_t pos = channel->Source() & cSource::st_Pos;
+ hash = pos;
#if VDRVERSNUM >= 20101
- hash = -hash;
-#endif
-
- if(hash > 0x00007FFF)
- hash |= 0xFFFF0000;
-
if(hash < 0)
- hash = -hash;
- else
- hash = 1800 + hash;
+ {
+ hash = 3600 + hash;
+ }
+#endif
hash = hash << 16;
}
diff --git a/vnsiclient.h b/vnsiclient.h
index b61e2e9..aadcffa 100644
--- a/vnsiclient.h
+++ b/vnsiclient.h
@@ -1,10 +1,11 @@
/*
- * vdr-plugin-vnsi - XBMC server plugin for VDR
+ * vdr-plugin-vnsi - KODI server plugin for VDR
*
* Copyright (C) 2010 Alwin Esch (Team XBMC)
* Copyright (C) 2010, 2011 Alexander Pipelka
+ * Copyright (C) 2015 Team KODI
*
- * http://www.xbmc.org
+ * http://kodi.tv
*
* This Program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -17,7 +18,7 @@
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
- * along with XBMC; see the file COPYING. If not, see
+ * along with KODI; see the file COPYING. If not, see
* <http://www.gnu.org/licenses/>.
*
*/
@@ -32,6 +33,7 @@
#include "config.h"
#include "cxsocket.h"
+#include "channelscancontrol.h"
#include <map>
#include <string>
@@ -56,6 +58,7 @@ private:
bool m_StatusInterfaceEnabled;
cLiveStreamer *m_Streamer;
bool m_isStreaming;
+ bool m_bSupportRDS;
cString m_ClientAddress;
cRecPlayer *m_RecPlayer;
cRequestPacket *m_req;
@@ -65,6 +68,8 @@ private:
cMutex m_msgLock;
static cMutex m_timerLock;
cVnsiOsdProvider *m_Osd;
+ CScanControl m_ChannelScanControl;
+ static bool m_inhibidDataUpdates;
typedef struct
{
int attempts;
@@ -92,6 +97,7 @@ public:
void RecordingsChange();
void TimerChange();
void EpgChange();
+ static bool InhibidDataUpdates() { return m_inhibidDataUpdates; }
unsigned int GetID() { return m_Id; }
@@ -159,34 +165,42 @@ private:
bool processRECORDINGS_Delete();
bool processRECORDINGS_Move();
bool processRECORDINGS_GetEdl();
+ bool processRECORDINGS_DELETED_Supported();
+ bool processRECORDINGS_DELETED_GetCount();
+ bool processRECORDINGS_DELETED_GetList();
+ bool processRECORDINGS_DELETED_Delete();
+ bool processRECORDINGS_DELETED_Undelete();
+ bool processRECORDINGS_DELETED_DeleteAll();
bool processEPG_GetForChannel();
bool processSCAN_ScanSupported();
+ bool processSCAN_GetSupportedTypes();
bool processSCAN_GetCountries();
bool processSCAN_GetSatellites();
bool processSCAN_Start();
bool processSCAN_Stop();
- /** Static callback functions to interact with wirbelscan plugin over
- the plugin service interface */
- static void processSCAN_AddCountry(int index, const char *isoName, const char *longName);
- static void processSCAN_AddSatellite(int index, const char *shortName, const char *longName);
- static void processSCAN_SetPercentage(int percent);
- static void processSCAN_SetSignalStrength(int strength, bool locked);
- static void processSCAN_SetDeviceInfo(const char *Info);
- static void processSCAN_SetTransponder(const char *Info);
- static void processSCAN_NewChannel(const char *Name, bool isRadio, bool isEncrypted, bool isHD);
- static void processSCAN_IsFinished();
- static void processSCAN_SetStatus(int status);
- static cResponsePacket *m_processSCAN_Response;
- static cxSocket *m_processSCAN_Socket;
+ bool Undelete(cRecording* recording);
bool processOSD_Connect();
bool processOSD_Disconnect();
bool processOSD_Hitkey();
cString CreatePiconRef(cChannel* channel);
+
+private:
+ /** Static callback functions to interact with wirbelscan plugin over
+ the plugin service interface */
+ friend class CScanControl;
+
+ void processSCAN_SetPercentage(int percent);
+ void processSCAN_SetSignalStrength(int strength, bool locked);
+ void processSCAN_SetDeviceInfo(const char *Info);
+ void processSCAN_SetTransponder(const char *Info);
+ void processSCAN_NewChannel(const char *Name, bool isRadio, bool isEncrypted, bool isHD);
+ void processSCAN_IsFinished();
+ void processSCAN_SetStatus(int status);
};
#endif // VNSI_CLIENT_H
diff --git a/vnsicommand.h b/vnsicommand.h
index b2e47fd..e5be0bf 100644
--- a/vnsicommand.h
+++ b/vnsicommand.h
@@ -1,10 +1,11 @@
/*
- * vdr-plugin-vnsi - XBMC server plugin for VDR
+ * vdr-plugin-vnsi - KODI server plugin for VDR
*
* Copyright (C) 2010 Alwin Esch (Team XBMC)
* Copyright (C) 2010, 2011 Alexander Pipelka
+ * Copyright (C) 2015 Team KODI
*
- * http://www.xbmc.org
+ * http://kodi.tv
*
* This Program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -17,7 +18,7 @@
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
- * along with XBMC; see the file COPYING. If not, see
+ * along with KODI; see the file COPYING. If not, see
* <http://www.gnu.org/licenses/>.
*
*/
@@ -26,7 +27,10 @@
#define VNSI_COMMAND_H
/** Current VNSI Protocol Version number */
-#define VNSI_PROTOCOLVERSION 6
+#define VNSI_PROTOCOLVERSION 8
+
+/** Start of RDS support protocol Version */
+#define VNSI_RDS_PROTOCOLVERSION 8
/** Minimum VNSI Protocol Version number */
#define VNSI_MIN_PROTOCOLVERSION 5
@@ -109,12 +113,21 @@
#define VNSI_SCAN_GETSATELLITES 142
#define VNSI_SCAN_START 143
#define VNSI_SCAN_STOP 144
+#define VNSI_SCAN_SUPPORTED_TYPES 145
/* OPCODE 160 - 179: VNSI network functions for channel scanning */
#define VNSI_OSD_CONNECT 160
#define VNSI_OSD_DISCONNECT 161
#define VNSI_OSD_HITKEY 162
+/* OPCODE 180 - 189: VNSI network functions for deleted recording access */
+#define VNSI_RECORDINGS_DELETED_ACCESS_SUPPORTED 180
+#define VNSI_RECORDINGS_DELETED_GETCOUNT 181
+#define VNSI_RECORDINGS_DELETED_GETLIST 182
+#define VNSI_RECORDINGS_DELETED_DELETE 183
+#define VNSI_RECORDINGS_DELETED_UNDELETE 184
+#define VNSI_RECORDINGS_DELETED_DELETE_ALL 185
+
/** Stream packet types (server -> client) */
#define VNSI_STREAM_CHANGE 1
#define VNSI_STREAM_STATUS 2
@@ -150,6 +163,14 @@
#define VNSI_STATUS_RECORDINGSCHANGE 5
#define VNSI_STATUS_EPGCHANGE 6
+/** Channel search signal supported flags */
+#define VNSI_SCAN_SUPPORT_DVB_T 0x01
+#define VNSI_SCAN_SUPPORT_DVB_C 0x02
+#define VNSI_SCAN_SUPPORT_DVB_S 0x04
+#define VNSI_SCAN_SUPPORT_ANALOG_TV 0x08
+#define VNSI_SCAN_SUPPORT_ANALOG_RADIO 0x10
+#define VNSI_SCAN_SUPPORT_ATSC 0x20
+
/** Packet return codes */
#define VNSI_RET_OK 0
#define VNSI_RET_RECRUNNING 1
diff --git a/vnsiosd.c b/vnsiosd.c
index 85ed0b2..3d6f7da 100644
--- a/vnsiosd.c
+++ b/vnsiosd.c
@@ -1,6 +1,10 @@
/*
+ * vdr-plugin-vnsi - KODI server plugin for VDR
+ *
* Copyright (C) 2005-2012 Team XBMC
- * http://www.xbmc.org
+ * Copyright (C) 2015 Team KODI
+ *
+ * http://kodi.tv
*
* This Program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -13,7 +17,7 @@
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
- * along with XBMC; see the file COPYING. If not, see
+ * along with KODI; see the file COPYING. If not, see
* <http://www.gnu.org/licenses/>.
*
*/
@@ -22,6 +26,7 @@
#include "vnsiosd.h"
#include "vnsicommand.h"
#include "responsepacket.h"
+#include "vnsi.h"
#include <signal.h>
#include <sys/ioctl.h>
#include <sys/unistd.h>
@@ -216,12 +221,16 @@ cVnsiOsdProvider::cVnsiOsdProvider(cxSocket *socket)
INFOLOG("new osd provider");
m_Socket = socket;
m_RequestFull = true;
+ if (VNSIServerConfig.pDevice)
+ ((cDvbVnsiDevice*)VNSIServerConfig.pDevice)->ActivateDecoder(true);
}
cVnsiOsdProvider::~cVnsiOsdProvider()
{
cMutexLock lock(&m_Mutex);
m_Socket = NULL;
+ if (VNSIServerConfig.pDevice)
+ ((cDvbVnsiDevice*)VNSIServerConfig.pDevice)->ActivateDecoder(false);
}
cOsd *cVnsiOsdProvider::CreateOsd(int Left, int Top, uint Level)
diff --git a/vnsiosd.h b/vnsiosd.h
index fe5f808..454099d 100644
--- a/vnsiosd.h
+++ b/vnsiosd.h
@@ -1,6 +1,10 @@
/*
+ * vdr-plugin-vnsi - KODI server plugin for VDR
+ *
* Copyright (C) 2005-2012 Team XBMC
- * http://www.xbmc.org
+ * Copyright (C) 2015 Team KODI
+ *
+ * http://kodi.tv
*
* This Program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -13,7 +17,7 @@
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
- * along with XBMC; see the file COPYING. If not, see
+ * along with KODI; see the file COPYING. If not, see
* <http://www.gnu.org/licenses/>.
*
*/
diff --git a/vnsiserver.c b/vnsiserver.c
index 2919308..ca565a5 100644
--- a/vnsiserver.c
+++ b/vnsiserver.c
@@ -1,10 +1,11 @@
/*
- * vdr-plugin-vnsi - XBMC server plugin for VDR
+ * vdr-plugin-vnsi - KODI server plugin for VDR
*
* Copyright (C) 2010 Alwin Esch (Team XBMC)
* Copyright (C) 2010, 2011 Alexander Pipelka
+ * Copyright (C) 2015 Team KODI
*
- * http://www.xbmc.org
+ * http://kodi.tv
*
* This Program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -17,7 +18,7 @@
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
- * along with XBMC; see the file COPYING. If not, see
+ * along with KODI; see the file COPYING. If not, see
* <http://www.gnu.org/licenses/>.
*
*/
diff --git a/vnsiserver.h b/vnsiserver.h
index 472d0bb..43c0865 100644
--- a/vnsiserver.h
+++ b/vnsiserver.h
@@ -1,10 +1,11 @@
/*
- * vdr-plugin-vnsi - XBMC server plugin for VDR
+ * vdr-plugin-vnsi - KODI server plugin for VDR
*
* Copyright (C) 2010 Alwin Esch (Team XBMC)
* Copyright (C) 2010, 2011 Alexander Pipelka
+ * Copyright (C) 2015 Team KODI
*
- * http://www.xbmc.org
+ * http://kodi.tv
*
* This Program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -17,7 +18,7 @@
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
- * along with XBMC; see the file COPYING. If not, see
+ * along with KODI; see the file COPYING. If not, see
* <http://www.gnu.org/licenses/>.
*
*/
diff --git a/wirbelscan_services.h b/wirbelscan_services.h
new file mode 100644
index 0000000..9078d73
--- /dev/null
+++ b/wirbelscan_services.h
@@ -0,0 +1,266 @@
+/*
+ * wirbelscan_services.h
+ *
+ * Copyright (C) 2010 Winfried Koehler
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ * Or, point your browser to http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
+ *
+ * The author can be reached at: handygewinnspiel AT gmx DOT de
+ *
+ * The project's page is http://wirbel.htpc-forum.de/wirbelscan/index2.html
+ */
+
+#ifndef __WIRBELSCAN_SERVICES_H__
+#define __WIRBELSCAN_SERVICES_H__
+
+
+/********************************************************************
+ *
+ * wirbelscans plugin service interface
+ *
+ * see http://wirbel.htpc-forum.de/wirbelscan/vdr-servdemo-0.0.1.tgz
+ * for example on usage.
+ *
+ *******************************************************************/
+
+namespace WIRBELSCAN_SERVICE {
+/* begin of namespace. to use this header file:
+ * #include "../wirbelscan/wirbelscan_services.h"
+ * using namespace WIRBELSCAN_SERVICE;
+ */
+
+/* --- service(s) version ----------------------------------------------------
+ */
+
+#define SPlugin "wirbelscan_" // prefix
+#define SInfo "GetVersion" // plugin version and service api
+#define SCommand "DoCmd#0001" // command api 0001
+#define SStatus "Status#0002" // query status
+#define SSetup "Setup#0001" // get/set setup, GetSetup#XXXX/SetSetup#XXXX
+#define SCountry "Country#0001" // get list of country IDs and Names
+#define SSat "Sat#0001" // get list of satellite IDs and Names
+#define SUser "User#0002" // get/set single user transponder, GetUser#XXXX/SetUser#XXXX
+
+/* --- wirbelscan_GetVersion -------------------------------------------------
+ * Query wirbelscans versions, will fail only if plugin version doesnt support service at all.
+ */
+
+typedef struct {
+ const char * PluginVersion; // plugin version
+ const char * CommandVersion; // commands service version
+ const char * StatusVersion; // status service version
+ const char * SetupVersion; // get/put setup service version
+ const char * CountryVersion; // country ID list version
+ const char * SatVersion; // satellite ID list version
+ const char * UserVersion; // user transponder api version, 0.0.5-pre12b or higher.
+ const char * reserved2; // reserved, dont use.
+ const char * reserved3; // reserved, dont use.
+} cWirbelscanInfo;
+
+/* --- wirbelscan_DoCmd ------------------------------------------------------
+ * Execute commands.
+ */
+
+typedef enum {
+ CmdStartScan = 0, // start scanning
+ CmdStopScan = 1, // stop scanning
+ CmdStore = 2, // store current setup
+} s_cmd;
+
+typedef struct {
+ s_cmd cmd; // see above.
+ bool replycode; // false, if unsuccessful.
+} cWirbelscanCmd;
+
+/* --- wirbelscan_Status -----------------------------------------------------
+ * Query Status. Use this to build up your osd information displayed to user.
+ */
+
+typedef enum {
+ StatusUnknown = 0, // no status information available, try again later.
+ StatusScanning = 1, // scan in progress.
+ StatusStopped = 2, // no scan in progress (not started, finished or stopped).
+ StatusBusy = 3, // plugin is busy, try again later.
+} cStatus;
+
+typedef struct {
+ cStatus status; // see above.
+ char curr_device[256]; // name of current device. meaningless, if (status != StatusScanning)
+ uint16_t progress; // progress by means of "percent of predefined transponders". NOTE: will differ in terms of time. meaningless, if (status != StatusScanning)
+ uint16_t strength; // current signal strength as reported from device. NOTE: updated only after switching to new transponder. meaningless, if (status != StatusScanning)
+ char transponder[256]; // current transponder. meaningless, if (status != StatusScanning)
+ uint16_t numChannels; // current number of (all) channels, including those which are new. meaningless, if (status != StatusScanning)
+ uint16_t newChannels; // number of channels found during this scan. meaningless, if (status != StatusScanning)
+ uint16_t nextTransponders; // number of transponders still to be scanned from NIT on this transponder. meaningless, if (status != StatusScanning)
+ uint16_t reserved2; // reserved, dont use.
+ uint16_t reserved3; // reserved, dont use.
+} cWirbelscanStatus;
+
+/* --- wirbelscan_GetSetup, wirbelscan_SetSetup ------------------------------
+ * Get/Set Setup. Use this to build up your setup osd displayed to user.
+ */
+
+typedef struct {
+ uint16_t verbosity; // 0 (errors only) .. 5 (extended debug); default = 3 (messages)
+ uint16_t logFile; // 0 = off, 1 = stdout, 2 = syslog
+ uint16_t DVB_Type; // DVB-T = 0, DVB-C = 1, DVB-S/S2 = 2, PVRINPUT = 3, PVRINPUT(FM Radio) = 4, ATSC = 5, TRANSPONDER = 999
+ uint16_t DVBT_Inversion; // AUTO/OFF = 0, AUTO/ON = 1
+ uint16_t DVBC_Inversion; // AUTO/OFF = 0, AUTO/ON = 1
+ uint16_t DVBC_Symbolrate; // careful here - may change. AUTO = 0, 6900 = 1, 6875 = 2 (...) 14 = 5483, 15 = ALL
+ uint16_t DVBC_QAM; // AUTO = 0,QAM64 = 1, QAM128 = 2, QAM256 = 3, ALL = 4
+ uint16_t CountryId; // the id according to country, found in country list, see wirbelscan_GetCountry
+ uint16_t SatId; // the id according to satellite, found in list, see wirbelscan_GetSat
+ uint32_t scanflags; // bitwise flag of wanted channels: TV = (1 << 0), RADIO = (1 << 1), FTA = (1 << 2), SCRAMBLED = (1 << 4), HDTV = (1 << 5)
+ uint16_t ATSC_type; // VSB = 0, QAM = 1, both VSB+QAM = 2
+ uint16_t stuffing[6]; // dont use.
+} cWirbelscanScanSetup;
+
+/* --- wirbelscan_GetCountry, wirbelscan_GetSat ------------------------------
+ * Use this to build up your setup OSD - user needs to choose satellite and
+ * country by name and assign correct IDs to setup, see
+ * * cWirbelscanScanSetup::CountryId
+ * * cWirbelscanScanSetup::SatId.
+ *
+ * 1) Query needed buffer size with cPreAllocBuffer::size == 0
+ * 2) allocate memory in your plugin, to be at least: cPreAllocBuffer::size * sizeof(SListItem)
+ * 3) second call fills buffer with count * sizeof(SListItem) bytes.
+ * 4) access to items as SListItem*
+ */
+
+typedef struct {
+ int id;
+ char short_name[8];
+ char full_name[64];
+} SListItem;
+
+typedef struct {
+ uint32_t size;
+ uint32_t count;
+ SListItem * buffer;
+} cPreAllocBuffer;
+
+/* --- wirbelscan_GetUser, wirbelscan_SetUser --------------------------------
+ * Scan a user defined Transponder. Service() expects a pointer to uint32_t Data[3];
+ * Data should be initialized and read using class cUserTransponder.
+ *
+ * ---------------------------------------------
+ * id : 9 country-id/sat-id
+ * frequency : 21 DVB-T: 177500..858000; ATSC/DVB-C: 73000..858000, DVB-S/S2: 2000..15000
+ * polarisation : 2 0=h, 1=v, 2=l, 3=r
+ * type : 3 DVB_Type
+ * symbolrate : 17 i.e. 27500, 6900
+ * fec_hi : 4 DVB-S/S2: 1=1/2, 2=2/3, 3=3/4, 4=4/5, 5=5/6, 6=6/7, 7=7/8, 8=8/9, 9=forbidden, 10=3/5, 11=9/10
+ * DVB-T 1=1/2, 2=2/3, 3=3/4, 4=forbidden, 5=5/6, 6=forbidden, 7=7/8, 8..15=forbidden
+ * fec_lo : 4 DVB-T 1=1/2, 2=2/3, 3=3/4, 4=forbidden, 5=5/6, 6=forbidden, 7=7/8, 8..15=forbidden
+ * modulation : 4 DVB-C: 0=forbidden, 1=QAM16, 2=QAM32, 3=QAM64, 4=QAM128, 5=QAM256, 6..15: forbidden
+ * DVB-T: 0=QPSK, 1=QAM16, 2=forbidden, 3=QAM64, 4..15: forbidden
+ * DVB-S: 0=QPSK, 1=QAM16, 2..8: forbidden, 9=PSK8, 10..15:forbidden
+ * ATSC: 0..2: forbidden, 3=QAM64, 4=forbidden, 5=QAM256, 6=QAM_AUTO, 7=VSB8, 8=VSB16, 9..15=forbidden
+ * orbit : 12 i.e. 192 for S19E2
+ * we_flag : 1 0=west, 1=east
+ * rolloff : 2 0=0,35, 1=0,25, 2=0,20
+ * 2nd_gen_sys : 1 0=DVB-S/T, 1=DVB-S2/T2
+ * bw : 2 0=8MHz, 1=7MHz, 2=6MHz, 3=5MHz
+ * priority : 1 0=LP, 1=HP
+ * hierarchy : 4 0=OFF, 1=alpha1, 2=alpha2, 3=alpha4
+ * guardinterval : 2 0=1/32, 1=1/16, 2=1/8, 3=1/4
+ * transmission : 2 0=2k, 1=8k, 2=4k
+ * inversion : 1 0=OFF, 1=ON
+ * use_nit : 1 0=OFF, 1=ON
+ * reserved : 3 always 0
+ * ---------------------------------------------
+ */
+
+#if ! defined(uint32_t) || ! defined(uint8_t)
+#include <stdint.h>
+#endif
+
+#define P(v,b,p) ((v & ((1 << b) -1)) << p)
+#define G(v,b,p) ((v >> p) & ((1 << b) -1))
+
+class cUserTransponder {
+ private:
+ uint32_t data[3];
+ public:
+ ~cUserTransponder() { };
+ cUserTransponder(uint32_t * Data) {
+ data[0] = *(Data + 0);
+ data[1] = *(Data + 1);
+ data[2] = *(Data + 2);
+ };
+
+ // DVB-T
+ cUserTransponder(uint8_t id, uint32_t frequency, uint8_t modulation, uint8_t fec_hp, uint8_t fec_lp, uint8_t bw,
+ uint8_t priority, uint8_t hierarchy, uint8_t guard, uint8_t tm, uint8_t inversion, uint8_t use_nit) {
+ data[0] = P(id,9,23) | P(frequency,21,2);
+ data[1] = P(fec_hp,4,8) | P(fec_lp,4,4) | P(modulation,4,0);
+ data[2] = P(bw,2,14) | P(priority,1,13) | P(hierarchy,4,9) | P(guard,2,7) | P(tm,2,5) | P(inversion,1,4) | P(use_nit,1,3);
+ };
+
+ // DVB-C
+ cUserTransponder(uint8_t id, uint32_t frequency, uint32_t symbolrate, uint8_t modulation, uint8_t inversion, uint8_t use_nit) {
+ data[0] = P(id,9,23) | P(frequency,21,2);
+ data[1] = P(1,3,29) | P(symbolrate,17,12) | P(modulation,4,0);
+ data[2] = P(inversion,1,4) | P(use_nit,1,3);
+ };
+
+ // DVB-S
+ cUserTransponder(uint8_t id, uint8_t system, uint32_t frequency, uint8_t polarisation, uint32_t symbolrate,
+ uint8_t modulation, uint8_t fec, uint16_t orbit, uint8_t we_flag, uint8_t rolloff, uint8_t use_nit) {
+ data[0] = P(id,9,23) | P(frequency,21,2) | P(polarisation,2,0);
+ data[1] = P(2,3,29) | P(symbolrate,17,12) | P(fec,4,8) | P(modulation,4,0);
+ data[2] = P(orbit,12,20) | P(we_flag,1,19) | P(rolloff,2,17) | P(system,1,16) | P(use_nit,1,3);
+ };
+
+ // ATSC
+ cUserTransponder(uint8_t id, uint32_t frequency, uint8_t modulation, uint8_t use_nit) {
+ data[0] = P(id,9,23) | P(frequency,21,2);
+ data[1] = P(5,3,29) | P(modulation,4,0);
+ data[2] = P(use_nit,1,3);
+ };
+
+ const uint32_t * Data(void) { return data; };
+ int Id(void) { return G(data[0],9,23); };
+ int Frequency(void) { return G(data[0],21,2); };
+ int Polarisation(void){ return G(data[0],2,0); };
+ int Type(void) { return G(data[1],3,29); };
+ int Symbolrate(void) { return G(data[1],17,12); };
+ int FecHP(void) { return G(data[1],4,8); };
+ int FecLP(void) { return G(data[1],4,4); };
+ int Modulation(void) { return G(data[1],4,0); };
+ int Orbit(void) { return G(data[2],12,20); };
+ int EastFlag(void) { return G(data[2],1,19); };
+ int Rolloff(void) { return G(data[2],2,17); };
+ int Satsystem(void) { return G(data[2],1,16) + 5; }; /*deprecated. use System() instead.*/
+ int System(void) { return G(data[2],1,16) + 5; };
+ int Bandwidth(void) { return (8 - G(data[2],2,14)) * (int) 1E6; };
+ int Priority(void) { return G(data[2],1,13); };
+ int Hierarchy(void) { return G(data[2],4,9); };
+ int Guard(void) { return G(data[2],2,7); };
+ int Transmission(void){ return G(data[2],2,5); };
+ int Inversion(void) { return G(data[2],1,4); };
+ int UseNit(void) { return G(data[2],1,3); };
+ bool IsTerr(void) { return IsType(0); };
+ bool IsCable(void) { return IsType(1); };
+ bool IsSat(void) { return IsType(2); };
+ bool IsAtsc(void) { return IsType(5); };
+ bool IsType(int type) { return type == Type(); };
+
+};
+
+
+} /* end of namespace, dont touch */
+#endif
diff --git a/wirbelscanservice.h b/wirbelscanservice.h
deleted file mode 100644
index 625e0d3..0000000
--- a/wirbelscanservice.h
+++ /dev/null
@@ -1,57 +0,0 @@
-/*
- * wirbelscan.c: A plugin for the Video Disk Recorder
- *
- * See the README file for copyright information and how to reach the author.
- *
- * $Id$
- */
-
-#ifndef __WIRBELSCAN_SERVICE_H
-#define __WIRBELSCAN_SERVICE_H
-
-typedef enum scantype
-{
- DVB_TERR = 0,
- DVB_CABLE = 1,
- DVB_SAT = 2,
- PVRINPUT = 3,
- PVRINPUT_FM = 4,
- DVB_ATSC = 5,
-} scantype_t;
-
-typedef void (*WirbelScanService_GetCountries_v1_0)(int index, const char *isoName, const char *longName);
-typedef void (*WirbelScanService_GetSatellites_v1_0)(int index, const char *shortName, const char *longName);
-
-struct WirbelScanService_DoScan_v1_0
-{
- scantype_t type;
-
- bool scan_tv;
- bool scan_radio;
- bool scan_fta;
- bool scan_scrambled;
- bool scan_hd;
-
- int CountryIndex;
-
- int DVBC_Inversion;
- int DVBC_Symbolrate;
- int DVBC_QAM;
-
- int DVBT_Inversion;
-
- int SatIndex;
-
- int ATSC_Type;
-
- void (*SetPercentage)(int percent);
- void (*SetSignalStrength)(int strenght, bool locked);
- void (*SetDeviceInfo)(const char *Info);
- void (*SetTransponder)(const char *Info);
- void (*NewChannel)(const char *Name, bool isRadio, bool isEncrypted, bool isHD);
- void (*IsFinished)();
- void (*SetStatus)(int status);
-};
-
-#endif //__WIRBELSCAN_SERVICE_H
-
--
vdr-plugin-vnsiserver packaging
More information about the pkg-multimedia-commits
mailing list