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

Added support for cDevice::Ready() and preliminary RTP packet sequence check.

This commit is contained in:
Rolf Ahrenberg 2014-03-23 17:59:08 +02:00
parent 06dd2f7261
commit 9f2d99435d
13 changed files with 37 additions and 7 deletions

View File

@ -19,3 +19,7 @@ VDR Plugin 'satip' Revision History
- Refactored the session code. - Refactored the session code.
- Fixed EIT scan functionality. - Fixed EIT scan functionality.
- Updated for vdr-2.1.6. - Updated for vdr-2.1.6.
2014-xx-xx: Version 0.2.0
- Added support for cDevice::Ready().

3
README
View File

@ -112,6 +112,9 @@ Notes:
patched VDR providing channel configuration for pilot, T2 system id, patched VDR providing channel configuration for pilot, T2 system id,
and SISO/MISO values. and SISO/MISO values.
- If you're using Triax TSS400, you'll need the libcurl from 2013-03-20
or newer.
Acknowledgements: Acknowledgements:
- Big thanks to Digital Devices GmbH for providing the Octopus Net - Big thanks to Digital Devices GmbH for providing the Octopus Net

View File

@ -144,6 +144,12 @@ cString cSatipDevice::GetInformation(unsigned int pageP)
return s; return s;
} }
bool cSatipDevice::Ready(void)
{
//debug("cSatipDevice::%s(%u)", __FUNCTION__, deviceIndexM);
return (cSatipDiscover::GetInstance()->GetServerCount() > 0);
}
cString cSatipDevice::DeviceType(void) const cString cSatipDevice::DeviceType(void) const
{ {
//debug("cSatipDevice::%s(%u)", __FUNCTION__, deviceIndexM); //debug("cSatipDevice::%s(%u)", __FUNCTION__, deviceIndexM);

View File

@ -54,6 +54,7 @@ private:
// for channel info // for channel info
public: public:
virtual bool Ready(void);
virtual cString DeviceType(void) const; virtual cString DeviceType(void) const;
virtual cString DeviceName(void) const; virtual cString DeviceName(void) const;
virtual bool AvoidRecording(void) const; virtual bool AvoidRecording(void) const;

View File

@ -251,6 +251,13 @@ void cSatipDiscover::AddServer(const char *addrP, const char *descP, const char
} }
} }
int cSatipDiscover::GetServerCount(void)
{
//debug("cSatipDiscover::%s()", __FUNCTION__);
cMutexLock MutexLock(&mutexM);
return serversM ? serversM->Count() : -1;
}
cSatipServer *cSatipDiscover::GetServer(int sourceP, int systemP) cSatipServer *cSatipDiscover::GetServer(int sourceP, int systemP)
{ {
//debug("cSatipDiscover::%s(%d, %d)", __FUNCTION__, sourceP, systemP); //debug("cSatipDiscover::%s(%d, %d)", __FUNCTION__, sourceP, systemP);

View File

@ -56,6 +56,7 @@ public:
static void Destroy(void); static void Destroy(void);
virtual ~cSatipDiscover(); virtual ~cSatipDiscover();
void TriggerScan(void) { probeIntervalM.Set(0); } void TriggerScan(void) { probeIntervalM.Set(0); }
int GetServerCount(void);
cSatipServer *GetServer(int sourceP, int systemP = -1); cSatipServer *GetServer(int sourceP, int systemP = -1);
cSatipServer *GetServer(cSatipServer *serverP); cSatipServer *GetServer(cSatipServer *serverP);
cSatipServers *GetServers(void); cSatipServers *GetServers(void);

View File

@ -5,7 +5,7 @@
# #
msgid "" msgid ""
msgstr "" msgstr ""
"Project-Id-Version: vdr-satip 0.1.1\n" "Project-Id-Version: vdr-satip 0.2.0\n"
"Report-Msgid-Bugs-To: <see README>\n" "Report-Msgid-Bugs-To: <see README>\n"
"POT-Creation-Date: 2014-03-16 03:16+0200\n" "POT-Creation-Date: 2014-03-16 03:16+0200\n"
"PO-Revision-Date: 2014-03-16 03:16+0200\n" "PO-Revision-Date: 2014-03-16 03:16+0200\n"

View File

@ -5,7 +5,7 @@
# #
msgid "" msgid ""
msgstr "" msgstr ""
"Project-Id-Version: vdr-satip 0.1.1\n" "Project-Id-Version: vdr-satip 0.2.0\n"
"Report-Msgid-Bugs-To: <see README>\n" "Report-Msgid-Bugs-To: <see README>\n"
"POT-Creation-Date: 2014-03-16 03:16+0200\n" "POT-Creation-Date: 2014-03-16 03:16+0200\n"
"PO-Revision-Date: 2014-03-16 03:16+0200\n" "PO-Revision-Date: 2014-03-16 03:16+0200\n"

View File

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

View File

@ -149,7 +149,7 @@ cString cSatipServers::GetString(cSatipServer *serverP)
cString list = ""; cString list = "";
for (cSatipServer *s = First(); s; s = Next(s)) { for (cSatipServer *s = First(); s; s = Next(s)) {
if (s == serverP) { if (s == serverP) {
list = cString::sprintf("%s:%s:%s", s->Address(), s->Model(), s->Description()); list = cString::sprintf("%s|%s|%s", s->Address(), s->Model(), s->Description());
break; break;
} }
} }
@ -160,7 +160,7 @@ cString cSatipServers::List(void)
{ {
cString list = ""; cString list = "";
for (cSatipServer *s = First(); s; s = Next(s)) for (cSatipServer *s = First(); s; s = Next(s))
list = cString::sprintf("%s%s:%s:%s\n", *list, s->Address(), s->Model(), s->Description()); list = cString::sprintf("%s%s|%s|%s\n", *list, s->Address(), s->Model(), s->Description());
return list; return list;
} }

View File

@ -20,7 +20,8 @@
cSatipSocket::cSatipSocket() cSatipSocket::cSatipSocket()
: socketPortM(0), : socketPortM(0),
socketDescM(-1) socketDescM(-1),
sequenceNumberM(-1)
{ {
debug("cSatipSocket::%s()", __FUNCTION__); debug("cSatipSocket::%s()", __FUNCTION__);
memset(&sockAddrM, 0, sizeof(sockAddrM)); memset(&sockAddrM, 0, sizeof(sockAddrM));
@ -72,6 +73,7 @@ void cSatipSocket::Close(void)
close(socketDescM); close(socketDescM);
socketDescM = -1; socketDescM = -1;
socketPortM = 0; socketPortM = 0;
sequenceNumberM = -1;
memset(&sockAddrM, 0, sizeof(sockAddrM)); memset(&sockAddrM, 0, sizeof(sockAddrM));
} }
} }
@ -150,6 +152,11 @@ int cSatipSocket::ReadVideo(unsigned char *bufferAddrP, unsigned int bufferLenP)
unsigned int cc = bufferAddrP[0] & 0x0F; unsigned int cc = bufferAddrP[0] & 0x0F;
// Payload type: MPEG2 TS = 33 // Payload type: MPEG2 TS = 33
//unsigned int pt = bufferAddrP[1] & 0x7F; //unsigned int pt = bufferAddrP[1] & 0x7F;
// Sequence number
int seq = ((bufferAddrP[2] & 0xFF) << 8) | (bufferAddrP[3] & 0xFF);
if ((sequenceNumberM >= 0) && (((sequenceNumberM + 1) % 0xFFFF) != seq))
error("missed %d RTP packets", seq - sequenceNumberM - 1);
sequenceNumberM = seq;
// Header lenght // Header lenght
unsigned int headerlen = (3 + cc) * (unsigned int)sizeof(uint32_t); unsigned int headerlen = (3 + cc) * (unsigned int)sizeof(uint32_t);
// Check if extension // Check if extension

