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

9 Commits

Author SHA1 Message Date
Rolf Ahrenberg
37a0572a64 Updated HISTORY. 2015-09-18 18:49:44 +03:00
Rolf Ahrenberg
613c0aed7c Added a force lock quirk for Schwaiger MS41IP. 2015-09-18 18:31:53 +03:00
Rolf Ahrenberg
c3ad29eb27 Updated for vdr-2.3.1 (Thanks to Klaus Schmidinger). 2015-08-20 19:12:21 +03:00
Rolf Ahrenberg
e90b8651e6 Silenced some cppcheck warnings. 2015-08-16 01:38:03 +03:00
Rolf Ahrenberg
0f370aa36a Added a tuning timeout for better recovery. 2015-08-16 01:10:52 +03:00
Rolf Ahrenberg
49e2dd1fc1 Reset the RTSP connection after any failed connect. 2015-06-04 18:51:09 +03:00
Rolf Ahrenberg
ba0b808ec4 Enabled the X_PMT extension for minisatip servers. 2015-05-26 21:18:05 +03:00
Rolf Ahrenberg
4e2535a7e2 Added a double check for the idle release. 2015-05-23 15:28:37 +03:00
Rolf Ahrenberg
6384b8694e Added a timeout for releasing idling devices. 2015-05-22 22:43:08 +03:00
21 changed files with 74 additions and 22 deletions

View File

@@ -137,3 +137,10 @@ VDR Plugin 'satip' Revision History
interface.
- Added new ATTA and DETA SVDRP commands.
- Set the default device count to two.
2015-09-18: Version 2.2.3
- Added a timeout for releasing idling devices.
- Reset the RTSP connection after any failed connect.
- Added tweaks for minisatip and Schwaiger MS41IP.
- Updated for vdr-2.3.1 (Thanks to Klaus Schmidinger).

View File

