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:
parent
06dd2f7261
commit
9f2d99435d
4
HISTORY
4
HISTORY
@ -19,3 +19,7 @@ VDR Plugin 'satip' Revision History
|
||||
- Refactored the session code.
|
||||
- Fixed EIT scan functionality.
|
||||
- Updated for vdr-2.1.6.
|
||||
|
||||
2014-xx-xx: Version 0.2.0
|
||||
|
||||
- Added support for cDevice::Ready().
|
||||
|
3
README
3
README
@ -112,6 +112,9 @@ Notes:
|
||||
patched VDR providing channel configuration for pilot, T2 system id,
|
||||
and SISO/MISO values.
|
||||
|
||||
- If you're using Triax TSS400, you'll need the libcurl from 2013-03-20
|
||||
or newer.
|
||||
|
||||
Acknowledgements:
|
||||
|
||||
- Big thanks to Digital Devices GmbH for providing the Octopus Net
|
||||
|
6
device.c
6
device.c
@ -144,6 +144,12 @@ cString cSatipDevice::GetInformation(unsigned int pageP)
|
||||
return s;
|
||||
}
|
||||
|
||||
bool cSatipDevice::Ready(void)
|
||||
{
|
||||
//debug("cSatipDevice::%s(%u)", __FUNCTION__, deviceIndexM);
|
||||
return (cSatipDiscover::GetInstance()->GetServerCount() > 0);
|
||||
}
|
||||
|
||||
cString cSatipDevice::DeviceType(void) const
|
||||
{
|
||||
//debug("cSatipDevice::%s(%u)", __FUNCTION__, deviceIndexM);
|
||||
|
1
device.h
1
device.h
@ -54,6 +54,7 @@ private:
|
||||
|
||||
// for channel info
|
||||
public:
|
||||
virtual bool Ready(void);
|
||||
virtual cString DeviceType(void) const;
|
||||
virtual cString DeviceName(void) const;
|
||||
virtual bool AvoidRecording(void) const;
|
||||
|
@ -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)
|
||||
{
|
||||
//debug("cSatipDiscover::%s(%d, %d)", __FUNCTION__, sourceP, systemP);
|
||||
|
@ -56,6 +56,7 @@ public:
|
||||
static void Destroy(void);
|
||||
virtual ~cSatipDiscover();
|
||||
void TriggerScan(void) { probeIntervalM.Set(0); }
|
||||
int GetServerCount(void);
|
||||
cSatipServer *GetServer(int sourceP, int systemP = -1);
|
||||
cSatipServer *GetServer(cSatipServer *serverP);
|
||||
cSatipServers *GetServers(void);
|
||||
|
@ -5,7 +5,7 @@
|
||||
#
|
||||
msgid ""
|
||||
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"
|
||||
"POT-Creation-Date: 2014-03-16 03:16+0200\n"
|
||||
"PO-Revision-Date: 2014-03-16 03:16+0200\n"
|
||||
|
@ -5,7 +5,7 @@
|
||||
#
|
||||
msgid ""
|
||||
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"
|
||||
"POT-Creation-Date: 2014-03-16 03:16+0200\n"
|
||||
"PO-Revision-Date: 2014-03-16 03:16+0200\n"
|
||||
|
2
satip.c
2
satip.c
@ -21,7 +21,7 @@
|
||||
#define GITVERSION ""
|
||||
#endif
|
||||
|
||||
const char VERSION[] = "0.1.1" GITVERSION;
|
||||
const char VERSION[] = "0.2.0" GITVERSION;
|
||||
static const char DESCRIPTION[] = trNOOP("SAT>IP Devices");
|
||||
|
||||
class cPluginSatip : public cPlugin {
|
||||
|
4
server.c
4
server.c
@ -149,7 +149,7 @@ cString cSatipServers::GetString(cSatipServer *serverP)
|
||||
cString list = "";
|
||||
for (cSatipServer *s = First(); s; s = Next(s)) {
|
||||
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;
|
||||
}
|
||||
}
|
||||
@ -160,7 +160,7 @@ cString cSatipServers::List(void)
|
||||
{
|
||||
cString list = "";
|
||||
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;
|
||||
}
|
||||
|
||||
|
9
socket.c
9
socket.c
@ -20,7 +20,8 @@
|
||||
|
||||
cSatipSocket::cSatipSocket()
|
||||
: socketPortM(0),
|
||||
socketDescM(-1)
|
||||
socketDescM(-1),
|
||||
sequenceNumberM(-1)
|
||||
{
|
||||
debug("cSatipSocket::%s()", __FUNCTION__);
|
||||
memset(&sockAddrM, 0, sizeof(sockAddrM));
|
||||
@ -72,6 +73,7 @@ void cSatipSocket::Close(void)
|
||||
close(socketDescM);
|
||||
socketDescM = -1;
|
||||
socketPortM = 0;
|
||||
sequenceNumberM = -1;
|
||||
memset(&sockAddrM, 0, sizeof(sockAddrM));
|
||||
}
|
||||
}
|
||||
@ -150,6 +152,11 @@ int cSatipSocket::ReadVideo(unsigned char *bufferAddrP, unsigned int bufferLenP)
|
||||
unsigned int cc = bufferAddrP[0] & 0x0F;
|
||||
// Payload type: MPEG2 TS = 33
|
||||
//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
|
||||
unsigned int headerlen = (3 + cc) * (unsigned int)sizeof(uint32_t);
|
||||
// Check if extension
|
||||
|
1
socket.h
1
socket.h
@ -15,6 +15,7 @@ private:
|
||||
int socketPortM;
|
||||
int socketDescM;
|
||||
struct sockaddr_in sockAddrM;
|
||||
int sequenceNumberM;
|
||||
|
||||
public:
|
||||
cSatipSocket();
|
||||
|
2
tuner.c
2
tuner.c
@ -247,7 +247,7 @@ bool cSatipTuner::Connect(void)
|
||||
// Start playing
|
||||
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_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_PERFORM(handleM);
|
||||
if (!ValidateLatestResponse())
|
||||
|
Loading…
Reference in New Issue
Block a user