mirror of
https://github.com/rofafor/vdr-plugin-satip.git
synced 2023-10-10 11:37:42 +00:00
Compare commits
2 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
9a8c6f8c0d | ||
|
|
fbbfdfab2b |
9
HISTORY
9
HISTORY
@@ -50,3 +50,12 @@ VDR Plugin 'satip' Revision History
|
||||
2014-04-20: Version 0.3.0
|
||||
|
||||
- Tweaked the pid update mechanism.
|
||||
|
||||
2014-04-27: Version 0.3.1
|
||||
|
||||
- Fixed the device discovery.
|
||||
|
||||
2014-05-10: Version 0.3.2
|
||||
|
||||
- Fixed model detection and OctopusNet DVB-C model quirks.
|
||||
- Added a session id quirk for GSSBOX.
|
||||
|
||||
34
discover.c
34
discover.c
@@ -179,7 +179,7 @@ void cSatipDiscover::Read(void)
|
||||
int len = socketM->Read(buf, eProbeBufferSize);
|
||||
if (len > 0) {
|
||||
//debug("cSatipDiscover::%s(): len=%d", __FUNCTION__, len);
|
||||
bool status = false;
|
||||
bool status = false, valid = false;
|
||||
char *s, *p = reinterpret_cast<char *>(buf), *location = NULL;
|
||||
char *r = strtok_r(p, "\r\n", &s);
|
||||
while (r) {
|
||||
@@ -187,18 +187,30 @@ void cSatipDiscover::Read(void)
|
||||
// Check the status code
|
||||
// HTTP/1.1 200 OK
|
||||
if (!status && startswith(r, "HTTP/1.1 200 OK")) {
|
||||
status = true;
|
||||
}
|
||||
// Check the location data
|
||||
// LOCATION: http://192.168.0.115:8888/octonet.xml
|
||||
if (status && startswith(r, "LOCATION:")) {
|
||||
location = compactspace(r + 9);
|
||||
debug("cSatipDiscover::%s(): location='%s'", __FUNCTION__, location);
|
||||
break;
|
||||
}
|
||||
status = true;
|
||||
}
|
||||
if (status) {
|
||||
// Check the location data
|
||||
// LOCATION: http://192.168.0.115:8888/octonet.xml
|
||||
if (startswith(r, "LOCATION:")) {
|
||||
location = compactspace(r + 9);
|
||||
debug("cSatipDiscover::%s(): location='%s'", __FUNCTION__, location);
|
||||
}
|
||||
// Check the source type
|
||||
// ST: urn:ses-com:device:SatIPServer:1
|
||||
else if (startswith(r, "ST:")) {
|
||||
char *st = compactspace(r + 3);
|
||||
if (strstr(st, "urn:ses-com:device:SatIPServer:1"))
|
||||
valid = true;
|
||||
debug("cSatipDiscover::%s(): st='%s'", __FUNCTION__, st);
|
||||
}
|
||||
// Check whether all the required data is found
|
||||
if (valid && !isempty(location))
|
||||
break;
|
||||
}
|
||||
r = strtok_r(NULL, "\r\n", &s);
|
||||
}
|
||||
if (handleM && !isempty(location)) {
|
||||
if (handleM && valid && !isempty(location)) {
|
||||
long rc = 0;
|
||||
CURLcode res = CURLE_OK;
|
||||
#ifdef DEBUG
|
||||
|
||||
@@ -5,10 +5,10 @@
|
||||
#
|
||||
msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: vdr-satip 0.3.0\n"
|
||||
"Project-Id-Version: vdr-satip 0.3.2\n"
|
||||
"Report-Msgid-Bugs-To: <see README>\n"
|
||||
"POT-Creation-Date: 2014-04-20 04:20+0200\n"
|
||||
"PO-Revision-Date: 2014-04-20 04:20+0200\n"
|
||||
"POT-Creation-Date: 2014-05-10 05:10+0200\n"
|
||||
"PO-Revision-Date: 2014-05-10 05:10+0200\n"
|
||||
"Last-Translator: Gabriel Bonich <gbonich@gmail.com>\n"
|
||||
"Language-Team: Catalan <vdr@linuxtv.org>\n"
|
||||
"Language: ca\n"
|
||||
|
||||
@@ -5,10 +5,10 @@
|
||||
#
|
||||
msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: vdr-satip 0.3.0\n"
|
||||
"Project-Id-Version: vdr-satip 0.3.2\n"
|
||||
"Report-Msgid-Bugs-To: <see README>\n"
|
||||
"POT-Creation-Date: 2014-04-20 04:20+0200\n"
|
||||
"PO-Revision-Date: 2014-04-20 04:20+0200\n"
|
||||
"POT-Creation-Date: 2014-05-10 05:10+0200\n"
|
||||
"PO-Revision-Date: 2014-05-10 05:10+0200\n"
|
||||
"Last-Translator: Frank Neumann <fnu@yavdr.org>\n"
|
||||
"Language-Team: German <vdr@linuxtv.org>\n"
|
||||
"Language: de\n"
|
||||
|
||||
@@ -5,10 +5,10 @@
|
||||
#
|
||||
msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: vdr-satip 0.3.0\n"
|
||||
"Project-Id-Version: vdr-satip 0.3.2\n"
|
||||
"Report-Msgid-Bugs-To: <see README>\n"
|
||||
"POT-Creation-Date: 2014-04-20 04:20+0200\n"
|
||||
"PO-Revision-Date: 2014-04-20 04:20+0200\n"
|
||||
"POT-Creation-Date: 2014-05-10 05:10+0200\n"
|
||||
"PO-Revision-Date: 2014-05-10 05:10+0200\n"
|
||||
"Last-Translator: Gabriel Bonich <gbonich@gmail.com>\n"
|
||||
"Language-Team: Spanish <vdr@linuxtv.org>\n"
|
||||
"Language: es\n"
|
||||
|
||||
@@ -5,10 +5,10 @@
|
||||
#
|
||||
msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: vdr-satip 0.3.0\n"
|
||||
"Project-Id-Version: vdr-satip 0.3.2\n"
|
||||
"Report-Msgid-Bugs-To: <see README>\n"
|
||||
"POT-Creation-Date: 2014-04-20 04:20+0200\n"
|
||||
"PO-Revision-Date: 2014-04-20 04:20+0200\n"
|
||||
"POT-Creation-Date: 2014-05-10 05:10+0200\n"
|
||||
"PO-Revision-Date: 2014-05-10 05:10+0200\n"
|
||||
"Last-Translator: Rolf Ahrenberg\n"
|
||||
"Language-Team: Finnish <vdr@linuxtv.org>\n"
|
||||
"Language: fi\n"
|
||||
|
||||
2
satip.c
2
satip.c
@@ -25,7 +25,7 @@
|
||||
#define GITVERSION ""
|
||||
#endif
|
||||
|
||||
const char VERSION[] = "0.3.0" GITVERSION;
|
||||
const char VERSION[] = "0.3.2" GITVERSION;
|
||||
static const char DESCRIPTION[] = trNOOP("SAT>IP Devices");
|
||||
|
||||
class cPluginSatip : public cPlugin {
|
||||
|
||||
10
server.c
10
server.c
@@ -16,7 +16,8 @@ cSatipServer::cSatipServer(const char *addressP, const char *descriptionP, const
|
||||
: addressM(addressP),
|
||||
descriptionM(descriptionP),
|
||||
modelM(modelP),
|
||||
modelTypeM(eSatipModelTypeMask),
|
||||
modelTypeM(eSatipModelTypeNone),
|
||||
quirkM(eSatipQuirkNone),
|
||||
useCountM(0),
|
||||
createdM(time(NULL)),
|
||||
lastSeenM(0)
|
||||
@@ -24,6 +25,9 @@ cSatipServer::cSatipServer(const char *addressP, const char *descriptionP, const
|
||||
memset(modelCountM, 0, sizeof(modelCountM));
|
||||
if (isempty(*modelM))
|
||||
modelM = "DVBS-1";
|
||||
// Grundig Sat Systems GSS.box DSI 400 has a session id bug
|
||||
if (strstr(*descriptionM, "GSSBOX"))
|
||||
quirkM |= eSatipQuirkSessionId;
|
||||
char *s, *p = strdup(*modelM);
|
||||
char *r = strtok_r(p, ",", &s);
|
||||
while (r) {
|
||||
@@ -41,7 +45,7 @@ cSatipServer::cSatipServer(const char *addressP, const char *descriptionP, const
|
||||
else
|
||||
modelCountM[eSatipModuleDVBT2] = 1;
|
||||
// Add model quirks here
|
||||
if (strstr(*addressM, "OctopusNet"))
|
||||
if (strstr(*descriptionM, "OctopusNet"))
|
||||
modelTypeM |= cSatipServer::eSatipModelTypeDVBC;
|
||||
}
|
||||
if (strstr(r, "DVBT")) {
|
||||
@@ -51,7 +55,7 @@ cSatipServer::cSatipServer(const char *addressP, const char *descriptionP, const
|
||||
else
|
||||
modelCountM[eSatipModuleDVBT] = 1;
|
||||
// Add model quirks here
|
||||
if (strstr(*addressM, "OctopusNet"))
|
||||
if (strstr(*descriptionM, "OctopusNet"))
|
||||
modelTypeM |= cSatipServer::eSatipModelTypeDVBC;
|
||||
}
|
||||
r = strtok_r(NULL, ",", &s);
|
||||
|
||||
8
server.h
8
server.h
@@ -23,12 +23,19 @@ private:
|
||||
cString modelM;
|
||||
int modelCountM[eSatipModuleCount];
|
||||
int modelTypeM;
|
||||
int quirkM;
|
||||
int useCountM;
|
||||
time_t createdM;
|
||||
cTimeMs lastSeenM;
|
||||
|
||||
public:
|
||||
enum eSatipQuirk {
|
||||
eSatipQuirkNone = 0x00,
|
||||
eSatipQuirkSessionId = 0x01,
|
||||
eSatipQuirkMask = 0x0F
|
||||
};
|
||||
enum eSatipModelType {
|
||||
eSatipModelTypeNone = 0x00,
|
||||
eSatipModelTypeDVBS2 = 0x01,
|
||||
eSatipModelTypeDVBT = 0x02,
|
||||
eSatipModelTypeDVBT2 = 0x04,
|
||||
@@ -43,6 +50,7 @@ public:
|
||||
const char *Description() { return *descriptionM; }
|
||||
const char *Address() { return *addressM; }
|
||||
const char *Model(void) { return modelM; }
|
||||
bool Quirk(int quirkP) { return ((quirkP & eSatipQuirkMask) & quirkM); }
|
||||
int ModelType(void) { return modelTypeM; }
|
||||
bool Match(int modelP) { return ((modelP & eSatipModelTypeMask) & modelTypeM); }
|
||||
int Cable() { return Match(eSatipModelTypeDVBC) ? (Match(eSatipModelTypeDVBT2) ? modelCountM[eSatipModuleDVBT2] : modelCountM[eSatipModuleDVBT]) : 0; } // an ugly hack
|
||||
|
||||
5
tuner.c
5
tuner.c
@@ -240,7 +240,10 @@ bool cSatipTuner::Connect(void)
|
||||
// Session id is now known - disable header parsing
|
||||
SATIP_CURL_EASY_SETOPT(handleM, CURLOPT_HEADERFUNCTION, NULL);
|
||||
SATIP_CURL_EASY_SETOPT(handleM, CURLOPT_WRITEHEADER, NULL);
|
||||
//SATIP_CURL_EASY_SETOPT(handleM, CURLOPT_RTSP_SESSION_ID, *sessionM);
|
||||
if (nextServerM && nextServerM->Quirk(cSatipServer::eSatipQuirkSessionId) && startswith(*sessionM, "0")) {
|
||||
debug("cSatipTuner::%s(): session id quirk [device %d]", __FUNCTION__, deviceM->GetId());
|
||||
SATIP_CURL_EASY_SETOPT(handleM, CURLOPT_RTSP_SESSION_ID, *sessionM + 1);
|
||||
}
|
||||
if (!ValidateLatestResponse())
|
||||
return false;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user