View File

@ -15,6 +15,7 @@ private:
int socketPortM; int socketPortM;
int socketDescM; int socketDescM;
struct sockaddr_in sockAddrM; struct sockaddr_in sockAddrM;
int sequenceNumberM;
public: public:
cSatipSocket(); cSatipSocket();

View File

@ -247,7 +247,7 @@ bool cSatipTuner::Connect(void)
// Start playing // Start playing
uri = cString::sprintf("rtsp://%s/stream=%d", *streamAddrM, streamIdM); uri = cString::sprintf("rtsp://%s/stream=%d", *streamAddrM, streamIdM);
SATIP_CURL_EASY_SETOPT(handleM, CURLOPT_RTSP_STREAM_URI, *uri); SATIP_CURL_EASY_SETOPT(handleM, CURLOPT_RTSP_STREAM_URI, *uri);
SATIP_CURL_EASY_SETOPT(handleM, CURLOPT_RTSP_SESSION_ID, *sessionM); //SATIP_CURL_EASY_SETOPT(handleM, CURLOPT_RTSP_SESSION_ID, *sessionM);
SATIP_CURL_EASY_SETOPT(handleM, CURLOPT_RTSP_REQUEST, (long)CURL_RTSPREQ_PLAY); SATIP_CURL_EASY_SETOPT(handleM, CURLOPT_RTSP_REQUEST, (long)CURL_RTSPREQ_PLAY);
SATIP_CURL_EASY_PERFORM(handleM); SATIP_CURL_EASY_PERFORM(handleM);
if (!ValidateLatestResponse()) if (!ValidateLatestResponse())