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

Add support for RTP-over-TCP.

This commit is contained in:
Rolf Ahrenberg 2016-06-20 18:14:38 +03:00
parent 4b1892d754
commit 4e9b6f11eb
14 changed files with 74 additions and 10 deletions

View File

@ -19,6 +19,7 @@ cSatipConfig::cSatipConfig(void)
useBytesM(1),
portRangeStartM(0),
portRangeStopM(0),
useRtpOverTcpM(false),
detachedModeM(false),
disableServerQuirksM(false),
useSingleModelServersM(false)

View File

@ -21,6 +21,7 @@ private:
unsigned int useBytesM;
unsigned int portRangeStartM;
unsigned int portRangeStopM;
bool useRtpOverTcpM;
bool detachedModeM;
bool disableServerQuirksM;
bool useSingleModelServersM;
@ -69,6 +70,7 @@ public:
int GetCICAM(unsigned int indexP) const;
unsigned int GetEITScan(void) const { return eitScanM; }
unsigned int GetUseBytes(void) const { return useBytesM; }
bool GetUseRtpOverTcp(void) const { return useRtpOverTcpM; }
bool GetDetachedMode(void) const { return detachedModeM; }
bool GetDisableServerQuirks(void) const { return disableServerQuirksM; }
bool GetUseSingleModelServers(void) const { return useSingleModelServersM; }
@ -85,6 +87,7 @@ public:
void SetCICAM(unsigned int indexP, int cicamP);
void SetEITScan(unsigned int onOffP) { eitScanM = onOffP; }
void SetUseBytes(unsigned int onOffP) { useBytesM = onOffP; }
void SetUseRtpOverTcp(bool onOffP) { useRtpOverTcpM = onOffP; }
void SetDetachedMode(bool onOffP) { detachedModeM = onOffP; }
void SetDisableServerQuirks(bool onOffP) { disableServerQuirksM = onOffP; }
void SetUseSingleModelServers(bool onOffP) { useSingleModelServersM = onOffP; }

View File

@ -178,6 +178,15 @@ msgstr "Filtra"
msgid "Define an ill-behaving filter to be blacklisted."
msgstr "Definir un filtre mal comportar a la llista negra."
msgid "Use RTP-over-TCP mode"
msgstr ""
msgid ""
"Define whether the RTP-over-TCP mode shall be used.\n"
"\n"
"This setting affects only SAT>IP devices supporting the feature."
msgstr ""
msgid "Active SAT>IP servers:"
msgstr "Activa SAT>IP servers:"

View File

@ -178,6 +178,15 @@ msgstr "Filter"
msgid "Define an ill-behaving filter to be blacklisted."
msgstr "Bestimme einen fehlerhaften Filter der ausgeblendet werden soll."
msgid "Use RTP-over-TCP mode"
msgstr ""
msgid ""
"Define whether the RTP-over-TCP mode shall be used.\n"
"\n"
"This setting affects only SAT>IP devices supporting the feature."
msgstr ""
msgid "Active SAT>IP servers:"
msgstr "Aktive SAT>IP Server:"

View File

@ -178,6 +178,15 @@ msgstr "Filtra"
msgid "Define an ill-behaving filter to be blacklisted."
msgstr "Define un filtro para poner en la lista negra."
msgid "Use RTP-over-TCP mode"
msgstr ""
msgid ""
"Define whether the RTP-over-TCP mode shall be used.\n"
"\n"
"This setting affects only SAT>IP devices supporting the feature."
msgstr ""
msgid "Active SAT>IP servers:"
msgstr "Activa SAT>IP servers:"

View File

