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

Preliminary documentation for used logging modes.

This commit is contained in:
Rolf Ahrenberg 2014-12-14 17:45:55 +02:00
parent 382e1dedef
commit 778f3bd84a
12 changed files with 104 additions and 91 deletions

View File

@ -83,10 +83,10 @@ unsigned int cSatipDevice::Count(void)
cSatipDevice *cSatipDevice::GetSatipDevice(int cardIndexP) cSatipDevice *cSatipDevice::GetSatipDevice(int cardIndexP)
{ {
debug8("%s (%d)", __PRETTY_FUNCTION__, cardIndexP); debug16("%s (%d)", __PRETTY_FUNCTION__, cardIndexP);
for (unsigned int i = 0; i < SATIP_MAX_DEVICES; ++i) { for (unsigned int i = 0; i < SATIP_MAX_DEVICES; ++i) {
if (SatipDevicesS[i] && (SatipDevicesS[i]->CardIndex() == cardIndexP)) { if (SatipDevicesS[i] && (SatipDevicesS[i]->CardIndex() == cardIndexP)) {
debug3("%s (%d): Found!", __PRETTY_FUNCTION__, cardIndexP); debug16("%s (%d): Found!", __PRETTY_FUNCTION__, cardIndexP);
return SatipDevicesS[i]; return SatipDevicesS[i];
} }
} }
@ -127,7 +127,7 @@ cString cSatipDevice::GetSatipStatus(void)
cString cSatipDevice::GetGeneralInformation(void) cString cSatipDevice::GetGeneralInformation(void)
{ {
debug8("%s [device %u]", __PRETTY_FUNCTION__, deviceIndexM); debug16("%s [device %u]", __PRETTY_FUNCTION__, deviceIndexM);
return cString::sprintf("SAT>IP device: %d\nCardIndex: %d\nStream: %s\nSignal: %s\nStream bitrate: %s\n%sChannel: %s", return cString::sprintf("SAT>IP device: %d\nCardIndex: %d\nStream: %s\nSignal: %s\nStream bitrate: %s\n%sChannel: %s",
deviceIndexM, CardIndex(), deviceIndexM, CardIndex(),
pTunerM ? *pTunerM->GetInformation() : "", pTunerM ? *pTunerM->GetInformation() : "",
@ -139,13 +139,13 @@ cString cSatipDevice::GetGeneralInformation(void)
cString cSatipDevice::GetPidsInformation(void) cString cSatipDevice::GetPidsInformation(void)
{ {
debug8("%s [device %u]", __PRETTY_FUNCTION__, deviceIndexM); debug16("%s [device %u]", __PRETTY_FUNCTION__, deviceIndexM);
return GetPidStatistic(); return GetPidStatistic();
} }
cString cSatipDevice::GetFiltersInformation(void) cString cSatipDevice::GetFiltersInformation(void)
{ {
debug8("%s [device %u]", __PRETTY_FUNCTION__, deviceIndexM); debug16("%s [device %u]", __PRETTY_FUNCTION__, deviceIndexM);
return cString::sprintf("Active section filters:\n%s", pSectionFilterHandlerM ? *pSectionFilterHandlerM->GetInformation() : ""); return cString::sprintf("Active section filters:\n%s", pSectionFilterHandlerM ? *pSectionFilterHandlerM->GetInformation() : "");
} }
@ -181,37 +181,37 @@ cString cSatipDevice::GetInformation(unsigned int pageP)
bool cSatipDevice::Ready(void) bool cSatipDevice::Ready(void)
{ {
debug8("%s [device %u]", __PRETTY_FUNCTION__, deviceIndexM); debug16("%s [device %u]", __PRETTY_FUNCTION__, deviceIndexM);
return ((cSatipDiscover::GetInstance()->GetServerCount() > 0) || (createdM.Elapsed() > eReadyTimeoutMs)); return ((cSatipDiscover::GetInstance()->GetServerCount() > 0) || (createdM.Elapsed() > eReadyTimeoutMs));
} }
cString cSatipDevice::DeviceType(void) const cString cSatipDevice::DeviceType(void) const
{ {
debug8("%s [device %u]", __PRETTY_FUNCTION__, deviceIndexM); debug16("%s [device %u]", __PRETTY_FUNCTION__, deviceIndexM);
return "SAT>IP"; return "SAT>IP";
} }
cString cSatipDevice::DeviceName(void) const cString cSatipDevice::DeviceName(void) const
{ {
debug8("%s [device %u]", __PRETTY_FUNCTION__, deviceIndexM); debug16("%s [device %u]", __PRETTY_FUNCTION__, deviceIndexM);
return deviceNameM; return deviceNameM;
} }
bool cSatipDevice::AvoidRecording(void) const bool cSatipDevice::AvoidRecording(void) const
{ {
debug8("%s [device %u]", __PRETTY_FUNCTION__, deviceIndexM); debug16("%s [device %u]", __PRETTY_FUNCTION__, deviceIndexM);
return SatipConfig.IsOperatingModeLow(); return SatipConfig.IsOperatingModeLow();
} }
int cSatipDevice::SignalStrength(void) const int cSatipDevice::SignalStrength(void) const
{ {
debug8("%s [device %u]", __PRETTY_FUNCTION__, deviceIndexM); debug16("%s [device %u]", __PRETTY_FUNCTION__, deviceIndexM);
return (pTunerM ? pTunerM->SignalStrength() : -1); return (pTunerM ? pTunerM->SignalStrength() : -1);
} }
int cSatipDevice::SignalQuality(void) const int cSatipDevice::SignalQuality(void) const
{ {
debug8("%s [device %u]", __PRETTY_FUNCTION__, deviceIndexM); debug16("%s [device %u]", __PRETTY_FUNCTION__, deviceIndexM);
return (pTunerM ? pTunerM->SignalQuality() : -1); return (pTunerM ? pTunerM->SignalQuality() : -1);
} }
@ -399,19 +399,19 @@ void cSatipDevice::CloseDvr(void)
bool cSatipDevice::HasLock(int timeoutMsP) const bool cSatipDevice::HasLock(int timeoutMsP) const
{ {
debug8("%s (%d) [device %d]", __PRETTY_FUNCTION__, timeoutMsP, deviceIndexM); debug16("%s (%d) [device %d]", __PRETTY_FUNCTION__, timeoutMsP, deviceIndexM);
return (pTunerM && pTunerM->HasLock()); return (pTunerM && pTunerM->HasLock());
} }
bool cSatipDevice::HasInternalCam(void) bool cSatipDevice::HasInternalCam(void)
{ {
debug8("%s [device %u]", __PRETTY_FUNCTION__, deviceIndexM); debug16("%s [device %u]", __PRETTY_FUNCTION__, deviceIndexM);
return false; return false;
} }
void cSatipDevice::WriteData(uchar *bufferP, int lengthP) void cSatipDevice::WriteData(uchar *bufferP, int lengthP)
{ {
debug8("%s [device %u]", __PRETTY_FUNCTION__, deviceIndexM); debug16("%s [device %u]", __PRETTY_FUNCTION__, deviceIndexM);
// Fill up TS buffer // Fill up TS buffer
if (isOpenDvrM && tsBufferM) { if (isOpenDvrM && tsBufferM) {
int len = tsBufferM->Put(bufferP, lengthP); int len = tsBufferM->Put(bufferP, lengthP);
@ -430,7 +430,7 @@ int cSatipDevice::GetId(void)
uchar *cSatipDevice::GetData(int *availableP) uchar *cSatipDevice::GetData(int *availableP)
{ {
debug8("%s [device %u]", __PRETTY_FUNCTION__, deviceIndexM); debug16("%s [device %u]", __PRETTY_FUNCTION__, deviceIndexM);
if (isOpenDvrM && tsBufferM) { if (isOpenDvrM && tsBufferM) {
int count = 0; int count = 0;
if (isPacketDeliveredM) if (isPacketDeliveredM)
@ -461,7 +461,7 @@ uchar *cSatipDevice::GetData(int *availableP)
void cSatipDevice::SkipData(int countP) void cSatipDevice::SkipData(int countP)
{ {
debug8("%s [device %u]", __PRETTY_FUNCTION__, deviceIndexM); debug16("%s [device %u]", __PRETTY_FUNCTION__, deviceIndexM);
tsBufferM->Del(countP); tsBufferM->Del(countP);
isPacketDeliveredM = false; isPacketDeliveredM = false;
// Update buffer statistics // Update buffer statistics
@ -470,7 +470,7 @@ void cSatipDevice::SkipData(int countP)
bool cSatipDevice::GetTSPacket(uchar *&dataP) bool cSatipDevice::GetTSPacket(uchar *&dataP)
{ {
debug8("%s [device %u]", __PRETTY_FUNCTION__, deviceIndexM); debug16("%s [device %u]", __PRETTY_FUNCTION__, deviceIndexM);
if (tsBufferM) { if (tsBufferM) {
#if defined(APIVERSNUM) && APIVERSNUM >= 20104 #if defined(APIVERSNUM) && APIVERSNUM >= 20104
if (cCamSlot *cs = CamSlot()) { if (cCamSlot *cs = CamSlot()) {

View File

@ -51,7 +51,7 @@ size_t cSatipDiscover::WriteCallback(char *ptrP, size_t sizeP, size_t nmembP, vo
{ {
cSatipDiscover *obj = reinterpret_cast<cSatipDiscover *>(dataP); cSatipDiscover *obj = reinterpret_cast<cSatipDiscover *>(dataP);
size_t len = sizeP * nmembP; size_t len = sizeP * nmembP;
debug8("%s len=%zu", __PRETTY_FUNCTION__, len); debug16("%s len=%zu", __PRETTY_FUNCTION__, len);
if (obj) { if (obj) {
CURLcode res = CURLE_OK; CURLcode res = CURLE_OK;
@ -245,70 +245,70 @@ void cSatipDiscover::AddServer(const char *addrP, const char *modelP, const char
int cSatipDiscover::GetServerCount(void) int cSatipDiscover::GetServerCount(void)
{ {
debug8("%s", __PRETTY_FUNCTION__); debug16("%s", __PRETTY_FUNCTION__);
cMutexLock MutexLock(&mutexM); cMutexLock MutexLock(&mutexM);
return serversM.Count(); return serversM.Count();
} }
cSatipServer *cSatipDiscover::GetServer(int sourceP, int transponderP, int systemP) cSatipServer *cSatipDiscover::GetServer(int sourceP, int transponderP, int systemP)
{ {
debug8("%s (%d, %d, %d)", __PRETTY_FUNCTION__, sourceP, transponderP, systemP); debug16("%s (%d, %d, %d)", __PRETTY_FUNCTION__, sourceP, transponderP, systemP);
cMutexLock MutexLock(&mutexM); cMutexLock MutexLock(&mutexM);
return serversM.Find(sourceP, transponderP, systemP); return serversM.Find(sourceP, transponderP, systemP);
} }
cSatipServer *cSatipDiscover::GetServer(cSatipServer *serverP) cSatipServer *cSatipDiscover::GetServer(cSatipServer *serverP)
{ {
debug8("%s", __PRETTY_FUNCTION__); debug16("%s", __PRETTY_FUNCTION__);
cMutexLock MutexLock(&mutexM); cMutexLock MutexLock(&mutexM);
return serversM.Find(serverP); return serversM.Find(serverP);
} }
cSatipServers *cSatipDiscover::GetServers(void) cSatipServers *cSatipDiscover::GetServers(void)
{ {
debug8("%s", __PRETTY_FUNCTION__); debug16("%s", __PRETTY_FUNCTION__);
cMutexLock MutexLock(&mutexM); cMutexLock MutexLock(&mutexM);
return &serversM; return &serversM;
} }
cString cSatipDiscover::GetServerString(cSatipServer *serverP) cString cSatipDiscover::GetServerString(cSatipServer *serverP)
{ {
debug8("%s", __PRETTY_FUNCTION__); debug16("%s", __PRETTY_FUNCTION__);
cMutexLock MutexLock(&mutexM); cMutexLock MutexLock(&mutexM);
return serversM.GetString(serverP); return serversM.GetString(serverP);
} }
cString cSatipDiscover::GetServerList(void) cString cSatipDiscover::GetServerList(void)
{ {
debug8("%s", __PRETTY_FUNCTION__); debug16("%s", __PRETTY_FUNCTION__);
cMutexLock MutexLock(&mutexM); cMutexLock MutexLock(&mutexM);
return serversM.List(); return serversM.List();
} }
void cSatipDiscover::SetTransponder(cSatipServer *serverP, int transponderP) void cSatipDiscover::SetTransponder(cSatipServer *serverP, int transponderP)
{ {
debug8("%s (, %d)", __PRETTY_FUNCTION__, transponderP); debug16("%s (, %d)", __PRETTY_FUNCTION__, transponderP);
cMutexLock MutexLock(&mutexM); cMutexLock MutexLock(&mutexM);
serversM.SetTransponder(serverP, transponderP); serversM.SetTransponder(serverP, transponderP);
} }
void cSatipDiscover::UseServer(cSatipServer *serverP, bool onOffP) void cSatipDiscover::UseServer(cSatipServer *serverP, bool onOffP)
{ {
debug8("%s (, %d)", __PRETTY_FUNCTION__, onOffP); debug16("%s (, %d)", __PRETTY_FUNCTION__, onOffP);
cMutexLock MutexLock(&mutexM); cMutexLock MutexLock(&mutexM);
serversM.Use(serverP, onOffP); serversM.Use(serverP, onOffP);
} }
int cSatipDiscover::NumProvidedSystems(void) int cSatipDiscover::NumProvidedSystems(void)
{ {
debug8("%s", __PRETTY_FUNCTION__); debug16("%s", __PRETTY_FUNCTION__);
cMutexLock MutexLock(&mutexM); cMutexLock MutexLock(&mutexM);
return serversM.NumProvidedSystems(); return serversM.NumProvidedSystems();
} }
void cSatipDiscover::SetUrl(const char *urlP) void cSatipDiscover::SetUrl(const char *urlP)
{ {
debug8("%s (%s)", __PRETTY_FUNCTION__, urlP); debug16("%s (%s)", __PRETTY_FUNCTION__, urlP);
mutexM.Lock(); mutexM.Lock();
probeUrlListM.Insert(strdup(urlP)); probeUrlListM.Insert(strdup(urlP));
mutexM.Unlock(); mutexM.Unlock();

16
log.h
View File

@ -12,21 +12,37 @@
#define error(x...) esyslog("SATIP-ERROR: " x) #define error(x...) esyslog("SATIP-ERROR: " x)
#define info(x...) isyslog("SATIP: " x) #define info(x...) isyslog("SATIP: " x)
// 0x0001: Generic call stack
#define debug1(x...) void( SatipConfig.IsLoggingMode(cSatipConfig::eLoggingModeDebug1) ? dsyslog("SATIP1: " x) : void() ) #define debug1(x...) void( SatipConfig.IsLoggingMode(cSatipConfig::eLoggingModeDebug1) ? dsyslog("SATIP1: " x) : void() )
// 0x0002: CURL data flow
#define debug2(x...) void( SatipConfig.IsLoggingMode(cSatipConfig::eLoggingModeDebug2) ? dsyslog("SATIP2: " x) : void() ) #define debug2(x...) void( SatipConfig.IsLoggingMode(cSatipConfig::eLoggingModeDebug2) ? dsyslog("SATIP2: " x) : void() )
// 0x0004: Data parsing
#define debug3(x...) void( SatipConfig.IsLoggingMode(cSatipConfig::eLoggingModeDebug3) ? dsyslog("SATIP3: " x) : void() ) #define debug3(x...) void( SatipConfig.IsLoggingMode(cSatipConfig::eLoggingModeDebug3) ? dsyslog("SATIP3: " x) : void() )
// 0x0008: Tuner state machine
#define debug4(x...) void( SatipConfig.IsLoggingMode(cSatipConfig::eLoggingModeDebug4) ? dsyslog("SATIP4: " x) : void() ) #define debug4(x...) void( SatipConfig.IsLoggingMode(cSatipConfig::eLoggingModeDebug4) ? dsyslog("SATIP4: " x) : void() )
// 0x0010: RTSP responses
#define debug5(x...) void( SatipConfig.IsLoggingMode(cSatipConfig::eLoggingModeDebug5) ? dsyslog("SATIP5: " x) : void() ) #define debug5(x...) void( SatipConfig.IsLoggingMode(cSatipConfig::eLoggingModeDebug5) ? dsyslog("SATIP5: " x) : void() )
// 0x0020: RTP throughput performance
#define debug6(x...) void( SatipConfig.IsLoggingMode(cSatipConfig::eLoggingModeDebug6) ? dsyslog("SATIP6: " x) : void() ) #define debug6(x...) void( SatipConfig.IsLoggingMode(cSatipConfig::eLoggingModeDebug6) ? dsyslog("SATIP6: " x) : void() )
// 0x0040: RTP packet internals
#define debug7(x...) void( SatipConfig.IsLoggingMode(cSatipConfig::eLoggingModeDebug7) ? dsyslog("SATIP7: " x) : void() ) #define debug7(x...) void( SatipConfig.IsLoggingMode(cSatipConfig::eLoggingModeDebug7) ? dsyslog("SATIP7: " x) : void() )
// 0x0080: Section filtering
#define debug8(x...) void( SatipConfig.IsLoggingMode(cSatipConfig::eLoggingModeDebug8) ? dsyslog("SATIP8: " x) : void() ) #define debug8(x...) void( SatipConfig.IsLoggingMode(cSatipConfig::eLoggingModeDebug8) ? dsyslog("SATIP8: " x) : void() )
// 0x0100: Channel switching
#define debug9(x...) void( SatipConfig.IsLoggingMode(cSatipConfig::eLoggingModeDebug9) ? dsyslog("SATIP9: " x) : void() ) #define debug9(x...) void( SatipConfig.IsLoggingMode(cSatipConfig::eLoggingModeDebug9) ? dsyslog("SATIP9: " x) : void() )
// 0x0200: TBD
#define debug10(x...) void( SatipConfig.IsLoggingMode(cSatipConfig::eLoggingModeDebug10) ? dsyslog("SATIP10: " x) : void() ) #define debug10(x...) void( SatipConfig.IsLoggingMode(cSatipConfig::eLoggingModeDebug10) ? dsyslog("SATIP10: " x) : void() )
// 0x0400: TBD
#define debug11(x...) void( SatipConfig.IsLoggingMode(cSatipConfig::eLoggingModeDebug11) ? dsyslog("SATIP11: " x) : void() ) #define debug11(x...) void( SatipConfig.IsLoggingMode(cSatipConfig::eLoggingModeDebug11) ? dsyslog("SATIP11: " x) : void() )
// 0x0800: TBD
#define debug12(x...) void( SatipConfig.IsLoggingMode(cSatipConfig::eLoggingModeDebug12) ? dsyslog("SATIP12: " x) : void() ) #define debug12(x...) void( SatipConfig.IsLoggingMode(cSatipConfig::eLoggingModeDebug12) ? dsyslog("SATIP12: " x) : void() )
// 0x1000: TBD
#define debug13(x...) void( SatipConfig.IsLoggingMode(cSatipConfig::eLoggingModeDebug13) ? dsyslog("SATIP13: " x) : void() ) #define debug13(x...) void( SatipConfig.IsLoggingMode(cSatipConfig::eLoggingModeDebug13) ? dsyslog("SATIP13: " x) : void() )
// 0x2000: TBD
#define debug14(x...) void( SatipConfig.IsLoggingMode(cSatipConfig::eLoggingModeDebug14) ? dsyslog("SATIP14: " x) : void() ) #define debug14(x...) void( SatipConfig.IsLoggingMode(cSatipConfig::eLoggingModeDebug14) ? dsyslog("SATIP14: " x) : void() )
// 0x4000: TBD
#define debug15(x...) void( SatipConfig.IsLoggingMode(cSatipConfig::eLoggingModeDebug15) ? dsyslog("SATIP15: " x) : void() ) #define debug15(x...) void( SatipConfig.IsLoggingMode(cSatipConfig::eLoggingModeDebug15) ? dsyslog("SATIP15: " x) : void() )
// 0x8000; Extra call stack
#define debug16(x...) void( SatipConfig.IsLoggingMode(cSatipConfig::eLoggingModeDebug16) ? dsyslog("SATIP16: " x) : void() ) #define debug16(x...) void( SatipConfig.IsLoggingMode(cSatipConfig::eLoggingModeDebug16) ? dsyslog("SATIP16: " x) : void() )
#endif // __SATIP_LOG_H #endif // __SATIP_LOG_H

View File

@ -54,7 +54,7 @@ int cSatipMsearch::GetFd(void)
void cSatipMsearch::Process(void) void cSatipMsearch::Process(void)
{ {
debug8("%s", __PRETTY_FUNCTION__); debug16("%s", __PRETTY_FUNCTION__);
if (bufferM) { if (bufferM) {
int length; int length;
while ((length = Read(bufferM, bufferLenM)) > 0) { while ((length = Read(bufferM, bufferLenM)) > 0) {

6
rtcp.c
View File

@ -30,13 +30,13 @@ cSatipRtcp::~cSatipRtcp()
int cSatipRtcp::GetFd(void) int cSatipRtcp::GetFd(void)
{ {
debug8("%s [device %d]", __PRETTY_FUNCTION__, tunerM.GetId()); debug16("%s [device %d]", __PRETTY_FUNCTION__, tunerM.GetId());
return Fd(); return Fd();
} }
int cSatipRtcp::GetApplicationOffset(int *lengthP) int cSatipRtcp::GetApplicationOffset(int *lengthP)
{ {
debug8("%s (%d) [device %d]", __PRETTY_FUNCTION__, *lengthP, tunerM.GetId()); debug16("%s (%d) [device %d]", __PRETTY_FUNCTION__, *lengthP, tunerM.GetId());
if (!lengthP) if (!lengthP)
return -1; return -1;
int offset = 0; int offset = 0;
@ -81,7 +81,7 @@ int cSatipRtcp::GetApplicationOffset(int *lengthP)
void cSatipRtcp::Process(void) void cSatipRtcp::Process(void)
{ {
debug8("%s [device %d]", __PRETTY_FUNCTION__, tunerM.GetId()); debug16("%s [device %d]", __PRETTY_FUNCTION__, tunerM.GetId());
if (bufferM) { if (bufferM) {
int length; int length;
while ((length = Read(bufferM, bufferLenM)) > 0) { while ((length = Read(bufferM, bufferLenM)) > 0) {

12
rtp.c
View File

@ -53,7 +53,7 @@ void cSatipRtp::Close(void)
int cSatipRtp::GetHeaderLenght(unsigned char *bufferP, unsigned int lengthP) int cSatipRtp::GetHeaderLenght(unsigned char *bufferP, unsigned int lengthP)
{ {
debug8("%s (, %d) [device %d]", __PRETTY_FUNCTION__, lengthP, tunerM.GetId()); debug16("%s (, %d) [device %d]", __PRETTY_FUNCTION__, lengthP, tunerM.GetId());
unsigned int headerlen = 0; unsigned int headerlen = 0;
if (lengthP > 0) { if (lengthP > 0) {
@ -71,7 +71,7 @@ int cSatipRtp::GetHeaderLenght(unsigned char *bufferP, unsigned int lengthP)
// Payload type: MPEG2 TS = 33 // Payload type: MPEG2 TS = 33
unsigned int pt = bufferP[1] & 0x7F; unsigned int pt = bufferP[1] & 0x7F;
if (pt != 33) if (pt != 33)
debug16("%s (%d) Received invalid RTP payload type %d - v=%d [device %d]", debug7("%s (%d) Received invalid RTP payload type %d - v=%d [device %d]",
__PRETTY_FUNCTION__, lengthP, pt, v, tunerM.GetId()); __PRETTY_FUNCTION__, lengthP, pt, v, tunerM.GetId());
// Sequence number // Sequence number
int seq = ((bufferP[2] & 0xFF) << 8) | (bufferP[3] & 0xFF); int seq = ((bufferP[2] & 0xFF) << 8) | (bufferP[3] & 0xFF);
@ -99,17 +99,17 @@ int cSatipRtp::GetHeaderLenght(unsigned char *bufferP, unsigned int lengthP)
} }
// Check for empty payload // Check for empty payload
if (lengthP == headerlen) { if (lengthP == headerlen) {
debug16("%s (%d) Received empty RTP packet #%d [device %d]", __PRETTY_FUNCTION__, lengthP, seq, tunerM.GetId()); debug7("%s (%d) Received empty RTP packet #%d [device %d]", __PRETTY_FUNCTION__, lengthP, seq, tunerM.GetId());
headerlen = -1; headerlen = -1;
} }
// Check that rtp is version 2 and payload contains multiple of TS packet data // Check that rtp is version 2 and payload contains multiple of TS packet data
else if ((v != 2) || (((lengthP - headerlen) % TS_SIZE) != 0) || (bufferP[headerlen] != TS_SYNC_BYTE)) { else if ((v != 2) || (((lengthP - headerlen) % TS_SIZE) != 0) || (bufferP[headerlen] != TS_SYNC_BYTE)) {
debug16("%s (%d) Received incorrect RTP packet #%d v=%d len=%d sync=0x%02X [device %d]", __PRETTY_FUNCTION__, debug7("%s (%d) Received incorrect RTP packet #%d v=%d len=%d sync=0x%02X [device %d]", __PRETTY_FUNCTION__,
lengthP, seq, v, headerlen, bufferP[headerlen], tunerM.GetId()); lengthP, seq, v, headerlen, bufferP[headerlen], tunerM.GetId());
headerlen = -1; headerlen = -1;
} }
else else
debug16("%s (%d) Received RTP packet #%d v=%d len=%d sync=0x%02X [device %d]", __PRETTY_FUNCTION__, debug7("%s (%d) Received RTP packet #%d v=%d len=%d sync=0x%02X [device %d]", __PRETTY_FUNCTION__,
lengthP, seq, v, headerlen, bufferP[headerlen], tunerM.GetId()); lengthP, seq, v, headerlen, bufferP[headerlen], tunerM.GetId());
} }
} }
@ -119,7 +119,7 @@ int cSatipRtp::GetHeaderLenght(unsigned char *bufferP, unsigned int lengthP)
void cSatipRtp::Process(void) void cSatipRtp::Process(void)
{ {
debug8("%s [device %d]", __PRETTY_FUNCTION__, tunerM.GetId()); debug16("%s [device %d]", __PRETTY_FUNCTION__, tunerM.GetId());
if (bufferM) { if (bufferM) {
unsigned int lenMsg[eRtpPacketReadCount]; unsigned int lenMsg[eRtpPacketReadCount];
uint64_t elapsed; uint64_t elapsed;

6
rtsp.c
View File

@ -60,13 +60,13 @@ size_t cSatipRtsp::HeaderCallback(void *ptrP, size_t sizeP, size_t nmembP, void
{ {
cSatipRtsp *obj = reinterpret_cast<cSatipRtsp *>(dataP); cSatipRtsp *obj = reinterpret_cast<cSatipRtsp *>(dataP);
size_t len = sizeP * nmembP; size_t len = sizeP * nmembP;
debug8("%s len=%zu", __PRETTY_FUNCTION__, len); debug16("%s len=%zu", __PRETTY_FUNCTION__, len);
char *s, *p = (char *)ptrP; char *s, *p = (char *)ptrP;
char *r = strtok_r(p, "\r\n", &s); char *r = strtok_r(p, "\r\n", &s);
while (obj && r) { while (obj && r) {
debug8("%s (%zu): %s", __PRETTY_FUNCTION__, len, r); debug16("%s (%zu): %s", __PRETTY_FUNCTION__, len, r);
r = skipspace(r); r = skipspace(r);
if (strstr(r, "com.ses.streamID")) { if (strstr(r, "com.ses.streamID")) {
int streamid = -1; int streamid = -1;
@ -92,7 +92,7 @@ size_t cSatipRtsp::WriteCallback(void *ptrP, size_t sizeP, size_t nmembP, void *
{ {
cSatipRtsp *obj = reinterpret_cast<cSatipRtsp *>(dataP); cSatipRtsp *obj = reinterpret_cast<cSatipRtsp *>(dataP);
size_t len = sizeP * nmembP; size_t len = sizeP * nmembP;
debug8("%s len=%zu", __PRETTY_FUNCTION__, len); debug16("%s len=%zu", __PRETTY_FUNCTION__, len);
if (obj && (len > 0)) if (obj && (len > 0))
obj->tunerM.ProcessApplicationData((u_char*)ptrP, len); obj->tunerM.ProcessApplicationData((u_char*)ptrP, len);

14
satip.c
View File

@ -64,7 +64,7 @@ cPluginSatip::cPluginSatip(void)
: deviceCountM(1), : deviceCountM(1),
serversM(NULL) serversM(NULL)
{ {
debug8("%s", __PRETTY_FUNCTION__); debug16("%s", __PRETTY_FUNCTION__);
// Initialize any member variables here. // Initialize any member variables here.
// DON'T DO ANYTHING ELSE THAT MAY HAVE SIDE EFFECTS, REQUIRE GLOBAL // DON'T DO ANYTHING ELSE THAT MAY HAVE SIDE EFFECTS, REQUIRE GLOBAL
// VDR OBJECTS TO EXIST OR PRODUCE ANY OUTPUT! // VDR OBJECTS TO EXIST OR PRODUCE ANY OUTPUT!
@ -72,7 +72,7 @@ cPluginSatip::cPluginSatip(void)
cPluginSatip::~cPluginSatip() cPluginSatip::~cPluginSatip()
{ {
debug8("%s", __PRETTY_FUNCTION__); debug16("%s", __PRETTY_FUNCTION__);
// Clean up after yourself! // Clean up after yourself!
} }
@ -154,34 +154,34 @@ void cPluginSatip::Stop(void)
void cPluginSatip::Housekeeping(void) void cPluginSatip::Housekeeping(void)
{ {
debug8("%s", __PRETTY_FUNCTION__); debug16("%s", __PRETTY_FUNCTION__);
// Perform any cleanup or other regular tasks. // Perform any cleanup or other regular tasks.
} }
void cPluginSatip::MainThreadHook(void) void cPluginSatip::MainThreadHook(void)
{ {
debug8("%s", __PRETTY_FUNCTION__); debug16("%s", __PRETTY_FUNCTION__);
// Perform actions in the context of the main program thread. // Perform actions in the context of the main program thread.
// WARNING: Use with great care - see PLUGINS.html! // WARNING: Use with great care - see PLUGINS.html!
} }
cString cPluginSatip::Active(void) cString cPluginSatip::Active(void)
{ {
debug8("%s", __PRETTY_FUNCTION__); debug16("%s", __PRETTY_FUNCTION__);
// Return a message string if shutdown should be postponed // Return a message string if shutdown should be postponed
return NULL; return NULL;
} }
time_t cPluginSatip::WakeupTime(void) time_t cPluginSatip::WakeupTime(void)
{ {
debug8("%s", __PRETTY_FUNCTION__); debug16("%s", __PRETTY_FUNCTION__);
// Return custom wakeup time for shutdown script // Return custom wakeup time for shutdown script
return 0; return 0;
} }
cOsdObject *cPluginSatip::MainMenuAction(void) cOsdObject *cPluginSatip::MainMenuAction(void)
{ {
debug8("%s", __PRETTY_FUNCTION__); debug16("%s", __PRETTY_FUNCTION__);
// Perform the action when selected from the main VDR menu. // Perform the action when selected from the main VDR menu.
return NULL; return NULL;
} }

View File

@ -21,7 +21,7 @@ cSatipSectionFilter::cSatipSectionFilter(int deviceIndexP, uint16_t pidP, uint8_
ringBufferM(new cRingBufferFrame(eDmxMaxSectionCount * eDmxMaxSectionSize)), ringBufferM(new cRingBufferFrame(eDmxMaxSectionCount * eDmxMaxSectionSize)),
deviceIndexM(deviceIndexP) deviceIndexM(deviceIndexP)
{ {
debug8("%s (%d, %d, %d, %d) [device %d]", __PRETTY_FUNCTION__, deviceIndexM, pidM, tidP, maskP, deviceIndexM); debug16("%s (%d, %d, %d, %d) [device %d]", __PRETTY_FUNCTION__, deviceIndexM, pidM, tidP, maskP, deviceIndexM);
int i; int i;
memset(secBufBaseM, 0, sizeof(secBufBaseM)); memset(secBufBaseM, 0, sizeof(secBufBaseM));
@ -62,7 +62,7 @@ cSatipSectionFilter::cSatipSectionFilter(int deviceIndexP, uint16_t pidP, uint8_
cSatipSectionFilter::~cSatipSectionFilter() cSatipSectionFilter::~cSatipSectionFilter()
{ {
debug8("%s pid=%d [device %d]", __PRETTY_FUNCTION__, pidM, deviceIndexM); debug16("%s pid=%d [device %d]", __PRETTY_FUNCTION__, pidM, deviceIndexM);
int tmp = socketM[1]; int tmp = socketM[1];
socketM[1] = -1; socketM[1] = -1;
if (tmp >= 0) if (tmp >= 0)
@ -321,7 +321,7 @@ void cSatipSectionFilterHandler::Action(void)
cString cSatipSectionFilterHandler::GetInformation(void) cString cSatipSectionFilterHandler::GetInformation(void)
{ {
debug8("%s [device %d]", __PRETTY_FUNCTION__, deviceIndexM); debug16("%s [device %d]", __PRETTY_FUNCTION__, deviceIndexM);
// loop through active section filters // loop through active section filters
cMutexLock MutexLock(&mutexM); cMutexLock MutexLock(&mutexM);
cString s = ""; cString s = "";
@ -340,9 +340,9 @@ cString cSatipSectionFilterHandler::GetInformation(void)
bool cSatipSectionFilterHandler::Delete(unsigned int indexP) bool cSatipSectionFilterHandler::Delete(unsigned int indexP)
{ {
debug8("%s (%d) [device %d]", __PRETTY_FUNCTION__, indexP, deviceIndexM); debug16("%s (%d) [device %d]", __PRETTY_FUNCTION__, indexP, deviceIndexM);
if ((indexP < eMaxSecFilterCount) && filtersM[indexP]) { if ((indexP < eMaxSecFilterCount) && filtersM[indexP]) {
debug3("%s (%d) Found [device %d]", __PRETTY_FUNCTION__, indexP, deviceIndexM); debug8("%s (%d) Found [device %d]", __PRETTY_FUNCTION__, indexP, deviceIndexM);
cSatipSectionFilter *tmp = filtersM[indexP]; cSatipSectionFilter *tmp = filtersM[indexP];
filtersM[indexP] = NULL; filtersM[indexP] = NULL;
delete tmp; delete tmp;
@ -353,7 +353,7 @@ bool cSatipSectionFilterHandler::Delete(unsigned int indexP)
bool cSatipSectionFilterHandler::IsBlackListed(u_short pidP, u_char tidP, u_char maskP) const bool cSatipSectionFilterHandler::IsBlackListed(u_short pidP, u_char tidP, u_char maskP) const
{ {
debug8("%s (%d, %02X, %02X) [device %d]", __PRETTY_FUNCTION__, pidP, tidP, maskP, deviceIndexM); debug16("%s (%d, %02X, %02X) [device %d]", __PRETTY_FUNCTION__, pidP, tidP, maskP, deviceIndexM);
// loop through section filter table // loop through section filter table
for (int i = 0; i < SECTION_FILTER_TABLE_SIZE; ++i) { for (int i = 0; i < SECTION_FILTER_TABLE_SIZE; ++i) {
int index = SatipConfig.GetDisabledFilters(i); int index = SatipConfig.GetDisabledFilters(i);
@ -361,7 +361,7 @@ bool cSatipSectionFilterHandler::IsBlackListed(u_short pidP, u_char tidP, u_char
if ((index >= 0) && (index < SECTION_FILTER_TABLE_SIZE) && if ((index >= 0) && (index < SECTION_FILTER_TABLE_SIZE) &&
(section_filter_table[index].pid == pidP) && (section_filter_table[index].tid == tidP) && (section_filter_table[index].pid == pidP) && (section_filter_table[index].tid == tidP) &&
(section_filter_table[index].mask == maskP)) { (section_filter_table[index].mask == maskP)) {
debug3("%s Found %s [device %d]", __PRETTY_FUNCTION__, section_filter_table[index].description, deviceIndexM); debug8("%s Found %s [device %d]", __PRETTY_FUNCTION__, section_filter_table[index].description, deviceIndexM);
return true; return true;
} }
} }
@ -370,7 +370,6 @@ bool cSatipSectionFilterHandler::IsBlackListed(u_short pidP, u_char tidP, u_char
int cSatipSectionFilterHandler::Open(u_short pidP, u_char tidP, u_char maskP) int cSatipSectionFilterHandler::Open(u_short pidP, u_char tidP, u_char maskP)
{ {
// Lock
cMutexLock MutexLock(&mutexM); cMutexLock MutexLock(&mutexM);
// Blacklist check, refuse certain filters // Blacklist check, refuse certain filters
if (IsBlackListed(pidP, tidP, maskP)) if (IsBlackListed(pidP, tidP, maskP))
@ -379,7 +378,7 @@ int cSatipSectionFilterHandler::Open(u_short pidP, u_char tidP, u_char maskP)
for (unsigned int i = 0; i < eMaxSecFilterCount; ++i) { for (unsigned int i = 0; i < eMaxSecFilterCount; ++i) {
if (!filtersM[i]) { if (!filtersM[i]) {
filtersM[i] = new cSatipSectionFilter(deviceIndexM, pidP, tidP, maskP); filtersM[i] = new cSatipSectionFilter(deviceIndexM, pidP, tidP, maskP);
debug8("%s (%d, %02X, %02X) handle=%d index=%u [device %d]", __PRETTY_FUNCTION__, pidP, tidP, maskP, filtersM[i]->GetFd(), i, deviceIndexM); debug16("%s (%d, %02X, %02X) handle=%d index=%u [device %d]", __PRETTY_FUNCTION__, pidP, tidP, maskP, filtersM[i]->GetFd(), i, deviceIndexM);
return filtersM[i]->GetFd(); return filtersM[i]->GetFd();
} }
} }
@ -389,12 +388,11 @@ int cSatipSectionFilterHandler::Open(u_short pidP, u_char tidP, u_char maskP)
void cSatipSectionFilterHandler::Close(int handleP) void cSatipSectionFilterHandler::Close(int handleP)
{ {
// Lock
cMutexLock MutexLock(&mutexM); cMutexLock MutexLock(&mutexM);
// Search the filter for deletion // Search the filter for deletion
for (unsigned int i = 0; i < eMaxSecFilterCount; ++i) { for (unsigned int i = 0; i < eMaxSecFilterCount; ++i) {
if (filtersM[i] && (handleP == filtersM[i]->GetFd())) { if (filtersM[i] && (handleP == filtersM[i]->GetFd())) {
debug3("%s (%d) pid=%d index=%u [device %d]", __PRETTY_FUNCTION__, handleP, filtersM[i]->GetPid(), i, deviceIndexM); debug8("%s (%d) pid=%d index=%u [device %d]", __PRETTY_FUNCTION__, handleP, filtersM[i]->GetPid(), i, deviceIndexM);
Delete(i); Delete(i);
break; break;
} }
@ -403,12 +401,11 @@ void cSatipSectionFilterHandler::Close(int handleP)
int cSatipSectionFilterHandler::GetPid(int handleP) int cSatipSectionFilterHandler::GetPid(int handleP)
{ {
// Lock
cMutexLock MutexLock(&mutexM); cMutexLock MutexLock(&mutexM);
// Search the filter for data // Search the filter for data
for (unsigned int i = 0; i < eMaxSecFilterCount; ++i) { for (unsigned int i = 0; i < eMaxSecFilterCount; ++i) {
if (filtersM[i] && (handleP == filtersM[i]->GetFd())) { if (filtersM[i] && (handleP == filtersM[i]->GetFd())) {
debug3("%s (%d) pid=%d index=%u [device %d]", __PRETTY_FUNCTION__, handleP, filtersM[i]->GetPid(), i, deviceIndexM); debug8("%s (%d) pid=%d index=%u [device %d]", __PRETTY_FUNCTION__, handleP, filtersM[i]->GetPid(), i, deviceIndexM);
return filtersM[i]->GetPid(); return filtersM[i]->GetPid();
} }
} }
@ -417,7 +414,7 @@ int cSatipSectionFilterHandler::GetPid(int handleP)
void cSatipSectionFilterHandler::Write(uchar *bufferP, int lengthP) void cSatipSectionFilterHandler::Write(uchar *bufferP, int lengthP)
{ {
debug8("%s (, %d) [device %d]", __PRETTY_FUNCTION__, lengthP, deviceIndexM); debug16("%s (, %d) [device %d]", __PRETTY_FUNCTION__, lengthP, deviceIndexM);
// Fill up the buffer // Fill up the buffer
if (ringBufferM) { if (ringBufferM) {
int len = ringBufferM->Put(bufferP, lengthP); int len = ringBufferM->Put(bufferP, lengthP);

View File

@ -98,7 +98,7 @@ bool cSatipSocket::Flush(void)
int cSatipSocket::Read(unsigned char *bufferAddrP, unsigned int bufferLenP) int cSatipSocket::Read(unsigned char *bufferAddrP, unsigned int bufferLenP)
{ {
debug8("%s (, %d)", __PRETTY_FUNCTION__, bufferLenP); debug16("%s (, %d)", __PRETTY_FUNCTION__, bufferLenP);
// Error out if socket not initialized // Error out if socket not initialized
if (socketDescM <= 0) { if (socketDescM <= 0) {
error("%s Invalid socket", __PRETTY_FUNCTION__); error("%s Invalid socket", __PRETTY_FUNCTION__);
@ -135,7 +135,7 @@ int cSatipSocket::Read(unsigned char *bufferAddrP, unsigned int bufferLenP)
int cSatipSocket::ReadMulti(unsigned char *bufferAddrP, unsigned int *elementRecvSizeP, unsigned int elementCountP, unsigned int elementBufferSizeP) int cSatipSocket::ReadMulti(unsigned char *bufferAddrP, unsigned int *elementRecvSizeP, unsigned int elementCountP, unsigned int elementBufferSizeP)
{ {
debug8("%s (, , %d, %d)", __PRETTY_FUNCTION__, elementCountP, elementBufferSizeP); debug16("%s (, , %d, %d)", __PRETTY_FUNCTION__, elementCountP, elementBufferSizeP);
// Error out if socket not initialized // Error out if socket not initialized
if (socketDescM <= 0) { if (socketDescM <= 0) {
error("%s Invalid socket", __PRETTY_FUNCTION__); error("%s Invalid socket", __PRETTY_FUNCTION__);
@ -159,7 +159,7 @@ int cSatipSocket::ReadMulti(unsigned char *bufferAddrP, unsigned int *elementRec
ERROR_IF_RET(count < 0 && errno != EAGAIN && errno != EWOULDBLOCK, "recvmmsg()", return -1); ERROR_IF_RET(count < 0 && errno != EAGAIN && errno != EWOULDBLOCK, "recvmmsg()", return -1);
for (int i = 0; i < count; ++i) for (int i = 0; i < count; ++i)
elementRecvSizeP[i] = mmsgh[i].msg_len; elementRecvSizeP[i] = mmsgh[i].msg_len;
debug8("%s Received %d packets size[0]=%d", __PRETTY_FUNCTION__, count, elementRecvSizeP[0]); debug16("%s Received %d packets size[0]=%d", __PRETTY_FUNCTION__, count, elementRecvSizeP[0]);
return count; return count;
} }

View File

@ -19,17 +19,17 @@ cSatipSectionStatistics::cSatipSectionStatistics()
timerM(), timerM(),
mutexM() mutexM()
{ {
debug8("%s", __PRETTY_FUNCTION__); debug16("%s", __PRETTY_FUNCTION__);
} }
cSatipSectionStatistics::~cSatipSectionStatistics() cSatipSectionStatistics::~cSatipSectionStatistics()
{ {
debug8("%s", __PRETTY_FUNCTION__); debug16("%s", __PRETTY_FUNCTION__);
} }
cString cSatipSectionStatistics::GetSectionStatistic() cString cSatipSectionStatistics::GetSectionStatistic()
{ {
debug8("%s", __PRETTY_FUNCTION__); debug16("%s", __PRETTY_FUNCTION__);
cMutexLock MutexLock(&mutexM); cMutexLock MutexLock(&mutexM);
uint64_t elapsed = timerM.Elapsed(); /* in milliseconds */ uint64_t elapsed = timerM.Elapsed(); /* in milliseconds */
timerM.Set(); timerM.Set();
@ -45,7 +45,7 @@ cString cSatipSectionStatistics::GetSectionStatistic()
void cSatipSectionStatistics::AddSectionStatistic(long bytesP, long callsP) void cSatipSectionStatistics::AddSectionStatistic(long bytesP, long callsP)
{ {
debug8("%s (%ld, %ld)", __PRETTY_FUNCTION__, bytesP, callsP); debug16("%s (%ld, %ld)", __PRETTY_FUNCTION__, bytesP, callsP);
cMutexLock MutexLock(&mutexM); cMutexLock MutexLock(&mutexM);
filteredDataM += bytesP; filteredDataM += bytesP;
numberOfCallsM += callsP; numberOfCallsM += callsP;
@ -73,7 +73,7 @@ cSatipPidStatistics::~cSatipPidStatistics()
cString cSatipPidStatistics::GetPidStatistic() cString cSatipPidStatistics::GetPidStatistic()
{ {
debug8("%s", __PRETTY_FUNCTION__); debug16("%s", __PRETTY_FUNCTION__);
cMutexLock MutexLock(&mutexM); cMutexLock MutexLock(&mutexM);
const int numberOfElements = sizeof(mostActivePidsM) / sizeof(pidStruct); const int numberOfElements = sizeof(mostActivePidsM) / sizeof(pidStruct);
uint64_t elapsed = timerM.Elapsed(); /* in milliseconds */ uint64_t elapsed = timerM.Elapsed(); /* in milliseconds */
@ -98,7 +98,7 @@ cString cSatipPidStatistics::GetPidStatistic()
int cSatipPidStatistics::SortPids(const void* data1P, const void* data2P) int cSatipPidStatistics::SortPids(const void* data1P, const void* data2P)
{ {
debug8("%s", __PRETTY_FUNCTION__); debug16("%s", __PRETTY_FUNCTION__);
const pidStruct *comp1 = reinterpret_cast<const pidStruct*>(data1P); const pidStruct *comp1 = reinterpret_cast<const pidStruct*>(data1P);
const pidStruct *comp2 = reinterpret_cast<const pidStruct*>(data2P); const pidStruct *comp2 = reinterpret_cast<const pidStruct*>(data2P);
if (comp1->dataAmount > comp2->dataAmount) if (comp1->dataAmount > comp2->dataAmount)
@ -110,7 +110,7 @@ int cSatipPidStatistics::SortPids(const void* data1P, const void* data2P)
void cSatipPidStatistics::AddPidStatistic(int pidP, long payloadP) void cSatipPidStatistics::AddPidStatistic(int pidP, long payloadP)
{ {
debug8("%s (%d, %ld)", __PRETTY_FUNCTION__, pidP, payloadP); debug16("%s (%d, %ld)", __PRETTY_FUNCTION__, pidP, payloadP);
cMutexLock MutexLock(&mutexM); cMutexLock MutexLock(&mutexM);
const int numberOfElements = sizeof(mostActivePidsM) / sizeof(pidStruct); const int numberOfElements = sizeof(mostActivePidsM) / sizeof(pidStruct);
// If our statistic already is in the array, update it and quit // If our statistic already is in the array, update it and quit
@ -150,7 +150,7 @@ cSatipTunerStatistics::~cSatipTunerStatistics()
cString cSatipTunerStatistics::GetTunerStatistic() cString cSatipTunerStatistics::GetTunerStatistic()
{ {
debug8("%s", __PRETTY_FUNCTION__); debug16("%s", __PRETTY_FUNCTION__);
mutexM.Lock(); mutexM.Lock();
uint64_t elapsed = timerM.Elapsed(); /* in milliseconds */ uint64_t elapsed = timerM.Elapsed(); /* in milliseconds */
timerM.Set(); timerM.Set();
@ -166,7 +166,7 @@ cString cSatipTunerStatistics::GetTunerStatistic()
void cSatipTunerStatistics::AddTunerStatistic(long bytesP) void cSatipTunerStatistics::AddTunerStatistic(long bytesP)
{ {
debug8("%s (%ld)", __PRETTY_FUNCTION__, bytesP); debug16("%s (%ld)", __PRETTY_FUNCTION__, bytesP);
cMutexLock MutexLock(&mutexM); cMutexLock MutexLock(&mutexM);
dataBytesM += bytesP; dataBytesM += bytesP;
} }
@ -190,7 +190,7 @@ cSatipBufferStatistics::~cSatipBufferStatistics()
cString cSatipBufferStatistics::GetBufferStatistic() cString cSatipBufferStatistics::GetBufferStatistic()
{ {
debug8("%s", __PRETTY_FUNCTION__); debug16("%s", __PRETTY_FUNCTION__);
cMutexLock MutexLock(&mutexM); cMutexLock MutexLock(&mutexM);
uint64_t elapsed = timerM.Elapsed(); /* in milliseconds */ uint64_t elapsed = timerM.Elapsed(); /* in milliseconds */
timerM.Set(); timerM.Set();
@ -214,7 +214,7 @@ cString cSatipBufferStatistics::GetBufferStatistic()
void cSatipBufferStatistics::AddBufferStatistic(long bytesP, long usedP) void cSatipBufferStatistics::AddBufferStatistic(long bytesP, long usedP)
{ {
debug8("%s (%ld, %ld)", __PRETTY_FUNCTION__, bytesP, usedP); debug16("%s (%ld, %ld)", __PRETTY_FUNCTION__, bytesP, usedP);
cMutexLock MutexLock(&mutexM); cMutexLock MutexLock(&mutexM);
dataBytesM += bytesP; dataBytesM += bytesP;
if (usedP > usedSpaceM) if (usedP > usedSpaceM)

30
tuner.c
View File

@ -246,7 +246,7 @@ bool cSatipTuner::Disconnect(void)
void cSatipTuner::ProcessVideoData(u_char *bufferP, int lengthP) void cSatipTuner::ProcessVideoData(u_char *bufferP, int lengthP)
{ {
debug8("%s (, %d) [device %d]", __PRETTY_FUNCTION__, lengthP, deviceIdM); debug16("%s (, %d) [device %d]", __PRETTY_FUNCTION__, lengthP, deviceIdM);
if (lengthP > 0) { if (lengthP > 0) {
uint64_t elapsed; uint64_t elapsed;
cTimeMs processing(0); cTimeMs processing(0);
@ -267,7 +267,7 @@ void cSatipTuner::ProcessVideoData(u_char *bufferP, int lengthP)
void cSatipTuner::ProcessApplicationData(u_char *bufferP, int lengthP) void cSatipTuner::ProcessApplicationData(u_char *bufferP, int lengthP)
{ {
debug8("%s (%d) [device %d]", __PRETTY_FUNCTION__, lengthP, deviceIdM); debug16("%s (%d) [device %d]", __PRETTY_FUNCTION__, lengthP, deviceIdM);
// DVB-S2: // DVB-S2:
// ver=<major>.<minor>;src=<srcID>;tuner=<feID>,<level>,<lock>,<quality>,<frequency>,<polarisation>,<system>,<type>,<pilots>,<roll_off>,<symbol_rate>,<fec_inner>;pids=<pid0>,...,<pidn> // ver=<major>.<minor>;src=<srcID>;tuner=<feID>,<level>,<lock>,<quality>,<frequency>,<polarisation>,<system>,<type>,<pilots>,<roll_off>,<symbol_rate>,<fec_inner>;pids=<pid0>,...,<pidn>
// DVB-T2: // DVB-T2:
@ -277,7 +277,7 @@ void cSatipTuner::ProcessApplicationData(u_char *bufferP, int lengthP)
if (lengthP > 0) { if (lengthP > 0) {
char s[lengthP]; char s[lengthP];
memcpy(s, (char *)bufferP, lengthP); memcpy(s, (char *)bufferP, lengthP);
debug8("%s (%s) [device %d]", __PRETTY_FUNCTION__, s, deviceIdM); debug16("%s (%s) [device %d]", __PRETTY_FUNCTION__, s, deviceIdM);
char *c = strstr(s, ";tuner="); char *c = strstr(s, ";tuner=");
if (c) { if (c) {
int value; int value;
@ -334,7 +334,7 @@ void cSatipTuner::SetSessionTimeout(const char *sessionP, int timeoutP)
int cSatipTuner::GetId(void) int cSatipTuner::GetId(void)
{ {
debug8("%s [device %d]", __PRETTY_FUNCTION__, deviceIdM); debug16("%s [device %d]", __PRETTY_FUNCTION__, deviceIdM);
return deviceIdM; return deviceIdM;
} }
@ -362,7 +362,7 @@ bool cSatipTuner::SetSource(cSatipServer *serverP, const char *parameterP, const
bool cSatipTuner::SetPid(int pidP, int typeP, bool onP) bool cSatipTuner::SetPid(int pidP, int typeP, bool onP)
{ {
debug8("%s (%d, %d, %d) [device %d]", __PRETTY_FUNCTION__, pidP, typeP, onP, deviceIdM); debug16("%s (%d, %d, %d) [device %d]", __PRETTY_FUNCTION__, pidP, typeP, onP, deviceIdM);
cMutexLock MutexLock(&mutexM); cMutexLock MutexLock(&mutexM);
if (onP) { if (onP) {
pidsM.AddPid(pidP); pidsM.AddPid(pidP);
@ -389,7 +389,7 @@ bool cSatipTuner::SetPid(int pidP, int typeP, bool onP)
bool cSatipTuner::UpdatePids(bool forceP) bool cSatipTuner::UpdatePids(bool forceP)
{ {
debug8("%s (%d) tunerState=%s [device %d]", __PRETTY_FUNCTION__, forceP, TunerStateString(currentStateM), deviceIdM); debug16("%s (%d) tunerState=%s [device %d]", __PRETTY_FUNCTION__, forceP, TunerStateString(currentStateM), deviceIdM);
if (((forceP && pidsM.Size()) || (pidUpdateCacheM.TimedOut() && (addPidsM.Size() || delPidsM.Size()))) && if (((forceP && pidsM.Size()) || (pidUpdateCacheM.TimedOut() && (addPidsM.Size() || delPidsM.Size()))) &&
!isempty(*streamAddrM) && (streamIdM > 0)) { !isempty(*streamAddrM) && (streamIdM > 0)) {
cString uri = cString::sprintf("rtsp://%s/stream=%d", *streamAddrM, streamIdM); cString uri = cString::sprintf("rtsp://%s/stream=%d", *streamAddrM, streamIdM);
@ -429,7 +429,7 @@ bool cSatipTuner::UpdatePids(bool forceP)
bool cSatipTuner::KeepAlive(bool forceP) bool cSatipTuner::KeepAlive(bool forceP)
{ {
debug8("%s (%d) tunerState=%s [device %d]", __PRETTY_FUNCTION__, forceP, TunerStateString(currentStateM), deviceIdM); debug16("%s (%d) tunerState=%s [device %d]", __PRETTY_FUNCTION__, forceP, TunerStateString(currentStateM), deviceIdM);
cMutexLock MutexLock(&mutexM); cMutexLock MutexLock(&mutexM);
if (keepAliveM.TimedOut()) { if (keepAliveM.TimedOut()) {
keepAliveM.Set(timeoutM); keepAliveM.Set(timeoutM);
@ -446,7 +446,7 @@ bool cSatipTuner::KeepAlive(bool forceP)
bool cSatipTuner::ReadReceptionStatus(bool forceP) bool cSatipTuner::ReadReceptionStatus(bool forceP)
{ {
debug8("%s (%d) tunerState=%s [device %d]", __PRETTY_FUNCTION__, forceP, TunerStateString(currentStateM), deviceIdM); debug16("%s (%d) tunerState=%s [device %d]", __PRETTY_FUNCTION__, forceP, TunerStateString(currentStateM), deviceIdM);
cMutexLock MutexLock(&mutexM); cMutexLock MutexLock(&mutexM);
if (statusUpdateM.TimedOut()) { if (statusUpdateM.TimedOut()) {
statusUpdateM.Set(eStatusUpdateTimeoutMs); statusUpdateM.Set(eStatusUpdateTimeoutMs);
@ -463,7 +463,7 @@ bool cSatipTuner::ReadReceptionStatus(bool forceP)
void cSatipTuner::UpdateCurrentState(void) void cSatipTuner::UpdateCurrentState(void)
{ {
debug8("%s [device %d]", __PRETTY_FUNCTION__, deviceIdM); debug16("%s [device %d]", __PRETTY_FUNCTION__, deviceIdM);
cMutexLock MutexLock(&mutexM); cMutexLock MutexLock(&mutexM);
eTunerState state = currentStateM; eTunerState state = currentStateM;
@ -485,7 +485,7 @@ void cSatipTuner::UpdateCurrentState(void)
bool cSatipTuner::StateRequested(void) bool cSatipTuner::StateRequested(void)
{ {
cMutexLock MutexLock(&mutexM); cMutexLock MutexLock(&mutexM);
debug8("%s current=%s internal=%d external=%d [device %d]", __PRETTY_FUNCTION__, TunerStateString(currentStateM), internalStateM.Size(), externalStateM.Size(), deviceIdM); debug16("%s current=%s internal=%d external=%d [device %d]", __PRETTY_FUNCTION__, TunerStateString(currentStateM), internalStateM.Size(), externalStateM.Size(), deviceIdM);
return (internalStateM.Size() || externalStateM.Size()); return (internalStateM.Size() || externalStateM.Size());
} }
@ -557,30 +557,30 @@ const char *cSatipTuner::TunerStateString(eTunerState stateP)
int cSatipTuner::SignalStrength(void) int cSatipTuner::SignalStrength(void)
{ {
debug8("%s [device %d]", __PRETTY_FUNCTION__, deviceIdM); debug16("%s [device %d]", __PRETTY_FUNCTION__, deviceIdM);
return signalStrengthM; return signalStrengthM;
} }
int cSatipTuner::SignalQuality(void) int cSatipTuner::SignalQuality(void)
{ {
debug8("%s [device %d]", __PRETTY_FUNCTION__, deviceIdM); debug16("%s [device %d]", __PRETTY_FUNCTION__, deviceIdM);
return signalQualityM; return signalQualityM;
} }
bool cSatipTuner::HasLock(void) bool cSatipTuner::HasLock(void)
{ {
debug8("%s [device %d]", __PRETTY_FUNCTION__, deviceIdM); debug16("%s [device %d]", __PRETTY_FUNCTION__, deviceIdM);
return (currentStateM >= tsTuned) && hasLockM; return (currentStateM >= tsTuned) && hasLockM;
} }
cString cSatipTuner::GetSignalStatus(void) cString cSatipTuner::GetSignalStatus(void)
{ {
debug8("%s [device %d]", __PRETTY_FUNCTION__, deviceIdM); debug16("%s [device %d]", __PRETTY_FUNCTION__, deviceIdM);
return cString::sprintf("lock=%d strength=%d quality=%d", HasLock(), SignalStrength(), SignalQuality()); return cString::sprintf("lock=%d strength=%d quality=%d", HasLock(), SignalStrength(), SignalQuality());
} }
cString cSatipTuner::GetInformation(void) cString cSatipTuner::GetInformation(void)
{ {
debug8("%s [device %d]", __PRETTY_FUNCTION__, deviceIdM); debug16("%s [device %d]", __PRETTY_FUNCTION__, deviceIdM);
return (currentStateM >= tsTuned) ? cString::sprintf("rtsp://%s/?%s [stream=%d]", *streamAddrM, *streamParamM, streamIdM) : "connection failed"; return (currentStateM >= tsTuned) ? cString::sprintf("rtsp://%s/?%s [stream=%d]", *streamAddrM, *streamParamM, streamIdM) : "connection failed";
} }