@@ -103,7 +103,12 @@ cString cSatipDevice::GetSatipStatus(void)
bool live = (device == cDevice::ActualDevice());
bool lock = device->HasLock();
const cChannel *channel = device->GetCurrentlyTunedTransponder();
#if defined(APIVERSNUM) && APIVERSNUM >= 20301
LOCK_TIMERS_READ;
for (const cTimer *timer = Timers->First(); timer; timer = Timers->Next(timer)) {
#else
for (cTimer *timer = Timers.First(); timer; timer = Timers.Next(timer)) {
#endif
if (timer->Recording()) {
cRecordControl *control = cRecordControls::GetRecordControl(timer);
if (control && control->Device() == device)
@@ -128,13 +133,20 @@ cString cSatipDevice::GetSatipStatus(void)
cString cSatipDevice::GetGeneralInformation(void)
{
debug16("%s [device %u]", __PRETTY_FUNCTION__, deviceIndexM);
#if defined(APIVERSNUM) && APIVERSNUM >= 20301
LOCK_CHANNELS_READ;
#endif
return cString::sprintf("SAT>IP device: %d\nCardIndex: %d\nStream: %s\nSignal: %s\nStream bitrate: %s\n%sChannel: %s",
deviceIndexM, CardIndex(),
pTunerM ? *pTunerM->GetInformation() : "",
pTunerM ? *pTunerM->GetSignalStatus() : "",
pTunerM ? *pTunerM->GetTunerStatistic() : "",
*GetBufferStatistic(),
#if defined(APIVERSNUM) && APIVERSNUM >= 20301
*Channels->GetByNumber(cDevice::CurrentChannel())->ToText());
#else
*Channels.GetByNumber(cDevice::CurrentChannel())->ToText());
#endif
}
cString cSatipDevice::GetPidsInformation(void)
@@ -350,7 +362,7 @@ bool cSatipDevice::SetChannelDevice(const cChannel *channelP, bool liveViewP)
bool cSatipDevice::SetPid(cPidHandle *handleP, int typeP, bool onP)
{
debug12("%s (%d, %d, %d) [device %u]", __PRETTY_FUNCTION__, handleP->pid, typeP, onP, deviceIndexM);
debug12("%s (%d, %d, %d) [device %u]", __PRETTY_FUNCTION__, handleP ? handleP->pid : -1, typeP, onP, deviceIndexM);
if (pTunerM && handleP && handleP->pid >= 0) {
if (onP)
return pTunerM->SetPid(handleP->pid, typeP, true);
@@ -460,6 +472,11 @@ int cSatipDevice::GetCISlot(void)
return slot;
}
bool cSatipDevice::IsIdle(void)
{
return !Receiving();
}
uchar *cSatipDevice::GetData(int *availableP)
{
debug16("%s [device %u]", __PRETTY_FUNCTION__, deviceIndexM);

View File

@@ -43,7 +43,7 @@ private:
// constructor & destructor
public:
cSatipDevice(unsigned int deviceIndexP);
explicit cSatipDevice(unsigned int deviceIndexP);
virtual ~cSatipDevice();
cString GetInformation(unsigned int pageP = SATIP_DEVICE_INFO_ALL);
@@ -110,6 +110,7 @@ public:
virtual int GetId(void);
virtual int GetPmtPid(void);
virtual int GetCISlot(void);
virtual bool IsIdle(void);
};
#endif // __SATIP_DEVICE_H

View File

@@ -16,9 +16,10 @@ public:
virtual int GetId(void) = 0;
virtual int GetPmtPid(void) = 0;
virtual int GetCISlot(void) = 0;
virtual bool IsIdle(void) = 0;
private:
cSatipDeviceIf(const cSatipDeviceIf&);
explicit cSatipDeviceIf(const cSatipDeviceIf&);
cSatipDeviceIf& operator=(const cSatipDeviceIf&);
};

View File

@@ -15,7 +15,7 @@ public:
virtual void SetUrl(const char *urlP) = 0;
private:
cSatipDiscoverIf(const cSatipDiscoverIf&);
explicit cSatipDiscoverIf(const cSatipDiscoverIf&);
cSatipDiscoverIf& operator=(const cSatipDiscoverIf&);
};

View File

@@ -26,7 +26,7 @@ private:
bool registeredM;
public:
cSatipMsearch(cSatipDiscoverIf &discoverP);
explicit cSatipMsearch(cSatipDiscoverIf &discoverP);
virtual ~cSatipMsearch();
void Probe(void);

View File

@@ -5,7 +5,7 @@
#
msgid ""
msgstr ""
"Project-Id-Version: vdr-satip 2.2.2\n"
"Project-Id-Version: vdr-satip 2.2.3\n"
"Report-Msgid-Bugs-To: <see README>\n"
"POT-Creation-Date: 2015-04-26 04:26+0300\n"
"PO-Revision-Date: 2015-04-26 04:26+0300\n"

View File

@@ -5,7 +5,7 @@
#
msgid ""
msgstr ""
"Project-Id-Version: vdr-satip 2.2.2\n"
"Project-Id-Version: vdr-satip 2.2.3\n"
"Report-Msgid-Bugs-To: <see README>\n"
"POT-Creation-Date: 2015-04-26 04:26+0300\n"
"PO-Revision-Date: 2015-04-26 04:26+0300\n"

View File

@@ -5,7 +5,7 @@
#
msgid ""
msgstr ""
"Project-Id-Version: vdr-satip 2.2.2\n"
"Project-Id-Version: vdr-satip 2.2.3\n"
"Report-Msgid-Bugs-To: <see README>\n"
"POT-Creation-Date: 2015-04-26 04:26+0300\n"
"PO-Revision-Date: 2015-04-26 04:26+0300\n"

View File

@@ -5,7 +5,7 @@
#
msgid ""
msgstr ""
"Project-Id-Version: vdr-satip 2.2.2\n"
"Project-Id-Version: vdr-satip 2.2.3\n"
"Report-Msgid-Bugs-To: <see README>\n"
"POT-Creation-Date: 2015-04-26 04:26+0300\n"
"PO-Revision-Date: 2015-04-26 04:26+0300\n"

View File

@@ -17,7 +17,7 @@ public:
virtual cString ToString(void) const = 0;
private:
cSatipPollerIf(const cSatipPollerIf&);
explicit cSatipPollerIf(const cSatipPollerIf&);
cSatipPollerIf& operator=(const cSatipPollerIf&);
};