@ -177,6 +177,18 @@ msgstr "Suodatin"
msgid "Define an ill-behaving filter to be blacklisted."
msgstr "Määrittele käytöstä poistettava suodatin, joka lisätään mustalle listalle."
msgid "Use RTP-over-TCP mode"
msgstr "Käytä RTP-over-TCP -moodia"
msgid ""
"Define whether the RTP-over-TCP mode shall be used.\n"
"\n"
"This setting affects only SAT>IP devices supporting the feature."
msgstr ""
"Määrittele RTP-over-TCP -moodin käyttöönotto.\n"
"\n"
"Tämä asetus vaikuttaa vain SAT>IP-laitteisiin, jotka tukevat kyseistä ominaisuutta."
msgid "Active SAT>IP servers:"
msgstr "Aktiiviset SAT>IP-palvelimet:"

7
rtsp.c
View File

@ -171,9 +171,9 @@ bool cSatipRtsp::Options(const char *uriP)
return result;
}
bool cSatipRtsp::Setup(const char *uriP, int rtpPortP, int rtcpPortP)
bool cSatipRtsp::Setup(const char *uriP, int rtpPortP, int rtcpPortP, bool useTcpP)
{
debug1("%s (%s, %d, %d) [device %d]", __PRETTY_FUNCTION__, uriP, rtpPortP, rtcpPortP, tunerM.GetId());
debug1("%s (%s, %d, %d, %d) [device %d]", __PRETTY_FUNCTION__, uriP, rtpPortP, rtcpPortP, useTcpP, tunerM.GetId());
bool result = false;
if (handleM && !isempty(uriP)) {
@ -190,7 +190,8 @@ bool cSatipRtsp::Setup(const char *uriP, int rtpPortP, int rtcpPortP)
default:
case cmUnicast:
// RTP/AVP;unicast;client_port=<client RTP port>-<client RTCP port>
transport = cString::sprintf("RTP/AVP;unicast;client_port=%d-%d", rtpPortP, rtcpPortP);
// RTP/AVP/TCP;unicast;client_port=<client RTP port>-<client RTCP port>
transport = cString::sprintf("RTP/AVP%s;unicast;client_port=%d-%d", useTcpP ? "/TCP" : "", rtpPortP, rtcpPortP);
break;
}

2
rtsp.h
View File

@ -56,7 +56,7 @@ public:
cString RtspUnescapeString(const char *strP);
void Reset(void);
bool Options(const char *uriP);
bool Setup(const char *uriP, int rtpPortP, int rtcpPortP);
bool Setup(const char *uriP, int rtpPortP, int rtcpPortP, bool useTcpP);
bool SetSession(const char *sessionP);
bool Describe(const char *uriP);
bool Play(const char *uriP);

View File

@ -386,6 +386,8 @@ bool cPluginSatip::SetupParse(const char *nameP, const char *valueP)
for (unsigned int i = 0; i < DisabledFiltersCount; ++i)
SatipConfig.SetDisabledFilters(i, DisabledFilters[i]);
}
else if (!strcasecmp(nameP, "UseRtpOverTcp"))
SatipConfig.SetUseRtpOverTcp(atoi(valueP));
else
return false;
return true;

View File

