Dropped compatibility of streamdev-server with VDR < 1.7.25

This commit is contained in:
Frank Schmirler 2012-03-05 10:18:38 +01:00
parent 783b261bcb
commit ae634538f8
8 changed files with 3 additions and 81 deletions

View File

@ -13,6 +13,7 @@ VDR Plugin 'streamdev' Revision History
- Fixed ProvidesChannel() on client always returning true since the new timeout - Fixed ProvidesChannel() on client always returning true since the new timeout
option has been added. option has been added.
- Updated Finnish translation (thanks to Rolf Ahrenberg) - Updated Finnish translation (thanks to Rolf Ahrenberg)
- Dropped compatibility of streamdev-server with VDR < 1.7.25
- With VDR 1.7.25 priorities down to -99 will be used. Please update - With VDR 1.7.25 priorities down to -99 will be used. Please update
"Minimum Priority" in streamdev-client setup. "Minimum Priority" in streamdev-client setup.
- Use the new streamdev-client setup option "Live TV Priority" to control - Use the new streamdev-client setup option "Live TV Priority" to control

View File

@ -75,9 +75,7 @@ cTSExt::cTSExt(cRingBufferLinear *ResultBuffer, const cServerConnection *Connect
// add channel ID, name and pids to environment // add channel ID, name and pids to environment
ADDENV("REMUX_CHANNEL_ID=%s", *Channel->GetChannelID().ToString()); ADDENV("REMUX_CHANNEL_ID=%s", *Channel->GetChannelID().ToString());
ADDENV("REMUX_CHANNEL_NAME=%s", Channel->Name()); ADDENV("REMUX_CHANNEL_NAME=%s", Channel->Name());
#if APIVERSNUM >= 10701
ADDENV("REMUX_VTYPE=%d", Channel->Vtype()); ADDENV("REMUX_VTYPE=%d", Channel->Vtype());
#endif
if (Channel->Vpid()) if (Channel->Vpid())
ADDENV("REMUX_VPID=%d", Channel->Vpid()); ADDENV("REMUX_VPID=%d", Channel->Vpid());
if (Channel->Ppid() != Channel->Vpid()) if (Channel->Ppid() != Channel->Vpid())

View File

@ -264,7 +264,6 @@ bool cServerConnection::Close()
return cTBSocket::Close(); return cTBSocket::Close();
} }
#if APIVERSNUM >= 10700
static int GetClippedNumProvidedSystems(int AvailableBits, cDevice *Device) static int GetClippedNumProvidedSystems(int AvailableBits, cDevice *Device)
{ {
int MaxNumProvidedSystems = (1 << AvailableBits) - 1; int MaxNumProvidedSystems = (1 << AvailableBits) - 1;
@ -279,7 +278,6 @@ static int GetClippedNumProvidedSystems(int AvailableBits, cDevice *Device)
} }
return NumProvidedSystems; return NumProvidedSystems;
} }
#endif
/* /*
* copy of cDevice::GetDevice(...) but without side effects (not detaching receivers) * 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 |= 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() && (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 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 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 <<= 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(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 <<= 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 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 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 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 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 imp <<= 1; imp |= device->IsPrimaryDevice(); // avoid the primary device
#endif
if (imp < Impact) { if (imp < Impact) {
// This device has less impact than any previous one, so we take it. // This device has less impact than any previous one, so we take it.
Impact = imp; Impact = imp;

View File

@ -37,16 +37,8 @@ enum eDumpModeStreamdev { dmsdAll, dmsdPresent, dmsdFollowing, dmsdAtTime, dmsdF
class cLSTEHandler class cLSTEHandler
{ {
private: 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, enum eStates { Channel, Event, Title, Subtitle, Description, Vps, Content, Rating,
EndEvent, EndChannel, EndEPG }; EndEvent, EndChannel, EndEPG };
#else
enum eStates { Channel, Event, Title, Subtitle, Description, Vps,
EndEvent, EndChannel, EndEPG };
#endif /* PARENTALRATING */
cConnectionVTP *m_Client; cConnectionVTP *m_Client;
cSchedulesLock *m_SchedulesLock; cSchedulesLock *m_SchedulesLock;
const cSchedules *m_Schedules; const cSchedules *m_Schedules;
@ -285,11 +277,7 @@ bool cLSTEHandler::Next(bool &Last)
break; break;
case Vps: case Vps:
#if defined(USE_PARENTALRATING) || defined(PARENTALRATINGCONTENTVERSNUM) || APIVERSNUM >= 10711
m_State = Content; m_State = Content;
#else
m_State = EndEvent;
#endif /* PARENTALRATING */
if (m_Event->Vps()) if (m_Event->Vps())
#ifdef __FreeBSD__ #ifdef __FreeBSD__
return m_Client->Respond(-215, "V %d", m_Event->Vps()); return m_Client->Respond(-215, "V %d", m_Event->Vps());
@ -300,18 +288,6 @@ bool cLSTEHandler::Next(bool &Last)
return Next(Last); return Next(Last);
break; 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: case Content:
m_State = Rating; m_State = Rating;
if (!isempty(m_Event->ContentToString(m_Event->Contents()))) { if (!isempty(m_Event->ContentToString(m_Event->Contents()))) {
@ -330,7 +306,6 @@ bool cLSTEHandler::Next(bool &Last)
else else
return Next(Last); return Next(Last);
break; break;
#endif
case EndEvent: case EndEvent:
if (m_Traverse) { if (m_Traverse) {
@ -597,9 +572,7 @@ cLSTRHandler::cLSTRHandler(cConnectionVTP *Client, const char *Option):
if (*Option) { if (*Option) {
if (isnumber(Option)) { if (isnumber(Option)) {
m_Recording = Recordings.Get(strtol(Option, NULL, 10) - 1); m_Recording = Recordings.Get(strtol(Option, NULL, 10) - 1);
#if defined(USE_STREAMDEVEXT) || APIVERSNUM >= 10705
m_Event = m_Recording->Info()->GetEvent(); m_Event = m_Recording->Info()->GetEvent();
#endif
m_Info = true; m_Info = true;
if (m_Recording == NULL) { if (m_Recording == NULL) {
m_Errno = 501; m_Errno = 501;
@ -1782,17 +1755,9 @@ bool cConnectionVTP::CmdRENR(const char *Option)
int n = strtol(Option, &tail, 10); int n = strtol(Option, &tail, 10);
cRecording *recording = Recordings.Get(n - 1); cRecording *recording = Recordings.Get(n - 1);
if (recording && tail && tail != Option) { if (recording && tail && tail != Option) {
#if APIVERSNUM < 10704
int priority = recording->priority;
int lifetime = recording->lifetime;
#endif
char *oldName = strdup(recording->Name()); char *oldName = strdup(recording->Name());
tail = skipspace(tail); tail = skipspace(tail);
#if APIVERSNUM < 10704
if (recording->Rename(tail, &priority, &lifetime)) {
#else
if (recording->Rename(tail)) { if (recording->Rename(tail)) {
#endif
Reply(250, "Renamed \"%s\" to \"%s\"", oldName, recording->Name()); Reply(250, "Renamed \"%s\" to \"%s\"", oldName, recording->Name());
Recordings.ChangeState(); Recordings.ChangeState();
Recordings.TouchUpdate(); Recordings.TouchUpdate();

View File

@ -35,18 +35,12 @@ public:
cStreamdevLiveReceiver::cStreamdevLiveReceiver(cStreamdevStreamer *Streamer, const cChannel *Channel, cStreamdevLiveReceiver::cStreamdevLiveReceiver(cStreamdevStreamer *Streamer, const cChannel *Channel,
int Priority, const int *Pids): int Priority, const int *Pids):
#if APIVERSNUM >= 10712
cReceiver(Channel, Priority), cReceiver(Channel, Priority),
#else
cReceiver(Channel->GetChannelID(), Priority, 0, Pids),
#endif
m_Streamer(Streamer) m_Streamer(Streamer)
{ {
#if APIVERSNUM >= 10712
// clears all PIDs but channel remains set // clears all PIDs but channel remains set
SetPids(NULL); SetPids(NULL);
AddPids(Pids); AddPids(Pids);
#endif
} }
cStreamdevLiveReceiver::~cStreamdevLiveReceiver() cStreamdevLiveReceiver::~cStreamdevLiveReceiver()
@ -453,10 +447,8 @@ void cStreamdevLiveStreamer::GetSignal(int *DevNum, int *Strength, int *Quality)
{ {
if (m_Device) { if (m_Device) {
*DevNum = m_Device->DeviceNumber() + 1; *DevNum = m_Device->DeviceNumber() + 1;
#if APIVERSNUM >= 10719
*Strength = m_Device->SignalStrength(); *Strength = m_Device->SignalStrength();
*Quality = m_Device->SignalQuality(); *Quality = m_Device->SignalQuality();
#endif
} }
} }

View File

@ -37,11 +37,7 @@ RecPlayer::RecPlayer(cRecording* rec)
// FIXME find out max file path / name lengths // FIXME find out max file path / name lengths
#if VDRVERSNUM >= 10703 || defined(TSPLAY_PATCH_VERSION)
indexFile = new cIndexFile(recording->FileName(), false, rec->IsPesRecording()); 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!"); if (!indexFile) esyslog("ERROR: Streamdev: Failed to create indexfile!");
scan(); scan();
@ -61,18 +57,12 @@ void RecPlayer::scan()
for(i = 1; i < 1000; i++) 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); snprintf(fileName, 2047, "%s/%05i.ts", recording->FileName(), i);
file = fopen(fileName, "r"); file = fopen(fileName, "r");
if (!file) { if (!file) {
snprintf(fileName, 2047, "%s/%03i.vdr", recording->FileName(), i); snprintf(fileName, 2047, "%s/%03i.vdr", recording->FileName(), i);
file = fopen(fileName, "r"); file = fopen(fileName, "r");
} }
#endif
if (!file) break; if (!file) break;
segments[i] = new Segment(); segments[i] = new Segment();
@ -102,7 +92,6 @@ int RecPlayer::openFile(int index)
char fileName[2048]; char fileName[2048];
#if APIVERSNUM >= 10703 || defined(TSPLAY_PATCH_VERSION)
snprintf(fileName, 2047, "%s/%05i.ts", recording->FileName(), index); snprintf(fileName, 2047, "%s/%05i.ts", recording->FileName(), index);
isyslog("openFile called for index %i string:%s", index, fileName); isyslog("openFile called for index %i string:%s", index, fileName);
@ -112,7 +101,6 @@ int RecPlayer::openFile(int index)
fileOpen = index; fileOpen = index;
return 1; return 1;
} }
#endif
snprintf(fileName, 2047, "%s/%03i.vdr", recording->FileName(), index); snprintf(fileName, 2047, "%s/%03i.vdr", recording->FileName(), index);
isyslog("openFile called for index %i string:%s", index, fileName); 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 (!indexFile) return 0;
#if VDRVERSNUM >= 10703 || defined(TSPLAY_PATCH_VERSION)
uint16_t retFileNumber; uint16_t retFileNumber;
off_t retFileOffset; off_t retFileOffset;
#else
uchar retFileNumber;
int retFileOffset;
#endif
if (!indexFile->Get((int)frameNumber, &retFileNumber, &retFileOffset)) if (!indexFile->Get((int)frameNumber, &retFileNumber, &retFileOffset))
{ {

View File

@ -13,8 +13,8 @@
#include "server/setup.h" #include "server/setup.h"
#include "server/server.h" #include "server/server.h"
#if !defined(APIVERSNUM) || APIVERSNUM < 10516 #if !defined(APIVERSNUM) || APIVERSNUM < 10725
#error "VDR-1.5.16 API version or greater is required!" #error "VDR-1.7.25 or greater required to compile server! Use 'make client' to compile client only."
#endif #endif
const char *cPluginStreamdevServer::DESCRIPTION = trNOOP("VDR Streaming Server"); const char *cPluginStreamdevServer::DESCRIPTION = trNOOP("VDR Streaming Server");

View File

@ -47,9 +47,7 @@ void cStreamdevWriter::Action(void)
int count, offset = 0; int count, offset = 0;
int timeout = 0; int timeout = 0;
#if APIVERSNUM >= 10705
SetPriority(-3); SetPriority(-3);
#endif
sel.Clear(); sel.Clear();
sel.Add(*m_Socket, true); sel.Add(*m_Socket, true);
while (Running()) { while (Running()) {
@ -156,9 +154,7 @@ void cStreamdevStreamer::Stop(void)
void cStreamdevStreamer::Action(void) void cStreamdevStreamer::Action(void)
{ {
#if APIVERSNUM >= 10705
SetPriority(-3); SetPriority(-3);
#endif
while (Running()) { while (Running()) {
int got; int got;
uchar *block = m_RingBuffer->Get(got); uchar *block = m_RingBuffer->Get(got);