mirror of
https://github.com/rofafor/vdr-plugin-satip.git
synced 2023-10-10 11:37:42 +00:00
Compare commits
9 Commits
Author | SHA1 | Date | |
---|---|---|---|
|
37a0572a64 | ||
|
613c0aed7c | ||
|
c3ad29eb27 | ||
|
e90b8651e6 | ||
|
0f370aa36a | ||
|
49e2dd1fc1 | ||
|
ba0b808ec4 | ||
|
4e2535a7e2 | ||
|
6384b8694e |
7
HISTORY
7
HISTORY
@@ -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).
|
||||
|
19
device.c
19
device.c
@@ -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);
|
||||
|
3
device.h
3
device.h
@@ -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
|
||||
|
@@ -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&);
|
||||
};
|
||||
|
||||
|
@@ -15,7 +15,7 @@ public:
|
||||
virtual void SetUrl(const char *urlP) = 0;
|
||||
|
||||
private:
|
||||
cSatipDiscoverIf(const cSatipDiscoverIf&);
|
||||
explicit cSatipDiscoverIf(const cSatipDiscoverIf&);
|
||||
cSatipDiscoverIf& operator=(const cSatipDiscoverIf&);
|
||||
};
|
||||
|
||||
|
@@ -26,7 +26,7 @@ private:
|
||||
bool registeredM;
|
||||
|
||||
public:
|
||||
cSatipMsearch(cSatipDiscoverIf &discoverP);
|
||||
explicit cSatipMsearch(cSatipDiscoverIf &discoverP);
|
||||
virtual ~cSatipMsearch();
|
||||
void Probe(void);
|
||||
|
||||
|
@@ -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"
|
||||
|
@@ -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"
|
||||
|
@@ -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"
|
||||
|
@@ -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"
|
||||
|
@@ -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
2
rtcp.c
@@ -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
2
rtcp.h
@@ -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
2
rtp.h
@@ -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
2
rtsp.h
@@ -50,7 +50,7 @@ private:
|
||||
cSatipRtsp& operator=(const cSatipRtsp&);
|
||||
|
||||
public:
|
||||
cSatipRtsp(cSatipTunerIf &tunerP);
|
||||
explicit cSatipRtsp(cSatipTunerIf &tunerP);
|
||||
virtual ~cSatipRtsp();
|
||||
|
||||
cString RtspUnescapeString(const char *strP);
|
||||
|
2
satip.c
2
satip.c
@@ -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 {
|
||||
|
8
server.c
8
server.c
@@ -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) {
|
||||
|
4
setup.c
4
setup.c
@@ -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
24
tuner.c
@@ -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);
|
||||
}
|
||||
|
2
tuner.h
2
tuner.h
@@ -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 };
|
||||
|
Reference in New Issue
Block a user