1
0
mirror of https://github.com/rofafor/vdr-plugin-satip.git synced 2023-10-10 13:37:42 +02:00

Fixed server reuse for active transponders.

This commit is contained in:
Rolf Ahrenberg 2014-11-01 16:31:44 +02:00
parent c4d82eac36
commit 92b2c63f0d
10 changed files with 57 additions and 24 deletions

View File

@ -65,7 +65,8 @@ VDR Plugin 'satip' Revision History
- Added a validity check for the session member.
- Added a session id quirk for Triax TSS 400.
2014-xx-xx: Version 0.3.4
2014-11-01: Version 0.3.4
- Fixed the cable only device detection.
- Added support for blacklisted sources.
- Fixed server reuse for active transponders.

View File

@ -288,11 +288,12 @@ bool cSatipDevice::SetChannelDevice(const cChannel *channelP, bool liveViewP)
return false;
}
cString address;
cSatipServer *server = cSatipDiscover::GetInstance()->GetServer(channelP->Source(), dtp.System());
cSatipServer *server = cSatipDiscover::GetInstance()->GetServer(channelP->Source(), channelP->Transponder(), dtp.System());
if (!server) {
debug("cSatipDevice::%s(%u): no suitable server found", __FUNCTION__, deviceIndexM);
return false;
}
cSatipDiscover::GetInstance()->SetTransponder(server, channelP->Transponder());
if (pTunerM && pTunerM->SetSource(server, *params, deviceIndexM)) {
deviceNameM = cString::sprintf("%s %d %s", *DeviceType(), deviceIndexM, *cSatipDiscover::GetInstance()->GetServerString(server));
channelM = *channelP;

View File

@ -270,11 +270,11 @@ int cSatipDiscover::GetServerCount(void)
return serversM ? serversM->Count() : -1;
}
cSatipServer *cSatipDiscover::GetServer(int sourceP, int systemP)
cSatipServer *cSatipDiscover::GetServer(int sourceP, int transponderP, int systemP)
{
//debug("cSatipDiscover::%s(%d, %d)", __FUNCTION__, sourceP, systemP);
//debug("cSatipDiscover::%s(%d, %d, %d)", __FUNCTION__, sourceP, transponderP, systemP);
cMutexLock MutexLock(&mutexM);
return serversM ? serversM->Find(sourceP, systemP) : NULL;
return serversM ? serversM->Find(sourceP, transponderP, systemP) : NULL;
}
cSatipServer *cSatipDiscover::GetServer(cSatipServer *serverP)
@ -293,21 +293,29 @@ cSatipServers *cSatipDiscover::GetServers(void)
cString cSatipDiscover::GetServerString(cSatipServer *serverP)
{
//debug("cSatipDiscover::%s(%d)", __FUNCTION__, modelP);
//debug("cSatipDiscover::%s()", __FUNCTION__);
cMutexLock MutexLock(&mutexM);
return serversM ? serversM->GetString(serverP) : "";
}
cString cSatipDiscover::GetServerList(void)
{
//debug("cSatipDiscover::%s(%d)", __FUNCTION__, modelP);
//debug("cSatipDiscover::%s()", __FUNCTION__);
cMutexLock MutexLock(&mutexM);
return serversM ? serversM->List() : "";
}
void cSatipDiscover::SetTransponder(cSatipServer *serverP, int transponderP)
{
//debug("cSatipDiscover::%s(%d)", __FUNCTION__, transponderP);
cMutexLock MutexLock(&mutexM);
if (serversM)
serversM->SetTransponder(serverP, transponderP);
}
void cSatipDiscover::UseServer(cSatipServer *serverP, bool onOffP)
{
//debug("cSatipDiscover::%s(%d)", __FUNCTION__, modelP);
//debug("cSatipDiscover::%s(%d)", __FUNCTION__, onOffP);
cMutexLock MutexLock(&mutexM);
if (serversM)
serversM->Use(serverP, onOffP);
@ -315,7 +323,7 @@ void cSatipDiscover::UseServer(cSatipServer *serverP, bool onOffP)
int cSatipDiscover::NumProvidedSystems(void)
{
//debug("cSatipDiscover::%s(%d)", __FUNCTION__, modelP);
//debug("cSatipDiscover::%s()", __FUNCTION__);
cMutexLock MutexLock(&mutexM);
return serversM ? serversM->NumProvidedSystems() : 0;
}

View File

@ -57,10 +57,11 @@ public:
virtual ~cSatipDiscover();
void TriggerScan(void) { probeIntervalM.Set(0); }
int GetServerCount(void);
cSatipServer *GetServer(int sourceP, int systemP = -1);
cSatipServer *GetServer(int sourceP, int transponderP = 0, int systemP = -1);
cSatipServer *GetServer(cSatipServer *serverP);
cSatipServers *GetServers(void);
cString GetServerString(cSatipServer *serverP);
void SetTransponder(cSatipServer *serverP, int transponderP);
void UseServer(cSatipServer *serverP, bool onOffP);
cString GetServerList(void);
int NumProvidedSystems(void);

View File

@ -7,8 +7,8 @@ msgid ""
msgstr ""
"Project-Id-Version: vdr-satip 0.3.4\n"
"Report-Msgid-Bugs-To: <see README>\n"
"POT-Creation-Date: 2014-10-31 10:31+0200\n"
"PO-Revision-Date: 2014-10-31 10:31+0200\n"
"POT-Creation-Date: 2014-11-01 11:01+0200\n"
"PO-Revision-Date: 2014-11-01 11:01+0200\n"
"Last-Translator: Gabriel Bonich <gbonich@gmail.com>\n"
"Language-Team: Catalan <vdr@linuxtv.org>\n"
"Language: ca\n"

View File

@ -7,8 +7,8 @@ msgid ""
msgstr ""
"Project-Id-Version: vdr-satip 0.3.4\n"
"Report-Msgid-Bugs-To: <see README>\n"
"POT-Creation-Date: 2014-10-31 10:31+0200\n"
"PO-Revision-Date: 2014-10-31 10:31+0200\n"
"POT-Creation-Date: 2014-11-01 11:01+0200\n"
"PO-Revision-Date: 2014-11-01 11:01+0200\n"
"Last-Translator: Frank Neumann <fnu@yavdr.org>\n"
"Language-Team: German <vdr@linuxtv.org>\n"
"Language: de\n"

View File

@ -7,8 +7,8 @@ msgid ""
msgstr ""
"Project-Id-Version: vdr-satip 0.3.4\n"
"Report-Msgid-Bugs-To: <see README>\n"
"POT-Creation-Date: 2014-10-31 10:31+0200\n"
"PO-Revision-Date: 2014-10-31 10:31+0200\n"
"POT-Creation-Date: 2014-11-01 11:01+0200\n"
"PO-Revision-Date: 2014-11-01 11:01+0200\n"
"Last-Translator: Gabriel Bonich <gbonich@gmail.com>\n"
"Language-Team: Spanish <vdr@linuxtv.org>\n"
"Language: es\n"

View File

@ -7,8 +7,8 @@ msgid ""
msgstr ""
"Project-Id-Version: vdr-satip 0.3.4\n"
"Report-Msgid-Bugs-To: <see README>\n"
"POT-Creation-Date: 2014-10-31 10:31+0200\n"
"PO-Revision-Date: 2014-10-31 10:31+0200\n"
"POT-Creation-Date: 2014-11-01 11:01+0200\n"
"PO-Revision-Date: 2014-11-01 11:01+0200\n"
"Last-Translator: Rolf Ahrenberg\n"
"Language-Team: Finnish <vdr@linuxtv.org>\n"
"Language: fi\n"

View File

@ -19,6 +19,7 @@ cSatipServer::cSatipServer(const char *addressP, const char *descriptionP, const
modelTypeM(eSatipModelTypeNone),
quirkM(eSatipQuirkNone),
useCountM(0),
transponderM(0),
createdM(time(NULL)),
lastSeenM(0)
{
@ -34,7 +35,7 @@ cSatipServer::cSatipServer(const char *addressP, const char *descriptionP, const
strstr(*descriptionM, "Triax SatIP Converter") // Triax TSS 400
)
quirkM |= eSatipQuirkSessionId;
// These devices contain a play (*pids) parameter bug:
// These devices contain a play (add/delpids) parameter bug:
if (strstr(*descriptionM, "fritzdvbc")) // Fritz!WLAN Repeater DVB-C
quirkM |= eSatipQuirkPlayPids;
}
@ -113,7 +114,7 @@ cSatipServer *cSatipServers::Find(cSatipServer *serverP)
return NULL;
}
cSatipServer *cSatipServers::Find(int sourceP, int systemP)
cSatipServer *cSatipServers::Find(int sourceP, int transponderP, int systemP)
{
cSatipServer *result = NULL;
int model = 0;
@ -127,6 +128,10 @@ cSatipServer *cSatipServers::Find(int sourceP, int systemP)
}
else if (cSource::IsType(sourceP, 'C'))
model |= cSatipServer::eSatipModelTypeDVBC;
for (cSatipServer *s = First(); s; s = Next(s)) {
if (s->Match(model) && s->Used() && (s->Transponder() == transponderP))
return s;
}
for (cSatipServer *s = First(); s; s = Next(s)) {
if (s->Match(model)) {
result = s;
@ -138,6 +143,16 @@ cSatipServer *cSatipServers::Find(int sourceP, int systemP)
return result;
}
void cSatipServers::SetTransponder(cSatipServer *serverP, bool transponderP)
{
for (cSatipServer *s = First(); s; s = Next(s)) {
if (s == serverP) {
s->SetTransponder(transponderP);
break;
}
}
}
cSatipServer *cSatipServers::Update(cSatipServer *serverP)
{
for (cSatipServer *s = First(); s; s = Next(s)) {
@ -193,10 +208,13 @@ int cSatipServers::NumProvidedSystems(void)
{
int count = 0;
for (cSatipServer *s = First(); s; s = Next(s)) {
// DVB-S*: qpsk, 8psk
// DVB-S2: qpsk, 8psk, 16apsk, 32apsk
count += s->Satellite() * 4;
// DVB-T*: qpsk, qam16, qam64, qam256
count += (s->Terrestrial2() ? s->Terrestrial2() : s->Terrestrial()) * 4;
// DVB-T2: qpsk, qam16, qam64, qam256
// DVB-T: qpsk, qam16, qam64
count += s->Terrestrial2() ? s->Terrestrial2() * 4 : s->Terrestrial() * 3;
// DVB-C: qam64, qam128, qam256
count += s->Cable() * 3;
}
return count;
}

View File

@ -26,6 +26,7 @@ private:
int modelTypeM;
int quirkM;
int useCountM;
int transponderM;
time_t createdM;
cTimeMs lastSeenM;
@ -48,6 +49,8 @@ public:
virtual ~cSatipServer();
virtual int Compare(const cListObject &listObjectP) const;
void Use(bool onOffP);
void SetTransponder(const int transponderP) { transponderM = transponderP; }
int Transponder(void) { return transponderM; }
bool Used(void) { return !!useCountM; }
const char *Description() { return *descriptionM; }
const char *Address() { return *addressM; }
@ -69,7 +72,8 @@ public:
class cSatipServers : public cList<cSatipServer> {
public:
cSatipServer *Find(cSatipServer *serverP);
cSatipServer *Find(int sourceP, int systemP);
cSatipServer *Find(int sourceP, int transponderP, int systemP);
void SetTransponder(cSatipServer *serverP, bool transponderP);
cSatipServer *Update(cSatipServer *serverP);
void Use(cSatipServer *serverP, bool onOffP);
void Cleanup(uint64_t intervalMsP = 0);