@ -102,6 +102,16 @@ cSatipServer::cSatipServer(const char *addressP, const int portP, const char *mo
quirkM |= eSatipQuirkSessionId;
quirksM = cString::sprintf("%s%sSessionId", *quirksM, isempty(*quirksM) ? "" : ",");
}
// These devices contain support for RTP over TCP:
if (strstr(*descriptionM, "minisatip") || // minisatip server
strstr(*descriptionM, "DVBViewer") || // DVBViewer Media Server
strstr(*descriptionM, "GSSBOX") || // Grundig Sat Systems GSS.box DSI 400
strstr(*descriptionM, "DIGIBIT") || // Telestar Digibit R1
strstr(*descriptionM, "Triax SatIP Converter") // Triax TSS 400
) {
quirkM |= eSatipQuirkRtpOverTcp;
quirksM = cString::sprintf("%s%sRtpOverTcp", *quirksM, isempty(*quirksM) ? "" : ",");
}
// These devices contain a play (add/delpids) parameter bug:
if (strstr(*descriptionM, "fritzdvbc") // Fritz!WLAN Repeater DVB-C
) {

View File

@ -67,11 +67,12 @@ private:
public:
enum eSatipQuirk {
eSatipQuirkNone = 0x00,
eSatipQuirkSessionId = 0x01,
eSatipQuirkPlayPids = 0x02,
eSatipQuirkForceLock = 0x04,
eSatipQuirkMask = 0x0F
eSatipQuirkNone = 0x00,
eSatipQuirkSessionId = 0x01,
eSatipQuirkPlayPids = 0x02,
eSatipQuirkForceLock = 0x04,
eSatipQuirkRtpOverTcp = 0x08,
eSatipQuirkMask = 0x0F
};
cSatipServer(const char *addressP, const int portP, const char *modelP, const char *descriptionP);
virtual ~cSatipServer();

View File

@ -332,6 +332,7 @@ eOSState cSatipMenuInfo::ProcessKey(eKeys keyP)
cSatipPluginSetup::cSatipPluginSetup()
: detachedModeM(SatipConfig.GetDetachedMode()),
deviceCountM(0),
useRtpOverTcpM(SatipConfig.GetUseRtpOverTcp()),
operatingModeM(SatipConfig.GetOperatingMode()),
ciExtensionM(SatipConfig.GetCIExtension()),
eitScanM(SatipConfig.GetEITScan()),
@ -400,6 +401,8 @@ void cSatipPluginSetup::Setup(void)
helpM.Append(tr("Define an ill-behaving filter to be blacklisted."));
}
}
Add(new cMenuEditBoolItem(tr("Use RTP-over-TCP mode"), &useRtpOverTcpM));
helpM.Append(tr("Define whether the RTP-over-TCP mode shall be used.\n\nThis setting affects only SAT>IP devices supporting the feature."));
Add(new cOsdItem(tr("Active SAT>IP servers:"), osUnknown, false));
helpM.Append("");
@ -546,6 +549,7 @@ void cSatipPluginSetup::StoreFilters(const char *nameP, int *valuesP)
void cSatipPluginSetup::Store(void)
{
// Store values into setup.conf
SetupStore("UseRtpOverTcp", useRtpOverTcpM);
SetupStore("OperatingMode", operatingModeM);
SetupStore("EnableCIExtension", ciExtensionM);
SetupStore("EnableEITScan", eitScanM);
@ -553,6 +557,7 @@ void cSatipPluginSetup::Store(void)
StoreSources("DisabledSources", disabledSourcesM);
StoreFilters("DisabledFilters", disabledFilterIndexesM);
// Update global config
SatipConfig.SetUseRtpOverTcp(useRtpOverTcpM);
SatipConfig.SetOperatingMode(operatingModeM);
SatipConfig.SetCIExtension(ciExtensionM);
SatipConfig.SetEITScan(eitScanM);

View File

@ -17,6 +17,7 @@ class cSatipPluginSetup : public cMenuSetupPage
private:
bool detachedModeM;
int deviceCountM;
int useRtpOverTcpM;
int operatingModeM;
const char *operatingModeTextsM[cSatipConfig::eOperatingModeCount];
int ciExtensionM;

View File

@ -221,10 +221,11 @@ bool cSatipTuner::Connect(void)
}
else if (rtspM.Options(*connectionUri)) {
cString uri = cString::sprintf("%s?%s", *connectionUri, *streamParamM);
bool useTcp = SatipConfig.GetUseRtpOverTcp() && nextServerM.IsValid() && nextServerM.IsQuirk(cSatipServer::eSatipQuirkRtpOverTcp);
// Flush any old content
//rtpM.Flush();
//rtcpM.Flush();
if (rtspM.Setup(*uri, rtpM.Port(), rtcpM.Port())) {
if (rtspM.Setup(*uri, rtpM.Port(), rtcpM.Port(), useTcp)) {
keepAliveM.Set(timeoutM);
if (nextServerM.IsValid()) {
currentServerM = nextServerM;