2
rtcp.c
View File

@@ -36,7 +36,7 @@ int cSatipRtcp::GetFd(void)
int cSatipRtcp::GetApplicationOffset(int *lengthP)
{
debug16("%s (%d) [device %d]", __PRETTY_FUNCTION__, *lengthP, tunerM.GetId());
debug16("%s (%d) [device %d]", __PRETTY_FUNCTION__, lengthP ? *lengthP : -1, tunerM.GetId());
if (!lengthP)
return -1;
int offset = 0;

2
rtcp.h
View File

@@ -23,7 +23,7 @@ private:
int GetApplicationOffset(int *lengthP);
public:
cSatipRtcp(cSatipTunerIf &tunerP);
explicit cSatipRtcp(cSatipTunerIf &tunerP);
virtual ~cSatipRtcp();
// for internal poller interface

2
rtp.h
View File

@@ -28,7 +28,7 @@ private:
int GetHeaderLength(unsigned char *bufferP, unsigned int lengthP);
public:
cSatipRtp(cSatipTunerIf &tunerP);
explicit cSatipRtp(cSatipTunerIf &tunerP);
virtual ~cSatipRtp();
virtual void Close(void);

2
rtsp.h
View File

@@ -50,7 +50,7 @@ private:
cSatipRtsp& operator=(const cSatipRtsp&);
public:
cSatipRtsp(cSatipTunerIf &tunerP);
explicit cSatipRtsp(cSatipTunerIf &tunerP);
virtual ~cSatipRtsp();
cString RtspUnescapeString(const char *strP);

View File

@@ -27,7 +27,7 @@
#define GITVERSION ""
#endif
const char VERSION[] = "2.2.2" GITVERSION;
const char VERSION[] = "2.2.3" GITVERSION;
static const char DESCRIPTION[] = trNOOP("SAT>IP Devices");
class cPluginSatip : public cPlugin {

View File

@@ -108,7 +108,8 @@ cSatipServer::cSatipServer(const char *addressP, const char *modelP, const char
quirksM = cString::sprintf("%s%sPlayPids", *quirksM, isempty(*quirksM) ? "" : ",");
}
// These devices contain a frontend locking bug:
if (strstr(*descriptionM, "fritzdvbc") // Fritz!WLAN Repeater DVB-C
if (strstr(*descriptionM, "fritzdvbc") || // Fritz!WLAN Repeater DVB-C
strstr(*descriptionM, "Schwaiger Sat>IP Server") // Schwaiger MS41IP
) {
quirkM |= eSatipQuirkForceLock;
quirksM = cString::sprintf("%s%sForceLock", *quirksM, isempty(*quirksM) ? "" : ",");
@@ -116,8 +117,11 @@ cSatipServer::cSatipServer(const char *addressP, const char *modelP, const char
debug3("%s description=%s quirks=%s", __PRETTY_FUNCTION__, *descriptionM, *quirksM);
}
// These devices support the X_PMT protocol extension
if (strstr(*descriptionM, "OctopusNet")) // Digital Devices OctopusNet
if (strstr(*descriptionM, "OctopusNet") || // Digital Devices OctopusNet
strstr(*descriptionM, "minisatip") // minisatip server
) {
hasCiM = true;
}
char *s, *p = strdup(*modelM);
char *r = strtok_r(p, ",", &s);
while (r) {

View File

@@ -94,7 +94,7 @@ private:
void Setup(void);
public:
cSatipServerInfo(cSatipServer *serverP);
explicit cSatipServerInfo(cSatipServer *serverP);
virtual ~cSatipServerInfo();
virtual eOSState ProcessKey(eKeys keyP);
};
@@ -145,7 +145,7 @@ private:
cSatipServer *serverM;
public:
cSatipServerItem(cSatipServer *serverP);
explicit cSatipServerItem(cSatipServer *serverP);
cSatipServer *Server(void) { return serverM; }
virtual void SetMenuItem(cSkinDisplayMenu *displayMenuP, int indexP, bool currentP, bool selectableP);
};

24
tuner.c
View File

@@ -91,6 +91,10 @@ cSatipTuner::~cSatipTuner()
void cSatipTuner::Action(void)
{
debug1("%s Entering [device %d]", __PRETTY_FUNCTION__, deviceIdM);
bool lastIdleStatus = false;
cTimeMs idleCheck(eIdleCheckTimeoutMs);
cTimeMs tuning(eTuningTimeoutMs);
reConnectM.Set(eConnectTimeoutMs);
// Do the thread loop
while (Running()) {
@@ -107,6 +111,7 @@ void cSatipTuner::Action(void)
case tsSet:
debug4("%s: tsSet [device %d]", __PRETTY_FUNCTION__, deviceIdM);
if (Connect()) {
tuning.Set(eTuningTimeoutMs);
RequestState(tsTuned, smInternal);
UpdatePids(true);
}
@@ -116,6 +121,8 @@ void cSatipTuner::Action(void)
case tsTuned:
debug4("%s: tsTuned [device %d]", __PRETTY_FUNCTION__, deviceIdM);
reConnectM.Set(eConnectTimeoutMs);
idleCheck.Set(eIdleCheckTimeoutMs);
lastIdleStatus = false;
// Read reception statistics via DESCRIBE and RTCP
if (hasLockM || ReadReceptionStatus()) {
// Quirk for devices without valid reception data
@@ -127,6 +134,10 @@ void cSatipTuner::Action(void)
if (hasLockM)
RequestState(tsLocked, smInternal);
}
else if (tuning.TimedOut()) {
error("Tuning timeout - retuning [device %d]", deviceIdM);
RequestState(tsSet, smInternal);
}
break;
case tsLocked:
debug4("%s: tsLocked [device %d]", __PRETTY_FUNCTION__, deviceIdM);
@@ -145,6 +156,16 @@ void cSatipTuner::Action(void)
RequestState(tsSet, smInternal);
break;
}
if (idleCheck.TimedOut()) {
bool currentIdleStatus = deviceM->IsIdle();
if (lastIdleStatus && currentIdleStatus) {
info("Idle timeout - releasing [device %d]", deviceIdM);
RequestState(tsRelease, smInternal);
}
lastIdleStatus = currentIdleStatus;
idleCheck.Set(eIdleCheckTimeoutMs);
break;
}
break;
default:
error("Unknown tuner status %d [device %d]", currentStateM, deviceIdM);
@@ -209,8 +230,7 @@ bool cSatipTuner::Connect(void)
return true;
}
}
else
rtspM.Reset();
rtspM.Reset();
streamIdM = -1;
error("Connect failed [device %d]", deviceIdM);
}

View File

@@ -83,6 +83,8 @@ private:
eStatusUpdateTimeoutMs = 1000, // in milliseconds
ePidUpdateIntervalMs = 250, // in milliseconds
eConnectTimeoutMs = 5000, // in milliseconds
eIdleCheckTimeoutMs = 15000, // in milliseconds
eTuningTimeoutMs = 20000, // in milliseconds
eMinKeepAliveIntervalMs = 30000 // in milliseconds
};
enum eTunerState { tsIdle, tsRelease, tsSet, tsTuned, tsLocked };

View File

@@ -19,7 +19,7 @@ public:
virtual int GetId(void) = 0;
private:
cSatipTunerIf(const cSatipTunerIf&);
explicit cSatipTunerIf(const cSatipTunerIf&);
cSatipTunerIf& operator=(const cSatipTunerIf&);
};