summaryrefslogtreecommitdiff
path: root/server
diff options
context:
space:
mode:
authorFrank Schmirler <vdr@schmirler.de>2012-03-05 10:18:38 +0100
committerFrank Schmirler <vdr@schmirler.de>2012-05-12 12:58:42 +0200
commitae634538f86d424024f4b30fff58889d217f3320 (patch)
tree955d84b17c8f5452b5d6da11346f313e3627cd15 /server
parent783b261bcbb2a19388a13386cb0bbf625c32e42c (diff)
downloadvdr-plugin-streamdev-ae634538f86d424024f4b30fff58889d217f3320.tar.gz
vdr-plugin-streamdev-ae634538f86d424024f4b30fff58889d217f3320.tar.bz2
Dropped compatibility of streamdev-server with VDR < 1.7.25
Diffstat (limited to 'server')
-rw-r--r--server/connection.c13
-rw-r--r--server/connectionVTP.c35
-rw-r--r--server/livestreamer.c8
-rw-r--r--server/recplayer.c17
-rw-r--r--server/streamdev-server.c4
-rw-r--r--server/streamer.c4
6 files changed, 2 insertions, 79 deletions
diff --git a/server/connection.c b/server/connection.c
index 212483c..b6df6fd 100644
--- a/server/connection.c
+++ b/server/connection.c
@@ -264,7 +264,6 @@ bool cServerConnection::Close()
return cTBSocket::Close();
}
-#if APIVERSNUM >= 10700
static int GetClippedNumProvidedSystems(int AvailableBits, cDevice *Device)
{
int MaxNumProvidedSystems = (1 << AvailableBits) - 1;
@@ -279,7 +278,6 @@ static int GetClippedNumProvidedSystems(int AvailableBits, cDevice *Device)
}
return NumProvidedSystems;
}
-#endif
/*
* copy of cDevice::GetDevice(...) but without side effects (not detaching receivers)
@@ -337,26 +335,15 @@ cDevice* cServerConnection::CheckDevice(const cChannel *Channel, int Priority, b
imp <<= 1; imp |= LiveView ? !device->IsPrimaryDevice() || ndr : 0; // prefer the primary device for live viewing if we don't need to detach existing receivers
imp <<= 1; imp |= !device->Receiving() && (device != cTransferControl::ReceiverDevice() || device->IsPrimaryDevice()) || ndr; // use receiving devices if we don't need to detach existing receivers, but avoid primary device in local transfer mode
imp <<= 1; imp |= device->Receiving(); // avoid devices that are receiving
-#if APIVERSNUM >= 10700
imp <<= 4; imp |= GetClippedNumProvidedSystems(4, device) - 1; // avoid cards which support multiple delivery systems
-#endif
imp <<= 1; imp |= device == cTransferControl::ReceiverDevice(); // avoid the Transfer Mode receiver device
imp <<= 8; imp |= min(max(device->Priority() + MAXPRIORITY, 0), 0xFF); // use the device with the lowest priority (+MAXPRIORITY to assure that values -99..99 can be used)
imp <<= 8; imp |= min(max((NumUsableSlots ? SlotPriority[j] : 0) + MAXPRIORITY, 0), 0xFF); // use the CAM slot with the lowest priority (+MAXPRIORITY to assure that values -99..99 can be used)
imp <<= 1; imp |= ndr; // avoid devices if we need to detach existing receivers
-#if VDRVERSNUM < 10719
- imp <<= 1; imp |= device->IsPrimaryDevice(); // avoid the primary device
-#endif
imp <<= 1; imp |= NumUsableSlots ? 0 : device->HasCi(); // avoid cards with Common Interface for FTA channels
-#if VDRVERSNUM < 10719
- imp <<= 1; imp |= device->HasDecoder(); // avoid full featured cards
-#else
imp <<= 1; imp |= device->AvoidRecording(); // avoid SD full featured cards
-#endif
imp <<= 1; imp |= NumUsableSlots ? !ChannelCamRelations.CamDecrypt(Channel->GetChannelID(), j + 1) : 0; // prefer CAMs that are known to decrypt this channel
-#if VDRVERSNUM >= 10719
imp <<= 1; imp |= device->IsPrimaryDevice(); // avoid the primary device
-#endif
if (imp < Impact) {
// This device has less impact than any previous one, so we take it.
Impact = imp;
diff --git a/server/connectionVTP.c b/server/connectionVTP.c
index 8515e61..9053d0f 100644
--- a/server/connectionVTP.c
+++ b/server/connectionVTP.c
@@ -37,16 +37,8 @@ enum eDumpModeStreamdev { dmsdAll, dmsdPresent, dmsdFollowing, dmsdAtTime, dmsdF
class cLSTEHandler
{
private:
-#if defined(USE_PARENTALRATING) || defined(PARENTALRATINGCONTENTVERSNUM)
- enum eStates { Channel, Event, Title, Subtitle, Description, Vps, Content,
- EndEvent, EndChannel, EndEPG };
-#elif APIVERSNUM >= 10711
enum eStates { Channel, Event, Title, Subtitle, Description, Vps, Content, Rating,
EndEvent, EndChannel, EndEPG };
-#else
- enum eStates { Channel, Event, Title, Subtitle, Description, Vps,
- EndEvent, EndChannel, EndEPG };
-#endif /* PARENTALRATING */
cConnectionVTP *m_Client;
cSchedulesLock *m_SchedulesLock;
const cSchedules *m_Schedules;
@@ -285,11 +277,7 @@ bool cLSTEHandler::Next(bool &Last)
break;
case Vps:
-#if defined(USE_PARENTALRATING) || defined(PARENTALRATINGCONTENTVERSNUM) || APIVERSNUM >= 10711
m_State = Content;
-#else
- m_State = EndEvent;
-#endif /* PARENTALRATING */
if (m_Event->Vps())
#ifdef __FreeBSD__
return m_Client->Respond(-215, "V %d", m_Event->Vps());
@@ -300,18 +288,6 @@ bool cLSTEHandler::Next(bool &Last)
return Next(Last);
break;
-#if defined(USE_PARENTALRATING) || defined(PARENTALRATINGCONTENTVERSNUM)
- case Content:
- m_State = EndEvent;
- if (!isempty(m_Event->GetContentsString())) {
- char *copy = strdup(m_Event->GetContentsString());
- cString cpy(copy, true);
- strreplace(copy, '\n', '|');
- return m_Client->Respond(-215, "G %i %i %s", m_Event->Contents() & 0xF0, m_Event->Contents() & 0x0F, copy);
- } else
- return Next(Last);
- break;
-#elif APIVERSNUM >= 10711
case Content:
m_State = Rating;
if (!isempty(m_Event->ContentToString(m_Event->Contents()))) {
@@ -330,7 +306,6 @@ bool cLSTEHandler::Next(bool &Last)
else
return Next(Last);
break;
-#endif
case EndEvent:
if (m_Traverse) {
@@ -597,9 +572,7 @@ cLSTRHandler::cLSTRHandler(cConnectionVTP *Client, const char *Option):
if (*Option) {
if (isnumber(Option)) {
m_Recording = Recordings.Get(strtol(Option, NULL, 10) - 1);
-#if defined(USE_STREAMDEVEXT) || APIVERSNUM >= 10705
m_Event = m_Recording->Info()->GetEvent();
-#endif
m_Info = true;
if (m_Recording == NULL) {
m_Errno = 501;
@@ -1782,17 +1755,9 @@ bool cConnectionVTP::CmdRENR(const char *Option)
int n = strtol(Option, &tail, 10);
cRecording *recording = Recordings.Get(n - 1);
if (recording && tail && tail != Option) {
-#if APIVERSNUM < 10704
- int priority = recording->priority;
- int lifetime = recording->lifetime;
-#endif
char *oldName = strdup(recording->Name());
tail = skipspace(tail);
-#if APIVERSNUM < 10704
- if (recording->Rename(tail, &priority, &lifetime)) {
-#else
if (recording->Rename(tail)) {
-#endif
Reply(250, "Renamed \"%s\" to \"%s\"", oldName, recording->Name());
Recordings.ChangeState();
Recordings.TouchUpdate();
diff --git a/server/livestreamer.c b/server/livestreamer.c
index a90471a..14d10c2 100644
--- a/server/livestreamer.c
+++ b/server/livestreamer.c
@@ -35,18 +35,12 @@ public:
cStreamdevLiveReceiver::cStreamdevLiveReceiver(cStreamdevStreamer *Streamer, const cChannel *Channel,
int Priority, const int *Pids):
-#if APIVERSNUM >= 10712
cReceiver(Channel, Priority),
-#else
- cReceiver(Channel->GetChannelID(), Priority, 0, Pids),
-#endif
m_Streamer(Streamer)
{
-#if APIVERSNUM >= 10712
// clears all PIDs but channel remains set
SetPids(NULL);
AddPids(Pids);
-#endif
}
cStreamdevLiveReceiver::~cStreamdevLiveReceiver()
@@ -453,10 +447,8 @@ void cStreamdevLiveStreamer::GetSignal(int *DevNum, int *Strength, int *Quality)
{
if (m_Device) {
*DevNum = m_Device->DeviceNumber() + 1;
-#if APIVERSNUM >= 10719
*Strength = m_Device->SignalStrength();
*Quality = m_Device->SignalQuality();
-#endif
}
}
diff --git a/server/recplayer.c b/server/recplayer.c
index 35de2b3..f6cfdef 100644
--- a/server/recplayer.c
+++ b/server/recplayer.c
@@ -37,11 +37,7 @@ RecPlayer::RecPlayer(cRecording* rec)
// FIXME find out max file path / name lengths
-#if VDRVERSNUM >= 10703 || defined(TSPLAY_PATCH_VERSION)
indexFile = new cIndexFile(recording->FileName(), false, rec->IsPesRecording());
-#else
- indexFile = new cIndexFile(recording->FileName(), false);
-#endif
if (!indexFile) esyslog("ERROR: Streamdev: Failed to create indexfile!");
scan();
@@ -61,18 +57,12 @@ void RecPlayer::scan()
for(i = 1; i < 1000; i++)
{
-#if APIVERSNUM < 10703 || !defined(TSPLAY_PATCH_VERSION)
- snprintf(fileName, 2047, "%s/%03i.vdr", recording->FileName(), i);
- //log->log("RecPlayer", Log::DEBUG, "FILENAME: %s", fileName);
- file = fopen(fileName, "r");
-#else
snprintf(fileName, 2047, "%s/%05i.ts", recording->FileName(), i);
file = fopen(fileName, "r");
if (!file) {
snprintf(fileName, 2047, "%s/%03i.vdr", recording->FileName(), i);
file = fopen(fileName, "r");
}
-#endif
if (!file) break;
segments[i] = new Segment();
@@ -102,7 +92,6 @@ int RecPlayer::openFile(int index)
char fileName[2048];
-#if APIVERSNUM >= 10703 || defined(TSPLAY_PATCH_VERSION)
snprintf(fileName, 2047, "%s/%05i.ts", recording->FileName(), index);
isyslog("openFile called for index %i string:%s", index, fileName);
@@ -112,7 +101,6 @@ int RecPlayer::openFile(int index)
fileOpen = index;
return 1;
}
-#endif
snprintf(fileName, 2047, "%s/%03i.vdr", recording->FileName(), index);
isyslog("openFile called for index %i string:%s", index, fileName);
@@ -225,13 +213,8 @@ uint64_t RecPlayer::positionFromFrameNumber(uint32_t frameNumber)
{
if (!indexFile) return 0;
-#if VDRVERSNUM >= 10703 || defined(TSPLAY_PATCH_VERSION)
uint16_t retFileNumber;
off_t retFileOffset;
-#else
- uchar retFileNumber;
- int retFileOffset;
-#endif
if (!indexFile->Get((int)frameNumber, &retFileNumber, &retFileOffset))
{
diff --git a/server/streamdev-server.c b/server/streamdev-server.c
index 849ad3b..65ed23e 100644
--- a/server/streamdev-server.c
+++ b/server/streamdev-server.c
@@ -13,8 +13,8 @@
#include "server/setup.h"
#include "server/server.h"
-#if !defined(APIVERSNUM) || APIVERSNUM < 10516
-#error "VDR-1.5.16 API version or greater is required!"
+#if !defined(APIVERSNUM) || APIVERSNUM < 10725
+#error "VDR-1.7.25 or greater required to compile server! Use 'make client' to compile client only."
#endif
const char *cPluginStreamdevServer::DESCRIPTION = trNOOP("VDR Streaming Server");
diff --git a/server/streamer.c b/server/streamer.c
index 3ae513d..10c267f 100644
--- a/server/streamer.c
+++ b/server/streamer.c
@@ -47,9 +47,7 @@ void cStreamdevWriter::Action(void)
int count, offset = 0;
int timeout = 0;
-#if APIVERSNUM >= 10705
SetPriority(-3);
-#endif
sel.Clear();
sel.Add(*m_Socket, true);
while (Running()) {
@@ -156,9 +154,7 @@ void cStreamdevStreamer::Stop(void)
void cStreamdevStreamer::Action(void)
{
-#if APIVERSNUM >= 10705
SetPriority(-3);
-#endif
while (Running()) {
int got;
uchar *block = m_RingBuffer->Get(got);